From python-checkins at python.org Fri May 1 07:59:54 2009 From: python-checkins at python.org (senthil.kumaran) Date: Fri, 1 May 2009 07:59:54 +0200 (CEST) Subject: [Python-checkins] r72155 - python/trunk/Lib/urllib.py Message-ID: <20090501055954.81D6F1E4010@bag.python.org> Author: senthil.kumaran Date: Fri May 1 07:59:52 2009 New Revision: 72155 Log: Fix for Issue1648102, based on the MSDN spec: If this parameter specifies the "" macro as the only entry, this function bypasses any host name that does not contain a period. Modified: python/trunk/Lib/urllib.py Modified: python/trunk/Lib/urllib.py ============================================================================== --- python/trunk/Lib/urllib.py (original) +++ python/trunk/Lib/urllib.py Fri May 1 07:59:52 2009 @@ -1650,18 +1650,11 @@ # '' string by the localhost entry and the corresponding # canonical entry. proxyOverride = proxyOverride.split(';') - i = 0 - while i < len(proxyOverride): - if proxyOverride[i] == '': - proxyOverride[i:i+1] = ['localhost', - '127.0.0.1', - socket.gethostname(), - socket.gethostbyname( - socket.gethostname())] - i += 1 - # print proxyOverride # now check if we match one of the registry values. for test in proxyOverride: + if test == '': + if '.' not in rawHost: + return 1 test = test.replace(".", r"\.") # mask dots test = test.replace("*", r".*") # change glob sequence test = test.replace("?", r".") # change glob char From python-checkins at python.org Fri May 1 08:00:24 2009 From: python-checkins at python.org (senthil.kumaran) Date: Fri, 1 May 2009 08:00:24 +0200 (CEST) Subject: [Python-checkins] r72156 - python/branches/py3k/Lib/urllib/request.py Message-ID: <20090501060024.1ABA51E4010@bag.python.org> Author: senthil.kumaran Date: Fri May 1 08:00:23 2009 New Revision: 72156 Log: Fix for Issue1648102, based on the MSDN spec: If this parameter specifies the "" macro as the only entry, this function bypasses any host name that does not contain a period. Modified: python/branches/py3k/Lib/urllib/request.py Modified: python/branches/py3k/Lib/urllib/request.py ============================================================================== --- python/branches/py3k/Lib/urllib/request.py (original) +++ python/branches/py3k/Lib/urllib/request.py Fri May 1 08:00:23 2009 @@ -2244,18 +2244,11 @@ # '' string by the localhost entry and the corresponding # canonical entry. proxyOverride = proxyOverride.split(';') - i = 0 - while i < len(proxyOverride): - if proxyOverride[i] == '': - proxyOverride[i:i+1] = ['localhost', - '127.0.0.1', - socket.gethostname(), - socket.gethostbyname( - socket.gethostname())] - i += 1 - # print proxyOverride # now check if we match one of the registry values. for test in proxyOverride: + if test == '': + if '.' not in rawHost: + return 1 test = test.replace(".", r"\.") # mask dots test = test.replace("*", r".*") # change glob sequence test = test.replace("?", r".") # change glob char From buildbot at python.org Fri May 1 08:41:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 May 2009 06:41:17 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090501064118.2779A1E4010@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/848 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: senthil.kumaran BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_os make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri May 1 08:51:56 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 1 May 2009 08:51:56 +0200 (CEST) Subject: [Python-checkins] r72157 - python/branches/pep-0383 Message-ID: <20090501065156.3AB2D1E4010@bag.python.org> Author: martin.v.loewis Date: Fri May 1 08:51:56 2009 New Revision: 72157 Log: Remove merge-tracking properties. Modified: python/branches/pep-0383/ (props changed) From python-checkins at python.org Fri May 1 08:52:43 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 1 May 2009 08:52:43 +0200 (CEST) Subject: [Python-checkins] r72158 - python/branches/pep-0383 Message-ID: <20090501065243.C862C1E4010@bag.python.org> Author: martin.v.loewis Date: Fri May 1 08:52:43 2009 New Revision: 72158 Log: Initialized merge tracking via "svnmerge" with revisions "1-72152" from svn+ssh://pythondev at svn.python.org/python/branches/py3k Modified: python/branches/pep-0383/ (props changed) From python-checkins at python.org Fri May 1 10:51:38 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 1 May 2009 10:51:38 +0200 (CEST) Subject: [Python-checkins] r72159 - python/trunk/Objects/stringlib/string_format.h Message-ID: <20090501085138.4DBC01E400C@bag.python.org> Author: georg.brandl Date: Fri May 1 10:51:37 2009 New Revision: 72159 Log: #5889: remove comma at the end of a list that some C compilers don't like. Modified: python/trunk/Objects/stringlib/string_format.h Modified: python/trunk/Objects/stringlib/string_format.h ============================================================================== --- python/trunk/Objects/stringlib/string_format.h (original) +++ python/trunk/Objects/stringlib/string_format.h Fri May 1 10:51:37 2009 @@ -34,7 +34,7 @@ typedef enum { ANS_INIT, ANS_AUTO, - ANS_MANUAL, + ANS_MANUAL } AutoNumberState; /* Keep track if we're auto-numbering fields */ /* Keeps track of our auto-numbering state, and which number field we're on */ From python-checkins at python.org Fri May 1 10:59:14 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 1 May 2009 10:59:14 +0200 (CEST) Subject: [Python-checkins] r72160 - in python/branches/py3k: Objects/stringlib/string_format.h Message-ID: <20090501085914.2033F1E400C@bag.python.org> Author: georg.brandl Date: Fri May 1 10:59:13 2009 New Revision: 72160 Log: Merged revisions 72159 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72159 | georg.brandl | 2009-05-01 10:51:37 +0200 (Fr, 01 Mai 2009) | 2 lines #5889: remove comma at the end of a list that some C compilers don't like. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Objects/stringlib/string_format.h Modified: python/branches/py3k/Objects/stringlib/string_format.h ============================================================================== --- python/branches/py3k/Objects/stringlib/string_format.h (original) +++ python/branches/py3k/Objects/stringlib/string_format.h Fri May 1 10:59:13 2009 @@ -34,7 +34,7 @@ typedef enum { ANS_INIT, ANS_AUTO, - ANS_MANUAL, + ANS_MANUAL } AutoNumberState; /* Keep track if we're auto-numbering fields */ /* Keeps track of our auto-numbering state, and which number field we're on */ From buildbot at python.org Fri May 1 11:26:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 May 2009 09:26:53 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090501092653.B1DA81E400C@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/4905 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_time make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri May 1 12:26:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 May 2009 10:26:29 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090501102629.D1C331E400C@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/672 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_time ====================================================================== FAIL: test_update2 (test.test_os.EnvironTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_os.py", line 382, in test_update2 self.assertEquals(value, "World") AssertionError: '' != 'World' ====================================================================== FAIL: test_tzset (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_time.py", line 166, in test_tzset self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) AssertionError: time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) == time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri May 1 13:42:00 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 1 May 2009 13:42:00 +0200 (CEST) Subject: [Python-checkins] r72161 - in python/branches/py3k: Lib/test/string_tests.py Misc/NEWS Objects/unicodeobject.c Python/pystrtod.c Message-ID: <20090501114200.D4BCB1E4091@bag.python.org> Author: mark.dickinson Date: Fri May 1 13:42:00 2009 New Revision: 72161 Log: Issue #5859: Remove use of fixed-length buffers for float formatting in unicodeobject.c and the fallback version of PyOS_double_to_string. As a result, operations like '%.120e' % 12.34 no longer raise an exception. Modified: python/branches/py3k/Lib/test/string_tests.py python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/unicodeobject.c python/branches/py3k/Python/pystrtod.c Modified: python/branches/py3k/Lib/test/string_tests.py ============================================================================== --- python/branches/py3k/Lib/test/string_tests.py (original) +++ python/branches/py3k/Lib/test/string_tests.py Fri May 1 13:42:00 2009 @@ -1105,14 +1105,7 @@ value = 0.01 for x in range(60): value = value * 3.141592655 / 3.0 * 10.0 - # The formatfloat() code in stringobject.c and - # unicodeobject.c uses a 120 byte buffer and switches from - # 'f' formatting to 'g' at precision 50, so we expect - # OverflowErrors for the ranges x < 50 and prec >= 67. - if x < 50 and prec >= 67: - self.checkraises(OverflowError, format, "__mod__", value) - else: - self.checkcall(format, "__mod__", value) + self.checkcall(format, "__mod__", value) def test_inplace_rewrites(self): # Check that strings don't copy and modify cached single-character strings Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri May 1 13:42:00 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #5859: Remove length restrictions for float formatting: + '%.67f' % 12.34 and '%.120e' % 12.34 no longer raise an exception. + - Issue #1588: Add complex.__format__. For example, format(complex(1, 2./3), '.5') now produces a sensible result. Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Fri May 1 13:42:00 2009 @@ -8792,73 +8792,30 @@ return NULL; } -static void -strtounicode(Py_UNICODE *buffer, const char *charbuffer, Py_ssize_t len) -{ - register Py_ssize_t i; - for (i = len - 1; i >= 0; i--) - buffer[i] = (Py_UNICODE) charbuffer[i]; -} +/* Returns a new reference to a PyUnicode object, or NULL on failure. */ -static int -formatfloat(Py_UNICODE *buf, - size_t buflen, - int flags, - int prec, - int type, - PyObject *v) -{ - /* eric.smith: To minimize disturbances in PyUnicode_Format (the - only caller of this routine), I'm going to keep the existing - API to this function. That means that we'll allocate memory and - then copy back into the supplied buffer. But that's better than - all of the changes that would be required in PyUnicode_Format - because it does lots of memory management tricks. */ - - char* p = NULL; - int result = -1; +static PyObject * +formatfloat(PyObject *v, int flags, int prec, int type) +{ + char *p; + PyObject *result; double x; - Py_ssize_t len; x = PyFloat_AsDouble(v); if (x == -1.0 && PyErr_Occurred()) - goto done; + return NULL; + if (prec < 0) prec = 6; - /* make sure that the decimal representation of precision really does - need at most 10 digits: platforms with sizeof(int) == 8 exist! */ - if (prec > 0x7fffffffL) { - PyErr_SetString(PyExc_OverflowError, - "outrageously large precision " - "for formatted float"); - goto done; - } - if (type == 'f' && fabs(x) >= 1e50) type = 'g'; - if (((type == 'g' || type == 'G') && - buflen <= (size_t)10 + (size_t)prec) || - ((type == 'f' || type == 'F') && - buflen <= (size_t)53 + (size_t)prec)) { - PyErr_SetString(PyExc_OverflowError, - "formatted float is too long (precision too large?)"); - goto done; - } - p = PyOS_double_to_string(x, type, prec, (flags & F_ALT) ? Py_DTSF_ALT : 0, NULL); - len = strlen(p); - if (len+1 >= buflen) { - /* Caller supplied buffer is not large enough. */ - PyErr_NoMemory(); - goto done; - } - strtounicode(buf, p, len); - result = Py_SAFE_DOWNCAST(len, Py_ssize_t, int); - -done: + if (p == NULL) + return NULL; + result = PyUnicode_FromStringAndSize(p, strlen(p)); PyMem_Free(p); return result; } @@ -8940,14 +8897,9 @@ } /* fmt%(v1,v2,...) is roughly equivalent to sprintf(fmt, v1, v2, ...) - - FORMATBUFLEN is the length of the buffer in which the floats, ints, & - chars are formatted. XXX This is a magic number. Each formatting - routine does bounds checking to ensure no overflow, but a better - solution may be to malloc a buffer of appropriate size for each - format. For now, the current solution is sufficient. + FORMATBUFLEN is the length of the buffer in which chars are formatted. */ -#define FORMATBUFLEN (size_t)120 +#define FORMATBUFLEN (size_t)10 PyObject *PyUnicode_Format(PyObject *format, PyObject *args) @@ -9012,7 +8964,7 @@ Py_UNICODE *pbuf; Py_UNICODE sign; Py_ssize_t len; - Py_UNICODE formatbuf[FORMATBUFLEN]; /* For format{float,int,char}() */ + Py_UNICODE formatbuf[FORMATBUFLEN]; /* For formatchar() */ fmt++; if (*fmt == '(') { @@ -9257,11 +9209,11 @@ case 'F': case 'g': case 'G': - pbuf = formatbuf; - len = formatfloat(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), - flags, prec, c, v); - if (len < 0) + temp = formatfloat(v, flags, prec, c); + if (!temp) goto onError; + pbuf = PyUnicode_AS_UNICODE(temp); + len = PyUnicode_GET_SIZE(temp); sign = 1; if (flags & F_ZERO) fill = '0'; Modified: python/branches/py3k/Python/pystrtod.c ============================================================================== --- python/branches/py3k/Python/pystrtod.c (original) +++ python/branches/py3k/Python/pystrtod.c Fri May 1 13:42:00 2009 @@ -620,12 +620,10 @@ int flags, int *type) { - char buf[128]; char format[32]; - Py_ssize_t len; - char *result; - char *p; - int t; + Py_ssize_t bufsize; + char *buf; + int t, exp; int upper = 0; /* Validate format_code, and map upper and lower case */ @@ -669,6 +667,61 @@ return NULL; } + /* Here's a quick-and-dirty calculation to figure out how big a buffer + we need. In general, for a finite float we need: + + 1 byte for each digit of the decimal significand, and + + 1 for a possible sign + 1 for a possible decimal point + 2 for a possible [eE][+-] + 1 for each digit of the exponent; if we allow 19 digits + total then we're safe up to exponents of 2**63. + 1 for the trailing nul byte + + This gives a total of 24 + the number of digits in the significand, + and the number of digits in the significand is: + + for 'g' format: at most precision, except possibly + when precision == 0, when it's 1. + for 'e' format: precision+1 + for 'f' format: precision digits after the point, at least 1 + before. To figure out how many digits appear before the point + we have to examine the size of the number. If fabs(val) < 1.0 + then there will be only one digit before the point. If + fabs(val) >= 1.0, then there are at most + + 1+floor(log10(ceiling(fabs(val)))) + + digits before the point (where the 'ceiling' allows for the + possibility that the rounding rounds the integer part of val + up). A safe upper bound for the above quantity is + 1+floor(exp/3), where exp is the unique integer such that 0.5 + <= fabs(val)/2**exp < 1.0. This exp can be obtained from + frexp. + + So we allow room for precision+1 digits for all formats, plus an + extra floor(exp/3) digits for 'f' format. + + */ + + if (Py_IS_NAN(val) || Py_IS_INFINITY(val)) + /* 3 for 'inf'/'nan', 1 for sign, 1 for '\0' */ + bufsize = 5; + else { + bufsize = 25 + precision; + if (format_code == 'f' && fabs(val) >= 1.0) { + frexp(val, &exp); + bufsize += exp/3; + } + } + + buf = PyMem_Malloc(bufsize); + if (buf == NULL) { + PyErr_NoMemory(); + return NULL; + } + /* Handle nan and inf. */ if (Py_IS_NAN(val)) { strcpy(buf, "nan"); @@ -687,38 +740,29 @@ PyOS_snprintf(format, sizeof(format), "%%%s.%i%c", (flags & Py_DTSF_ALT ? "#" : ""), precision, format_code); - _PyOS_ascii_formatd(buf, sizeof(buf), format, val, precision); + _PyOS_ascii_formatd(buf, bufsize, format, val, precision); } - len = strlen(buf); - - /* Add 1 for the trailing 0 byte. - Add 1 because we might need to make room for the sign. - */ - result = PyMem_Malloc(len + 2); - if (result == NULL) { - PyErr_NoMemory(); - return NULL; - } - p = result; - /* Add sign when requested. It's convenient (esp. when formatting complex numbers) to include a sign even for inf and nan. */ - if (flags & Py_DTSF_SIGN && buf[0] != '-') - *p++ = '+'; - - strcpy(p, buf); - + if (flags & Py_DTSF_SIGN && buf[0] != '-') { + size_t len = strlen(buf); + /* the bufsize calculations above should ensure that we've got + space to add a sign */ + assert((size_t)bufsize >= len+2); + memmove(buf+1, buf, len+1); + buf[0] = '+'; + } if (upper) { /* Convert to upper case. */ char *p1; - for (p1 = p; *p1; p1++) + for (p1 = buf; *p1; p1++) *p1 = Py_TOUPPER(*p1); } if (type) *type = t; - return result; + return buf; } #else From python-checkins at python.org Fri May 1 13:42:35 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 1 May 2009 13:42:35 +0200 (CEST) Subject: [Python-checkins] r72162 - python/branches/release30-maint Message-ID: <20090501114235.535841E4091@bag.python.org> Author: mark.dickinson Date: Fri May 1 13:42:35 2009 New Revision: 72162 Log: Blocked revisions 72161 via svnmerge ........ r72161 | mark.dickinson | 2009-05-01 12:42:00 +0100 (Fri, 01 May 2009) | 5 lines Issue #5859: Remove use of fixed-length buffers for float formatting in unicodeobject.c and the fallback version of PyOS_double_to_string. As a result, operations like '%.120e' % 12.34 no longer raise an exception. ........ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Fri May 1 14:27:17 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 1 May 2009 14:27:17 +0200 (CEST) Subject: [Python-checkins] r72163 - tracker/instances/python-dev/extensions/search_id.py Message-ID: <20090501122717.8280F1E405E@bag.python.org> Author: martin.v.loewis Date: Fri May 1 14:27:17 2009 New Revision: 72163 Log: Restrict number of search terms, to prevent postgres crashes. Modified: tracker/instances/python-dev/extensions/search_id.py Modified: tracker/instances/python-dev/extensions/search_id.py ============================================================================== --- tracker/instances/python-dev/extensions/search_id.py (original) +++ tracker/instances/python-dev/extensions/search_id.py Fri May 1 14:27:17 2009 @@ -10,6 +10,9 @@ if id.isdigit(): if self.db.hasnode('issue', id): raise exceptions.Redirect('issue'+id) + if len(split) > 50: + # Postgres crashes on log queries + raise exceptions.FormError("too many search terms") def init(instance): instance.registerAction('searchid', SearchIDAction) From python-checkins at python.org Fri May 1 15:25:53 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 1 May 2009 15:25:53 +0200 (CEST) Subject: [Python-checkins] r72164 - in python/branches/pep-0383: Doc/library/codecs.rst Lib/test/test_bytes.py Lib/test/test_codecs.py Lib/test/test_unicode.py Lib/test/test_unicodedata.py Objects/unicodeobject.c Python/codecs.c Python/marshal.c Message-ID: <20090501132553.E3B1E1E4615@bag.python.org> Author: martin.v.loewis Date: Fri May 1 15:25:53 2009 New Revision: 72164 Log: Issue #3672: Reject surrogates in UTF-8. Modified: python/branches/pep-0383/Doc/library/codecs.rst python/branches/pep-0383/Lib/test/test_bytes.py python/branches/pep-0383/Lib/test/test_codecs.py python/branches/pep-0383/Lib/test/test_unicode.py python/branches/pep-0383/Lib/test/test_unicodedata.py python/branches/pep-0383/Objects/unicodeobject.c python/branches/pep-0383/Python/codecs.c python/branches/pep-0383/Python/marshal.c Modified: python/branches/pep-0383/Doc/library/codecs.rst ============================================================================== --- python/branches/pep-0383/Doc/library/codecs.rst (original) +++ python/branches/pep-0383/Doc/library/codecs.rst Fri May 1 15:25:53 2009 @@ -323,6 +323,16 @@ | | (only for encoding). | +-------------------------+-----------------------------------------------+ +In addition, the following error handlers are specific to only selected +codecs: + ++------------------+---------+--------------------------------------------+ +| Value | Codec | Meaning | ++==================+=========+============================================+ +| ``'surrogates'`` | utf-8 | Allow encoding and decoding of surrogate | +| | | codes in UTF-8. | ++------------------+---------+--------------------------------------------+ + The set of allowed values can be extended via :meth:`register_error`. Modified: python/branches/pep-0383/Lib/test/test_bytes.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_bytes.py (original) +++ python/branches/pep-0383/Lib/test/test_bytes.py Fri May 1 15:25:53 2009 @@ -169,13 +169,13 @@ self.assertEqual(b[start:stop:step], self.type2test(L[start:stop:step])) def test_encoding(self): - sample = "Hello world\n\u1234\u5678\u9abc\udef0" + sample = "Hello world\n\u1234\u5678\u9abc" for enc in ("utf8", "utf16"): b = self.type2test(sample, enc) self.assertEqual(b, self.type2test(sample.encode(enc))) self.assertRaises(UnicodeEncodeError, self.type2test, sample, "latin1") b = self.type2test(sample, "latin1", "ignore") - self.assertEqual(b, self.type2test(sample[:-4], "utf-8")) + self.assertEqual(b, self.type2test(sample[:-3], "utf-8")) def test_decode(self): sample = "Hello world\n\u1234\u5678\u9abc\def0\def0" Modified: python/branches/pep-0383/Lib/test/test_codecs.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_codecs.py (original) +++ python/branches/pep-0383/Lib/test/test_codecs.py Fri May 1 15:25:53 2009 @@ -541,6 +541,13 @@ self.check_state_handling_decode(self.encoding, u, u.encode(self.encoding)) + def test_surrogates(self): + self.assertRaises(UnicodeEncodeError, "\ud800".encode, "utf-8") + self.assertRaises(UnicodeDecodeError, b"\xed\xa0\x80".decode, "utf-8") + self.assertEquals("\ud800".encode("utf-8", "surrogates"), b"\xed\xa0\x80") + self.assertEquals(b"\xed\xa0\x80".decode("utf-8", "surrogates"), "\ud800") + self.assertTrue(codecs.lookup_error("surrogates")) + class UTF7Test(ReadTest): encoding = "utf-7" @@ -1023,12 +1030,12 @@ # Skipped continue # The Unicode strings are given in UTF-8 - orig = str(orig, "utf-8") + orig = str(orig, "utf-8", "surrogates") if prepped is None: # Input contains prohibited characters self.assertRaises(UnicodeError, nameprep, orig) else: - prepped = str(prepped, "utf-8") + prepped = str(prepped, "utf-8", "surrogates") try: self.assertEquals(nameprep(orig), prepped) except Exception as e: Modified: python/branches/pep-0383/Lib/test/test_unicode.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_unicode.py (original) +++ python/branches/pep-0383/Lib/test/test_unicode.py Fri May 1 15:25:53 2009 @@ -886,10 +886,10 @@ self.assertEqual('\u20ac'.encode('utf-8'), b'\xe2\x82\xac') self.assertEqual('\ud800\udc02'.encode('utf-8'), b'\xf0\x90\x80\x82') self.assertEqual('\ud84d\udc56'.encode('utf-8'), b'\xf0\xa3\x91\x96') - self.assertEqual('\ud800'.encode('utf-8'), b'\xed\xa0\x80') - self.assertEqual('\udc00'.encode('utf-8'), b'\xed\xb0\x80') + self.assertEqual('\ud800'.encode('utf-8', 'surrogates'), b'\xed\xa0\x80') + self.assertEqual('\udc00'.encode('utf-8', 'surrogates'), b'\xed\xb0\x80') self.assertEqual( - ('\ud800\udc02'*1000).encode('utf-8'), + ('\ud800\udc02'*1000).encode('utf-8', 'surrogates'), b'\xf0\x90\x80\x82'*1000 ) self.assertEqual( Modified: python/branches/pep-0383/Lib/test/test_unicodedata.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_unicodedata.py (original) +++ python/branches/pep-0383/Lib/test/test_unicodedata.py Fri May 1 15:25:53 2009 @@ -13,6 +13,7 @@ import test.support encoding = 'utf-8' +errors = 'surrogates' ### Run tests @@ -61,7 +62,7 @@ (char + 'ABC').title(), ] - h.update(''.join(data).encode(encoding)) + h.update(''.join(data).encode(encoding, errors)) result = h.hexdigest() self.assertEqual(result, self.expectedchecksum) Modified: python/branches/pep-0383/Objects/unicodeobject.c ============================================================================== --- python/branches/pep-0383/Objects/unicodeobject.c (original) +++ python/branches/pep-0383/Objects/unicodeobject.c Fri May 1 15:25:53 2009 @@ -154,6 +154,13 @@ 0, 0, 0, 0, 0, 0, 0, 0 }; +static PyObject *unicode_encode_call_errorhandler(const char *errors, + PyObject **errorHandler, + const char *encoding, const char *reason, + const Py_UNICODE *unicode, Py_ssize_t size, PyObject **exceptionObject, + Py_ssize_t startpos, Py_ssize_t endpos, + Py_ssize_t *newpos); + /* Same for linebreaks */ static unsigned char ascii_linebreak[] = { 0, 0, 0, 0, 0, 0, 0, 0, @@ -2214,14 +2221,7 @@ goto utf8Error; } ch = ((s[0] & 0x0f) << 12) + ((s[1] & 0x3f) << 6) + (s[2] & 0x3f); - if (ch < 0x0800) { - /* Note: UTF-8 encodings of surrogates are considered - legal UTF-8 sequences; - - XXX For wide builds (UCS-4) we should probably try - to recombine the surrogates into a single code - unit. - */ + if (ch < 0x0800 || (ch >= 0xd800 && ch <= 0xDFFF)) { errmsg = "illegal encoding"; startinpos = s-starts; endinpos = startinpos+3; @@ -2328,6 +2328,7 @@ Py_ssize_t nallocated; /* number of result bytes allocated */ Py_ssize_t nneeded; /* number of result bytes needed */ char stackbuf[MAX_SHORT_UNICHARS * 4]; + PyObject *errorHandler = NULL; assert(s != NULL); assert(size >= 0); @@ -2367,6 +2368,7 @@ else { /* Encode UCS2 Unicode ordinals */ if (ch < 0x10000) { +#ifndef Py_UNICODE_WIDE /* Special case: check for high surrogate */ if (0xD800 <= ch && ch <= 0xDBFF && i != size) { Py_UCS4 ch2 = s[i]; @@ -2379,6 +2381,37 @@ } /* Fall through: handles isolated high surrogates */ } +#endif + if (ch >= 0xd800 && ch <= 0xdfff) { + PyObject *exc = NULL; + Py_ssize_t newpos; + PyObject *rep; + char *prep; + int k; + rep = unicode_encode_call_errorhandler + (errors, &errorHandler, "utf-8", "surrogates not allowed", + s, size, &exc, i-1, i, &newpos); + if (!rep) + goto error; + /* Implementation limitations: only support error handler that return + bytes, and only support up to four replacement bytes. */ + if (!PyBytes_Check(rep)) { + PyErr_SetString(PyExc_TypeError, "error handler should have returned bytes"); + Py_DECREF(rep); + goto error; + } + if (PyBytes_Size(rep) > 4) { + PyErr_SetString(PyExc_TypeError, "error handler returned too many bytes"); + Py_DECREF(rep); + goto error; + } + prep = PyBytes_AsString(rep); + for(k = PyBytes_Size(rep); k > 0; k--) + *p++ = *prep++; + Py_DECREF(rep); + continue; + + } *p++ = (char)(0xe0 | (ch >> 12)); *p++ = (char)(0x80 | ((ch >> 6) & 0x3f)); *p++ = (char)(0x80 | (ch & 0x3f)); @@ -2405,7 +2438,12 @@ assert(nneeded <= nallocated); _PyBytes_Resize(&result, nneeded); } + Py_XDECREF(errorHandler); return result; + error: + Py_XDECREF(errorHandler); + Py_XDECREF(result); + return NULL; #undef MAX_SHORT_UNICHARS } @@ -3897,7 +3935,7 @@ Py_ssize_t startpos, Py_ssize_t endpos, Py_ssize_t *newpos) { - static char *argparse = "O!n;encoding error handler must return (str, int) tuple"; + static char *argparse = "On;encoding error handler must return (str/bytes, int) tuple"; PyObject *restuple; PyObject *resunicode; @@ -3918,15 +3956,20 @@ if (restuple == NULL) return NULL; if (!PyTuple_Check(restuple)) { - PyErr_SetString(PyExc_TypeError, &argparse[4]); + PyErr_SetString(PyExc_TypeError, &argparse[3]); Py_DECREF(restuple); return NULL; } - if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type, + if (!PyArg_ParseTuple(restuple, argparse, &resunicode, newpos)) { Py_DECREF(restuple); return NULL; } + if (!PyUnicode_Check(resunicode) && !PyBytes_Check(resunicode)) { + PyErr_SetString(PyExc_TypeError, &argparse[3]); + Py_DECREF(restuple); + return NULL; + } if (*newpos<0) *newpos = size+*newpos; if (*newpos<0 || *newpos>size) { @@ -4064,6 +4107,12 @@ collstart-startp, collend-startp, &newpos); if (repunicode == NULL) goto onError; + if (!PyUnicode_Check(repunicode)) { + /* Implementation limitation: byte results not supported yet. */ + PyErr_SetString(PyExc_TypeError, "error handler should return unicode"); + Py_DECREF(repunicode); + goto onError; + } /* need more space? (at least enough for what we have+the replacement+the rest of the string, so we won't have to check space for encodable characters) */ @@ -5027,6 +5076,12 @@ collstartpos, collendpos, &newpos); if (repunicode == NULL) return -1; + if (!PyUnicode_Check(repunicode)) { + /* Implementation limitation: byte results not supported yet. */ + PyErr_SetString(PyExc_TypeError, "error handler should return unicode"); + Py_DECREF(repunicode); + return -1; + } /* generate replacement */ repsize = PyUnicode_GET_SIZE(repunicode); for (uni2 = PyUnicode_AS_UNICODE(repunicode); repsize-->0; ++uni2) { @@ -5588,6 +5643,12 @@ collstart-s, collend-s, &newpos); if (repunicode == NULL) goto onError; + if (!PyUnicode_Check(repunicode)) { + /* Implementation limitation: byte results not supported yet. */ + PyErr_SetString(PyExc_TypeError, "error handler should return unicode"); + Py_DECREF(repunicode); + goto onError; + } /* generate replacement */ repsize = PyUnicode_GET_SIZE(repunicode); for (uni2 = PyUnicode_AS_UNICODE(repunicode); repsize-->0; ++uni2) { Modified: python/branches/pep-0383/Python/codecs.c ============================================================================== --- python/branches/pep-0383/Python/codecs.c (original) +++ python/branches/pep-0383/Python/codecs.c Fri May 1 15:25:53 2009 @@ -748,6 +748,82 @@ } } +PyObject *PyCodec_SurrogateErrors(PyObject *exc) +{ + PyObject *restuple; + PyObject *object; + Py_ssize_t start; + Py_ssize_t end; + PyObject *res; + if (PyObject_IsInstance(exc, PyExc_UnicodeEncodeError)) { + Py_UNICODE *p; + Py_UNICODE *startp; + char *outp; + if (PyUnicodeEncodeError_GetStart(exc, &start)) + return NULL; + if (PyUnicodeEncodeError_GetEnd(exc, &end)) + return NULL; + if (!(object = PyUnicodeEncodeError_GetObject(exc))) + return NULL; + startp = PyUnicode_AS_UNICODE(object); + res = PyBytes_FromStringAndSize(NULL, 3*(end-start)); + if (!res) + return NULL; + outp = PyBytes_AsString(res); + for (p = startp+start; p < startp+end; p++) { + Py_UNICODE ch = *p; + if (ch < 0xd800 || ch > 0xdfff) { + /* Not a surrogate, fail with original exception */ + PyErr_SetObject(PyExceptionInstance_Class(exc), exc); + Py_DECREF(res); + Py_DECREF(object); + return NULL; + } + *outp++ = (char)(0xe0 | (ch >> 12)); + *outp++ = (char)(0x80 | ((ch >> 6) & 0x3f)); + *outp++ = (char)(0x80 | (ch & 0x3f)); + } + restuple = Py_BuildValue("(On)", res, end); + Py_DECREF(res); + Py_DECREF(object); + return restuple; + } + else if (PyObject_IsInstance(exc, PyExc_UnicodeDecodeError)) { + unsigned char *p; + Py_UNICODE ch = 0; + if (PyUnicodeDecodeError_GetStart(exc, &start)) + return NULL; + if (!(object = PyUnicodeDecodeError_GetObject(exc))) + return NULL; + if (!(p = (unsigned char*)PyBytes_AsString(object))) { + Py_DECREF(object); + return NULL; + } + /* Try decoding a single surrogate character. If + there are more, let the codec call us again. */ + if ((p[0] & 0xf0) == 0xe0 || + (p[1] & 0xc0) == 0x80 || + (p[2] & 0xc0) == 0x80) { + /* it's a three-byte code */ + ch = ((p[0] & 0x0f) << 12) + ((p[1] & 0x3f) << 6) + (p[2] & 0x3f); + if (ch < 0xd800 || ch > 0xdfff) + /* it's not a surrogate - fail */ + ch = 0; + } + Py_DECREF(object); + if (ch == 0) { + PyErr_SetObject(PyExceptionInstance_Class(exc), exc); + return NULL; + } + return Py_BuildValue("(u#n)", &ch, 1, start+3); + } + else { + wrong_exception_type(exc); + return NULL; + } +} + + static PyObject *strict_errors(PyObject *self, PyObject *exc) { return PyCodec_StrictErrors(exc); @@ -777,6 +853,11 @@ return PyCodec_BackslashReplaceErrors(exc); } +static PyObject *surrogates_errors(PyObject *self, PyObject *exc) +{ + return PyCodec_SurrogateErrors(exc); +} + static int _PyCodecRegistry_Init(void) { static struct { @@ -823,6 +904,14 @@ backslashreplace_errors, METH_O } + }, + { + "surrogates", + { + "surrogates", + surrogates_errors, + METH_O + } } }; Modified: python/branches/pep-0383/Python/marshal.c ============================================================================== --- python/branches/pep-0383/Python/marshal.c (original) +++ python/branches/pep-0383/Python/marshal.c Fri May 1 15:25:53 2009 @@ -312,7 +312,9 @@ } else if (PyUnicode_CheckExact(v)) { PyObject *utf8; - utf8 = PyUnicode_AsUTF8String(v); + utf8 = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(v), + PyUnicode_GET_SIZE(v), + "surrogates"); if (utf8 == NULL) { p->depth--; p->error = WFERR_UNMARSHALLABLE; @@ -810,7 +812,7 @@ retval = NULL; break; } - v = PyUnicode_DecodeUTF8(buffer, n, NULL); + v = PyUnicode_DecodeUTF8(buffer, n, "surrogates"); PyMem_DEL(buffer); retval = v; break; From buildbot at python.org Fri May 1 15:39:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 May 2009 13:39:54 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090501133955.018A41E405E@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/320 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 45, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/Include ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Fri May 1 17:37:05 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 1 May 2009 17:37:05 +0200 (CEST) Subject: [Python-checkins] r72165 - in python/branches/py3k: Doc/library/stdtypes.rst Lib/test/formatfloat_testcases.txt Lib/test/test_types.py Misc/NEWS Objects/stringlib/formatter.h Objects/unicodeobject.c Message-ID: <20090501153705.20ADB1E4143@bag.python.org> Author: mark.dickinson Date: Fri May 1 17:37:04 2009 New Revision: 72165 Log: Issue #5859: Remove '%f' to '%g' formatting switch for large floats. Modified: python/branches/py3k/Doc/library/stdtypes.rst python/branches/py3k/Lib/test/formatfloat_testcases.txt python/branches/py3k/Lib/test/test_types.py python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/stringlib/formatter.h python/branches/py3k/Objects/unicodeobject.c Modified: python/branches/py3k/Doc/library/stdtypes.rst ============================================================================== --- python/branches/py3k/Doc/library/stdtypes.rst (original) +++ python/branches/py3k/Doc/library/stdtypes.rst Fri May 1 17:37:04 2009 @@ -1321,9 +1321,9 @@ .. XXX Examples? -For safety reasons, floating point precisions are clipped to 50; ``%f`` -conversions for numbers whose absolute value is over 1e50 are replaced by ``%g`` -conversions. [#]_ All other errors raise exceptions. +.. versionchanged:: 3.1 + ``%f`` conversions for numbers whose absolute value is over 1e50 are no + longer replaced by ``%g`` conversions. .. index:: module: string @@ -2723,10 +2723,6 @@ .. [#] To format only a tuple you should therefore provide a singleton tuple whose only element is the tuple to be formatted. -.. [#] These numbers are fairly arbitrary. They are intended to avoid printing endless - strings of meaningless digits without hampering correct use and without having - to know the exact precision of floating point values on a particular machine. - .. [#] The advantage of leaving the newline on is that returning an empty string is then an unambiguous EOF indication. It is also possible (in cases where it might matter, for example, if you want to make an exact copy of a file while Modified: python/branches/py3k/Lib/test/formatfloat_testcases.txt ============================================================================== --- python/branches/py3k/Lib/test/formatfloat_testcases.txt (original) +++ python/branches/py3k/Lib/test/formatfloat_testcases.txt Fri May 1 17:37:04 2009 @@ -22,8 +22,8 @@ %.0f 123.456 -> 123 %.0f 1234.56 -> 1235 %.0f 1e49 -> 9999999999999999464902769475481793196872414789632 --- %.0f 1e50 -> 100000000000000007629769841091887003294964970946560 %.0f 9.9999999999999987e+49 -> 99999999999999986860582406952576489172979654066176 +%.0f 1e50 -> 100000000000000007629769841091887003294964970946560 -- precision 1 %.1f 0.0001 -> 0.0 Modified: python/branches/py3k/Lib/test/test_types.py ============================================================================== --- python/branches/py3k/Lib/test/test_types.py (original) +++ python/branches/py3k/Lib/test/test_types.py Fri May 1 17:37:04 2009 @@ -538,10 +538,25 @@ test(-1.0, ' f', '-1.000000') test( 1.0, '+f', '+1.000000') test(-1.0, '+f', '-1.000000') - test(1.1234e90, 'f', '1.1234e+90') - test(1.1234e90, 'F', '1.1234e+90') - test(1.1234e200, 'f', '1.1234e+200') - test(1.1234e200, 'F', '1.1234e+200') + + # Python versions <= 3.0 switched from 'f' to 'g' formatting for + # values larger than 1e50. No longer. + f = 1.1234e90 + for fmt in 'f', 'F': + # don't do a direct equality check, since on some + # platforms only the first few digits of dtoa + # will be reliable + result = f.__format__(fmt) + self.assertEqual(len(result), 98) + self.assertEqual(result[-7], '.') + self.assert_(result[:12] in ('112340000000', '112339999999')) + f = 1.1234e200 + for fmt in 'f', 'F': + result = f.__format__(fmt) + self.assertEqual(len(result), 208) + self.assertEqual(result[-7], '.') + self.assert_(result[:12] in ('112340000000', '112339999999')) + test( 1.0, 'e', '1.000000e+00') test(-1.0, 'e', '-1.000000e+00') Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri May 1 17:37:04 2009 @@ -12,8 +12,10 @@ Core and Builtins ----------------- -- Issue #5859: Remove length restrictions for float formatting: - '%.67f' % 12.34 and '%.120e' % 12.34 no longer raise an exception. +- Issue #5859: Remove switch from '%f' to '%g'-style formatting for + floats with absolute value over 1e50. Also remove length + restrictions for float formatting: '%.67f' % 12.34 and '%.120e' % + 12.34 no longer raise an exception. - Issue #1588: Add complex.__format__. For example, format(complex(1, 2./3), '.5') now produces a sensible result. Modified: python/branches/py3k/Objects/stringlib/formatter.h ============================================================================== --- python/branches/py3k/Objects/stringlib/formatter.h (original) +++ python/branches/py3k/Objects/stringlib/formatter.h Fri May 1 17:37:04 2009 @@ -934,8 +934,6 @@ if (precision < 0) precision = 6; - if ((type == 'f' || type == 'F') && fabs(val) >= 1e50) - type = 'g'; /* Cast "type", because if we're in unicode we need to pass a 8-bit char. This is safe, because we've restricted what "type" Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Fri May 1 17:37:04 2009 @@ -8808,9 +8808,6 @@ if (prec < 0) prec = 6; - if (type == 'f' && fabs(x) >= 1e50) - type = 'g'; - p = PyOS_double_to_string(x, type, prec, (flags & F_ALT) ? Py_DTSF_ALT : 0, NULL); if (p == NULL) From buildbot at python.org Fri May 1 17:55:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 May 2009 15:55:11 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090501155512.3DA981E40A7@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/851 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_multiprocessing test_os test_time make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri May 1 18:26:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 May 2009 16:26:59 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090501162700.0C84F1E41E9@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/609 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 177, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Fri May 1 18:27:28 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 1 May 2009 18:27:28 +0200 (CEST) Subject: [Python-checkins] r72166 - python/branches/release30-maint Message-ID: <20090501162728.90BA01E41E9@bag.python.org> Author: mark.dickinson Date: Fri May 1 18:27:28 2009 New Revision: 72166 Log: Blocked revisions 72165 via svnmerge ........ r72165 | mark.dickinson | 2009-05-01 16:37:04 +0100 (Fri, 01 May 2009) | 2 lines Issue #5859: Remove '%f' to '%g' formatting switch for large floats. ........ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Fri May 1 19:35:38 2009 From: python-checkins at python.org (walter.doerwald) Date: Fri, 1 May 2009 19:35:38 +0200 (CEST) Subject: [Python-checkins] r72167 - in python/trunk: Doc/library/test.rst Lib/test/test_getopt.py Lib/test/test_gettext.py Lib/test/test_ntpath.py Lib/test/test_optparse.py Lib/test/test_posixpath.py Lib/test/test_support.py Lib/test/test_tcl.py Lib/test/test_tempfile.py Lib/test/test_urllib.py Lib/test/test_xmlrpc.py Message-ID: <20090501173538.6A2931E4643@bag.python.org> Author: walter.doerwald Date: Fri May 1 19:35:37 2009 New Revision: 72167 Log: Make test.test_support.EnvironmentVarGuard behave like a dictionary. All changes are mirrored to the underlying os.environ dict, but rolled back on exit from the with block. Modified: python/trunk/Doc/library/test.rst python/trunk/Lib/test/test_getopt.py python/trunk/Lib/test/test_gettext.py python/trunk/Lib/test/test_ntpath.py python/trunk/Lib/test/test_optparse.py python/trunk/Lib/test/test_posixpath.py python/trunk/Lib/test/test_support.py python/trunk/Lib/test/test_tcl.py python/trunk/Lib/test/test_tempfile.py python/trunk/Lib/test/test_urllib.py python/trunk/Lib/test/test_xmlrpc.py Modified: python/trunk/Doc/library/test.rst ============================================================================== --- python/trunk/Doc/library/test.rst (original) +++ python/trunk/Doc/library/test.rst Fri May 1 19:35:37 2009 @@ -401,9 +401,14 @@ .. class:: EnvironmentVarGuard() Class used to temporarily set or unset environment variables. Instances can be - used as a context manager. + used as a context manager and have a complete dictionary interface for + querying/modifying the underlying ``os.environ``. After exit from the context + manager all changes to environment variables done through this instance will + be rolled back. .. versionadded:: 2.6 + .. versionchanged:: 2.7 + Added dictionary interface. .. method:: EnvironmentVarGuard.set(envvar, value) @@ -415,6 +420,7 @@ Temporarily unset the environment variable ``envvar``. + .. class:: WarningsRecorder() Class used to record warnings for unit tests. See documentation of Modified: python/trunk/Lib/test/test_getopt.py ============================================================================== --- python/trunk/Lib/test/test_getopt.py (original) +++ python/trunk/Lib/test/test_getopt.py Fri May 1 19:35:37 2009 @@ -1,7 +1,7 @@ # test_getopt.py # David Goodger 2000-08-19 -from test.test_support import verbose, run_doctest, run_unittest +from test.test_support import verbose, run_doctest, run_unittest, EnvironmentVarGuard import unittest import getopt @@ -11,15 +11,13 @@ class GetoptTests(unittest.TestCase): def setUp(self): - self.old_posixly_correct = os.environ.get("POSIXLY_CORRECT", sentinel) - if self.old_posixly_correct is not sentinel: - del os.environ["POSIXLY_CORRECT"] + self.env = EnvironmentVarGuard() + if "POSIXLY_CORRECT" in self.env: + del self.env["POSIXLY_CORRECT"] def tearDown(self): - if self.old_posixly_correct is sentinel: - os.environ.pop("POSIXLY_CORRECT", None) - else: - os.environ["POSIXLY_CORRECT"] = self.old_posixly_correct + self.env.__exit__() + del self.env def assertError(self, *args, **kwargs): self.assertRaises(getopt.GetoptError, *args, **kwargs) @@ -135,7 +133,7 @@ self.assertEqual(args, ['arg1', '-b', '1', '--alpha', '--beta=2']) # Posix style via POSIXLY_CORRECT - os.environ["POSIXLY_CORRECT"] = "1" + self.env["POSIXLY_CORRECT"] = "1" opts, args = getopt.gnu_getopt(cmdline, 'ab:', ['alpha', 'beta=']) self.assertEqual(opts, [('-a', '')]) self.assertEqual(args, ['arg1', '-b', '1', '--alpha', '--beta=2']) Modified: python/trunk/Lib/test/test_gettext.py ============================================================================== --- python/trunk/Lib/test/test_gettext.py (original) +++ python/trunk/Lib/test/test_gettext.py Fri May 1 19:35:37 2009 @@ -58,10 +58,6 @@ MOFILE = os.path.join(LOCALEDIR, 'gettext.mo') UMOFILE = os.path.join(LOCALEDIR, 'ugettext.mo') MMOFILE = os.path.join(LOCALEDIR, 'metadata.mo') -try: - LANG = os.environ['LANGUAGE'] -except: - LANG = 'en' class GettextBaseTest(unittest.TestCase): @@ -77,10 +73,12 @@ fp = open(MMOFILE, 'wb') fp.write(base64.decodestring(MMO_DATA)) fp.close() - os.environ['LANGUAGE'] = 'xx' + self.env = test_support.EnvironmentVarGuard() + self.env['LANGUAGE'] = 'xx' def tearDown(self): - os.environ['LANGUAGE'] = LANG + self.env.__exit__() + del self.env shutil.rmtree(os.path.split(LOCALEDIR)[0]) Modified: python/trunk/Lib/test/test_ntpath.py ============================================================================== --- python/trunk/Lib/test/test_ntpath.py (original) +++ python/trunk/Lib/test/test_ntpath.py Fri May 1 19:35:37 2009 @@ -124,12 +124,11 @@ tester("ntpath.normpath('//machine/share//a/b')", r'\\machine\share\a\b') def test_expandvars(self): - oldenv = os.environ.copy() - try: - os.environ.clear() - os.environ["foo"] = "bar" - os.environ["{foo"] = "baz1" - os.environ["{foo}"] = "baz2" + with test_support.EnvironmentVarGuard() as env: + env.clear() + env["foo"] = "bar" + env["{foo"] = "baz1" + env["{foo}"] = "baz2" tester('ntpath.expandvars("foo")', "foo") tester('ntpath.expandvars("$foo bar")', "bar bar") tester('ntpath.expandvars("${foo}bar")', "barbar") @@ -149,9 +148,6 @@ tester('ntpath.expandvars("%?bar%")', "%?bar%") tester('ntpath.expandvars("%foo%%bar")', "bar%bar") tester('ntpath.expandvars("\'%foo%\'%bar")', "\'%foo%\'%bar") - finally: - os.environ.clear() - os.environ.update(oldenv) def test_abspath(self): # ntpath.abspath() can only be used on a system with the "nt" module Modified: python/trunk/Lib/test/test_optparse.py ============================================================================== --- python/trunk/Lib/test/test_optparse.py (original) +++ python/trunk/Lib/test/test_optparse.py Fri May 1 19:35:37 2009 @@ -1465,7 +1465,7 @@ # screws things up for other tests when it's part of the Python # test suite. with test_support.EnvironmentVarGuard() as env: - env.set('COLUMNS', str(columns)) + env['COLUMNS'] = str(columns) return InterceptingOptionParser(option_list=options) def assertHelpEquals(self, expected_output): @@ -1494,7 +1494,7 @@ def test_help_title_formatter(self): with test_support.EnvironmentVarGuard() as env: - env.set("COLUMNS", "80") + env["COLUMNS"] = "80" self.parser.formatter = TitledHelpFormatter() self.assertHelpEquals(_expected_help_title_formatter) Modified: python/trunk/Lib/test/test_posixpath.py ============================================================================== --- python/trunk/Lib/test/test_posixpath.py (original) +++ python/trunk/Lib/test/test_posixpath.py Fri May 1 19:35:37 2009 @@ -346,18 +346,17 @@ self.assert_(isinstance(posixpath.expanduser("~foo/"), basestring)) with test_support.EnvironmentVarGuard() as env: - env.set('HOME', '/') + env['HOME'] = '/' self.assertEqual(posixpath.expanduser("~"), "/") self.assertRaises(TypeError, posixpath.expanduser) def test_expandvars(self): - oldenv = os.environ.copy() - try: - os.environ.clear() - os.environ["foo"] = "bar" - os.environ["{foo"] = "baz1" - os.environ["{foo}"] = "baz2" + with test_support.EnvironmentVarGuard() as env: + env.clear() + env["foo"] = "bar" + env["{foo"] = "baz1" + env["{foo}"] = "baz2" self.assertEqual(posixpath.expandvars("foo"), "foo") self.assertEqual(posixpath.expandvars("$foo bar"), "bar bar") self.assertEqual(posixpath.expandvars("${foo}bar"), "barbar") @@ -370,9 +369,6 @@ self.assertEqual(posixpath.expandvars("${{foo}}"), "baz1}") self.assertEqual(posixpath.expandvars("$foo$foo"), "barbar") self.assertEqual(posixpath.expandvars("$bar$bar"), "$bar$bar") - finally: - os.environ.clear() - os.environ.update(oldenv) self.assertRaises(TypeError, posixpath.expandvars) Modified: python/trunk/Lib/test/test_support.py ============================================================================== --- python/trunk/Lib/test/test_support.py (original) +++ python/trunk/Lib/test/test_support.py Fri May 1 19:35:37 2009 @@ -13,6 +13,7 @@ import warnings import unittest import importlib +import UserDict __all__ = ["Error", "TestFailed", "ResourceDenied", "import_module", "verbose", "use_resources", "max_memuse", "record_original_stdout", @@ -526,26 +527,39 @@ sys.modules.update(self.original_modules) -class EnvironmentVarGuard(object): +class EnvironmentVarGuard(UserDict.DictMixin): """Class to help protect the environment variable properly. Can be used as a context manager.""" def __init__(self): + self._environ = os.environ self._changed = {} - def set(self, envvar, value): + def __getitem__(self, envvar): + return self._environ[envvar] + + def __setitem__(self, envvar, value): # Remember the initial value on the first access if envvar not in self._changed: - self._changed[envvar] = os.environ.get(envvar) - os.environ[envvar] = value + self._changed[envvar] = self._environ.get(envvar) + self._environ[envvar] = value - def unset(self, envvar): + def __delitem__(self, envvar): # Remember the initial value on the first access if envvar not in self._changed: - self._changed[envvar] = os.environ.get(envvar) - if envvar in os.environ: - del os.environ[envvar] + self._changed[envvar] = self._environ.get(envvar) + if envvar in self._environ: + del self._environ[envvar] + + def keys(self): + return self._environ.keys() + + def set(self, envvar, value): + self[envvar] = value + + def unset(self, envvar): + del self[envvar] def __enter__(self): return self @@ -553,10 +567,10 @@ def __exit__(self, *ignore_exc): for (k, v) in self._changed.items(): if v is None: - if k in os.environ: - del os.environ[k] + if k in self._environ: + del self._environ[k] else: - os.environ[k] = v + self._environ[k] = v class TransientResource(object): Modified: python/trunk/Lib/test/test_tcl.py ============================================================================== --- python/trunk/Lib/test/test_tcl.py (original) +++ python/trunk/Lib/test/test_tcl.py Fri May 1 19:35:37 2009 @@ -144,23 +144,20 @@ import sys if sys.platform.startswith(('win', 'darwin', 'cygwin')): return # no failure possible on windows? - if 'DISPLAY' in os.environ: - old_display = os.environ['DISPLAY'] - del os.environ['DISPLAY'] - # on some platforms, deleting environment variables - # doesn't actually carry through to the process level - # because they don't support unsetenv - # If that's the case, abort. - display = os.popen('echo $DISPLAY').read().strip() - if display: - return - try: + with test_support.EnvironmentVarGuard() as env: + if 'DISPLAY' in os.environ: + del env['DISPLAY'] + # on some platforms, deleting environment variables + # doesn't actually carry through to the process level + # because they don't support unsetenv + # If that's the case, abort. + display = os.popen('echo $DISPLAY').read().strip() + if display: + return + tcl = Tcl() self.assertRaises(TclError, tcl.winfo_geometry) self.assertRaises(TclError, tcl.loadtk) - finally: - if old_display is not None: - os.environ['DISPLAY'] = old_display def test_main(): test_support.run_unittest(TclTest, TkinterTest) Modified: python/trunk/Lib/test/test_tempfile.py ============================================================================== --- python/trunk/Lib/test/test_tempfile.py (original) +++ python/trunk/Lib/test/test_tempfile.py Fri May 1 19:35:37 2009 @@ -153,7 +153,7 @@ for envname in 'TMPDIR', 'TEMP', 'TMP': dirname = os.getenv(envname) if not dirname: - env.set(envname, os.path.abspath(envname)) + env[envname] = os.path.abspath(envname) cand = tempfile._candidate_tempdir_list() Modified: python/trunk/Lib/test/test_urllib.py ============================================================================== --- python/trunk/Lib/test/test_urllib.py (original) +++ python/trunk/Lib/test/test_urllib.py Fri May 1 19:35:37 2009 @@ -103,7 +103,7 @@ # Delete all proxy related env vars for k, v in os.environ.iteritems(): if 'proxy' in k.lower(): - env.unset(k) + del env[k] def tearDown(self): # Restore all proxy related env vars Modified: python/trunk/Lib/test/test_xmlrpc.py ============================================================================== --- python/trunk/Lib/test/test_xmlrpc.py (original) +++ python/trunk/Lib/test/test_xmlrpc.py Fri May 1 19:35:37 2009 @@ -605,7 +605,7 @@ def test_cgi_get(self): with test_support.EnvironmentVarGuard() as env: - env.set('REQUEST_METHOD', 'GET') + env['REQUEST_METHOD'] = 'GET' # if the method is GET and no request_text is given, it runs handle_get # get sysout output tmp = sys.stdout @@ -646,7 +646,7 @@ sys.stdout = open(test_support.TESTFN, "w") with test_support.EnvironmentVarGuard() as env: - env.set('CONTENT_LENGTH', str(len(data))) + env['CONTENT_LENGTH'] = str(len(data)) self.cgi.handle_request() sys.stdin.close() From python-checkins at python.org Fri May 1 19:37:10 2009 From: python-checkins at python.org (walter.doerwald) Date: Fri, 1 May 2009 19:37:10 +0200 (CEST) Subject: [Python-checkins] r72168 - python/branches/release26-maint Message-ID: <20090501173710.C84B71E4082@bag.python.org> Author: walter.doerwald Date: Fri May 1 19:37:10 2009 New Revision: 72168 Log: Blocked revisions 72167 via svnmerge ........ r72167 | walter.doerwald | 2009-05-01 19:35:37 +0200 (Fr, 01 Mai 2009) | 5 lines Make test.test_support.EnvironmentVarGuard behave like a dictionary. All changes are mirrored to the underlying os.environ dict, but rolled back on exit from the with block. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri May 1 19:46:00 2009 From: python-checkins at python.org (senthil.kumaran) Date: Fri, 1 May 2009 19:46:00 +0200 (CEST) Subject: [Python-checkins] r72169 - sandbox/trunk/urllib Message-ID: <20090501174600.399971E4095@bag.python.org> Author: senthil.kumaran Date: Fri May 1 19:45:56 2009 New Revision: 72169 Log: Sandbox for urllib related changes. Added: sandbox/trunk/urllib/ From buildbot at python.org Fri May 1 20:23:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 May 2009 18:23:18 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090501182319.00AEC1E4082@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/441 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: walter.doerwald BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_os make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri May 1 20:36:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 May 2009 18:36:06 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc trunk Message-ID: <20090501183607.0498D1E4082@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%20trunk/builds/354 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: walter.doerwald BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_time ====================================================================== FAIL: test_tzset (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/test/test_time.py", line 152, in test_tzset time.gmtime(xmas2002), time.localtime(xmas2002) AssertionError: time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) != time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=1, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) sincerely, -The Buildbot From python-checkins at python.org Fri May 1 21:38:21 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 1 May 2009 21:38:21 +0200 (CEST) Subject: [Python-checkins] r72170 - in python/branches/pep-0383: Include/unicodeobject.h Modules/_io/fileio.c Modules/posixmodule.c Objects/unicodeobject.c Python/codecs.c Message-ID: <20090501193821.62C571E4095@bag.python.org> Author: martin.v.loewis Date: Fri May 1 21:38:20 2009 New Revision: 72170 Log: Implement PEP 383 for file IO. Modified: python/branches/pep-0383/Include/unicodeobject.h python/branches/pep-0383/Modules/_io/fileio.c python/branches/pep-0383/Modules/posixmodule.c python/branches/pep-0383/Objects/unicodeobject.c python/branches/pep-0383/Python/codecs.c Modified: python/branches/pep-0383/Include/unicodeobject.h ============================================================================== --- python/branches/pep-0383/Include/unicodeobject.h (original) +++ python/branches/pep-0383/Include/unicodeobject.h Fri May 1 21:38:20 2009 @@ -198,6 +198,7 @@ # define PyUnicode_FromStringAndSize PyUnicodeUCS2_FromStringAndSize # define PyUnicode_FromUnicode PyUnicodeUCS2_FromUnicode # define PyUnicode_FromWideChar PyUnicodeUCS2_FromWideChar +# define PyUnicode_FSConverter PyUnicodeUCS2_FSConverter # define PyUnicode_GetDefaultEncoding PyUnicodeUCS2_GetDefaultEncoding # define PyUnicode_GetMax PyUnicodeUCS2_GetMax # define PyUnicode_GetSize PyUnicodeUCS2_GetSize @@ -296,6 +297,7 @@ # define PyUnicode_FromStringAndSize PyUnicodeUCS4_FromStringAndSize # define PyUnicode_FromUnicode PyUnicodeUCS4_FromUnicode # define PyUnicode_FromWideChar PyUnicodeUCS4_FromWideChar +# define PyUnicode_FSConverter PyUnicodeUCS4_FSConverter # define PyUnicode_GetDefaultEncoding PyUnicodeUCS4_GetDefaultEncoding # define PyUnicode_GetMax PyUnicodeUCS4_GetMax # define PyUnicode_GetSize PyUnicodeUCS4_GetSize @@ -693,25 +695,6 @@ PyObject *unicode, const char *errors); -/* Decode a null-terminated string using Py_FileSystemDefaultEncoding. - - If the encoding is supported by one of the built-in codecs (i.e., UTF-8, - UTF-16, UTF-32, Latin-1 or MBCS), otherwise fallback to UTF-8 and replace - invalid characters with '?'. - - The function is intended to be used for paths and file names only - during bootstrapping process where the codecs are not set up. -*/ - -PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefault( - const char *s /* encoded string */ - ); - -PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefaultAndSize( - const char *s, /* encoded string */ - Py_ssize_t size /* size */ - ); - /* Returns a pointer to the default encoding (normally, UTF-8) of the Unicode object unicode and the size of the encoded representation in bytes stored in *size. @@ -1254,6 +1237,33 @@ const char *errors /* error handling */ ); +/* --- File system encoding ---------------------------------------------- */ + +/* ParseTuple converter which converts a Unicode object into the file + system encoding, using the PEP 383 error handler; bytes objects are + output as-is. */ + +PyAPI_FUNC(int) PyUnicode_FSConverter(PyObject*, void*); + +/* Decode a null-terminated string using Py_FileSystemDefaultEncoding. + + If the encoding is supported by one of the built-in codecs (i.e., UTF-8, + UTF-16, UTF-32, Latin-1 or MBCS), otherwise fallback to UTF-8 and replace + invalid characters with '?'. + + The function is intended to be used for paths and file names only + during bootstrapping process where the codecs are not set up. +*/ + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefault( + const char *s /* encoded string */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefaultAndSize( + const char *s, /* encoded string */ + Py_ssize_t size /* size */ + ); + /* --- Methods & Slots ---------------------------------------------------- These are capable of handling Unicode objects and strings on input Modified: python/branches/pep-0383/Modules/_io/fileio.c ============================================================================== --- python/branches/pep-0383/Modules/_io/fileio.c (original) +++ python/branches/pep-0383/Modules/_io/fileio.c Fri May 1 21:38:20 2009 @@ -245,7 +245,7 @@ return -1; stringobj = PyUnicode_AsEncodedString( - u, Py_FileSystemDefaultEncoding, NULL); + u, Py_FileSystemDefaultEncoding, "utf8b"); Py_DECREF(u); if (stringobj == NULL) return -1; Modified: python/branches/pep-0383/Modules/posixmodule.c ============================================================================== --- python/branches/pep-0383/Modules/posixmodule.c (original) +++ python/branches/pep-0383/Modules/posixmodule.c Fri May 1 21:38:20 2009 @@ -534,6 +534,36 @@ return d; } +/* Convert a bytes object to a char*. Optionally lock the buffer if it is a + bytes array. */ + +static char* +bytes2str(PyObject* o, int lock) +{ + if(PyBytes_Check(o)) + return PyBytes_AsString(o); + else if(PyByteArray_Check(o)) { + if (lock && o->ob_type->tp_as_buffer->bf_getbuffer(o, NULL, 0) < 0) + /* On a bytearray, this should not fail. */ + PyErr_BadInternalCall(); + return PyByteArray_AsString(o); + } else { + /* The FS converter should have verified that this + is either bytes or bytearray. */ + PyErr_BadInternalCall(); + return NULL; + } +} + +/* Release the lock, decref the object. */ +static void +release_bytes(PyObject* o) +{ + if (PyByteArray_Check(o)) + o->ob_type->tp_as_buffer->bf_releasebuffer(NULL, 0); + Py_DECREF(o); +} + /* Set a POSIX-specific error from errno, and return NULL */ @@ -558,10 +588,11 @@ static PyObject * -posix_error_with_allocated_filename(char* name) +posix_error_with_allocated_filename(PyObject* name) { - PyObject *rc = PyErr_SetFromErrnoWithFilename(PyExc_OSError, name); - PyMem_Free(name); + PyObject *rc = PyErr_SetFromErrnoWithFilename(PyExc_OSError, + bytes2str(name, 0)); + release_bytes(name); return rc; } @@ -728,17 +759,19 @@ static PyObject * posix_1str(PyObject *args, char *format, int (*func)(const char*)) { - char *path1 = NULL; + PyObject *opath1 = NULL; + char *path1; int res; if (!PyArg_ParseTuple(args, format, - Py_FileSystemDefaultEncoding, &path1)) + PyUnicode_FSConverter, &opath1)) return NULL; + path1 = bytes2str(opath1, 1); Py_BEGIN_ALLOW_THREADS res = (*func)(path1); Py_END_ALLOW_THREADS if (res < 0) - return posix_error_with_allocated_filename(path1); - PyMem_Free(path1); + return posix_error_with_allocated_filename(opath1); + release_bytes(opath1); Py_INCREF(Py_None); return Py_None; } @@ -748,17 +781,20 @@ char *format, int (*func)(const char *, const char *)) { - char *path1 = NULL, *path2 = NULL; + PyObject *opath1, *opath2; + char *path1, *path2; int res; if (!PyArg_ParseTuple(args, format, - Py_FileSystemDefaultEncoding, &path1, - Py_FileSystemDefaultEncoding, &path2)) + PyUnicode_FSConverter, &opath1, + PyUnicode_FSConverter, &opath2)) return NULL; + path1 = bytes2str(opath1, 1); + path2 = bytes2str(opath2, 1); Py_BEGIN_ALLOW_THREADS res = (*func)(path1, path2); Py_END_ALLOW_THREADS - PyMem_Free(path1); - PyMem_Free(path2); + release_bytes(opath1); + release_bytes(opath2); if (res != 0) /* XXX how to report both path1 and path2??? */ return posix_error(); @@ -1560,8 +1596,8 @@ int (*wstatfunc)(const Py_UNICODE *, STRUCT_STAT *)) { STRUCT_STAT st; - char *path = NULL; /* pass this to stat; do not free() it */ - char *pathfree = NULL; /* this memory must be free'd */ + PyObject *opath; + char *path; int res; PyObject *result; @@ -1590,25 +1626,24 @@ #endif if (!PyArg_ParseTuple(args, format, - Py_FileSystemDefaultEncoding, &path)) + PyUnicode_FSConverter, &opath)) return NULL; - pathfree = path; - + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS res = (*statfunc)(path, &st); Py_END_ALLOW_THREADS if (res != 0) { #ifdef MS_WINDOWS - result = win32_error("stat", pathfree); + result = win32_error("stat", path); #else - result = posix_error_with_filename(pathfree); + result = posix_error_with_filename(path); #endif } else result = _pystat_fromstructstat(&st); - PyMem_Free(pathfree); + release_bytes(opath); return result; } @@ -1625,6 +1660,7 @@ static PyObject * posix_access(PyObject *self, PyObject *args) { + PyObject *opath; char *path; int mode; @@ -1644,13 +1680,14 @@ are also valid. */ PyErr_Clear(); } - if (!PyArg_ParseTuple(args, "eti:access", - Py_FileSystemDefaultEncoding, &path, &mode)) + if (!PyArg_ParseTuple(args, "O&i:access", + PyUnicode_FSConverter, &opath, &mode)) return 0; + path = bytes2str(opath); Py_BEGIN_ALLOW_THREADS attr = GetFileAttributesA(path); Py_END_ALLOW_THREADS - PyMem_Free(path); + release_bytes(opath); finish: if (attr == 0xFFFFFFFF) /* File does not exist, or cannot read attributes */ @@ -1663,13 +1700,14 @@ || (attr & FILE_ATTRIBUTE_DIRECTORY)); #else int res; - if (!PyArg_ParseTuple(args, "eti:access", - Py_FileSystemDefaultEncoding, &path, &mode)) + if (!PyArg_ParseTuple(args, "O&i:access", + PyUnicode_FSConverter, &opath, &mode)) return NULL; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS res = access(path, mode); Py_END_ALLOW_THREADS - PyMem_Free(path); + release_bytes(opath); return PyBool_FromLong(res == 0); #endif } @@ -1750,11 +1788,11 @@ #ifdef MS_WINDOWS return win32_1str(args, "chdir", "y:chdir", win32_chdir, "U:chdir", win32_wchdir); #elif defined(PYOS_OS2) && defined(PYCC_GCC) - return posix_1str(args, "et:chdir", _chdir2); + return posix_1str(args, "O&:chdir", _chdir2); #elif defined(__VMS) - return posix_1str(args, "et:chdir", (int (*)(const char *))chdir); + return posix_1str(args, "O&:chdir", (int (*)(const char *))chdir); #else - return posix_1str(args, "et:chdir", chdir); + return posix_1str(args, "O&:chdir", chdir); #endif } @@ -1779,6 +1817,7 @@ static PyObject * posix_chmod(PyObject *self, PyObject *args) { + PyObject *opath = NULL; char *path = NULL; int i; int res; @@ -1809,9 +1848,10 @@ are also valid. */ PyErr_Clear(); } - if (!PyArg_ParseTuple(args, "eti:chmod", Py_FileSystemDefaultEncoding, - &path, &i)) + if (!PyArg_ParseTuple(args, "O&i:chmod", PyUnicode_FSConverter, + &opath, &i)) return NULL; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS attr = GetFileAttributesA(path); if (attr != 0xFFFFFFFF) { @@ -1826,22 +1866,23 @@ Py_END_ALLOW_THREADS if (!res) { win32_error("chmod", path); - PyMem_Free(path); + release_bytes(opath); return NULL; } - PyMem_Free(path); + release_bytes(opath); Py_INCREF(Py_None); return Py_None; #else /* Py_WIN_WIDE_FILENAMES */ - if (!PyArg_ParseTuple(args, "eti:chmod", Py_FileSystemDefaultEncoding, - &path, &i)) + if (!PyArg_ParseTuple(args, "O&i:chmod", PyUnicode_FSConverter, + &opath, &i)) return NULL; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS res = chmod(path, i); Py_END_ALLOW_THREADS if (res < 0) - return posix_error_with_allocated_filename(path); - PyMem_Free(path); + return posix_error_with_allocated_filename(opath); + release_bytes(opath); Py_INCREF(Py_None); return Py_None; #endif @@ -1877,18 +1918,20 @@ static PyObject * posix_lchmod(PyObject *self, PyObject *args) { - char *path = NULL; + PyObject *opath; + char *path; int i; int res; - if (!PyArg_ParseTuple(args, "eti:lchmod", Py_FileSystemDefaultEncoding, - &path, &i)) + if (!PyArg_ParseTuple(args, "O&i:lchmod", PyUnicode_FSConverter, + &opath, &i)) return NULL; + path = bytes2str(opath, 1) Py_BEGIN_ALLOW_THREADS res = lchmod(path, i); Py_END_ALLOW_THREADS if (res < 0) - return posix_error_with_allocated_filename(path); - PyMem_Free(path); + return posix_error_with_allocated_filename(opath); + release_bytes(opath); Py_RETURN_NONE; } #endif /* HAVE_LCHMOD */ @@ -1902,18 +1945,20 @@ static PyObject * posix_chflags(PyObject *self, PyObject *args) { + PyObject *opath; char *path; unsigned long flags; int res; - if (!PyArg_ParseTuple(args, "etk:chflags", - Py_FileSystemDefaultEncoding, &path, &flags)) + if (!PyArg_ParseTuple(args, "O&k:chflags", + PyUnicode_FSConverter, &opath, &flags)) return NULL; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS res = chflags(path, flags); Py_END_ALLOW_THREADS if (res < 0) - return posix_error_with_allocated_filename(path); - PyMem_Free(path); + return posix_error_with_allocated_filename(opath); + release_bytes(opath); Py_INCREF(Py_None); return Py_None; } @@ -1928,18 +1973,20 @@ static PyObject * posix_lchflags(PyObject *self, PyObject *args) { + PyObject *opath; char *path; unsigned long flags; int res; - if (!PyArg_ParseTuple(args, "etk:lchflags", - Py_FileSystemDefaultEncoding, &path, &flags)) + if (!PyArg_ParseTuple(args, "O&k:lchflags", + PyUnicode_FSConverter, &path, &flags)) return NULL; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS res = lchflags(path, flags); Py_END_ALLOW_THREADS if (res < 0) - return posix_error_with_allocated_filename(path); - PyMem_Free(path); + return posix_error_with_allocated_filename(opath); + release_bytes(opath); Py_INCREF(Py_None); return Py_None; } @@ -1953,7 +2000,7 @@ static PyObject * posix_chroot(PyObject *self, PyObject *args) { - return posix_1str(args, "et:chroot", chroot); + return posix_1str(args, "O&:chroot", chroot); } #endif @@ -1996,19 +2043,21 @@ static PyObject * posix_chown(PyObject *self, PyObject *args) { - char *path = NULL; + PyObject *opath; + char *path; long uid, gid; int res; - if (!PyArg_ParseTuple(args, "etll:chown", - Py_FileSystemDefaultEncoding, &path, + if (!PyArg_ParseTuple(args, "O&ll:chown", + PyUnicode_FSConverter, &opath, &uid, &gid)) return NULL; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS res = chown(path, (uid_t) uid, (gid_t) gid); Py_END_ALLOW_THREADS if (res < 0) - return posix_error_with_allocated_filename(path); - PyMem_Free(path); + return posix_error_with_allocated_filename(opath); + release_bytes(opath); Py_INCREF(Py_None); return Py_None; } @@ -2045,19 +2094,21 @@ static PyObject * posix_lchown(PyObject *self, PyObject *args) { - char *path = NULL; + PyObject *opath; + char *path; int uid, gid; int res; - if (!PyArg_ParseTuple(args, "etii:lchown", - Py_FileSystemDefaultEncoding, &path, + if (!PyArg_ParseTuple(args, "O&ii:lchown", + PyUnicode_FSConverter, &opath, &uid, &gid)) return NULL; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS res = lchown(path, (uid_t) uid, (gid_t) gid); Py_END_ALLOW_THREADS if (res < 0) - return posix_error_with_allocated_filename(path); - PyMem_Free(path); + return posix_error_with_allocated_filename(opath); + release_bytes(opath); Py_INCREF(Py_None); return Py_None; } @@ -2113,7 +2164,7 @@ return posix_error(); if (use_bytes) return PyBytes_FromStringAndSize(buf, strlen(buf)); - return PyUnicode_Decode(buf, strlen(buf), Py_FileSystemDefaultEncoding,"strict"); + return PyUnicode_Decode(buf, strlen(buf), Py_FileSystemDefaultEncoding,"utf8b"); } PyDoc_STRVAR(posix_getcwd__doc__, @@ -2146,7 +2197,7 @@ static PyObject * posix_link(PyObject *self, PyObject *args) { - return posix_2str(args, "etet:link", link); + return posix_2str(args, "O&O&:link", link); } #endif /* HAVE_LINK */ @@ -2259,9 +2310,16 @@ } #endif - if (!PyArg_ParseTuple(args, "et#:listdir", - Py_FileSystemDefaultEncoding, &bufptr, &len)) + if (!PyArg_ParseTuple(args, "O&:listdir", + PyUnicode_FSConverter, &opath)) return NULL; + if (PyObject_Size(opath)+1 > MAX_PATH) { + PyErr_SetString(PyExc_ValueError, "path too long"); + Py_DECREF(opath); + return NULL; + } + strcpy(namebuf, bytes2str(opath, 0)); + len = PyObject_Size(opath); if (len > 0) { char ch = namebuf[len-1]; if (ch != SEP && ch != ALTSEP && ch != ':') @@ -2323,6 +2381,7 @@ #ifndef MAX_PATH #define MAX_PATH CCHMAXPATH #endif + PyObject *oname; char *name, *pt; Py_ssize_t len; PyObject *d, *v; @@ -2332,11 +2391,13 @@ FILEFINDBUF3 ep; APIRET rc; - if (!PyArg_ParseTuple(args, "et#:listdir", - Py_FileSystemDefaultEncoding, &name, &len)) + if (!PyArg_ParseTuple(args, "O&:listdir", + PyUnicode_FSConverter, &oname)) return NULL; + name = bytes2str(oname); + len = PyObject_Size(oname); if (len >= MAX_PATH) { - PyMem_Free(name); + release_bytes(oname); PyErr_SetString(PyExc_ValueError, "path too long"); return NULL; } @@ -2349,7 +2410,7 @@ strcpy(namebuf + len, "*.*"); if ((d = PyList_New(0)) == NULL) { - PyMem_Free(name); + release_bytes(oname); return NULL; } @@ -2362,7 +2423,7 @@ if (rc != NO_ERROR) { errno = ENOENT; - return posix_error_with_allocated_filename(name); + return posix_error_with_allocated_filename(oname); } if (srchcnt > 0) { /* If Directory is NOT Totally Empty, */ @@ -2392,11 +2453,11 @@ } while (DosFindNext(hdir, &ep, sizeof(ep), &srchcnt) == NO_ERROR && srchcnt > 0); } - PyMem_Free(name); + release_bytes(oname); return d; #else - - char *name = NULL; + PyObject *oname; + char *name; PyObject *d, *v; DIR *dirp; struct dirent *ep; @@ -2407,14 +2468,15 @@ arg_is_unicode = 0; PyErr_Clear(); } - if (!PyArg_ParseTuple(args, "et:listdir", Py_FileSystemDefaultEncoding, &name)) + if (!PyArg_ParseTuple(args, "O&:listdir", PyUnicode_FSConverter, &oname)) return NULL; + name = bytes2str(oname, 1); if ((dirp = opendir(name)) == NULL) { - return posix_error_with_allocated_filename(name); + return posix_error_with_allocated_filename(oname); } if ((d = PyList_New(0)) == NULL) { closedir(dirp); - PyMem_Free(name); + release_bytes(oname); return NULL; } for (;;) { @@ -2428,7 +2490,7 @@ } else { closedir(dirp); Py_DECREF(d); - return posix_error_with_allocated_filename(name); + return posix_error_with_allocated_filename(oname); } } if (ep->d_name[0] == '.' && @@ -2446,7 +2508,7 @@ w = PyUnicode_FromEncodedObject(v, Py_FileSystemDefaultEncoding, - "strict"); + "utf8b"); if (w != NULL) { Py_DECREF(v); v = w; @@ -2469,7 +2531,7 @@ Py_DECREF(v); } closedir(dirp); - PyMem_Free(name); + release_bytes(oname); return d; @@ -2481,10 +2543,8 @@ static PyObject * posix__getfullpathname(PyObject *self, PyObject *args) { - /* assume encoded strings won't more than double no of chars */ - char inbuf[MAX_PATH*2]; - char *inbufp = inbuf; - Py_ssize_t insize = sizeof(inbuf); + PyObject *opath; + char *path; char outbuf[MAX_PATH*2]; char *temp; #ifdef Py_WIN_WIDE_FILENAMES @@ -2518,13 +2578,17 @@ PyErr_Clear(); } #endif - if (!PyArg_ParseTuple (args, "et#:_getfullpathname", - Py_FileSystemDefaultEncoding, &inbufp, - &insize)) - return NULL; - if (!GetFullPathName(inbuf, sizeof(outbuf)/sizeof(outbuf[0]), - outbuf, &temp)) - return win32_error("GetFullPathName", inbuf); + if (!PyArg_ParseTuple (args, "O&:_getfullpathname", + PyUnicode_FSConverter, &opath)) + return NULL; + path = bytes2str(opath, 1); + if (!GetFullPathName(path, sizeof(outbuf)/sizeof(outbuf[0]), + outbuf, &temp)) { + win32_error("GetFullPathName", path); + release_bytes(opath); + return NULL; + } + release_bytes(path); if (PyUnicode_Check(PyTuple_GetItem(args, 0))) { return PyUnicode_Decode(outbuf, strlen(outbuf), Py_FileSystemDefaultEncoding, NULL); @@ -2541,7 +2605,8 @@ posix_mkdir(PyObject *self, PyObject *args) { int res; - char *path = NULL; + PyObject *opath; + char *path; int mode = 0777; #ifdef Py_WIN_WIDE_FILENAMES @@ -2562,9 +2627,10 @@ are also valid. */ PyErr_Clear(); } - if (!PyArg_ParseTuple(args, "et|i:mkdir", - Py_FileSystemDefaultEncoding, &path, &mode)) + if (!PyArg_ParseTuple(args, "O&|i:mkdir", + PyUnicode_FSConverter, &opath, &mode)) return NULL; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS /* PyUnicode_AS_UNICODE OK without thread lock as it is a simple dereference. */ @@ -2572,17 +2638,18 @@ Py_END_ALLOW_THREADS if (!res) { win32_error("mkdir", path); - PyMem_Free(path); + release_bytes(opath); return NULL; } - PyMem_Free(path); + release_bytes(opath); Py_INCREF(Py_None); return Py_None; #else - if (!PyArg_ParseTuple(args, "et|i:mkdir", - Py_FileSystemDefaultEncoding, &path, &mode)) + if (!PyArg_ParseTuple(args, "O&|i:mkdir", + PyUnicode_FSConverter, &opath, &mode)) return NULL; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS #if ( defined(__WATCOMC__) || defined(PYCC_VACPP) ) && !defined(__QNX__) res = mkdir(path); @@ -2591,8 +2658,8 @@ #endif Py_END_ALLOW_THREADS if (res < 0) - return posix_error_with_allocated_filename(path); - PyMem_Free(path); + return posix_error_with_allocated_filename(opath); + release_bytes(opath); Py_INCREF(Py_None); return Py_None; #endif @@ -2684,7 +2751,7 @@ Py_INCREF(Py_None); return Py_None; #else - return posix_2str(args, "etet:rename", rename); + return posix_2str(args, "O&O&:rename", rename); #endif } @@ -2699,7 +2766,7 @@ #ifdef MS_WINDOWS return win32_1str(args, "rmdir", "y:rmdir", RemoveDirectoryA, "U:rmdir", RemoveDirectoryW); #else - return posix_1str(args, "et:rmdir", rmdir); + return posix_1str(args, "O&:rmdir", rmdir); #endif } @@ -2712,9 +2779,9 @@ posix_stat(PyObject *self, PyObject *args) { #ifdef MS_WINDOWS - return posix_do_stat(self, args, "et:stat", STAT, "U:stat", win32_wstat); + return posix_do_stat(self, args, "O&:stat", STAT, "U:stat", win32_wstat); #else - return posix_do_stat(self, args, "et:stat", STAT, NULL, NULL); + return posix_do_stat(self, args, "O&:stat", STAT, NULL, NULL); #endif } @@ -2780,7 +2847,7 @@ #ifdef MS_WINDOWS return win32_1str(args, "remove", "y:remove", DeleteFileA, "U:remove", DeleteFileW); #else - return posix_1str(args, "et:remove", unlink); + return posix_1str(args, "O&:remove", unlink); #endif } @@ -2852,7 +2919,8 @@ PyObject *arg; PyUnicodeObject *obwpath; wchar_t *wpath = NULL; - char *apath = NULL; + PyObject *oapath; + char *apath; HANDLE hFile; long atimesec, mtimesec, ausec, musec; FILETIME atime, mtime; @@ -2874,9 +2942,10 @@ PyErr_Clear(); } if (!wpath) { - if (!PyArg_ParseTuple(args, "etO:utime", - Py_FileSystemDefaultEncoding, &apath, &arg)) + if (!PyArg_ParseTuple(args, "O&O:utime", + PyUnicode_FSConverter, &oapath, &arg)) return NULL; + apath = bytes2str(oapath); Py_BEGIN_ALLOW_THREADS hFile = CreateFileA(apath, FILE_WRITE_ATTRIBUTES, 0, NULL, OPEN_EXISTING, @@ -2884,10 +2953,10 @@ Py_END_ALLOW_THREADS if (hFile == INVALID_HANDLE_VALUE) { win32_error("utime", apath); - PyMem_Free(apath); + release(oapath); return NULL; } - PyMem_Free(apath); + release_bytes(oapath); } if (arg == Py_None) { @@ -2928,7 +2997,8 @@ return result; #else /* Py_WIN_WIDE_FILENAMES */ - char *path = NULL; + PyObject *opath; + char *path; long atime, mtime, ausec, musec; int res; PyObject* arg; @@ -2951,9 +3021,10 @@ #endif /* HAVE_UTIMES */ - if (!PyArg_ParseTuple(args, "etO:utime", - Py_FileSystemDefaultEncoding, &path, &arg)) + if (!PyArg_ParseTuple(args, "O&O:utime", + PyUnicode_FSConverter, &opath, &arg)) return NULL; + path = bytes2str(opath, 1); if (arg == Py_None) { /* optional time values not given */ Py_BEGIN_ALLOW_THREADS @@ -2963,18 +3034,18 @@ else if (!PyTuple_Check(arg) || PyTuple_Size(arg) != 2) { PyErr_SetString(PyExc_TypeError, "utime() arg 2 must be a tuple (atime, mtime)"); - PyMem_Free(path); + release_bytes(opath); return NULL; } else { if (extract_time(PyTuple_GET_ITEM(arg, 0), &atime, &ausec) == -1) { - PyMem_Free(path); + release_bytes(opath); return NULL; } if (extract_time(PyTuple_GET_ITEM(arg, 1), &mtime, &musec) == -1) { - PyMem_Free(path); + release_bytes(opath); return NULL; } ATIME = atime; @@ -2992,9 +3063,9 @@ #endif /* HAVE_UTIMES */ } if (res < 0) { - return posix_error_with_allocated_filename(path); + return posix_error_with_allocated_filename(opath); } - PyMem_Free(path); + release_bytes(opath); Py_INCREF(Py_None); return Py_None; #undef UTIME_ARG @@ -3029,6 +3100,22 @@ PyMem_Free(array[i]); PyMem_DEL(array); } + +int fsconvert_strdup(PyObject *o, char**out) +{ + PyObject *bytes; + Py_ssize_t size; + if (!PyUnicode_FSConverter(o, &bytes)) + return 0; + size = PyObject_Size(bytes); + *out = PyMem_Malloc(size+1); + if (!*out) + return 0; + /* Don't lock bytes, as we hold the GIL */ + memcpy(*out, bytes2str(bytes, 0), size+1); + Py_DECREF(bytes); + return 1; +} #endif @@ -3043,6 +3130,7 @@ static PyObject * posix_execv(PyObject *self, PyObject *args) { + PyObject *opath; char *path; PyObject *argv; char **argvlist; @@ -3052,10 +3140,11 @@ /* execv has two arguments: (path, argv), where argv is a list or tuple of strings. */ - if (!PyArg_ParseTuple(args, "etO:execv", - Py_FileSystemDefaultEncoding, - &path, &argv)) + if (!PyArg_ParseTuple(args, "O&O:execv", + PyUnicode_FSConverter, + &opath, &argv)) return NULL; + path = bytes2str(opath, 1); if (PyList_Check(argv)) { argc = PyList_Size(argv); getitem = PyList_GetItem; @@ -3066,28 +3155,27 @@ } else { PyErr_SetString(PyExc_TypeError, "execv() arg 2 must be a tuple or list"); - PyMem_Free(path); + release_bytes(opath); return NULL; } if (argc < 1) { PyErr_SetString(PyExc_ValueError, "execv() arg 2 must not be empty"); - PyMem_Free(path); + release_bytes(opath); return NULL; } argvlist = PyMem_NEW(char *, argc+1); if (argvlist == NULL) { - PyMem_Free(path); + release_bytes(opath); return PyErr_NoMemory(); } for (i = 0; i < argc; i++) { - if (!PyArg_Parse((*getitem)(argv, i), "et", - Py_FileSystemDefaultEncoding, - &argvlist[i])) { + if (!fsconvert_strdup((*getitem)(argv, i), + &argvlist[i])) { free_string_array(argvlist, i); PyErr_SetString(PyExc_TypeError, "execv() arg 2 must contain only strings"); - PyMem_Free(path); + release_bytes(opath); return NULL; } @@ -3099,7 +3187,7 @@ /* If we get here it's definitely an error */ free_string_array(argvlist, argc); - PyMem_Free(path); + release_bytes(opath); return posix_error(); } @@ -3115,6 +3203,7 @@ static PyObject * posix_execve(PyObject *self, PyObject *args) { + PyObject *opath; char *path; PyObject *argv, *env; char **argvlist; @@ -3128,10 +3217,11 @@ argv is a list or tuple of strings and env is a dictionary like posix.environ. */ - if (!PyArg_ParseTuple(args, "etOO:execve", - Py_FileSystemDefaultEncoding, - &path, &argv, &env)) + if (!PyArg_ParseTuple(args, "O&OO:execve", + PyUnicode_FSConverter, + &opath, &argv, &env)) return NULL; + path = bytes2str(opath, 1); if (PyList_Check(argv)) { argc = PyList_Size(argv); getitem = PyList_GetItem; @@ -3157,10 +3247,8 @@ goto fail_0; } for (i = 0; i < argc; i++) { - if (!PyArg_Parse((*getitem)(argv, i), - "et;execve() arg 2 must contain only strings", - Py_FileSystemDefaultEncoding, - &argvlist[i])) + if (!fsconvert_strdup((*getitem)(argv, i), + &argvlist[i])) { lastarg = i; goto fail_1; @@ -3242,7 +3330,7 @@ Py_XDECREF(vals); Py_XDECREF(keys); fail_0: - PyMem_Free(path); + release_bytes(opath); return NULL; } #endif /* HAVE_EXECV */ @@ -3260,8 +3348,10 @@ static PyObject * posix_spawnv(PyObject *self, PyObject *args) { + PyObject *opath; char *path; PyObject *argv; + PyObject **oargvlist; char **argvlist; int mode, i; Py_ssize_t argc; @@ -3271,10 +3361,11 @@ /* spawnv has three arguments: (mode, path, argv), where argv is a list or tuple of strings. */ - if (!PyArg_ParseTuple(args, "ietO:spawnv", &mode, - Py_FileSystemDefaultEncoding, - &path, &argv)) + if (!PyArg_ParseTuple(args, "iO&O:spawnv", &mode, + PyUnicode_FSConverter, + &opath, &argv)) return NULL; + path = bytes2str(opath); if (PyList_Check(argv)) { argc = PyList_Size(argv); getitem = PyList_GetItem; @@ -3286,24 +3377,23 @@ else { PyErr_SetString(PyExc_TypeError, "spawnv() arg 2 must be a tuple or list"); - PyMem_Free(path); + release_bytes(opath); return NULL; } argvlist = PyMem_NEW(char *, argc+1); if (argvlist == NULL) { - PyMem_Free(path); + release_bytes(opath); return PyErr_NoMemory(); } for (i = 0; i < argc; i++) { - if (!PyArg_Parse((*getitem)(argv, i), "et", - Py_FileSystemDefaultEncoding, - &argvlist[i])) { + if (!fsconvert_strdup((*getitem)(argv, i), + &oargvlist[i])) { free_string_array(argvlist, i); PyErr_SetString( PyExc_TypeError, "spawnv() arg 2 must contain only strings"); - PyMem_Free(path); + release_bytes(opath); return NULL; } } @@ -3323,7 +3413,7 @@ #endif free_string_array(argvlist, argc); - PyMem_Free(path); + release_bytes(opath); if (spawnval == -1) return posix_error(); @@ -3348,6 +3438,7 @@ static PyObject * posix_spawnve(PyObject *self, PyObject *args) { + PyObject *opath; char *path; PyObject *argv, *env; char **argvlist; @@ -3363,10 +3454,11 @@ argv is a list or tuple of strings and env is a dictionary like posix.environ. */ - if (!PyArg_ParseTuple(args, "ietOO:spawnve", &mode, - Py_FileSystemDefaultEncoding, - &path, &argv, &env)) + if (!PyArg_ParseTuple(args, "iO&OO:spawnve", &mode, + PyUnicode_FSConverter, + &opath, &argv, &env)) return NULL; + path = bytes2str(opath); if (PyList_Check(argv)) { argc = PyList_Size(argv); getitem = PyList_GetItem; @@ -3392,10 +3484,8 @@ goto fail_0; } for (i = 0; i < argc; i++) { - if (!PyArg_Parse((*getitem)(argv, i), - "et;spawnve() arg 2 must contain only strings", - Py_FileSystemDefaultEncoding, - &argvlist[i])) + if (!fsconvert_strdup((*getitem)(argv, i), + &argvlist[i])) { lastarg = i; goto fail_1; @@ -3485,7 +3575,7 @@ Py_XDECREF(vals); Py_XDECREF(keys); fail_0: - PyMem_Free(path); + release_bytes(opath); return res; } @@ -3503,6 +3593,7 @@ static PyObject * posix_spawnvp(PyObject *self, PyObject *args) { + PyObject *opath; char *path; PyObject *argv; char **argvlist; @@ -3513,10 +3604,11 @@ /* spawnvp has three arguments: (mode, path, argv), where argv is a list or tuple of strings. */ - if (!PyArg_ParseTuple(args, "ietO:spawnvp", &mode, - Py_FileSystemDefaultEncoding, - &path, &argv)) + if (!PyArg_ParseTuple(args, "iO&O:spawnvp", &mode, + PyUnicode_FSConverter, + &opath, &argv)) return NULL; + path = bytes2str(opath); if (PyList_Check(argv)) { argc = PyList_Size(argv); getitem = PyList_GetItem; @@ -3528,24 +3620,23 @@ else { PyErr_SetString(PyExc_TypeError, "spawnvp() arg 2 must be a tuple or list"); - PyMem_Free(path); + release_bytes(opath); return NULL; } argvlist = PyMem_NEW(char *, argc+1); if (argvlist == NULL) { - PyMem_Free(path); + release_bytes(opath); return PyErr_NoMemory(); } for (i = 0; i < argc; i++) { - if (!PyArg_Parse((*getitem)(argv, i), "et", - Py_FileSystemDefaultEncoding, - &argvlist[i])) { + if (!fsconvert_strdup((*getitem)(argv, i), + &argvlist[i])) { free_string_array(argvlist, i); PyErr_SetString( PyExc_TypeError, "spawnvp() arg 2 must contain only strings"); - PyMem_Free(path); + release_bytes(opath); return NULL; } } @@ -3560,7 +3651,7 @@ Py_END_ALLOW_THREADS free_string_array(argvlist, argc); - PyMem_Free(path); + release_bytes(opath); if (spawnval == -1) return posix_error(); @@ -3582,6 +3673,7 @@ static PyObject * posix_spawnvpe(PyObject *self, PyObject *args) { + PyObject *opath char *path; PyObject *argv, *env; char **argvlist; @@ -3597,9 +3689,10 @@ like posix.environ. */ if (!PyArg_ParseTuple(args, "ietOO:spawnvpe", &mode, - Py_FileSystemDefaultEncoding, - &path, &argv, &env)) + PyUnicode_FSConverter, + &opath, &argv, &env)) return NULL; + path = bytes2str(opath); if (PyList_Check(argv)) { argc = PyList_Size(argv); getitem = PyList_GetItem; @@ -3625,10 +3718,8 @@ goto fail_0; } for (i = 0; i < argc; i++) { - if (!PyArg_Parse((*getitem)(argv, i), - "et;spawnvpe() arg 2 must contain only strings", - Py_FileSystemDefaultEncoding, - &argvlist[i])) + if (!fsconvert_strdup((*getitem)(argv, i), + &argvlist[i])) { lastarg = i; goto fail_1; @@ -3709,7 +3800,7 @@ Py_XDECREF(vals); Py_XDECREF(keys); fail_0: - PyMem_Free(path); + release_bytes(opath); return res; } #endif /* PYOS_OS2 */ @@ -4548,12 +4639,12 @@ posix_lstat(PyObject *self, PyObject *args) { #ifdef HAVE_LSTAT - return posix_do_stat(self, args, "et:lstat", lstat, NULL, NULL); + return posix_do_stat(self, args, "O&:lstat", lstat, NULL, NULL); #else /* !HAVE_LSTAT */ #ifdef MS_WINDOWS - return posix_do_stat(self, args, "et:lstat", STAT, "U:lstat", win32_wstat); + return posix_do_stat(self, args, "O&:lstat", STAT, "U:lstat", win32_wstat); #else - return posix_do_stat(self, args, "et:lstat", STAT, NULL, NULL); + return posix_do_stat(self, args, "O&:lstat", STAT, NULL, NULL); #endif #endif /* !HAVE_LSTAT */ } @@ -4569,16 +4660,18 @@ { PyObject* v; char buf[MAXPATHLEN]; + PyObject *opath; char *path; int n; int arg_is_unicode = 0; - if (!PyArg_ParseTuple(args, "et:readlink", - Py_FileSystemDefaultEncoding, &path)) + if (!PyArg_ParseTuple(args, "O&:readlink", + PyUnicode_FSConverter, &opath)) return NULL; + path = bytes2str(opath, 1); v = PySequence_GetItem(args, 0); if (v == NULL) { - PyMem_Free(path); + release_bytes(opath); return NULL; } @@ -4591,16 +4684,16 @@ n = readlink(path, buf, (int) sizeof buf); Py_END_ALLOW_THREADS if (n < 0) - return posix_error_with_allocated_filename(path); + return posix_error_with_allocated_filename(opath); - PyMem_Free(path); + release_bytes(opath); v = PyBytes_FromStringAndSize(buf, n); if (arg_is_unicode) { PyObject *w; w = PyUnicode_FromEncodedObject(v, Py_FileSystemDefaultEncoding, - "strict"); + "utf8b"); if (w != NULL) { Py_DECREF(v); v = w; @@ -4622,7 +4715,7 @@ static PyObject * posix_symlink(PyObject *self, PyObject *args) { - return posix_2str(args, "etet:symlink", symlink); + return posix_2str(args, "O&O&:symlink", symlink); } #endif /* HAVE_SYMLINK */ @@ -4810,7 +4903,8 @@ static PyObject * posix_open(PyObject *self, PyObject *args) { - char *file = NULL; + PyObject *ofile; + char *file; int flag; int mode = 0777; int fd; @@ -4834,17 +4928,17 @@ } #endif - if (!PyArg_ParseTuple(args, "eti|i", - Py_FileSystemDefaultEncoding, &file, + if (!PyArg_ParseTuple(args, "O&i|i", + PyUnicode_FSConverter, &ofile, &flag, &mode)) return NULL; - + file = bytes2str(ofile, 1); Py_BEGIN_ALLOW_THREADS fd = open(file, flag, mode); Py_END_ALLOW_THREADS if (fd < 0) - return posix_error_with_allocated_filename(file); - PyMem_Free(file); + return posix_error_with_allocated_filename(ofile); + release_bytes(ofile); return PyLong_FromLong((long)fd); } @@ -6728,20 +6822,21 @@ #endif normal: - if (!PyArg_ParseTuple(args, "et|s:startfile", - Py_FileSystemDefaultEncoding, &filepath, + if (!PyArg_ParseTuple(args, "O&|s:startfile", + PyUnicode_FSConverter, &ofilepath, &operation)) return NULL; + filepath = bytes2str(ofilepath); Py_BEGIN_ALLOW_THREADS rc = ShellExecute((HWND)0, operation, filepath, NULL, NULL, SW_SHOWNORMAL); Py_END_ALLOW_THREADS if (rc <= (HINSTANCE)32) { PyObject *errval = win32_error("startfile", filepath); - PyMem_Free(filepath); + release_bytes(ofilepath); return errval; } - PyMem_Free(filepath); + release_bytes(ofilepath); Py_INCREF(Py_None); return Py_None; } Modified: python/branches/pep-0383/Objects/unicodeobject.c ============================================================================== --- python/branches/pep-0383/Objects/unicodeobject.c (original) +++ python/branches/pep-0383/Objects/unicodeobject.c Fri May 1 21:38:20 2009 @@ -1548,6 +1548,53 @@ } } +/* Convert the argument to a bytes object, according to the file + system encoding */ + +int +PyUnicode_FSConverter(PyObject* arg, void* addr) +{ + PyObject *output = NULL; + Py_ssize_t size; + void *data; + if (PyBytes_Check(arg) || PyByteArray_Check(arg)) { + output = arg; + Py_INCREF(output); + } + else { + arg = PyUnicode_FromObject(arg); + if (!arg) + return 0; + output = PyUnicode_AsEncodedObject(arg, + Py_FileSystemDefaultEncoding, + "utf8b"); + Py_DECREF(arg); + if (!output) + return 0; + if (!PyBytes_Check(output)) { + Py_DECREF(output); + PyErr_SetString(PyExc_TypeError, "encoder failed to return bytes"); + return 0; + } + } + if (PyBytes_Check(output)) { + size = PyBytes_GET_SIZE(output); + data = PyBytes_AS_STRING(output); + } + else { + size = PyByteArray_GET_SIZE(output); + data = PyByteArray_AS_STRING(output); + } + if (size != strlen(data)) { + PyErr_SetString(PyExc_TypeError, "embedded NUL character"); + Py_DECREF(output); + return 0; + } + *(PyObject**)addr = output; + return 1; +} + + char* _PyUnicode_AsStringAndSize(PyObject *unicode, Py_ssize_t *psize) { Modified: python/branches/pep-0383/Python/codecs.c ============================================================================== --- python/branches/pep-0383/Python/codecs.c (original) +++ python/branches/pep-0383/Python/codecs.c Fri May 1 21:38:20 2009 @@ -823,6 +823,75 @@ } } +PyObject *PyCodec_UTF8bErrors(PyObject *exc) +{ + PyObject *restuple; + PyObject *object; + Py_ssize_t start; + Py_ssize_t end; + PyObject *res; + if (PyObject_IsInstance(exc, PyExc_UnicodeEncodeError)) { + Py_UNICODE *p; + Py_UNICODE *startp; + char *outp; + if (PyUnicodeEncodeError_GetStart(exc, &start)) + return NULL; + if (PyUnicodeEncodeError_GetEnd(exc, &end)) + return NULL; + if (!(object = PyUnicodeEncodeError_GetObject(exc))) + return NULL; + startp = PyUnicode_AS_UNICODE(object); + res = PyBytes_FromStringAndSize(NULL, end-start); + if (!res) + return NULL; + outp = PyBytes_AsString(res); + for (p = startp+start; p < startp+end; p++) { + Py_UNICODE ch = *p; + if (ch < 0xdc80 || ch > 0xdcff) { + /* Not a UTF-8b surrogate, fail with original exception */ + PyErr_SetObject(PyExceptionInstance_Class(exc), exc); + Py_DECREF(res); + Py_DECREF(object); + return NULL; + } + *outp++ = ch - 0xdc00; + } + restuple = Py_BuildValue("(On)", res, end); + Py_DECREF(res); + Py_DECREF(object); + return restuple; + } + else if (PyObject_IsInstance(exc, PyExc_UnicodeDecodeError)) { + unsigned char *p; + Py_UNICODE ch[4]; /* decode up to 4 bad bytes. */ + int consumed = 0; + if (PyUnicodeDecodeError_GetStart(exc, &start)) + return NULL; + if (PyUnicodeDecodeError_GetEnd(exc, &end)) + return NULL; + if (!(object = PyUnicodeDecodeError_GetObject(exc))) + return NULL; + if (!(p = (unsigned char*)PyBytes_AsString(object))) { + Py_DECREF(object); + return NULL; + } + while (consumed < 4 && consumed < end-start) { + ch[consumed] = 0xdc00 + p[start+consumed]; + consumed++; + } + Py_DECREF(object); + if (ch == 0) { + PyErr_SetObject(PyExceptionInstance_Class(exc), exc); + return NULL; + } + return Py_BuildValue("(u#n)", ch, consumed, start+consumed); + } + else { + wrong_exception_type(exc); + return NULL; + } +} + static PyObject *strict_errors(PyObject *self, PyObject *exc) { @@ -858,6 +927,11 @@ return PyCodec_SurrogateErrors(exc); } +static PyObject *utf8b_errors(PyObject *self, PyObject *exc) +{ + return PyCodec_UTF8bErrors(exc); +} + static int _PyCodecRegistry_Init(void) { static struct { @@ -912,6 +986,14 @@ surrogates_errors, METH_O } + }, + { + "utf8b", + { + "utf8b", + utf8b_errors, + METH_O + } } }; From python-checkins at python.org Fri May 1 21:43:59 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 1 May 2009 21:43:59 +0200 (CEST) Subject: [Python-checkins] r72171 - in python/branches/pep-0383: Lib/test/test_codecs.py Python/codecs.c Message-ID: <20090501194359.902931E4095@bag.python.org> Author: martin.v.loewis Date: Fri May 1 21:43:59 2009 New Revision: 72171 Log: Fix indexing bug in r72164. Modified: python/branches/pep-0383/Lib/test/test_codecs.py python/branches/pep-0383/Python/codecs.c Modified: python/branches/pep-0383/Lib/test/test_codecs.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_codecs.py (original) +++ python/branches/pep-0383/Lib/test/test_codecs.py Fri May 1 21:43:59 2009 @@ -544,8 +544,10 @@ def test_surrogates(self): self.assertRaises(UnicodeEncodeError, "\ud800".encode, "utf-8") self.assertRaises(UnicodeDecodeError, b"\xed\xa0\x80".decode, "utf-8") - self.assertEquals("\ud800".encode("utf-8", "surrogates"), b"\xed\xa0\x80") - self.assertEquals(b"\xed\xa0\x80".decode("utf-8", "surrogates"), "\ud800") + self.assertEquals("abc\ud800def".encode("utf-8", "surrogates"), + b"abc\xed\xa0\x80def") + self.assertEquals(b"abc\xed\xa0\x80def".decode("utf-8", "surrogates"), + "abc\ud800def") self.assertTrue(codecs.lookup_error("surrogates")) class UTF7Test(ReadTest): Modified: python/branches/pep-0383/Python/codecs.c ============================================================================== --- python/branches/pep-0383/Python/codecs.c (original) +++ python/branches/pep-0383/Python/codecs.c Fri May 1 21:43:59 2009 @@ -801,6 +801,7 @@ } /* Try decoding a single surrogate character. If there are more, let the codec call us again. */ + p += start; if ((p[0] & 0xf0) == 0xe0 || (p[1] & 0xc0) == 0x80 || (p[2] & 0xc0) == 0x80) { From python-checkins at python.org Fri May 1 21:58:59 2009 From: python-checkins at python.org (walter.doerwald) Date: Fri, 1 May 2009 21:58:59 +0200 (CEST) Subject: [Python-checkins] r72172 - in python/branches/py3k: Doc/library/test.rst Lib/test/support.py Lib/test/test_getopt.py Lib/test/test_gettext.py Lib/test/test_ntpath.py Lib/test/test_optparse.py Lib/test/test_posixpath.py Lib/test/test_tcl.py Lib/test/test_tempfile.py Lib/test/test_xmlrpc.py Message-ID: <20090501195859.29AFD1E40B7@bag.python.org> Author: walter.doerwald Date: Fri May 1 21:58:58 2009 New Revision: 72172 Log: Merged revisions 72167 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72167 | walter.doerwald | 2009-05-01 19:35:37 +0200 (Fr, 01 Mai 2009) | 5 lines Make test.test_support.EnvironmentVarGuard behave like a dictionary. All changes are mirrored to the underlying os.environ dict, but rolled back on exit from the with block. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/test.rst python/branches/py3k/Lib/test/support.py python/branches/py3k/Lib/test/test_getopt.py python/branches/py3k/Lib/test/test_gettext.py python/branches/py3k/Lib/test/test_ntpath.py python/branches/py3k/Lib/test/test_optparse.py python/branches/py3k/Lib/test/test_posixpath.py python/branches/py3k/Lib/test/test_tcl.py python/branches/py3k/Lib/test/test_tempfile.py python/branches/py3k/Lib/test/test_xmlrpc.py Modified: python/branches/py3k/Doc/library/test.rst ============================================================================== --- python/branches/py3k/Doc/library/test.rst (original) +++ python/branches/py3k/Doc/library/test.rst Fri May 1 21:58:58 2009 @@ -384,8 +384,13 @@ .. class:: EnvironmentVarGuard() Class used to temporarily set or unset environment variables. Instances can be - used as a context manager. + used as a context manager and have a complete dictionary interface for + querying/modifying the underlying ``os.environ``. After exit from the context + manager all changes to environment variables done through this instance will + be rolled back. + .. versionchanged:: 2.7 + Added dictionary interface. .. method:: EnvironmentVarGuard.set(envvar, value) @@ -396,6 +401,7 @@ Temporarily unset the environment variable ``envvar``. + .. class:: WarningsRecorder() Class used to record warnings for unit tests. See documentation of Modified: python/branches/py3k/Lib/test/support.py ============================================================================== --- python/branches/py3k/Lib/test/support.py (original) +++ python/branches/py3k/Lib/test/support.py Fri May 1 21:58:58 2009 @@ -13,6 +13,7 @@ import warnings import unittest import importlib +import collections __all__ = ["Error", "TestFailed", "ResourceDenied", "import_module", "verbose", "use_resources", "max_memuse", "record_original_stdout", @@ -510,26 +511,45 @@ sys.modules.update(self.original_modules) -class EnvironmentVarGuard(object): +class EnvironmentVarGuard(collections.MutableMapping): """Class to help protect the environment variable properly. Can be used as a context manager.""" def __init__(self): + self._environ = os.environ self._changed = {} - def set(self, envvar, value): + def __getitem__(self, envvar): + return self._environ[envvar] + + def __setitem__(self, envvar, value): # Remember the initial value on the first access if envvar not in self._changed: - self._changed[envvar] = os.environ.get(envvar) - os.environ[envvar] = value + self._changed[envvar] = self._environ.get(envvar) + self._environ[envvar] = value - def unset(self, envvar): + def __delitem__(self, envvar): # Remember the initial value on the first access if envvar not in self._changed: - self._changed[envvar] = os.environ.get(envvar) - if envvar in os.environ: - del os.environ[envvar] + self._changed[envvar] = self._environ.get(envvar) + if envvar in self._environ: + del self._environ[envvar] + + def keys(self): + return self._environ.keys() + + def __iter__(self): + return iter(self._environ) + + def __len__(self): + return len(self._environ) + + def set(self, envvar, value): + self[envvar] = value + + def unset(self, envvar): + del self[envvar] def __enter__(self): return self @@ -537,10 +557,11 @@ def __exit__(self, *ignore_exc): for (k, v) in self._changed.items(): if v is None: - if k in os.environ: - del os.environ[k] + if k in self._environ: + del self._environ[k] else: - os.environ[k] = v + self._environ[k] = v + class TransientResource(object): Modified: python/branches/py3k/Lib/test/test_getopt.py ============================================================================== --- python/branches/py3k/Lib/test/test_getopt.py (original) +++ python/branches/py3k/Lib/test/test_getopt.py Fri May 1 21:58:58 2009 @@ -1,7 +1,7 @@ # test_getopt.py # David Goodger 2000-08-19 -from test.support import verbose, run_doctest, run_unittest +from test.support import verbose, run_doctest, run_unittest, EnvironmentVarGuard import unittest import getopt @@ -11,15 +11,13 @@ class GetoptTests(unittest.TestCase): def setUp(self): - self.old_posixly_correct = os.environ.get("POSIXLY_CORRECT", sentinel) - if self.old_posixly_correct is not sentinel: - del os.environ["POSIXLY_CORRECT"] + self.env = EnvironmentVarGuard() + if "POSIXLY_CORRECT" in self.env: + del self.env["POSIXLY_CORRECT"] def tearDown(self): - if self.old_posixly_correct is sentinel: - os.environ.pop("POSIXLY_CORRECT", None) - else: - os.environ["POSIXLY_CORRECT"] = self.old_posixly_correct + self.env.__exit__() + del self.env def assertError(self, *args, **kwargs): self.assertRaises(getopt.GetoptError, *args, **kwargs) @@ -135,7 +133,7 @@ self.assertEqual(args, ['arg1', '-b', '1', '--alpha', '--beta=2']) # Posix style via POSIXLY_CORRECT - os.environ["POSIXLY_CORRECT"] = "1" + self.env["POSIXLY_CORRECT"] = "1" opts, args = getopt.gnu_getopt(cmdline, 'ab:', ['alpha', 'beta=']) self.assertEqual(opts, [('-a', '')]) self.assertEqual(args, ['arg1', '-b', '1', '--alpha', '--beta=2']) Modified: python/branches/py3k/Lib/test/test_gettext.py ============================================================================== --- python/branches/py3k/Lib/test/test_gettext.py (original) +++ python/branches/py3k/Lib/test/test_gettext.py Fri May 1 21:58:58 2009 @@ -58,10 +58,6 @@ MOFILE = os.path.join(LOCALEDIR, 'gettext.mo') UMOFILE = os.path.join(LOCALEDIR, 'ugettext.mo') MMOFILE = os.path.join(LOCALEDIR, 'metadata.mo') -try: - LANG = os.environ['LANGUAGE'] -except: - LANG = 'en' class GettextBaseTest(unittest.TestCase): @@ -77,10 +73,12 @@ fp = open(MMOFILE, 'wb') fp.write(base64.decodestring(MMO_DATA)) fp.close() - os.environ['LANGUAGE'] = 'xx' + self.env = support.EnvironmentVarGuard() + self.env['LANGUAGE'] = 'xx' def tearDown(self): - os.environ['LANGUAGE'] = LANG + self.env.__exit__() + del self.env shutil.rmtree(os.path.split(LOCALEDIR)[0]) Modified: python/branches/py3k/Lib/test/test_ntpath.py ============================================================================== --- python/branches/py3k/Lib/test/test_ntpath.py (original) +++ python/branches/py3k/Lib/test/test_ntpath.py Fri May 1 21:58:58 2009 @@ -141,12 +141,11 @@ tester("ntpath.normpath('//machine/share//a/b')", r'\\machine\share\a\b') def test_expandvars(self): - oldenv = os.environ.copy() - try: - os.environ.clear() - os.environ["foo"] = "bar" - os.environ["{foo"] = "baz1" - os.environ["{foo}"] = "baz2" + with support.EnvironmentVarGuard() as env: + env.clear() + env["foo"] = "bar" + env["{foo"] = "baz1" + env["{foo}"] = "baz2" tester('ntpath.expandvars("foo")', "foo") tester('ntpath.expandvars("$foo bar")', "bar bar") tester('ntpath.expandvars("${foo}bar")', "barbar") @@ -166,9 +165,6 @@ tester('ntpath.expandvars("%?bar%")', "%?bar%") tester('ntpath.expandvars("%foo%%bar")', "bar%bar") tester('ntpath.expandvars("\'%foo%\'%bar")', "\'%foo%\'%bar") - finally: - os.environ.clear() - os.environ.update(oldenv) def test_abspath(self): # ntpath.abspath() can only be used on a system with the "nt" module Modified: python/branches/py3k/Lib/test/test_optparse.py ============================================================================== --- python/branches/py3k/Lib/test/test_optparse.py (original) +++ python/branches/py3k/Lib/test/test_optparse.py Fri May 1 21:58:58 2009 @@ -1449,7 +1449,7 @@ # screws things up for other tests when it's part of the Python # test suite. with support.EnvironmentVarGuard() as env: - env.set('COLUMNS', str(columns)) + env['COLUMNS'] = str(columns) return InterceptingOptionParser(option_list=options) def assertHelpEquals(self, expected_output): @@ -1474,7 +1474,7 @@ def test_help_title_formatter(self): with support.EnvironmentVarGuard() as env: - env.set("COLUMNS", "80") + env["COLUMNS"] = "80" self.parser.formatter = TitledHelpFormatter() self.assertHelpEquals(_expected_help_title_formatter) Modified: python/branches/py3k/Lib/test/test_posixpath.py ============================================================================== --- python/branches/py3k/Lib/test/test_posixpath.py (original) +++ python/branches/py3k/Lib/test/test_posixpath.py Fri May 1 21:58:58 2009 @@ -420,18 +420,17 @@ self.assert_(isinstance(posixpath.expanduser(b"~foo/"), bytes)) with support.EnvironmentVarGuard() as env: - env.set('HOME', '/') + env['HOME'] = '/' self.assertEqual(posixpath.expanduser("~"), "/") self.assertRaises(TypeError, posixpath.expanduser) def test_expandvars(self): - oldenv = os.environ.copy() - try: - os.environ.clear() - os.environ["foo"] = "bar" - os.environ["{foo"] = "baz1" - os.environ["{foo}"] = "baz2" + with support.EnvironmentVarGuard() as env: + env.clear() + env["foo"] = "bar" + env["{foo"] = "baz1" + env["{foo}"] = "baz2" self.assertEqual(posixpath.expandvars("foo"), "foo") self.assertEqual(posixpath.expandvars("$foo bar"), "bar bar") self.assertEqual(posixpath.expandvars("${foo}bar"), "barbar") @@ -457,11 +456,7 @@ self.assertEqual(posixpath.expandvars(b"${{foo}}"), b"baz1}") self.assertEqual(posixpath.expandvars(b"$foo$foo"), b"barbar") self.assertEqual(posixpath.expandvars(b"$bar$bar"), b"$bar$bar") - finally: - os.environ.clear() - os.environ.update(oldenv) - - self.assertRaises(TypeError, posixpath.expandvars) + self.assertRaises(TypeError, posixpath.expandvars) def test_normpath(self): self.assertEqual(posixpath.normpath(""), ".") Modified: python/branches/py3k/Lib/test/test_tcl.py ============================================================================== --- python/branches/py3k/Lib/test/test_tcl.py (original) +++ python/branches/py3k/Lib/test/test_tcl.py Fri May 1 21:58:58 2009 @@ -144,23 +144,20 @@ import sys if sys.platform.startswith(('win', 'darwin', 'cygwin')): return # no failure possible on windows? - if 'DISPLAY' in os.environ: - old_display = os.environ['DISPLAY'] - del os.environ['DISPLAY'] - # on some platforms, deleting environment variables - # doesn't actually carry through to the process level - # because they don't support unsetenv - # If that's the case, abort. - display = os.popen('echo $DISPLAY').read().strip() - if display: - return - try: + with support.EnvironmentVarGuard() as env: + if 'DISPLAY' in os.environ: + del env['DISPLAY'] + # on some platforms, deleting environment variables + # doesn't actually carry through to the process level + # because they don't support unsetenv + # If that's the case, abort. + display = os.popen('echo $DISPLAY').read().strip() + if display: + return + tcl = Tcl() self.assertRaises(TclError, tcl.winfo_geometry) self.assertRaises(TclError, tcl.loadtk) - finally: - if old_display is not None: - os.environ['DISPLAY'] = old_display def test_main(): support.run_unittest(TclTest, TkinterTest) Modified: python/branches/py3k/Lib/test/test_tempfile.py ============================================================================== --- python/branches/py3k/Lib/test/test_tempfile.py (original) +++ python/branches/py3k/Lib/test/test_tempfile.py Fri May 1 21:58:58 2009 @@ -153,7 +153,7 @@ for envname in 'TMPDIR', 'TEMP', 'TMP': dirname = os.getenv(envname) if not dirname: - env.set(envname, os.path.abspath(envname)) + env[envname] = os.path.abspath(envname) cand = tempfile._candidate_tempdir_list() Modified: python/branches/py3k/Lib/test/test_xmlrpc.py ============================================================================== --- python/branches/py3k/Lib/test/test_xmlrpc.py (original) +++ python/branches/py3k/Lib/test/test_xmlrpc.py Fri May 1 21:58:58 2009 @@ -572,7 +572,7 @@ def test_cgi_get(self): with support.EnvironmentVarGuard() as env: - env.set('REQUEST_METHOD', 'GET') + env['REQUEST_METHOD'] = 'GET' # if the method is GET and no request_text is given, it runs handle_get # get sysout output tmp = sys.stdout @@ -613,7 +613,7 @@ sys.stdout = open(support.TESTFN, "w") with support.EnvironmentVarGuard() as env: - env.set('CONTENT_LENGTH', str(len(data))) + env['CONTENT_LENGTH'] = str(len(data)) self.cgi.handle_request() sys.stdin.close() From python-checkins at python.org Fri May 1 21:59:53 2009 From: python-checkins at python.org (gregory.p.smith) Date: Fri, 1 May 2009 21:59:53 +0200 (CEST) Subject: [Python-checkins] r72173 - in python/trunk: Doc/library/ipaddr.rst Lib/ipaddr.py Lib/test/test_ipaddr.py Misc/NEWS Message-ID: <20090501195953.86CCE1E40B7@bag.python.org> Author: gregory.p.smith Date: Fri May 1 21:59:52 2009 New Revision: 72173 Log: Adds the ipaddr module to the standard library. Issue #3959. Based off of subversion r69 from http://code.google.com/p/ipaddr-py/ This code is 2to3 safe, I'll merge it into py3k later this afternoon. Added: python/trunk/Doc/library/ipaddr.rst python/trunk/Lib/ipaddr.py python/trunk/Lib/test/test_ipaddr.py (contents, props changed) Modified: python/trunk/Misc/NEWS Added: python/trunk/Doc/library/ipaddr.rst ============================================================================== --- (empty file) +++ python/trunk/Doc/library/ipaddr.rst Fri May 1 21:59:52 2009 @@ -0,0 +1,327 @@ + +:mod:`ipaddr` --- IP address manipulation library +================================================= + +.. module:: ipaddr + :synopsis: IPv4 and IPv6 network address manipulation classes. +.. moduleauthor:: Google, Inc. +.. sectionauthor:: Gregory P. Smith + + +.. versionadded:: 2.7 + +.. index:: + single: IP address, IPv4, IPv6, netmask + +This module implements classes for working with IP host and network addresses, +both IPv4 and IPv6. + + +.. function:: IP(ipaddr) + + Take an IP string or int and return an object of the correct type. + Returns an :class:`IPv4` or :class:`IPv6` object. + + The ``ipaddr`` parameter must be a string or integer representing the IP + address. Either IPv4 or IPv6 addresses may be supplied. Integers less + than 2**32 will be considered to be IPv4. + + Raises :exc:`ValueError` if the ipaddr passed is not either an IPv4 or an + IPv6 address. + + +.. function:: collapse_address_list(addresses) + + Collapses a sequence of :class:`IPv4` or :class:`IPv6` objects into + the most concise representation. Returns a list of :class:`IPv4` + or :class:`IPv6` objects. + +Example usage:: + + >>> collapse_address_list([IPv4('1.1.0.0/24'), IPv4('1.1.1.0/24')]) + [IPv4('1.1.0.0/23')] + + +.. class:: BaseIP() + + A generic IP address object. This base class defines the API and contains + common code. Most authors should either use the :func:`IP` function or + create :class:`IPv4` or :class:`IPv6` objects directly rather than using + this base class. + + + IP address objects support the following python operators: + ``=``, ``!=``, ``<``, ``>``, ``<=``, ``>=``, and ``in``. + + An IP address object may be used as a sequence index or as a hash key + and can be converted back to an integer representation using ``int()``. + It may also be used as a sequence that yeilds the string + representation of every IP address within the object's subnet. + + + The following properties are available on all IP address objects: + + .. data:: broadcast + + Integer representation of the broadcast address. Read only. + + .. data:: broadcast_ext + + Dotted decimal or colon string version of the broadcast address. Read only. + + .. data:: hostmask + + Integer representation of the hostmask. Read only. + + .. data:: hostmask_ext + + Dotted decimal or colon string version of the hostmask. Read only. + + .. data:: ip + + Integer representation of the IP address. Read only. + + .. data:: ip_ext + + Dotted decimal or colon string version of the IP address. Read only. + + .. data:: ip_ext_full + + Canonical string version of the IP address. Read only. + + .. data:: is_loopback + + True if the address is a loopback address as defined in IPv4 :rfc:`3330` + or IPv6 :rfc:`2373` section 2.5.3. + + .. data:: is_link_local + + True if the address is a link-local address as defined in IPv4 :rfc:`3927` + or IPv6 :rfc:`4291`. + + .. data:: is_multicast + + True if the address is reserved for multicast use. + See IPv4 :rfc:`3171` or IPv6 :rfc:`2373` section 2.7 for details. + + .. data:: is_private + + True if the address is reserved for private networks as defined in + IPv4 :rfc:`1918` or IPv6 :rfc:`4193`. + + .. data:: netmask + + Integer representation of the netmask. Read only. + + .. data:: netmask_ext + + Dotted decimal or colon string version of the netmask. Read only. + + .. data:: network + + Integer representation of the network. Read only. + + .. data:: network_ext + + Dotted decimal or colon string version of the network. Read only. + + .. data:: numhosts + + Number of hosts in the current subnet. Read only. + + .. data:: packed + + The packed network byte order representation of this network address. Read only. + + .. data:: prefixlen + + A property to get and set the prefix length. Readable and writeable. + + .. data:: version + + Integer IP version number. Read only. + + + The following methods are available on all IP address objects: + + .. method:: address_exclude(other) + + Remove an address from within a larger block. + Returns a sorted list of IP address objects representing networks. + + Examples:: + + >>> addr1 = IP('10.1.1.0/24') + >>> addr2 = IP('10.1.1.0/26') + >>> addr1.address_exclude(addr2) + [IP('10.1.1.64/26'), IP('10.1.1.128/25')] + + >>> addr1 = IP('::1/32') + >>> addr2 = IP('::1/128') + >>> addr1.address_exclude(addr2) + [IP('::0/128'), IP('::2/127'), IP('::4/126'), IP('::8/125'), + ... IP('0:0:8000::/33')] + + Raises :exc:`ValueError` if `other` is not completely contained by self. + + + .. method:: compare_networks(other) + + Compare this IP object's network to another IP network. + Returns -1, 0 or 1. + + This compares the integer representation of the network addresses. + The host bits are not considered by this method. + If you want to compare host bits, you can use ``host_a.ip < host_b.ip``. + + If the IP versions of self and other are the same, returns: + + -1 if self < other + eg: IPv4('1.1.1.0/24') < IPv4('1.1.2.0/24') + + IPv6('1080::200C:417A') < IPv6('1080::200B:417B') + + 0 if self == other + eg: IPv4('1.1.1.1/24') == IPv4('1.1.1.2/24') + + IPv6('1080::200C:417A/96') == IPv6('1080::200C:417B/96') + + 1 if self > other + eg: IPv4('1.1.1.0/24') > IPv4('1.1.0.0/24') + + IPv6('1080::1:200C:417A/112') > IPv6('1080::0:200C:417A/112') + + If the IP versions of self and other are different, returns: + + -1 if self.version < other.version + eg: IPv4('10.0.0.1/24') < IPv6('::1/128') + + 1 if self.version > other.version + eg: IPv6('::1/128') > IPv4('255.255.255.0/24') + + + .. method:: subnet(prefixlen_diff=1) + + Returns a list of subnets which when joined make up the current subnet. + + The optional ``prefixlen_diff`` argument specifies how many bits the prefix + length should be increased by. Given a /24 network and prefixlen_diff=3, + for example, 8 subnets of size /27 will be returned. + + If called on a host IP address rather than a network, a list containing + the host itself will be returned. + + Raises :exc:`PrefixlenDiffInvalidError` if the prefixlen_diff is out of + range. + + + .. method:: supernet(prefixlen_diff=1) + + Returns a single IP object representing the supernet containing the + current network. + + The optional ``prefixlen_diff`` argument specifies how many bits the prefix + length should be decreased by. Given a /24 network and prefixlen_diff=3, + for example, a supernet with a 21 bit netmask is returned. + + Raises :exc:`PrefixlenDiffInvalidError` if the prefixlen_diff is out of + range. + + +.. class:: IPv4() + + This class represents and manipulates 32-bit IPv4 addresses. + + Attributes:: + + # These examples for IPv4('1.2.3.4/27') + .ip: 16909060 + .ip_ext: '1.2.3.4' + .ip_ext_full: '1.2.3.4' + .network: 16909056 + .network_ext: '1.2.3.0' + .hostmask: 31 (0x1F) + .hostmask_ext: '0.0.0.31' + .broadcast: 16909087 (0x102031F) + .broadcast_ext: '1.2.3.31' + .netmask: 4294967040 (0xFFFFFFE0) + .netmask_ext: '255.255.255.224' + .prefixlen: 27 + + +.. class:: IPv6() + + This class respresents and manipulates 128-bit IPv6 addresses. + + Attributes:: + + # These examples are for IPv6('2001:658:22A:CAFE:200::1/64') + .ip: 42540616829182469433547762482097946625 + .ip_ext: '2001:658:22a:cafe:200::1' + .ip_ext_full: '2001:0658:022a:cafe:0200:0000:0000:0001' + .network: 42540616829182469433403647294022090752 + .network_ext: '2001:658:22a:cafe::' + .hostmask: 18446744073709551615 + .hostmask_ext: '::ffff:ffff:ffff:ffff' + .broadcast: 42540616829182469451850391367731642367 + .broadcast_ext: '2001:658:22a:cafe:ffff:ffff:ffff:ffff' + .netmask: 340282366920938463444927863358058659840 + .netmask_ext: 64 + .prefixlen: 64 + + .. data:: is_site_local + + True if the address was reserved as site-local in :rfc:`3513` section 2.5.6. + + .. note:: + + The IPv6 site-local address space has been deprecated by :rfc:`3879`. + Use :data:`is_private` to test if this address is in the space of + unique local addresses as defined by :rfc:`4193`. + + .. data:: is_unspecified + + True if this is the unspecified address as defined in :rfc:`2373` section 2.5.2. + + +The following exceptions are defined by this module: + +.. exception:: Error + + Base class for all exceptions defined in this module. + +.. exception:: IPTypeError + + Tried to perform a v4 action on v6 object or vice versa. + +.. exception:: IPAddressExclusionError + + An Error we should never see occurred in address exclusion. + +.. exception:: IPv4IpValidationError + + Raised when an IPv4 address is invalid. + +.. exception:: IPv4NetmaskValidationError + + Raised when a netmask is invalid. + +.. exception:: IPv6IpValidationError + + Raised when an IPv6 address is invalid. + +.. exception:: IPv6NetmaskValidationError + + Raised when an IPv6 netmask is invalid. + +.. exception:: PrefixlenDiffInvalidError + + Raised when :meth:`BaseIP.subnet` or :meth:`BaseIP.supernet` is called with a bad + ``prefixlen_diff``. + + +.. seealso:: + + http://code.google.com/p/ipaddr-py/ + The original source of this module and a place to download it as + a package for use on earlier versions of Python. Added: python/trunk/Lib/ipaddr.py ============================================================================== --- (empty file) +++ python/trunk/Lib/ipaddr.py Fri May 1 21:59:52 2009 @@ -0,0 +1,1365 @@ +# Copyright 2007 Google Inc. +# Licensed to PSF under a Contributor Agreement. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. See the License for the specific language governing +# permissions and limitations under the License. +# +# See also: http://code.google.com/p/ipaddr-py/ + +"""An IPv4/IPv6 manipulation library in Python. + +This library is used to create/poke/manipulate IPv4 and IPv6 addresses +and prefixes. + +""" + +__version__ = '1.0.2' + +import struct + +class Error(Exception): + + """Base class for exceptions.""" + + +class IPTypeError(Error): + + """Tried to perform a v4 action on v6 object or vice versa.""" + + +class IPAddressExclusionError(Error): + + """An Error we should never see occurred in address exclusion.""" + + +class IPv4IpValidationError(Error): + + """Raised when an IPv4 address is invalid.""" + + def __init__(self, ip): + Error.__init__(self) + self.ip = ip + + def __str__(self): + return repr(self.ip) + ' is not a valid IPv4 address' + + +class IPv4NetmaskValidationError(Error): + + """Raised when a netmask is invalid.""" + + def __init__(self, netmask): + Error.__init__(self) + self.netmask = netmask + + def __str__(self): + return repr(self.netmask) + ' is not a valid IPv4 netmask' + + +class IPv6IpValidationError(Error): + + """Raised when an IPv6 address is invalid.""" + + def __init__(self, ip): + Error.__init__(self) + self.ip = ip + + def __str__(self): + return repr(self.ip) + ' is not a valid IPv6 address' + + +class IPv6NetmaskValidationError(Error): + + """Raised when an IPv6 netmask is invalid.""" + + def __init__(self, netmask): + Error.__init__(self) + self.netmask = netmask + + def __str__(self): + return repr(self.netmask) + ' is not a valid IPv6 netmask' + + +class PrefixlenDiffInvalidError(Error): + + """Raised when Sub/Supernets is called with a bad prefixlen_diff.""" + + def __init__(self, error_str): + Error.__init__(self) + self.error_str = error_str + + +def IP(ipaddr): + """Take an IP string/int and return an object of the correct type. + + Args: + ipaddr: A string or integer, the IP address. Either IPv4 or + IPv6 addresses may be supplied; integers less than 2**32 will + be considered to be IPv4. + + Returns: + An IPv4 or IPv6 object. + + Raises: + ValueError: if the string passed isn't either a v4 or a v6 + address. + + """ + + try: + return IPv4(ipaddr) + except (IPv4IpValidationError, IPv4NetmaskValidationError): + pass + + try: + return IPv6(ipaddr) + except (IPv6IpValidationError, IPv6NetmaskValidationError): + pass + + raise ValueError('%r does not appear to be an IPv4 or IPv6 address' % + ipaddr) + + +def _collapse_address_list_recursive(addresses): + """Loops through the addresses, collapsing concurrent netblocks. + + Example: + + ip1 = IPv4('1.1.0.0/24') + ip2 = IPv4('1.1.1.0/24') + ip3 = IPv4('1.1.2.0/24') + ip4 = IPv4('1.1.3.0/24') + ip5 = IPv4('1.1.4.0/24') + ip6 = IPv4('1.1.0.1/22') + + _collapse_address_list_recursive([ip1, ip2, ip3, ip4, ip5, ip6]) -> + [IPv4('1.1.0.0/22'), IPv4('1.1.4.0/24')] + + This shouldn't be called directly; it is called via + collapse_address_list([]). + + Args: + addresses: A list of IPv4 or IPv6 objects. + + Returns: + A list of IPv4 or IPv6 objects depending on what we were passed. + + """ + ret_array = [] + optimized = False + + for cur_addr in addresses: + if not ret_array: + ret_array.append(cur_addr) + continue + if cur_addr in ret_array[-1]: + optimized = True + elif cur_addr == ret_array[-1].supernet().subnet()[1]: + ret_array.append(ret_array.pop().supernet()) + optimized = True + else: + ret_array.append(cur_addr) + + if optimized: + return _collapse_address_list_recursive(ret_array) + + return ret_array + + +def collapse_address_list(addresses): + """Collapse a list of IP objects. + + Example: + collapse_address_list([IPv4('1.1.0.0/24'), IPv4('1.1.1.0/24')]) -> + [IPv4('1.1.0.0/23')] + + Args: + addresses: A list of IPv4 or IPv6 objects. + + Returns: + A list of IPv4 or IPv6 objects depending on what we were passed. + + """ + return _collapse_address_list_recursive( + sorted(addresses, key=BaseIP._get_networks_key)) + + +# Test whether this Python implementation supports byte objects that +# are not identical to str ones. +# We need to exclude platforms where bytes == str so that we can +# distinguish between packed representations and strings, for example +# b'12::' (the IPv4 address 49.50.58.58) and '12::' (an IPv6 address). +try: + _compat_has_real_bytes = bytes != str +except NameError: # = 0: + if self.network + n > self.broadcast: + raise IndexError + return self._string_from_ip_int(self.network + n) + else: + if self.broadcast + n < self.network: + raise IndexError + return self._string_from_ip_int(self.broadcast + n) + + def __lt__(self, other): + try: + return (self.version < other.version + or self.ip < other.ip + or self.netmask < other.netmask) + except AttributeError: + return NotImplemented + + def __gt__(self, other): + try: + return (self.version > other.version + or self.ip > other.ip + or self.netmask > other.netmask) + except AttributeError: + return NotImplemented + + def __eq__(self, other): + try: + return (self.version == other.version + and self.ip == other.ip + and self.netmask == other.netmask) + except AttributeError: + return NotImplemented + + def __ne__(self, other): + eq = self.__eq__(other) + if eq is NotImplemented: + return NotImplemented + return not eq + + def __le__(self, other): + gt = self.__gt__(other) + if gt is NotImplemented: + return NotImplemented + return not gt + + def __ge__(self, other): + lt = self.__lt__(other) + if lt is NotImplemented: + return NotImplemented + return not lt + + def __repr__(self): + return '%s(%r)' % (self.__class__.__name__, str(self)) + + def __index__(self): + return self.ip + + def __int__(self): + return self.ip + + def __hex__(self): + return hex(int(self)) + + def address_exclude(self, other): + """Remove an address from a larger block. + + For example: + + addr1 = IP('10.1.1.0/24') + addr2 = IP('10.1.1.0/26') + addr1.address_exclude(addr2) = + [IP('10.1.1.64/26'), IP('10.1.1.128/25')] + + or IPv6: + + addr1 = IP('::1/32') + addr2 = IP('::1/128') + addr1.address_exclude(addr2) = [IP('::0/128'), + IP('::2/127'), + IP('::4/126'), + IP('::8/125'), + ... + IP('0:0:8000::/33')] + + Args: + other: An IP object of the same type. + + Returns: + A sorted list of IP objects addresses which is self minus + other. + + Raises: + IPTypeError: If self and other are of difffering address + versions. + IPAddressExclusionError: There was some unknown error in the + address exclusion process. This likely points to a bug + elsewhere in this code. + ValueError: If other is not completely contained by self. + + """ + if not self.version == other.version: + raise IPTypeError("%s and %s aren't of the same version" % ( + str(self), str(other))) + + if other not in self: + raise ValueError('%s not contained in %s' % (str(other), + str(self))) + + ret_addrs = [] + + # Make sure we're comparing the network of other. + other = IP(other.network_ext + '/' + str(other.prefixlen)) + + s1, s2 = self.subnet() + while s1 != other and s2 != other: + if other in s1: + ret_addrs.append(s2) + s1, s2 = s1.subnet() + elif other in s2: + ret_addrs.append(s1) + s1, s2 = s2.subnet() + else: + # If we got here, there's a bug somewhere. + raise IPAddressExclusionError('Error performing exclusion: ' + 's1: %s s2: %s other: %s' % + (str(s1), str(s2), str(other))) + if s1 == other: + ret_addrs.append(s2) + elif s2 == other: + ret_addrs.append(s1) + else: + # If we got here, there's a bug somewhere. + raise IPAddressExclusionError('Error performing exclusion: ' + 's1: %s s2: %s other: %s' % + (str(s1), str(s2), str(other))) + + return sorted(ret_addrs, key=BaseIP._get_networks_key) + + def compare_networks(self, other): + """Compare two IP objects. + + This is only concerned about the comparison of the integer + representation of the network addresses. This means that the + host bits aren't considered at all in this method. If you want + to compare host bits, you can easily enough do a + 'HostA.ip < HostB.ip' + + Args: + other: An IP object. + + Returns: + If the IP versions of self and other are the same, returns: + + -1 if self < other: + eg: IPv4('1.1.1.0/24') < IPv4('1.1.2.0/24') + IPv6('1080::200C:417A') < IPv6('1080::200B:417B') + 0 if self == other + eg: IPv4('1.1.1.1/24') == IPv4('1.1.1.2/24') + IPv6('1080::200C:417A/96') == IPv6('1080::200C:417B/96') + 1 if self > other + eg: IPv4('1.1.1.0/24') > IPv4('1.1.0.0/24') + IPv6('1080::1:200C:417A/112') > + IPv6('1080::0:200C:417A/112') + + If the IP versions of self and other are different, returns: + + -1 if self.version < other.version + eg: IPv4('10.0.0.1/24') < IPv6('::1/128') + 1 if self.version > other.version + eg: IPv6('::1/128') > IPv4('255.255.255.0/24') + + """ + if self.version < other.version: + return -1 + if self.version > other.version: + return 1 + # self.version == other.version below here: + if self.network < other.network: + return -1 + if self.network > other.network: + return 1 + # self.network == other.network below here: + if self.netmask < other.netmask: + return -1 + if self.netmask > other.netmask: + return 1 + # self.network == other.network and self.netmask == other.netmask + return 0 + + def _get_networks_key(self): + """Network-only key function. + + Returns an object that identifies this address' network and + netmask. This function is a suitable "key" argument for sorted() + and list.sort(). + + """ + return (self.version, self.network, self.netmask) + + prefixlen = property( + fget=lambda self: self._prefixlen, + fset=lambda self, prefixlen: self._set_prefix(prefixlen)) + + def __str__(self): + return '%s/%s' % (self._string_from_ip_int(self.ip), + str(self.prefixlen)) + + def __hash__(self): + return hash(self.ip ^ self.netmask) + + def __contains__(self, other): + return self.network <= other.ip and self.broadcast >= other.broadcast + + @property + def ip_ext(self): + """Dotted decimal or colon string version of the IP address.""" + return self._string_from_ip_int(self.ip) + + @property + def ip_ext_full(self): + """Canonical string version of the IP address.""" + return self.ip_ext + + @property + def broadcast(self): + """Integer representation of the broadcast address.""" + return self.ip | self.hostmask + + @property + def broadcast_ext(self): + """Dotted decimal or colon string version of the broadcast.""" + return self._string_from_ip_int(self.broadcast) + + @property + def hostmask(self): + """Integer representation of the hostmask.""" + return self.netmask ^ self._ALL_ONES + + @property + def hostmask_ext(self): + """Dotted decimal or colon string version of the hostmask.""" + return self._string_from_ip_int(self.hostmask) + + @property + def network(self): + """Integer representation of the network.""" + return self.ip & self.netmask + + @property + def network_ext(self): + """Dotted decimal or colon string version of the network.""" + return self._string_from_ip_int(self.network) + + @property + def netmask_ext(self): + """Dotted decimal or colon string version of the netmask.""" + return self._string_from_ip_int(self.netmask) + + @property + def numhosts(self): + """Number of hosts in the current subnet.""" + return self.broadcast - self.network + 1 + + @property + def version(self): + raise NotImplementedError('BaseIP has no version') + + def _ip_int_from_prefix(self, prefixlen=None): + """Turn the prefix length netmask into a int for comparison. + + Args: + prefixlen: An integer, the prefix length. + + Returns: + An integer. + + """ + if not prefixlen and prefixlen != 0: + prefixlen = self.prefixlen + return self._ALL_ONES ^ (self._ALL_ONES >> prefixlen) + + def _prefix_from_ip_int(self, ip_int, mask=32): + """Return prefix length from the decimal netmask. + + Args: + ip_int: An integer, the IP address. + mask: The netmask. Defaults to 32. + + Returns: + An integer, the prefix length. + + """ + while mask: + if ip_int & 1 == 1: + break + ip_int >>= 1 + mask -= 1 + + return mask + + def _ip_string_from_prefix(self, prefixlen=None): + """Turn a prefix length into a dotted decimal string. + + Args: + prefixlen: An integer, the netmask prefix length. + + Returns: + A string, the dotted decimal netmask string. + + """ + if not prefixlen: + prefixlen = self.prefixlen + return self._string_from_ip_int(self._ip_int_from_prefix(prefixlen)) + + +class IPv4(BaseIP): + + """This class represents and manipulates 32-bit IPv4 addresses. + + Attributes: [examples for IPv4('1.2.3.4/27')] + .ip: 16909060 + .ip_ext: '1.2.3.4' + .ip_ext_full: '1.2.3.4' + .network: 16909056L + .network_ext: '1.2.3.0' + .hostmask: 31L (0x1F) + .hostmask_ext: '0.0.0.31' + .broadcast: 16909087L (0x102031F) + .broadcast_ext: '1.2.3.31' + .netmask: 4294967040L (0xFFFFFFE0) + .netmask_ext: '255.255.255.224' + .prefixlen: 27 + + """ + + # Equivalent to 255.255.255.255 or 32 bits of 1's. + _ALL_ONES = 0xffffffff + + def __init__(self, ipaddr): + """Instantiate a new IPv4 object. + + Args: + ipaddr: A string or integer representing the IP [& network]. + '192.168.1.1/32' + '192.168.1.1/255.255.255.255' + '192.168.1.1/0.0.0.255' + '192.168.1.1' + are all functionally the same in IPv4. That is to say, + failing to provide a subnetmask will create an object with + a mask of /32. A netmask of '255.255.255.255' is assumed + to be /32 and '0.0.0.0' is assumed to be /0, even though + other netmasks can be expressed both as host- and + net-masks. (255.0.0.0 == 0.255.255.255) + + Additionally, an integer can be passed, so + IPv4('192.168.1.1') == IPv4(3232235777). + or, more generally + IPv4(IPv4('192.168.1.1').ip) == IPv4('192.168.1.1') + + Raises: + IPv4IpValidationError: If ipaddr isn't a valid IPv4 address. + IPv4NetmaskValidationError: If the netmask isn't valid for + an IPv4 address. + + """ + BaseIP.__init__(self) + self._version = 4 + + # Efficient constructor from integer. + if isinstance(ipaddr, int) or isinstance(ipaddr, long): + self.ip = ipaddr + self._prefixlen = 32 + self.netmask = self._ALL_ONES + if ipaddr < 0 or ipaddr > self._ALL_ONES: + raise IPv4IpValidationError(ipaddr) + return + + # Constructing from a packed address + if _compat_has_real_bytes: + if isinstance(ipaddr, bytes) and len(ipaddr) == 4: + self.ip = struct.unpack('!I', ipaddr)[0] + self._prefixlen = 32 + self.netmask = self._ALL_ONES + return + + # Assume input argument to be string or any object representation + # which converts into a formatted IP prefix string. + addr = str(ipaddr).split('/') + + if len(addr) > 2: + raise IPv4IpValidationError(ipaddr) + + if not self._is_valid_ip(addr[0]): + raise IPv4IpValidationError(addr[0]) + + self.ip = self._ip_int_from_string(addr[0]) + + if len(addr) == 2: + mask = addr[1].split('.') + if len(mask) == 4: + # We have dotted decimal netmask. + if not self._is_valid_netmask(addr[1]): + raise IPv4NetmaskValidationError(addr[1]) + if self._is_hostmask(addr[1]): + self.netmask = ( + self._ip_int_from_string(addr[1]) ^ self._ALL_ONES) + else: + self.netmask = self._ip_int_from_string(addr[1]) + self._prefixlen = self._prefix_from_ip_int(self.netmask) + else: + # We have a netmask in prefix length form. + if not self._is_valid_netmask(addr[1]): + raise IPv4NetmaskValidationError(addr[1]) + self._prefixlen = int(addr[1]) + self.netmask = self._ip_int_from_prefix(self._prefixlen) + else: + self._prefixlen = 32 + self.netmask = self._ip_int_from_prefix(self._prefixlen) + + def _set_prefix(self, prefixlen): + """Change the prefix length. + + Args: + prefixlen: An integer, the new prefix length. + + Raises: + IPv4NetmaskValidationError: If prefixlen is out of bounds. + + """ + if not 0 <= prefixlen <= 32: + raise IPv4NetmaskValidationError(prefixlen) + self._prefixlen = prefixlen + self.netmask = self._ip_int_from_prefix(self._prefixlen) + + def subnet(self, prefixlen_diff=1): + """The subnets which join to make the current subnet. + + In the case that self contains only one IP + (self._prefixlen == 32), return a list with just ourself. + + Args: + prefixlen_diff: An integer, the amount the prefix length + should be increased by. Given a /24 network and a + prefixlen_diff of 3, for example, 8 subnets of size /27 + will be returned. The default value of 1 splits the + current network into two halves. + + Returns: + A list of IPv4 objects. + + Raises: + PrefixlenDiffInvalidError: The prefixlen_diff is too small + or too large. + + """ + if self._prefixlen == 32: + return [self] + + if prefixlen_diff < 0: + raise PrefixlenDiffInvalidError('prefix length diff must be > 0') + new_prefixlen = self.prefixlen + prefixlen_diff + + if not self._is_valid_netmask(str(new_prefixlen)): + raise PrefixlenDiffInvalidError( + 'prefix length diff %d is invalid for netblock %s' % ( + new_prefixlen, str(self))) + + first = IPv4( + self._string_from_ip_int(self.network) + '/' + + str(self._prefixlen + prefixlen_diff)) + subnets = [first] + current = first + while True: + broadcast = current.broadcast + if broadcast == self.broadcast: + break + current = IPv4(self._string_from_ip_int(broadcast + 1) + '/' + + str(new_prefixlen)) + subnets.append(current) + + return subnets + + def supernet(self, prefixlen_diff=1): + """The supernet containing the current network. + + Args: + prefixlen_diff: An integer, the amount the prefix length of + the network should be decreased by. For example, given a + /24 network and a prefixlen_diff of 3, a supernet with a + /21 netmask is returned. + + Returns: + An IPv4 object. + + Raises: + PrefixlenDiffInvalidError: If + self.prefixlen - prefixlen_diff < 0. I.e., you have a + negative prefix length. + + """ + if self.prefixlen == 0: + return self + if self.prefixlen - prefixlen_diff < 0: + raise PrefixlenDiffInvalidError( + 'current prefixlen is %d, cannot have a prefixlen_diff of %d' % + (self.prefixlen, prefixlen_diff)) + return IPv4(self.ip_ext + '/' + str(self.prefixlen - prefixlen_diff)) + + @property + def is_private(self): + """Test if this address is allocated for private networks. + + Returns: + A boolean, True if the address is reserved per RFC 1918. + + """ + return (self in IPv4('10.0.0.0/8') or + self in IPv4('172.16.0.0/12') or + self in IPv4('192.168.0.0/16')) + + @property + def is_multicast(self): + """Test if the address is reserved for multicast use. + + Returns: + A boolean, True if the address is multicast. + See RFC 3171 for details. + + """ + return self in IPv4('224.0.0.0/4') + + @property + def is_loopback(self): + """Test if the address is a loopback adddress. + + Returns: + A boolean, True if the address is a loopback per RFC 3330. + + """ + return self in IPv4('127.0.0.0/8') + + @property + def is_link_local(self): + """Test if the address is reserved for link-local. + + Returns: + A boolean, True if the address is link-local per RFC 3927. + + """ + return self in IPv4('169.254.0.0/16') + + @property + def version(self): + return self._version + + @property + def packed(self): + """The binary representation of this address.""" + return struct.pack('!I', self.ip) + + def _is_hostmask(self, ip_str): + """Test if the IP string is a hostmask (rather than a netmask). + + Args: + ip_str: A string, the potential hostmask. + + Returns: + A boolean, True if the IP string is a hostmask. + + """ + parts = [int(x) for x in ip_str.split('.')] + if parts[0] < parts[-1]: + return True + return False + + def _ip_int_from_string(self, ip_str): + """Turn the given IP string into an integer for comparison. + + Args: + ip_str: A string, the IP address. + + Returns: + The IP address as an integer. + + """ + packed_ip = 0 + for oc in ip_str.split('.'): + packed_ip = (packed_ip << 8) | int(oc) + return packed_ip + + def _string_from_ip_int(self, ip_int): + """Turns a 32-bit integer into dotted decimal notation. + + Args: + ip_int: An integer, the IP address. + + Returns: + The IP address as a string in dotted decimal notation. + + """ + octets = [] + for _ in xrange(4): + octets.insert(0, str(ip_int & 0xFF)) + ip_int >>= 8 + return '.'.join(octets) + + def _is_valid_ip(self, ip_str): + """Validate the dotted decimal notation IP/netmask string. + + Args: + ip_str: A string, the IP address. + + Returns: + A boolean, True if the string is a valid dotted decimal IP + string. + + """ + octets = ip_str.split('.') + if len(octets) == 1: + # We have an integer rather than a dotted decimal IP. + try: + return int(ip_str) >= 0 and int(ip_str) <= self._ALL_ONES + except ValueError: + return False + + if len(octets) != 4: + return False + + for octet in octets: + try: + if not 0 <= int(octet) <= 255: + return False + except ValueError: + return False + return True + + def _is_valid_netmask(self, netmask): + """Verify that the netmask is valid. + + Args: + netmask: A string, either a prefix or dotted decimal + netmask. + + Returns: + A boolean, True if the prefix represents a valid IPv4 + netmask. + + """ + if len(netmask.split('.')) == 4: + return self._is_valid_ip(netmask) + try: + netmask = int(netmask) + except ValueError: + return False + return 0 <= netmask <= 32 + + +class IPv6(BaseIP): + + """This class respresents and manipulates 128-bit IPv6 addresses. + + Attributes: [examples for IPv6('2001:658:22A:CAFE:200::1/64')] + .ip: 42540616829182469433547762482097946625L + .ip_ext: '2001:658:22a:cafe:200::1' + .ip_ext_full: '2001:0658:022a:cafe:0200:0000:0000:0001' + .network: 42540616829182469433403647294022090752L + .network_ext: '2001:658:22a:cafe::' + .hostmask: 18446744073709551615L + .hostmask_ext: '::ffff:ffff:ffff:ffff' + .broadcast: 42540616829182469451850391367731642367L + .broadcast_ext: '2001:658:22a:cafe:ffff:ffff:ffff:ffff' + .netmask: 340282366920938463444927863358058659840L + .netmask_ext: 64 + .prefixlen: 64 + + """ + + _ALL_ONES = (2**128) - 1 + + def __init__(self, ipaddr): + """Instantiate a new IPv6 object. + + Args: + ipaddr: A string or integer representing the IP or the IP + and prefix/netmask. + '2001:4860::/128' + '2001:4860:0000:0000:0000:0000:0000:0000/128' + '2001:4860::' + are all functionally the same in IPv6. That is to say, + failing to provide a subnetmask will create an object with + a mask of /128. + + Additionally, an integer can be passed, so + IPv6('2001:4860::') == + IPv6(42541956101370907050197289607612071936L). + or, more generally + IPv6(IPv6('2001:4860::').ip) == IPv6('2001:4860::') + + Raises: + IPv6IpValidationError: If ipaddr isn't a valid IPv6 address. + IPv6NetmaskValidationError: If the netmask isn't valid for + an IPv6 address. + + """ + BaseIP.__init__(self) + self._version = 6 + + # Efficient constructor from integer. + if isinstance(ipaddr, long) or isinstance(ipaddr, int): + self.ip = ipaddr + self._prefixlen = 128 + self.netmask = self._ALL_ONES + if ipaddr < 0 or ipaddr > self._ALL_ONES: + raise IPv6IpValidationError(ipaddr) + return + + # Constructing from a packed address + if _compat_has_real_bytes: + if isinstance(ipaddr, bytes) and len(ipaddr) == 16: + tmp = struct.unpack('!QQ', ipaddr) + self.ip = (tmp[0] << 64) | tmp[1] + self._prefixlen = 128 + self.netmask = self._ALL_ONES + return + + # Assume input argument to be string or any object representation + # which converts into a formatted IP prefix string. + addr_str = str(ipaddr) + if not addr_str: + raise IPv6IpValidationError('') + addr = addr_str.split('/') + if len(addr) > 1: + if self._is_valid_netmask(addr[1]): + self._prefixlen = int(addr[1]) + else: + raise IPv6NetmaskValidationError(addr[1]) + else: + self._prefixlen = 128 + + self.netmask = self._ip_int_from_prefix(self._prefixlen) + + if not self._is_valid_ip(addr[0]): + raise IPv6IpValidationError(addr[0]) + + self.ip = self._ip_int_from_string(addr[0]) + + @property + def ip_ext_full(self): + """Returns the expanded version of the IPv6 string.""" + return self._explode_shorthand_ip_string(self.ip_ext) + + def _set_prefix(self, prefixlen): + """Change the prefix length. + + Args: + prefixlen: An integer, the new prefix length. + + Raises: + IPv6NetmaskValidationError: If prefixlen is out of bounds. + + """ + if not 0 <= prefixlen <= 128: + raise IPv6NetmaskValidationError(prefixlen) + self._prefixlen = prefixlen + self.netmask = self._ip_int_from_prefix(self.prefixlen) + + def subnet(self, prefixlen_diff=1): + """The subnets which join to make the current subnet. + + In the case that self contains only one IP + (self._prefixlen == 128), return a list with just ourself. + + Args: + prefixlen_diff: An integer, the amount the prefix length + should be increased by. + + Returns: + A list of IPv6 objects. + + Raises: + PrefixlenDiffInvalidError: The prefixlen_diff is too small + or too large. + + """ + # Preserve original functionality (return [self] if + # self.prefixlen == 128). + if self.prefixlen == 128: + return [self] + + if prefixlen_diff < 0: + raise PrefixlenDiffInvalidError('Prefix length diff must be > 0') + new_prefixlen = self.prefixlen + prefixlen_diff + if not self._is_valid_netmask(str(new_prefixlen)): + raise PrefixlenDiffInvalidError( + 'Prefix length diff %d is invalid for netblock %s' % ( + new_prefixlen, str(self))) + first = IPv6( + self._string_from_ip_int(self.network) + '/' + + str(self._prefixlen + prefixlen_diff)) + subnets = [first] + current = first + while True: + broadcast = current.broadcast + if current.broadcast == self.broadcast: + break + current = IPv6(self._string_from_ip_int(broadcast + 1) + '/' + + str(new_prefixlen)) + subnets.append(current) + + return subnets + + def supernet(self, prefixlen_diff=1): + """The supernet containing the current network. + + Args: + prefixlen_diff: An integer, the amount the prefix length of the + network should be decreased by. For example, given a /96 + network and a prefixlen_diff of 3, a supernet with a /93 + netmask is returned. + + Returns: + An IPv6 object. + + Raises: + PrefixlenDiffInvalidError: If + self._prefixlen - prefixlen_diff < 0. I.e., you have a + negative prefix length. + + """ + if self.prefixlen == 0: + return self + if self.prefixlen - prefixlen_diff < 0: + raise PrefixlenDiffInvalidError( + 'current prefixlen is %d, cannot have a prefixlen_diff of %d' % + (self.prefixlen, prefixlen_diff)) + return IPv6(self.ip_ext + '/' + str(self.prefixlen - prefixlen_diff)) + + @property + def is_multicast(self): + """Test if the address is reserved for multicast use. + + Returns: + A boolean, True if the address is a multicast address. + See RFC 2373 2.7 for details. + + """ + return self in IPv6('ff00::/8') + + @property + def is_unspecified(self): + """Test if the address is unspecified. + + Returns: + A boolean, True if this is the unspecified address as defined in + RFC 2373 2.5.2. + + """ + return self == IPv6('::') + + @property + def is_loopback(self): + """Test if the address is a loopback adddress. + + Returns: + A boolean, True if the address is a loopback address as defined in + RFC 2373 2.5.3. + + """ + return self == IPv6('::1') + + @property + def is_link_local(self): + """Test if the address is reserved for link-local. + + Returns: + A boolean, True if the address is reserved per RFC 4291. + + """ + return self in IPv6('fe80::/10') + + @property + def is_site_local(self): + """Test if the address is reserved for site-local. + + Note that the site-local address space has been deprecated by RFC 3879. + Use is_private to test if this address is in the space of unique local + addresses as defined by RFC 4193. + + Returns: + A boolean, True if the address is reserved per RFC 3513 2.5.6. + + """ + return self in IPv6('fec0::/10') + + @property + def is_private(self): + """Test if this address is allocated for private networks. + + Returns: + A boolean, True if the address is reserved per RFC 4193. + + """ + return self in IPv6('fc00::/7') + + @property + def version(self): + return self._version + + @property + def packed(self): + """The binary representation of this address.""" + return struct.pack('!QQ', self.ip >> 64, self.ip & (2**64 - 1)) + + def _is_shorthand_ip(self, ip_str=None): + """Determine if the address is shortened. + + Args: + ip_str: A string, the IPv6 address. + + Returns: + A boolean, True if the address is shortened. + + """ + if ip_str.count('::') == 1: + return True + return False + + def _explode_shorthand_ip_string(self, ip_str): + """Expand a shortened IPv6 address. + + Args: + ip_str: A string, the IPv6 address. + + Returns: + A string, the expanded IPv6 address. + + """ + if self._is_shorthand_ip(ip_str): + new_ip = [] + hextet = ip_str.split('::') + sep = len(hextet[0].split(':')) + len(hextet[1].split(':')) + new_ip = hextet[0].split(':') + + for _ in xrange(8 - sep): + new_ip.append('0000') + new_ip += hextet[1].split(':') + + # Now need to make sure every hextet is 4 lower case characters. + # If a hextet is < 4 characters, we've got missing leading 0's. + ret_ip = [] + for hextet in new_ip: + ret_ip.append(('0' * (4 - len(hextet)) + hextet).lower()) + return ':'.join(ret_ip) + # We've already got a longhand ip_str. + return ip_str + + def _is_valid_ip(self, ip_str=None): + """Ensure we have a valid IPv6 address. + + Probably not as exhaustive as it should be. + + Args: + ip_str: A string, the IPv6 address. + + Returns: + A boolean, True if this is a valid IPv6 address. + + """ + if not ip_str: + ip_str = self.ip_ext + + # We need to have at least one ':'. + if ':' not in ip_str: + return False + + # We can only have one '::' shortener. + if ip_str.count('::') > 1: + return False + + # '::' should be encompassed by start, digits or end. + if ':::' in ip_str: + return False + + # A single colon can neither start nor end an address. + if ((ip_str.startswith(':') and not ip_str.startswith('::')) or + (ip_str.endswith(':') and not ip_str.endswith('::'))): + return False + + # If we have no concatenation, we need to have 8 fields with 7 ':'. + if '::' not in ip_str and ip_str.count(':') != 7: + # We might have an IPv4 mapped address. + if ip_str.count('.') != 3: + return False + + ip_str = self._explode_shorthand_ip_string(ip_str) + + # Now that we have that all squared away, let's check that each of the + # hextets are between 0x0 and 0xFFFF. + for hextet in ip_str.split(':'): + if hextet.count('.') == 3: + # If we have an IPv4 mapped address, the IPv4 portion has to be + # at the end of the IPv6 portion. + if not ip_str.split(':')[-1] == hextet: + return False + try: + IPv4(hextet) + except IPv4IpValidationError: + return False + elif int(hextet, 16) < 0x0 or int(hextet, 16) > 0xFFFF: + return False + return True + + def _is_valid_netmask(self, prefixlen): + """Verify that the netmask/prefixlen is valid. + + Args: + prefixlen: A string, the netmask in prefix length format. + + Returns: + A boolean, True if the prefix represents a valid IPv6 + netmask. + + """ + try: + prefixlen = int(prefixlen) + except ValueError: + return False + return 0 <= prefixlen <= 128 + + def _ip_int_from_string(self, ip_str=None): + """Turn an IPv6 address into an integer. + + Args: + ip_str: A string, the IPv6 address. + + Returns: + A long, the IPv6 address. + + """ + if not ip_str: + ip_str = self.ip_ext + + ip_int = 0 + + fields = self._explode_shorthand_ip_string(ip_str).split(':') + + # Do we have an IPv4 mapped (::ffff:a.b.c.d) or compact (::a.b.c.d) + # address? + if fields[-1].count('.') == 3: + ipv4_string = fields.pop() + ipv4_int = IPv4(ipv4_string).ip + octets = [] + for _ in xrange(2): + octets.append(hex(ipv4_int & 0xFFFF).lstrip('0x').rstrip('L')) + ipv4_int >>= 16 + fields.extend(reversed(octets)) + + for field in fields: + ip_int = (ip_int << 16) + int(field, 16) + + return ip_int + + def _compress_hextets(self, hextets): + """Compresses a list of hextets. + + Compresses a list of strings, replacing the longest continuous + sequence of "0" in the list with "" and adding empty strings at + the beginning or at the end of the string such that subsequently + calling ":".join(hextets) will produce the compressed version of + the IPv6 address. + + Args: + hextets: A list of strings, the hextets to compress. + + Returns: + A list of strings. + + """ + best_doublecolon_start = -1 + best_doublecolon_len = 0 + doublecolon_start = -1 + doublecolon_len = 0 + for index in range(len(hextets)): + if hextets[index] == '0': + doublecolon_len += 1 + if doublecolon_start == -1: + # Start of a sequence of zeros. + doublecolon_start = index + if doublecolon_len > best_doublecolon_len: + # This is the longest sequence of zeros so far. + best_doublecolon_len = doublecolon_len + best_doublecolon_start = doublecolon_start + else: + doublecolon_len = 0 + doublecolon_start = -1 + + if best_doublecolon_len > 1: + best_doublecolon_end = (best_doublecolon_start + + best_doublecolon_len) + # For zeros at the end of the address. + if best_doublecolon_end == len(hextets): + hextets += [''] + hextets[best_doublecolon_start:best_doublecolon_end] = [''] + # For zeros at the beginning of the address. + if best_doublecolon_start == 0: + hextets = [''] + hextets + + return hextets + + def _string_from_ip_int(self, ip_int=None): + """Turns a 128-bit integer into hexadecimal notation. + + Args: + ip_int: An integer, the IP address. + + Returns: + A string, the hexadecimal representation of the address. + + Raises: + ValueError: The address is bigger than 128 bits of all ones. + + """ + if not ip_int and ip_int != 0: + ip_int = self.ip + + if ip_int > self._ALL_ONES: + raise ValueError('IPv6 address is too large') + + hex_str = '%032x' % ip_int + hextets = [] + for x in range(0, 32, 4): + hextets.append('%x' % int(hex_str[x:x+4], 16)) + + hextets = self._compress_hextets(hextets) + return ':'.join(hextets) + + @property + def netmask_ext(self): + """IPv6 extended netmask. + + We don't deal with netmasks in IPv6 like we do in IPv4. This is + here strictly for IPv4 compatibility. We simply return the + prefix length. + + Returns: + An integer. + + """ + return self.prefixlen Added: python/trunk/Lib/test/test_ipaddr.py ============================================================================== --- (empty file) +++ python/trunk/Lib/test/test_ipaddr.py Fri May 1 21:59:52 2009 @@ -0,0 +1,567 @@ +# Copyright 2007 Google Inc. +# Licensed to PSF under a Contributor Agreement. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# See also: http://code.google.com/p/ipaddr-py/ + +"""Unittest for ipaddr module.""" + + +import unittest + +import ipaddr + +# Compatibility function to cast str to bytes objects +if ipaddr._compat_has_real_bytes: + _cb = lambda bytestr: bytes(bytestr, 'charmap') +else: + _cb = str + +class IpaddrUnitTest(unittest.TestCase): + + def setUp(self): + self.ipv4 = ipaddr.IPv4('1.2.3.4/24') + self.ipv4_hostmask = ipaddr.IPv4('10.0.0.1/0.255.255.255') + self.ipv6 = ipaddr.IPv6('2001:658:22a:cafe:200:0:0:1/64') + + def testRepr(self): + self.assertEqual("IPv4('1.2.3.4/32')", repr(ipaddr.IPv4('1.2.3.4'))) + self.assertEqual("IPv6('::1/128')", repr(ipaddr.IPv6('::1'))) + + def testInvalidStrings(self): + self.assertRaises(ValueError, ipaddr.IP, '') + self.assertRaises(ValueError, ipaddr.IP, 'www.google.com') + self.assertRaises(ValueError, ipaddr.IP, '1.2.3') + self.assertRaises(ValueError, ipaddr.IP, '1.2.3.4.5') + self.assertRaises(ValueError, ipaddr.IP, '301.2.2.2') + self.assertRaises(ValueError, ipaddr.IP, '1:2:3:4:5:6:7') + self.assertRaises(ValueError, ipaddr.IP, '1:2:3:4:5:6:7:') + self.assertRaises(ValueError, ipaddr.IP, ':2:3:4:5:6:7:8') + self.assertRaises(ValueError, ipaddr.IP, '1:2:3:4:5:6:7:8:9') + self.assertRaises(ValueError, ipaddr.IP, '1:2:3:4:5:6:7:8:') + self.assertRaises(ValueError, ipaddr.IP, '1::3:4:5:6::8') + self.assertRaises(ValueError, ipaddr.IP, 'a:') + self.assertRaises(ValueError, ipaddr.IP, ':') + self.assertRaises(ValueError, ipaddr.IP, ':::') + self.assertRaises(ValueError, ipaddr.IP, '::a:') + self.assertRaises(ValueError, ipaddr.IP, '1ffff::') + self.assertRaises(ValueError, ipaddr.IP, '0xa::') + self.assertRaises(ValueError, ipaddr.IP, '1:2:3:4:5:6:1a.2.3.4') + self.assertRaises(ValueError, ipaddr.IP, '1:2:3:4:5:1.2.3.4:8') + self.assertRaises(ipaddr.IPv4IpValidationError, ipaddr.IPv4, '') + self.assertRaises(ipaddr.IPv4IpValidationError, ipaddr.IPv4, + 'google.com') + self.assertRaises(ipaddr.IPv4IpValidationError, ipaddr.IPv4, + '::1.2.3.4') + self.assertRaises(ipaddr.IPv6IpValidationError, ipaddr.IPv6, '') + self.assertRaises(ipaddr.IPv6IpValidationError, ipaddr.IPv6, + 'google.com') + self.assertRaises(ipaddr.IPv6IpValidationError, ipaddr.IPv6, + '1.2.3.4') + + def testGetNetwork(self): + self.assertEqual(self.ipv4.network, 16909056) + self.assertEqual(self.ipv4.network_ext, '1.2.3.0') + self.assertEqual(self.ipv4_hostmask.network_ext, '10.0.0.0') + + self.assertEqual(self.ipv6.network, + 42540616829182469433403647294022090752) + self.assertEqual(self.ipv6.network_ext, + '2001:658:22a:cafe::') + self.assertEqual(self.ipv6.hostmask_ext, + '::ffff:ffff:ffff:ffff') + + def testIpFromInt(self): + self.assertEqual(self.ipv4.ip, ipaddr.IPv4(16909060).ip) + self.assertRaises(ipaddr.IPv4IpValidationError, + ipaddr.IPv4, 2**32) + self.assertRaises(ipaddr.IPv4IpValidationError, + ipaddr.IPv4, -1) + + self.assertEqual(self.ipv6.ip, + ipaddr.IPv6(42540616829182469433547762482097946625).ip) + self.assertRaises(ipaddr.IPv6IpValidationError, + ipaddr.IPv6, 2**128) + self.assertRaises(ipaddr.IPv6IpValidationError, + ipaddr.IPv6, -1) + + self.assertEqual(ipaddr.IP(self.ipv4.ip).version, 4) + self.assertEqual(ipaddr.IP(self.ipv6.ip).version, 6) + + if ipaddr._compat_has_real_bytes: # on python3+ + def testIpFromPacked(self): + ip = ipaddr.IP + + self.assertEqual(self.ipv4.ip, + ip(_cb('\x01\x02\x03\x04')).ip) + self.assertEqual(ip('255.254.253.252'), + ip(_cb('\xff\xfe\xfd\xfc'))) + self.assertRaises(ValueError, ipaddr.IP, _cb('\x00' * 3)) + self.assertRaises(ValueError, ipaddr.IP, _cb('\x00' * 5)) + self.assertEqual(self.ipv6.ip, + ip(_cb('\x20\x01\x06\x58\x02\x2a\xca\xfe' + '\x02\x00\x00\x00\x00\x00\x00\x01')).ip) + self.assertEqual(ip('ffff:2:3:4:ffff::'), + ip(_cb('\xff\xff\x00\x02\x00\x03\x00\x04' + + '\xff\xff' + '\x00' * 6))) + self.assertEqual(ip('::'), + ip(_cb('\x00' * 16))) + self.assertRaises(ValueError, ip, _cb('\x00' * 15)) + self.assertRaises(ValueError, ip, _cb('\x00' * 17)) + + def testGetIp(self): + self.assertEqual(self.ipv4.ip, 16909060) + self.assertEqual(self.ipv4.ip_ext, '1.2.3.4') + self.assertEqual(self.ipv4.ip_ext_full, '1.2.3.4') + self.assertEqual(self.ipv4_hostmask.ip_ext, '10.0.0.1') + + self.assertEqual(self.ipv6.ip, 42540616829182469433547762482097946625) + self.assertEqual(self.ipv6.ip_ext, + '2001:658:22a:cafe:200::1') + self.assertEqual(self.ipv6.ip_ext_full, + '2001:0658:022a:cafe:0200:0000:0000:0001') + + def testGetNetmask(self): + self.assertEqual(self.ipv4.netmask, 4294967040) + self.assertEqual(self.ipv4.netmask_ext, '255.255.255.0') + self.assertEqual(self.ipv4_hostmask.netmask_ext, '255.0.0.0') + self.assertEqual(self.ipv6.netmask, + 340282366920938463444927863358058659840) + self.assertEqual(self.ipv6.netmask_ext, 64) + + def testZeroNetmask(self): + ipv4_zero_netmask = ipaddr.IPv4('1.2.3.4/0') + self.assertEqual(ipv4_zero_netmask.netmask, 0) + self.assert_(ipv4_zero_netmask._is_valid_netmask(str(0))) + + ipv6_zero_netmask = ipaddr.IPv6('::1/0') + self.assertEqual(ipv6_zero_netmask.netmask, 0) + self.assert_(ipv6_zero_netmask._is_valid_netmask(str(0))) + + def testGetBroadcast(self): + self.assertEqual(self.ipv4.broadcast, 16909311) + self.assertEqual(self.ipv4.broadcast_ext, '1.2.3.255') + + self.assertEqual(self.ipv6.broadcast, + 42540616829182469451850391367731642367) + self.assertEqual(self.ipv6.broadcast_ext, + '2001:658:22a:cafe:ffff:ffff:ffff:ffff') + + def testGetPrefixlen(self): + self.assertEqual(self.ipv4.prefixlen, 24) + + self.assertEqual(self.ipv6.prefixlen, 64) + + def testGetSupernet(self): + self.assertEqual(self.ipv4.supernet().prefixlen, 23) + self.assertEqual(self.ipv4.supernet().network_ext, '1.2.2.0') + self.assertEqual(ipaddr.IPv4('0.0.0.0/0').supernet(), + ipaddr.IPv4('0.0.0.0/0')) + + self.assertEqual(self.ipv6.supernet().prefixlen, 63) + self.assertEqual(self.ipv6.supernet().network_ext, + '2001:658:22a:cafe::') + self.assertEqual(ipaddr.IPv6('::0/0').supernet(), ipaddr.IPv6('::0/0')) + + def testGetSupernet3(self): + self.assertEqual(self.ipv4.supernet(3).prefixlen, 21) + self.assertEqual(self.ipv4.supernet(3).network_ext, '1.2.0.0') + + self.assertEqual(self.ipv6.supernet(3).prefixlen, 61) + self.assertEqual(self.ipv6.supernet(3).network_ext, + '2001:658:22a:caf8::') + + def testGetSubnet(self): + self.assertEqual(self.ipv4.subnet()[0].prefixlen, 25) + self.assertEqual(self.ipv4.subnet()[0].network_ext, '1.2.3.0') + self.assertEqual(self.ipv4.subnet()[1].network_ext, '1.2.3.128') + + self.assertEqual(self.ipv6.subnet()[0].prefixlen, 65) + + def testGetSubnetForSingle32(self): + ip = ipaddr.IPv4('1.2.3.4/32') + subnets1 = [str(x) for x in ip.subnet()] + subnets2 = [str(x) for x in ip.subnet(2)] + self.assertEqual(subnets1, ['1.2.3.4/32']) + self.assertEqual(subnets1, subnets2) + + def testGetSubnetForSingle128(self): + ip = ipaddr.IPv6('::1/128') + subnets1 = [str(x) for x in ip.subnet()] + subnets2 = [str(x) for x in ip.subnet(2)] + self.assertEqual(subnets1, ['::1/128']) + self.assertEqual(subnets1, subnets2) + + def testSubnet2(self): + ips = [str(x) for x in self.ipv4.subnet(2)] + self.assertEqual( + ips, + ['1.2.3.0/26', '1.2.3.64/26', '1.2.3.128/26', '1.2.3.192/26']) + + ipsv6 = [str(x) for x in self.ipv6.subnet(2)] + self.assertEqual( + ipsv6, + ['2001:658:22a:cafe::/66', + '2001:658:22a:cafe:4000::/66', + '2001:658:22a:cafe:8000::/66', + '2001:658:22a:cafe:c000::/66']) + + def testSubnetFailsForLargeCidrDiff(self): + self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv4.subnet, 9) + self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv6.subnet, + 65) + + def testSupernetFailsForLargeCidrDiff(self): + self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv4.supernet, + 25) + self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv6.supernet, + 65) + + def testSubnetFailsForNegativeCidrDiff(self): + self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv4.subnet, + -1) + self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv6.subnet, + -1) + + def testGetNumHosts(self): + self.assertEqual(self.ipv4.numhosts, 256) + self.assertEqual(self.ipv4.subnet()[0].numhosts, 128) + self.assertEqual(self.ipv4.supernet().numhosts, 512) + + self.assertEqual(self.ipv6.numhosts, 18446744073709551616) + self.assertEqual(self.ipv6.subnet()[0].numhosts, 9223372036854775808) + self.assertEqual(self.ipv6.supernet().numhosts, 36893488147419103232) + + def testContains(self): + self.assertTrue(ipaddr.IPv4('1.2.3.128/25') in self.ipv4) + self.assertFalse(ipaddr.IPv4('1.2.4.1/24') in self.ipv4) + self.assertFalse(self.ipv4 in self.ipv6) + self.assertFalse(self.ipv6 in self.ipv4) + self.assertTrue(self.ipv4 in self.ipv4) + self.assertTrue(self.ipv6 in self.ipv6) + + def testBadAddress(self): + self.assertRaises(ipaddr.IPv4IpValidationError, ipaddr.IPv4, 'poop') + self.assertRaises(ipaddr.IPv4IpValidationError, + ipaddr.IPv4, '1.2.3.256') + + self.assertRaises(ipaddr.IPv6IpValidationError, ipaddr.IPv6, 'poopv6') + self.assertRaises(ipaddr.IPv4IpValidationError, + ipaddr.IPv4, '1.2.3.4/32/24') + + def testBadNetMask(self): + self.assertRaises(ipaddr.IPv4NetmaskValidationError, + ipaddr.IPv4, '1.2.3.4/') + self.assertRaises(ipaddr.IPv4NetmaskValidationError, + ipaddr.IPv4, '1.2.3.4/33') + self.assertRaises(ipaddr.IPv4NetmaskValidationError, + ipaddr.IPv4, '1.2.3.4/254.254.255.256') + + self.assertRaises(ipaddr.IPv6NetmaskValidationError, + ipaddr.IPv6, '::1/') + self.assertRaises(ipaddr.IPv6NetmaskValidationError, + ipaddr.IPv6, '::1/129') + + def testNth(self): + self.assertEqual(self.ipv4[5], '1.2.3.5') + self.assertRaises(IndexError, self.ipv4.__getitem__, 256) + + self.assertEqual(self.ipv6[5], + '2001:658:22a:cafe::5') + + def testEquals(self): + self.assertTrue(self.ipv4 == ipaddr.IPv4('1.2.3.4/24')) + self.assertFalse(self.ipv4 == ipaddr.IPv4('1.2.3.4/23')) + self.assertFalse(self.ipv4 == ipaddr.IPv4('1.2.3.5/24')) + self.assertFalse(self.ipv4 == ipaddr.IPv6('::1.2.3.4/24')) + self.assertFalse(self.ipv4 == '') + self.assertFalse(self.ipv4 == []) + self.assertFalse(self.ipv4 == 2) + + self.assertTrue(self.ipv6 == + ipaddr.IPv6('2001:658:22a:cafe:200::1/64')) + self.assertFalse(self.ipv6 == + ipaddr.IPv6('2001:658:22a:cafe:200::1/63')) + self.assertFalse(self.ipv6 == + ipaddr.IPv6('2001:658:22a:cafe:200::2/64')) + self.assertFalse(self.ipv6 == ipaddr.IPv4('1.2.3.4/23')) + self.assertFalse(self.ipv6 == '') + self.assertFalse(self.ipv6 == []) + self.assertFalse(self.ipv6 == 2) + + def testNotEquals(self): + self.assertFalse(self.ipv4 != ipaddr.IPv4('1.2.3.4/24')) + self.assertTrue(self.ipv4 != ipaddr.IPv4('1.2.3.4/23')) + self.assertTrue(self.ipv4 != ipaddr.IPv4('1.2.3.5/24')) + self.assertTrue(self.ipv4 != ipaddr.IPv6('::1.2.3.4/24')) + self.assertTrue(self.ipv4 != '') + self.assertTrue(self.ipv4 != []) + self.assertTrue(self.ipv4 != 2) + + self.assertFalse(self.ipv6 != + ipaddr.IPv6('2001:658:22a:cafe:200::1/64')) + self.assertTrue(self.ipv6 != + ipaddr.IPv6('2001:658:22a:cafe:200::1/63')) + self.assertTrue(self.ipv6 != + ipaddr.IPv6('2001:658:22a:cafe:200::2/64')) + self.assertTrue(self.ipv6 != ipaddr.IPv4('1.2.3.4/23')) + self.assertTrue(self.ipv6 != '') + self.assertTrue(self.ipv6 != []) + self.assertTrue(self.ipv6 != 2) + + def testSlash32Constructor(self): + self.assertEquals(str(ipaddr.IPv4('1.2.3.4/255.255.255.255')), + '1.2.3.4/32') + + def testSlash128Constructor(self): + self.assertEquals(str(ipaddr.IPv6('::1/128')), + '::1/128') + + def testSlash0Constructor(self): + self.assertEquals(str(ipaddr.IPv4('1.2.3.4/0.0.0.0')), '1.2.3.4/0') + + def testCollapsing(self): + ip1 = ipaddr.IPv4('1.1.0.0/24') + ip2 = ipaddr.IPv4('1.1.1.0/24') + ip3 = ipaddr.IPv4('1.1.2.0/24') + ip4 = ipaddr.IPv4('1.1.3.0/24') + ip5 = ipaddr.IPv4('1.1.4.0/24') + # stored in no particular order b/c we want CollapseAddr to call [].sort + ip6 = ipaddr.IPv4('1.1.0.0/22') + # check that addreses are subsumed properlly. + collapsed = ipaddr.collapse_address_list([ip1, ip2, ip3, ip4, ip5, ip6]) + self.assertEqual(collapsed, [ipaddr.IPv4('1.1.0.0/22'), + ipaddr.IPv4('1.1.4.0/24')]) + # test that two addresses are supernet'ed properlly + collapsed = ipaddr.collapse_address_list([ip1, ip2]) + self.assertEqual(collapsed, [ipaddr.IPv4('1.1.0.0/23')]) + + ip_same1 = ip_same2 = ipaddr.IPv4('1.1.1.1/32') + self.assertEqual(ipaddr.collapse_address_list([ip_same1, ip_same2]), + [ip_same1]) + ip1 = ipaddr.IPv6('::2001:1/100') + ip2 = ipaddr.IPv6('::2002:1/120') + ip3 = ipaddr.IPv6('::2001:1/96') + # test that ipv6 addresses are subsumed properly. + collapsed = ipaddr.collapse_address_list([ip1, ip2, ip3]) + self.assertEqual(collapsed, [ip3]) + + def testNetworkComparison(self): + # ip1 and ip2 have the same network address + ip1 = ipaddr.IPv4('1.1.1.0/24') + ip2 = ipaddr.IPv4('1.1.1.1/24') + ip3 = ipaddr.IPv4('1.1.2.0/24') + + self.assertTrue(ip1 < ip3) + self.assertTrue(ip3 > ip2) + + self.assertEquals(ip1.compare_networks(ip2), 0) + self.assertTrue(ip1._get_networks_key() == ip2._get_networks_key()) + self.assertEquals(ip1.compare_networks(ip3), -1) + self.assertTrue(ip1._get_networks_key() < ip3._get_networks_key()) + + ip1 = ipaddr.IPv6('2001::2000/96') + ip2 = ipaddr.IPv6('2001::2001/96') + ip3 = ipaddr.IPv6('2001:ffff::2000/96') + + self.assertTrue(ip1 < ip3) + self.assertTrue(ip3 > ip2) + self.assertEquals(ip1.compare_networks(ip2), 0) + self.assertTrue(ip1._get_networks_key() == ip2._get_networks_key()) + self.assertEquals(ip1.compare_networks(ip3), -1) + self.assertTrue(ip1._get_networks_key() < ip3._get_networks_key()) + + # Test comparing different protocols + ipv6 = ipaddr.IPv6('::/0') + ipv4 = ipaddr.IPv4('0.0.0.0/0') + self.assertTrue(ipv6 > ipv4) + self.assertTrue(ipv4 < ipv6) + + def testEmbeddedIpv4(self): + ipv4_string = '192.168.0.1' + ipv4 = ipaddr.IPv4(ipv4_string) + v4compat_ipv6 = ipaddr.IPv6('::%s' % ipv4_string) + self.assertEquals(v4compat_ipv6.ip, ipv4.ip) + v4mapped_ipv6 = ipaddr.IPv6('::ffff:%s' % ipv4_string) + self.assertNotEquals(v4mapped_ipv6.ip, ipv4.ip) + self.assertRaises(ipaddr.IPv6IpValidationError, ipaddr.IPv6, + '2001:1.1.1.1:1.1.1.1') + + def testIPVersion(self): + self.assertEqual(self.ipv4.version, 4) + self.assertEqual(self.ipv6.version, 6) + + def testPacked(self): + self.assertEqual(self.ipv4.packed, + _cb('\x01\x02\x03\x04')) + self.assertEqual(ipaddr.IPv4('255.254.253.252').packed, + _cb('\xff\xfe\xfd\xfc')) + self.assertEqual(self.ipv6.packed, + _cb('\x20\x01\x06\x58\x02\x2a\xca\xfe' + '\x02\x00\x00\x00\x00\x00\x00\x01')) + self.assertEqual(ipaddr.IPv6('ffff:2:3:4:ffff::').packed, + _cb('\xff\xff\x00\x02\x00\x03\x00\x04\xff\xff' + + '\x00' * 6)) + self.assertEqual(ipaddr.IPv6('::1:0:0:0:0').packed, + _cb('\x00' * 6 + '\x00\x01' + '\x00' * 8)) + + def testIpStrFromPrefixlen(self): + ipv4 = ipaddr.IPv4('1.2.3.4/24') + self.assertEquals(ipv4._ip_string_from_prefix(), '255.255.255.0') + self.assertEquals(ipv4._ip_string_from_prefix(28), '255.255.255.240') + + def testIpType(self): + ipv4 = ipaddr.IP('1.2.3.4') + ipv6 = ipaddr.IP('::1.2.3.4') + self.assertEquals(ipaddr.IPv4, type(ipv4)) + self.assertEquals(ipaddr.IPv6, type(ipv6)) + + def testReservedIpv4(self): + self.assertEquals(True, ipaddr.IP('224.1.1.1/31').is_multicast) + self.assertEquals(False, ipaddr.IP('240.0.0.0').is_multicast) + + self.assertEquals(True, ipaddr.IP('192.168.1.1/17').is_private) + self.assertEquals(False, ipaddr.IP('192.169.0.0').is_private) + self.assertEquals(True, ipaddr.IP('10.255.255.255').is_private) + self.assertEquals(False, ipaddr.IP('11.0.0.0').is_private) + self.assertEquals(True, ipaddr.IP('172.31.255.255').is_private) + self.assertEquals(False, ipaddr.IP('172.32.0.0').is_private) + + self.assertEquals(True, ipaddr.IP('169.254.100.200/24').is_link_local) + self.assertEquals(False, ipaddr.IP('169.255.100.200/24').is_link_local) + + self.assertEquals(True, ipaddr.IP('127.100.200.254/32').is_loopback) + self.assertEquals(True, ipaddr.IP('127.42.0.0/16').is_loopback) + self.assertEquals(False, ipaddr.IP('128.0.0.0').is_loopback) + + def testReservedIpv6(self): + ip = ipaddr.IP + + self.assertEquals(True, ip('ffff::').is_multicast) + self.assertEquals(True, ip(2**128-1).is_multicast) + self.assertEquals(True, ip('ff00::').is_multicast) + self.assertEquals(False, ip('fdff::').is_multicast) + + self.assertEquals(True, ip('fecf::').is_site_local) + self.assertEquals(True, ip('feff:ffff:ffff:ffff::').is_site_local) + self.assertEquals(False, ip('fbf:ffff::').is_site_local) + self.assertEquals(False, ip('ff00::').is_site_local) + + self.assertEquals(True, ip('fc00::').is_private) + self.assertEquals(True, ip('fc00:ffff:ffff:ffff::').is_private) + self.assertEquals(False, ip('fbff:ffff::').is_private) + self.assertEquals(False, ip('fe00::').is_private) + + self.assertEquals(True, ip('fea0::').is_link_local) + self.assertEquals(True, ip('febf:ffff::').is_link_local) + self.assertEquals(False, ip('fe7f:ffff::').is_link_local) + self.assertEquals(False, ip('fec0::').is_link_local) + + self.assertEquals(True, ip('0:0::0:01').is_loopback) + self.assertEquals(False, ip('::1/127').is_loopback) + self.assertEquals(False, ip('::').is_loopback) + self.assertEquals(False, ip('::2').is_loopback) + + self.assertEquals(True, ip('0::0').is_unspecified) + self.assertEquals(False, ip('::1').is_unspecified) + self.assertEquals(False, ip('::/127').is_unspecified) + + def testAddrExclude(self): + addr1 = ipaddr.IP('10.1.1.0/24') + addr2 = ipaddr.IP('10.1.1.0/26') + addr3 = ipaddr.IP('10.2.1.0/24') + self.assertEqual(addr1.address_exclude(addr2), + [ipaddr.IP('10.1.1.64/26'), + ipaddr.IP('10.1.1.128/25')]) + self.assertRaises(ValueError, addr1.address_exclude, addr3) + + def testHash(self): + self.assertEquals(hash(ipaddr.IP('10.1.1.0/24')), + hash(ipaddr.IP('10.1.1.0/24'))) + dummy = {} + dummy[self.ipv4] = None + dummy[self.ipv6] = None + self.assertTrue(self.ipv4 in dummy) + + def testIPv4PrefixFromInt(self): + addr1 = ipaddr.IP('10.1.1.0/24') + addr2 = ipaddr.IPv4(addr1.ip) # clone prefix + addr2.prefixlen = addr1.prefixlen + addr3 = ipaddr.IP(123456) + + self.assertEqual(123456, addr3.ip) + self.assertRaises(ipaddr.IPv4NetmaskValidationError, + addr2._set_prefix, -1) + self.assertEqual(addr1, addr2) + self.assertEqual(str(addr1), str(addr2)) + + def testIPv6PrefixFromInt(self): + addr1 = ipaddr.IP('2001:0658:022a:cafe:0200::1/64') + addr2 = ipaddr.IPv6(addr1.ip) # clone prefix + addr2.prefixlen = addr1.prefixlen + addr3 = ipaddr.IP(123456) + + self.assertEqual(123456, addr3.ip) + self.assertRaises(ipaddr.IPv6NetmaskValidationError, + addr2._set_prefix, -1) + self.assertEqual(addr1, addr2) + self.assertEqual(str(addr1), str(addr2)) + + def testCopyConstructor(self): + addr1 = ipaddr.IP('10.1.1.0/24') + addr2 = ipaddr.IP(addr1) + addr3 = ipaddr.IP('2001:658:22a:cafe:200::1/64') + addr4 = ipaddr.IP(addr3) + + self.assertEqual(addr1, addr2) + self.assertEqual(addr3, addr4) + + def testCompressIPv6Address(self): + test_addresses = { + '1:2:3:4:5:6:7:8': '1:2:3:4:5:6:7:8/128', + '2001:0:0:4:0:0:0:8': '2001:0:0:4::8/128', + '2001:0:0:4:5:6:7:8': '2001::4:5:6:7:8/128', + '2001:0:3:4:5:6:7:8': '2001:0:3:4:5:6:7:8/128', + '2001:0::3:4:5:6:7:8': '2001:0:3:4:5:6:7:8/128', + '0:0:3:0:0:0:0:ffff': '0:0:3::ffff/128', + '0:0:0:4:0:0:0:ffff': '::4:0:0:0:ffff/128', + '0:0:0:0:5:0:0:ffff': '::5:0:0:ffff/128', + '1:0:0:4:0:0:7:8': '1::4:0:0:7:8/128', + '0:0:0:0:0:0:0:0': '::/128', + '0:0:0:0:0:0:0:0/0': '::/0', + '0:0:0:0:0:0:0:1': '::1/128', + '2001:0658:022a:cafe:0000:0000:0000:0000/66': + '2001:658:22a:cafe::/66', + } + for uncompressed, compressed in test_addresses.items(): + self.assertEquals(compressed, str(ipaddr.IPv6(uncompressed))) + + def testExplodeShortHandIpStr(self): + addr1 = ipaddr.IPv6('2001::1') + self.assertEqual('2001:0000:0000:0000:0000:0000:0000:0001', + addr1._explode_shorthand_ip_string(addr1.ip_ext)) + + def testIntRepresentation(self): + self.assertEqual(16909060, int(self.ipv4)) + self.assertEqual(42540616829182469433547762482097946625, int(self.ipv6)) + + def testHexRepresentation(self): + self.assertEqual(hex(0x1020304), hex(self.ipv4)) + + self.assertEqual(hex(0x20010658022ACAFE0200000000000001), + hex(self.ipv6)) + + +if __name__ == '__main__': + unittest.main() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri May 1 21:59:52 2009 @@ -261,6 +261,9 @@ Library ------- +- Issue #3959: The ipaddr module has been added to the standard library. + Contributed by Google. + - Issue #2245: aifc now skips chunk types it doesn't recognize, per spec. - Issue #5874: distutils.tests.test_config_cmd is not locale-sensitive From python-checkins at python.org Fri May 1 22:03:27 2009 From: python-checkins at python.org (walter.doerwald) Date: Fri, 1 May 2009 22:03:27 +0200 (CEST) Subject: [Python-checkins] r72174 - python/branches/release30-maint Message-ID: <20090501200327.F3F121E40B7@bag.python.org> Author: walter.doerwald Date: Fri May 1 22:03:27 2009 New Revision: 72174 Log: Blocked revisions 72172 via svnmerge ................ r72172 | walter.doerwald | 2009-05-01 21:58:58 +0200 (Fr, 01 Mai 2009) | 12 lines Merged revisions 72167 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72167 | walter.doerwald | 2009-05-01 19:35:37 +0200 (Fr, 01 Mai 2009) | 5 lines Make test.test_support.EnvironmentVarGuard behave like a dictionary. All changes are mirrored to the underlying os.environ dict, but rolled back on exit from the with block. ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Fri May 1 22:35:43 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 May 2009 20:35:43 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090501203543.446DB1E4051@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1220 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: gregory.p.smith BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_xpickle make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri May 1 22:36:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 May 2009 20:36:39 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090501203639.0559B1E4051@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/720 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: walter.doerwald BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_time ====================================================================== FAIL: test_tzset (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_time.py", line 166, in test_tzset self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) AssertionError: time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) == time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri May 1 22:40:59 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 1 May 2009 22:40:59 +0200 (CEST) Subject: [Python-checkins] r72175 - in python/branches/py3k: Doc/library/io.rst Lib/_pyio.py Lib/test/test_io.py Lib/test/test_memoryio.py Misc/NEWS Modules/_io/bufferedio.c Modules/_io/textio.c Message-ID: <20090501204059.574CA1E4051@bag.python.org> Author: benjamin.peterson Date: Fri May 1 22:40:59 2009 New Revision: 72175 Log: implement a detach() method for BufferedIOBase and TextIOBase #5883 Modified: python/branches/py3k/Doc/library/io.rst python/branches/py3k/Lib/_pyio.py python/branches/py3k/Lib/test/test_io.py python/branches/py3k/Lib/test/test_memoryio.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_io/bufferedio.c python/branches/py3k/Modules/_io/textio.c Modified: python/branches/py3k/Doc/library/io.rst ============================================================================== --- python/branches/py3k/Doc/library/io.rst (original) +++ python/branches/py3k/Doc/library/io.rst Fri May 1 22:40:59 2009 @@ -361,6 +361,17 @@ :class:`BufferedIOBase` provides or overrides these methods in addition to those from :class:`IOBase`: + .. method:: detach() + + Separate the underlying raw stream from the buffer and return it. + + After the raw stream has been detached, the buffer is in an unusable + state. + + Some buffers, like :class:`BytesIO`, do not have the concept of a single + raw stream to return from this method. They raise + :exc:`UnsupportedOperation`. + .. method:: read([n]) Read and return up to *n* bytes. If the argument is omitted, ``None``, or @@ -547,7 +558,9 @@ *max_buffer_size* is unused and deprecated. - :class:`BufferedRWPair` implements all of :class:`BufferedIOBase`\'s methods. + :class:`BufferedRWPair` implements all of :class:`BufferedIOBase`\'s methods + except for :meth:`~BufferedIOBase.detach`, which raises + :exc:`UnsupportedOperation`. .. class:: BufferedRandom(raw[, buffer_size[, max_buffer_size]]) @@ -588,6 +601,17 @@ A string, a tuple of strings, or ``None``, indicating the newlines translated so far. + .. method:: detach() + + Separate the underlying buffer from the :class:`TextIOBase` and return it. + + After the underlying buffer has been detached, the :class:`TextIOBase` is + in an unusable state. + + Some :class:`TextIOBase` implementations, like :class:`StringIO`, may not + have the concept of an underlying buffer and calling this method will + raise :exc:`UnsupportedOperation`. + .. method:: read(n) Read and return at most *n* characters from the stream as a single Modified: python/branches/py3k/Lib/_pyio.py ============================================================================== --- python/branches/py3k/Lib/_pyio.py (original) +++ python/branches/py3k/Lib/_pyio.py Fri May 1 22:40:59 2009 @@ -642,6 +642,15 @@ """ self._unsupported("write") + def detach(self) -> None: + """ + Separate the underlying raw stream from the buffer and return it. + + After the raw stream has been detached, the buffer is in an unusable + state. + """ + self._unsupported("detach") + io.BufferedIOBase.register(BufferedIOBase) @@ -689,13 +698,21 @@ self.raw.flush() def close(self): - if not self.closed: + if not self.closed and self.raw is not None: try: self.flush() except IOError: pass # If flush() fails, just give up self.raw.close() + def detach(self): + if self.raw is None: + raise ValueError("raw stream already detached") + self.flush() + raw = self.raw + self.raw = None + return raw + ### Inquiries ### def seekable(self): @@ -1236,6 +1253,15 @@ """ self._unsupported("readline") + def detach(self) -> None: + """ + Separate the underlying buffer from the TextIOBase and return it. + + After the underlying buffer has been detached, the TextIO is in an + unusable state. + """ + self._unsupported("detach") + @property def encoding(self): """Subclasses should override.""" @@ -1448,11 +1474,12 @@ self._telling = self._seekable def close(self): - try: - self.flush() - except IOError: - pass # If flush() fails, just give up - self.buffer.close() + if self.buffer is not None: + try: + self.flush() + except IOError: + pass # If flush() fails, just give up + self.buffer.close() @property def closed(self): @@ -1647,6 +1674,14 @@ self.seek(pos) return self.buffer.truncate() + def detach(self): + if self.buffer is None: + raise ValueError("buffer is already detached") + self.flush() + buffer = self.buffer + self.buffer = None + return buffer + def seek(self, cookie, whence=0): if self.closed: raise ValueError("tell on closed file") @@ -1865,3 +1900,7 @@ @property def encoding(self): return None + + def detach(self): + # This doesn't make sense on StringIO. + self._unsupported("detach") Modified: python/branches/py3k/Lib/test/test_io.py ============================================================================== --- python/branches/py3k/Lib/test/test_io.py (original) +++ python/branches/py3k/Lib/test/test_io.py Fri May 1 22:40:59 2009 @@ -526,6 +526,12 @@ class CommonBufferedTests: # Tests common to BufferedReader, BufferedWriter and BufferedRandom + def test_detach(self): + raw = self.MockRawIO() + buf = self.tp(raw) + self.assertIs(buf.detach(), raw) + self.assertRaises(ValueError, buf.detach) + def test_fileno(self): rawio = self.MockRawIO() bufio = self.tp(rawio) @@ -811,6 +817,14 @@ bufio.flush() self.assertEquals(b"".join(rawio._write_stack), b"abcghi") + def test_detach_flush(self): + raw = self.MockRawIO() + buf = self.tp(raw) + buf.write(b"howdy!") + self.assertFalse(raw._write_stack) + buf.detach() + self.assertEqual(raw._write_stack, [b"howdy!"]) + def test_write(self): # Write to the buffered IO but don't overflow the buffer. writer = self.MockRawIO() @@ -1052,6 +1066,10 @@ pair = self.tp(self.MockRawIO(), self.MockRawIO()) self.assertFalse(pair.closed) + def test_detach(self): + pair = self.tp(self.MockRawIO(), self.MockRawIO()) + self.assertRaises(self.UnsupportedOperation, pair.detach) + def test_constructor_max_buffer_size_deprecation(self): with support.check_warnings() as w: warnings.simplefilter("always", DeprecationWarning) @@ -1480,6 +1498,19 @@ self.assertRaises(TypeError, t.__init__, b, newline=42) self.assertRaises(ValueError, t.__init__, b, newline='xyzzy') + def test_detach(self): + r = self.BytesIO() + b = self.BufferedWriter(r) + t = self.TextIOWrapper(b) + self.assertIs(t.detach(), b) + + t = self.TextIOWrapper(b, encoding="ascii") + t.write("howdy") + self.assertFalse(r.getvalue()) + t.detach() + self.assertEqual(r.getvalue(), b"howdy") + self.assertRaises(ValueError, t.detach) + def test_repr(self): raw = self.BytesIO("hello".encode("utf-8")) b = self.BufferedReader(raw) Modified: python/branches/py3k/Lib/test/test_memoryio.py ============================================================================== --- python/branches/py3k/Lib/test/test_memoryio.py (original) +++ python/branches/py3k/Lib/test/test_memoryio.py Fri May 1 22:40:59 2009 @@ -57,6 +57,10 @@ class MemoryTestMixin: + def test_detach(self): + buf = self.ioclass() + self.assertRaises(self.UnsupportedOperation, buf.detach) + def write_ops(self, f, t): self.assertEqual(f.write(t("blah.")), 5) self.assertEqual(f.seek(0), 0) @@ -336,6 +340,9 @@ class PyBytesIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase): + + UnsupportedOperation = pyio.UnsupportedOperation + @staticmethod def buftype(s): return s.encode("ascii") @@ -413,6 +420,7 @@ class PyStringIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase): buftype = str ioclass = pyio.StringIO + UnsupportedOperation = pyio.UnsupportedOperation EOF = "" # TextIO-specific behaviour. @@ -518,9 +526,11 @@ class CBytesIOTest(PyBytesIOTest): ioclass = io.BytesIO + UnsupportedOperation = io.UnsupportedOperation class CStringIOTest(PyStringIOTest): ioclass = io.StringIO + UnsupportedOperation = io.UnsupportedOperation # XXX: For the Python version of io.StringIO, this is highly # dependent on the encoding used for the underlying buffer. Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri May 1 22:40:59 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #5883: In the io module, the BufferedIOBase and TextIOBase ABCs have + received a new method, detach(). detach() disconnects the underlying stream + from the buffer or text IO and returns it. + - Issue #5859: Remove switch from '%f' to '%g'-style formatting for floats with absolute value over 1e50. Also remove length restrictions for float formatting: '%.67f' % 12.34 and '%.120e' % Modified: python/branches/py3k/Modules/_io/bufferedio.c ============================================================================== --- python/branches/py3k/Modules/_io/bufferedio.c (original) +++ python/branches/py3k/Modules/_io/bufferedio.c Fri May 1 22:40:59 2009 @@ -73,6 +73,18 @@ return NULL; } +PyDoc_STRVAR(BufferedIOBase_detach_doc, + "Disconnect this buffer from its underlying raw stream and return it.\n" + "\n" + "After the raw stream has been detached, the buffer is in an unusable\n" + "state.\n"); + +static PyObject * +BufferedIOBase_detach(PyObject *self) +{ + return BufferedIOBase_unsupported("detach"); +} + PyDoc_STRVAR(BufferedIOBase_read_doc, "Read and return up to n bytes.\n" "\n" @@ -127,6 +139,7 @@ static PyMethodDef BufferedIOBase_methods[] = { + {"detach", (PyCFunction)BufferedIOBase_detach, METH_NOARGS, BufferedIOBase_detach_doc}, {"read", BufferedIOBase_read, METH_VARARGS, BufferedIOBase_read_doc}, {"read1", BufferedIOBase_read1, METH_VARARGS, BufferedIOBase_read1_doc}, {"readinto", BufferedIOBase_readinto, METH_VARARGS, NULL}, @@ -181,6 +194,7 @@ PyObject *raw; int ok; /* Initialized? */ + int detached; int readable; int writable; @@ -260,15 +274,25 @@ #define CHECK_INITIALIZED(self) \ if (self->ok <= 0) { \ - PyErr_SetString(PyExc_ValueError, \ - "I/O operation on uninitialized object"); \ + if (self->detached) { \ + PyErr_SetString(PyExc_ValueError, \ + "raw stream has been detached"); \ + } else { \ + PyErr_SetString(PyExc_ValueError, \ + "I/O operation on uninitialized object"); \ + } \ return NULL; \ } #define CHECK_INITIALIZED_INT(self) \ if (self->ok <= 0) { \ - PyErr_SetString(PyExc_ValueError, \ - "I/O operation on uninitialized object"); \ + if (self->detached) { \ + PyErr_SetString(PyExc_ValueError, \ + "raw stream has been detached"); \ + } else { \ + PyErr_SetString(PyExc_ValueError, \ + "I/O operation on uninitialized object"); \ + } \ return -1; \ } @@ -430,6 +454,24 @@ return res; } +/* detach */ + +static PyObject * +BufferedIOMixin_detach(BufferedObject *self, PyObject *args) +{ + PyObject *raw, *res; + CHECK_INITIALIZED(self) + res = PyObject_CallMethodObjArgs((PyObject *)self, _PyIO_str_flush, NULL); + if (res == NULL) + return NULL; + Py_DECREF(res); + raw = self->raw; + self->raw = NULL; + self->detached = 1; + self->ok = 0; + return raw; +} + /* Inquiries */ static PyObject * @@ -1101,6 +1143,7 @@ PyObject *raw; self->ok = 0; + self->detached = 0; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|n:BufferedReader", kwlist, &raw, &buffer_size)) { @@ -1387,6 +1430,7 @@ static PyMethodDef BufferedReader_methods[] = { /* BufferedIOMixin methods */ + {"detach", (PyCFunction)BufferedIOMixin_detach, METH_NOARGS}, {"flush", (PyCFunction)BufferedIOMixin_flush, METH_NOARGS}, {"close", (PyCFunction)BufferedIOMixin_close, METH_NOARGS}, {"seekable", (PyCFunction)BufferedIOMixin_seekable, METH_NOARGS}, @@ -1499,6 +1543,7 @@ PyObject *raw; self->ok = 0; + self->detached = 0; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|nn:BufferedReader", kwlist, &raw, &buffer_size, &max_buffer_size)) { @@ -1745,6 +1790,7 @@ static PyMethodDef BufferedWriter_methods[] = { /* BufferedIOMixin methods */ {"close", (PyCFunction)BufferedIOMixin_close, METH_NOARGS}, + {"detach", (PyCFunction)BufferedIOMixin_detach, METH_NOARGS}, {"seekable", (PyCFunction)BufferedIOMixin_seekable, METH_NOARGS}, {"readable", (PyCFunction)BufferedIOMixin_readable, METH_NOARGS}, {"writable", (PyCFunction)BufferedIOMixin_writable, METH_NOARGS}, @@ -2089,6 +2135,7 @@ PyObject *raw; self->ok = 0; + self->detached = 0; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|nn:BufferedReader", kwlist, &raw, &buffer_size, &max_buffer_size)) { @@ -2128,6 +2175,7 @@ static PyMethodDef BufferedRandom_methods[] = { /* BufferedIOMixin methods */ {"close", (PyCFunction)BufferedIOMixin_close, METH_NOARGS}, + {"detach", (PyCFunction)BufferedIOMixin_detach, METH_NOARGS}, {"seekable", (PyCFunction)BufferedIOMixin_seekable, METH_NOARGS}, {"readable", (PyCFunction)BufferedIOMixin_readable, METH_NOARGS}, {"writable", (PyCFunction)BufferedIOMixin_writable, METH_NOARGS}, Modified: python/branches/py3k/Modules/_io/textio.c ============================================================================== --- python/branches/py3k/Modules/_io/textio.c (original) +++ python/branches/py3k/Modules/_io/textio.c Fri May 1 22:40:59 2009 @@ -28,6 +28,19 @@ return NULL; } +PyDoc_STRVAR(TextIOBase_detach_doc, + "Separate the underlying buffer from the TextIOBase and return it.\n" + "\n" + "After the underlying buffer has been detached, the TextIO is in an\n" + "unusable state.\n" + ); + +static PyObject * +TextIOBase_detach(PyObject *self) +{ + return _unsupported("detach"); +} + PyDoc_STRVAR(TextIOBase_read_doc, "Read at most n characters from stream.\n" "\n" @@ -93,6 +106,7 @@ static PyMethodDef TextIOBase_methods[] = { + {"detach", (PyCFunction)TextIOBase_detach, METH_NOARGS, TextIOBase_detach_doc}, {"read", TextIOBase_read, METH_VARARGS, TextIOBase_read_doc}, {"readline", TextIOBase_readline, METH_VARARGS, TextIOBase_readline_doc}, {"write", TextIOBase_write, METH_VARARGS, TextIOBase_write_doc}, @@ -616,6 +630,7 @@ { PyObject_HEAD int ok; /* initialized? */ + int detached; Py_ssize_t chunk_size; PyObject *buffer; PyObject *encoding; @@ -759,6 +774,7 @@ int r; self->ok = 0; + self->detached = 0; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|zzzi:fileio", kwlist, &buffer, &encoding, &errors, &newline, &line_buffering)) @@ -1059,19 +1075,45 @@ #define CHECK_INITIALIZED(self) \ if (self->ok <= 0) { \ - PyErr_SetString(PyExc_ValueError, \ - "I/O operation on uninitialized object"); \ + if (self->detached) { \ + PyErr_SetString(PyExc_ValueError, \ + "underlying buffer has been detached"); \ + } else { \ + PyErr_SetString(PyExc_ValueError, \ + "I/O operation on uninitialized object"); \ + } \ return NULL; \ } #define CHECK_INITIALIZED_INT(self) \ if (self->ok <= 0) { \ - PyErr_SetString(PyExc_ValueError, \ - "I/O operation on uninitialized object"); \ + if (self->detached) { \ + PyErr_SetString(PyExc_ValueError, \ + "underlying buffer has been detached"); \ + } else { \ + PyErr_SetString(PyExc_ValueError, \ + "I/O operation on uninitialized object"); \ + } \ return -1; \ } +static PyObject * +TextIOWrapper_detach(PyTextIOWrapperObject *self) +{ + PyObject *buffer, *res; + CHECK_INITIALIZED(self); + res = PyObject_CallMethodObjArgs((PyObject *)self, _PyIO_str_flush, NULL); + if (res == NULL) + return NULL; + Py_DECREF(res); + buffer = self->buffer; + self->buffer = NULL; + self->detached = 1; + self->ok = 0; + return buffer; +} + Py_LOCAL_INLINE(const Py_UNICODE *) findchar(const Py_UNICODE *s, Py_ssize_t size, Py_UNICODE ch) { @@ -2341,6 +2383,7 @@ } static PyMethodDef TextIOWrapper_methods[] = { + {"detach", (PyCFunction)TextIOWrapper_detach, METH_NOARGS}, {"write", (PyCFunction)TextIOWrapper_write, METH_VARARGS}, {"read", (PyCFunction)TextIOWrapper_read, METH_VARARGS}, {"readline", (PyCFunction)TextIOWrapper_readline, METH_VARARGS}, From python-checkins at python.org Fri May 1 22:45:43 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 1 May 2009 22:45:43 +0200 (CEST) Subject: [Python-checkins] r72176 - in python/branches/py3k: Doc/library/io.rst Lib/io.py Message-ID: <20090501204543.75A851E4051@bag.python.org> Author: benjamin.peterson Date: Fri May 1 22:45:43 2009 New Revision: 72176 Log: add myself Modified: python/branches/py3k/Doc/library/io.rst python/branches/py3k/Lib/io.py Modified: python/branches/py3k/Doc/library/io.rst ============================================================================== --- python/branches/py3k/Doc/library/io.rst (original) +++ python/branches/py3k/Doc/library/io.rst Fri May 1 22:45:43 2009 @@ -8,6 +8,7 @@ .. moduleauthor:: Mark Russell .. moduleauthor:: Antoine Pitrou .. moduleauthor:: Amaury Forgeot d'Arc +.. moduleauthor:: Benjamin Peterson .. sectionauthor:: Benjamin Peterson The :mod:`io` module provides the Python interfaces to stream handling. The Modified: python/branches/py3k/Lib/io.py ============================================================================== --- python/branches/py3k/Lib/io.py (original) +++ python/branches/py3k/Lib/io.py Fri May 1 22:45:43 2009 @@ -47,7 +47,8 @@ "Mike Verdone , " "Mark Russell , " "Antoine Pitrou , " - "Amaury Forgeot d'Arc ") + "Amaury Forgeot d'Arc , " + "Benjamin Peterson ") __all__ = ["BlockingIOError", "open", "IOBase", "RawIOBase", "FileIO", "BytesIO", "StringIO", "BufferedIOBase", From python-checkins at python.org Fri May 1 22:48:14 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 1 May 2009 22:48:14 +0200 (CEST) Subject: [Python-checkins] r72177 - python/branches/py3k/Doc/library/io.rst Message-ID: <20090501204814.E27C41E4051@bag.python.org> Author: benjamin.peterson Date: Fri May 1 22:48:14 2009 New Revision: 72177 Log: versionadded Modified: python/branches/py3k/Doc/library/io.rst Modified: python/branches/py3k/Doc/library/io.rst ============================================================================== --- python/branches/py3k/Doc/library/io.rst (original) +++ python/branches/py3k/Doc/library/io.rst Fri May 1 22:48:14 2009 @@ -373,6 +373,8 @@ raw stream to return from this method. They raise :exc:`UnsupportedOperation`. + .. versionadded:: 3.1 + .. method:: read([n]) Read and return up to *n* bytes. If the argument is omitted, ``None``, or @@ -613,6 +615,8 @@ have the concept of an underlying buffer and calling this method will raise :exc:`UnsupportedOperation`. + .. versionadded:: 3.1 + .. method:: read(n) Read and return at most *n* characters from the stream as a single From python-checkins at python.org Fri May 1 22:55:36 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 1 May 2009 22:55:36 +0200 (CEST) Subject: [Python-checkins] r72178 - in python/trunk: Lib/shutil.py Lib/test/test_shutil.py Misc/NEWS Message-ID: <20090501205536.D6A1C1E4508@bag.python.org> Author: antoine.pitrou Date: Fri May 1 22:55:35 2009 New Revision: 72178 Log: Issue #3002: `shutil.copyfile()` and `shutil.copytree()` now raise an error when a named pipe is encountered, rather than blocking infinitely. Modified: python/trunk/Lib/shutil.py python/trunk/Lib/test/test_shutil.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/shutil.py ============================================================================== --- python/trunk/Lib/shutil.py (original) +++ python/trunk/Lib/shutil.py Fri May 1 22:55:35 2009 @@ -11,11 +11,15 @@ import fnmatch __all__ = ["copyfileobj","copyfile","copymode","copystat","copy","copy2", - "copytree","move","rmtree","Error"] + "copytree","move","rmtree","Error", "SpecialFileError"] class Error(EnvironmentError): pass +class SpecialFileError(EnvironmentError): + """Raised when trying to do a kind of operation (e.g. copying) which is + not supported on a special file (e.g. a named pipe)""" + try: WindowsError except NameError: @@ -48,6 +52,15 @@ fsrc = None fdst = None + for fn in [src, dst]: + try: + st = os.stat(fn) + except OSError: + # File most likely does not exist + pass + # XXX What about other special files? (sockets, devices...) + if stat.S_ISFIFO(st.st_mode): + raise SpecialFileError("`%s` is a named pipe" % fn) try: fsrc = open(src, 'rb') fdst = open(dst, 'wb') @@ -157,14 +170,14 @@ elif os.path.isdir(srcname): copytree(srcname, dstname, symlinks, ignore) else: + # Will raise a SpecialFileError for unsupported file types copy2(srcname, dstname) - # XXX What about devices, sockets etc.? - except (IOError, os.error), why: - errors.append((srcname, dstname, str(why))) # catch the Error from the recursive copytree so that we can # continue with other files except Error, err: errors.extend(err.args[0]) + except EnvironmentError, why: + errors.append((srcname, dstname, str(why))) try: copystat(src, dst) except OSError, why: Modified: python/trunk/Lib/test/test_shutil.py ============================================================================== --- python/trunk/Lib/test/test_shutil.py (original) +++ python/trunk/Lib/test/test_shutil.py Fri May 1 22:55:35 2009 @@ -9,6 +9,7 @@ import os.path from test import test_support from test.test_support import TESTFN +TESTFN2 = TESTFN + "2" class TestShutil(unittest.TestCase): def test_rmtree_errors(self): @@ -240,6 +241,38 @@ finally: shutil.rmtree(TESTFN, ignore_errors=True) + if hasattr(os, "mkfifo"): + # Issue #3002: copyfile and copytree block indefinitely on named pipes + def test_copyfile_named_pipe(self): + os.mkfifo(TESTFN) + try: + self.assertRaises(shutil.SpecialFileError, + shutil.copyfile, TESTFN, TESTFN2) + self.assertRaises(shutil.SpecialFileError, + shutil.copyfile, __file__, TESTFN) + finally: + os.remove(TESTFN) + + def test_copytree_named_pipe(self): + os.mkdir(TESTFN) + try: + subdir = os.path.join(TESTFN, "subdir") + os.mkdir(subdir) + pipe = os.path.join(subdir, "mypipe") + os.mkfifo(pipe) + try: + shutil.copytree(TESTFN, TESTFN2) + except shutil.Error as e: + errors = e.args[0] + self.assertEqual(len(errors), 1) + src, dst, error_msg = errors[0] + self.assertEqual("`%s` is a named pipe" % pipe, error_msg) + else: + self.fail("shutil.Error should have been raised") + finally: + shutil.rmtree(TESTFN, ignore_errors=True) + shutil.rmtree(TESTFN2, ignore_errors=True) + class TestMove(unittest.TestCase): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri May 1 22:55:35 2009 @@ -261,6 +261,9 @@ Library ------- +- Issue #3002: ``shutil.copyfile()`` and ``shutil.copytree()`` now raise an + error when a named pipe is encountered, rather than blocking infinitely. + - Issue #3959: The ipaddr module has been added to the standard library. Contributed by Google. From python-checkins at python.org Fri May 1 23:09:45 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 1 May 2009 23:09:45 +0200 (CEST) Subject: [Python-checkins] r72179 - in python/branches/py3k: Lib/shutil.py Lib/test/test_shutil.py Misc/NEWS Message-ID: <20090501210945.1B6BA1E405B@bag.python.org> Author: antoine.pitrou Date: Fri May 1 23:09:44 2009 New Revision: 72179 Log: Merged revisions 72178 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72178 | antoine.pitrou | 2009-05-01 22:55:35 +0200 (ven., 01 mai 2009) | 4 lines Issue #3002: `shutil.copyfile()` and `shutil.copytree()` now raise an error when a named pipe is encountered, rather than blocking infinitely. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/shutil.py python/branches/py3k/Lib/test/test_shutil.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/shutil.py ============================================================================== --- python/branches/py3k/Lib/shutil.py (original) +++ python/branches/py3k/Lib/shutil.py Fri May 1 23:09:44 2009 @@ -11,11 +11,15 @@ import fnmatch __all__ = ["copyfileobj","copyfile","copymode","copystat","copy","copy2", - "copytree","move","rmtree","Error"] + "copytree","move","rmtree","Error", "SpecialFileError"] class Error(EnvironmentError): pass +class SpecialFileError(EnvironmentError): + """Raised when trying to do a kind of operation (e.g. copying) which is + not supported on a special file (e.g. a named pipe)""" + try: WindowsError except NameError: @@ -48,6 +52,15 @@ fsrc = None fdst = None + for fn in [src, dst]: + try: + st = os.stat(fn) + except OSError: + # File most likely does not exist + pass + # XXX What about other special files? (sockets, devices...) + if stat.S_ISFIFO(st.st_mode): + raise SpecialFileError("`%s` is a named pipe" % fn) try: fsrc = open(src, 'rb') fdst = open(dst, 'wb') @@ -157,14 +170,14 @@ elif os.path.isdir(srcname): copytree(srcname, dstname, symlinks, ignore) else: + # Will raise a SpecialFileError for unsupported file types copy2(srcname, dstname) - # XXX What about devices, sockets etc.? - except (IOError, os.error) as why: - errors.append((srcname, dstname, str(why))) # catch the Error from the recursive copytree so that we can # continue with other files except Error as err: errors.extend(err.args[0]) + except EnvironmentError as why: + errors.append((srcname, dstname, str(why))) try: copystat(src, dst) except OSError as why: Modified: python/branches/py3k/Lib/test/test_shutil.py ============================================================================== --- python/branches/py3k/Lib/test/test_shutil.py (original) +++ python/branches/py3k/Lib/test/test_shutil.py Fri May 1 23:09:44 2009 @@ -9,6 +9,7 @@ import os.path from test import support from test.support import TESTFN +TESTFN2 = TESTFN + "2" class TestShutil(unittest.TestCase): def test_rmtree_errors(self): @@ -226,6 +227,38 @@ finally: shutil.rmtree(TESTFN, ignore_errors=True) + if hasattr(os, "mkfifo"): + # Issue #3002: copyfile and copytree block indefinitely on named pipes + def test_copyfile_named_pipe(self): + os.mkfifo(TESTFN) + try: + self.assertRaises(shutil.SpecialFileError, + shutil.copyfile, TESTFN, TESTFN2) + self.assertRaises(shutil.SpecialFileError, + shutil.copyfile, __file__, TESTFN) + finally: + os.remove(TESTFN) + + def test_copytree_named_pipe(self): + os.mkdir(TESTFN) + try: + subdir = os.path.join(TESTFN, "subdir") + os.mkdir(subdir) + pipe = os.path.join(subdir, "mypipe") + os.mkfifo(pipe) + try: + shutil.copytree(TESTFN, TESTFN2) + except shutil.Error as e: + errors = e.args[0] + self.assertEqual(len(errors), 1) + src, dst, error_msg = errors[0] + self.assertEqual("`%s` is a named pipe" % pipe, error_msg) + else: + self.fail("shutil.Error should have been raised") + finally: + shutil.rmtree(TESTFN, ignore_errors=True) + shutil.rmtree(TESTFN2, ignore_errors=True) + class TestMove(unittest.TestCase): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri May 1 23:09:44 2009 @@ -107,6 +107,9 @@ Library ------- +- Issue #3002: ``shutil.copyfile()`` and ``shutil.copytree()`` now raise an + error when a named pipe is encountered, rather than blocking infinitely. + - Issue #5857: tokenize.tokenize() now returns named tuples. - Issue #4305: ctypes should now build again on mipsel-linux-gnu From python-checkins at python.org Fri May 1 23:16:15 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 1 May 2009 23:16:15 +0200 (CEST) Subject: [Python-checkins] r72180 - in python/trunk: Misc/NEWS Modules/ld_so_aix Message-ID: <20090501211615.0CEED1E4051@bag.python.org> Author: antoine.pitrou Date: Fri May 1 23:16:14 2009 New Revision: 72180 Log: Issue #5726: Make Modules/ld_so_aix return the actual exit code of the linker, rather than always exit successfully. Patch by Floris Bruynooghe. Modified: python/trunk/Misc/NEWS python/trunk/Modules/ld_so_aix Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri May 1 23:16:14 2009 @@ -826,6 +826,9 @@ Build ----- +- Issue #5726: Make Modules/ld_so_aix return the actual exit code of the + linker, rather than always exit successfully. Patch by Floris Bruynooghe. + - Issue #4587: Add configure option --with-dbmliborder=db1:db2:... to specify the order that backends for the dbm extension are checked. Modified: python/trunk/Modules/ld_so_aix ============================================================================== --- python/trunk/Modules/ld_so_aix (original) +++ python/trunk/Modules/ld_so_aix Fri May 1 23:16:14 2009 @@ -181,7 +181,10 @@ # Perform the link. #echo $CC $CCOPT $CCARGS $CC $CCOPT $CCARGS +retval=$? # Delete the module's export list file. # Comment this line if you need it. rm -f $expfile + +exit $retval From python-checkins at python.org Fri May 1 23:18:27 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 1 May 2009 23:18:27 +0200 (CEST) Subject: [Python-checkins] r72181 - in python/branches/py3k: Misc/NEWS Modules/ld_so_aix Message-ID: <20090501211827.623821E4083@bag.python.org> Author: antoine.pitrou Date: Fri May 1 23:18:27 2009 New Revision: 72181 Log: Merged revisions 72180 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72180 | antoine.pitrou | 2009-05-01 23:16:14 +0200 (ven., 01 mai 2009) | 4 lines Issue #5726: Make Modules/ld_so_aix return the actual exit code of the linker, rather than always exit successfully. Patch by Floris Bruynooghe. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/ld_so_aix Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri May 1 23:18:27 2009 @@ -892,6 +892,9 @@ Build ----- +- Issue #5726: Make Modules/ld_so_aix return the actual exit code of the + linker, rather than always exit successfully. Patch by Floris Bruynooghe. + - Issue #4587: Add configure option --with-dbmliborder=db1:db2:... to specify the order that backends for the dbm extension are checked. Modified: python/branches/py3k/Modules/ld_so_aix ============================================================================== --- python/branches/py3k/Modules/ld_so_aix (original) +++ python/branches/py3k/Modules/ld_so_aix Fri May 1 23:18:27 2009 @@ -181,7 +181,10 @@ # Perform the link. #echo $CC $CCOPT $CCARGS $CC $CCOPT $CCARGS +retval=$? # Delete the module's export list file. # Comment this line if you need it. rm -f $expfile + +exit $retval From python-checkins at python.org Fri May 1 23:24:57 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 1 May 2009 23:24:57 +0200 (CEST) Subject: [Python-checkins] r72182 - in python/branches/release26-maint: Misc/NEWS Modules/ld_so_aix Message-ID: <20090501212457.4F6261E4083@bag.python.org> Author: antoine.pitrou Date: Fri May 1 23:24:56 2009 New Revision: 72182 Log: Merged revisions 72180 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72180 | antoine.pitrou | 2009-05-01 23:16:14 +0200 (ven., 01 mai 2009) | 4 lines Issue #5726: Make Modules/ld_so_aix return the actual exit code of the linker, rather than always exit successfully. Patch by Floris Bruynooghe. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/ld_so_aix Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Fri May 1 23:24:56 2009 @@ -49,6 +49,12 @@ makeunicodedata.py and regenerated the Unicode database (This fixes u'\u1d79'.lower() == '\x00'). +Build +----- + +- Issue #5726: Make Modules/ld_so_aix return the actual exit code of the + linker, rather than always exit successfully. Patch by Floris Bruynooghe. + Tests ----- Modified: python/branches/release26-maint/Modules/ld_so_aix ============================================================================== --- python/branches/release26-maint/Modules/ld_so_aix (original) +++ python/branches/release26-maint/Modules/ld_so_aix Fri May 1 23:24:56 2009 @@ -181,7 +181,10 @@ # Perform the link. #echo $CC $CCOPT $CCARGS $CC $CCOPT $CCARGS +retval=$? # Delete the module's export list file. # Comment this line if you need it. rm -f $expfile + +exit $retval From python-checkins at python.org Fri May 1 23:28:35 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 1 May 2009 23:28:35 +0200 (CEST) Subject: [Python-checkins] r72183 - in python/trunk/Doc/library: internet.rst ipaddr.rst Message-ID: <20090501212835.A7BF31E40B9@bag.python.org> Author: georg.brandl Date: Fri May 1 23:28:35 2009 New Revision: 72183 Log: Review ipaddr docs and add them in the TOC under "Internet protocols". Modified: python/trunk/Doc/library/internet.rst python/trunk/Doc/library/ipaddr.rst Modified: python/trunk/Doc/library/internet.rst ============================================================================== --- python/trunk/Doc/library/internet.rst (original) +++ python/trunk/Doc/library/internet.rst Fri May 1 23:28:35 2009 @@ -35,6 +35,7 @@ smtpd.rst telnetlib.rst uuid.rst + ipaddr.rst urlparse.rst socketserver.rst basehttpserver.rst Modified: python/trunk/Doc/library/ipaddr.rst ============================================================================== --- python/trunk/Doc/library/ipaddr.rst (original) +++ python/trunk/Doc/library/ipaddr.rst Fri May 1 23:28:35 2009 @@ -1,4 +1,3 @@ - :mod:`ipaddr` --- IP address manipulation library ================================================= @@ -19,125 +18,125 @@ .. function:: IP(ipaddr) - Take an IP string or int and return an object of the correct type. - Returns an :class:`IPv4` or :class:`IPv6` object. + Take an IP string or int and return an object of the correct type. Returns + an :class:`IPv4` or :class:`IPv6` object. - The ``ipaddr`` parameter must be a string or integer representing the IP - address. Either IPv4 or IPv6 addresses may be supplied. Integers less - than 2**32 will be considered to be IPv4. + The *ipaddr* parameter must be a string or integer representing the IP + address. Either IPv4 or IPv6 addresses may be supplied. Integers less than + 2**32 will be considered to be IPv4. - Raises :exc:`ValueError` if the ipaddr passed is not either an IPv4 or an + Raises :exc:`ValueError` if the *ipaddr* passed is not either an IPv4 or an IPv6 address. .. function:: collapse_address_list(addresses) - Collapses a sequence of :class:`IPv4` or :class:`IPv6` objects into - the most concise representation. Returns a list of :class:`IPv4` - or :class:`IPv6` objects. + Collapse a sequence of :class:`IPv4` or :class:`IPv6` objects into the most + concise representation. Returns a list of :class:`IPv4` or :class:`IPv6` + objects. -Example usage:: + Example usage:: - >>> collapse_address_list([IPv4('1.1.0.0/24'), IPv4('1.1.1.0/24')]) - [IPv4('1.1.0.0/23')] + >>> collapse_address_list([IPv4('1.1.0.0/24'), IPv4('1.1.1.0/24')]) + [IPv4('1.1.0.0/23')] .. class:: BaseIP() A generic IP address object. This base class defines the API and contains common code. Most authors should either use the :func:`IP` function or - create :class:`IPv4` or :class:`IPv6` objects directly rather than using - this base class. - + create :class:`IPv4` or :class:`IPv6` objects directly rather than using this + base class. IP address objects support the following python operators: ``=``, ``!=``, ``<``, ``>``, ``<=``, ``>=``, and ``in``. - An IP address object may be used as a sequence index or as a hash key - and can be converted back to an integer representation using ``int()``. - It may also be used as a sequence that yeilds the string - representation of every IP address within the object's subnet. - + An IP address object may be used as a sequence index or as a hash key and can + be converted back to an integer representation using :func:`int`. It may + also be used as a sequence that yields the string representation of every IP + address within the object's subnet. The following properties are available on all IP address objects: - .. data:: broadcast + .. attr:: broadcast Integer representation of the broadcast address. Read only. - .. data:: broadcast_ext + .. attr:: broadcast_ext - Dotted decimal or colon string version of the broadcast address. Read only. + Dotted decimal or colon string version of the broadcast address. Read + only. - .. data:: hostmask + .. attr:: hostmask Integer representation of the hostmask. Read only. - .. data:: hostmask_ext + .. attr:: hostmask_ext Dotted decimal or colon string version of the hostmask. Read only. - .. data:: ip + .. attr:: ip Integer representation of the IP address. Read only. - .. data:: ip_ext + .. attr:: ip_ext Dotted decimal or colon string version of the IP address. Read only. - .. data:: ip_ext_full + .. attr:: ip_ext_full Canonical string version of the IP address. Read only. - .. data:: is_loopback + .. attr:: is_loopback True if the address is a loopback address as defined in IPv4 :rfc:`3330` or IPv6 :rfc:`2373` section 2.5.3. - .. data:: is_link_local + .. attr:: is_link_local True if the address is a link-local address as defined in IPv4 :rfc:`3927` or IPv6 :rfc:`4291`. - .. data:: is_multicast + .. attr:: is_multicast - True if the address is reserved for multicast use. - See IPv4 :rfc:`3171` or IPv6 :rfc:`2373` section 2.7 for details. + True if the address is reserved for multicast use. See IPv4 :rfc:`3171` + or IPv6 :rfc:`2373` section 2.7 for details. - .. data:: is_private + .. attr:: is_private - True if the address is reserved for private networks as defined in - IPv4 :rfc:`1918` or IPv6 :rfc:`4193`. + True if the address is reserved for private networks as defined in IPv4 + :rfc:`1918` or IPv6 :rfc:`4193`. - .. data:: netmask + .. attr:: netmask Integer representation of the netmask. Read only. - .. data:: netmask_ext + .. attr:: netmask_ext Dotted decimal or colon string version of the netmask. Read only. - .. data:: network + .. attr:: network Integer representation of the network. Read only. - .. data:: network_ext + .. attr:: network_ext Dotted decimal or colon string version of the network. Read only. - .. data:: numhosts + .. attr:: numhosts Number of hosts in the current subnet. Read only. - .. data:: packed + .. attr:: packed - The packed network byte order representation of this network address. Read only. + The packed network byte order representation of this network address. + Read only. - .. data:: prefixlen + .. attr:: prefixlen A property to get and set the prefix length. Readable and writeable. - .. data:: version + .. attr:: version Integer IP version number. Read only. @@ -146,23 +145,23 @@ .. method:: address_exclude(other) - Remove an address from within a larger block. - Returns a sorted list of IP address objects representing networks. + Remove an address from within a larger block. Returns a sorted list of IP + address objects representing networks. - Examples:: + Examples:: - >>> addr1 = IP('10.1.1.0/24') - >>> addr2 = IP('10.1.1.0/26') - >>> addr1.address_exclude(addr2) - [IP('10.1.1.64/26'), IP('10.1.1.128/25')] - - >>> addr1 = IP('::1/32') - >>> addr2 = IP('::1/128') - >>> addr1.address_exclude(addr2) - [IP('::0/128'), IP('::2/127'), IP('::4/126'), IP('::8/125'), - ... IP('0:0:8000::/33')] + >>> addr1 = IP('10.1.1.0/24') + >>> addr2 = IP('10.1.1.0/26') + >>> addr1.address_exclude(addr2) + [IP('10.1.1.64/26'), IP('10.1.1.128/25')] + + >>> addr1 = IP('::1/32') + >>> addr2 = IP('::1/128') + >>> addr1.address_exclude(addr2) + [IP('::0/128'), IP('::2/127'), IP('::4/126'), IP('::8/125'), + ... IP('0:0:8000::/33')] - Raises :exc:`ValueError` if `other` is not completely contained by self. + Raises :exc:`ValueError` if *other* is not completely contained by *self*. .. method:: compare_networks(other) @@ -170,9 +169,9 @@ Compare this IP object's network to another IP network. Returns -1, 0 or 1. - This compares the integer representation of the network addresses. - The host bits are not considered by this method. - If you want to compare host bits, you can use ``host_a.ip < host_b.ip``. + This compares the integer representation of the network addresses. The + host bits are not considered by this method. If you want to compare host + bits, you can use ``host_a.ip < host_b.ip``. If the IP versions of self and other are the same, returns: @@ -204,14 +203,14 @@ Returns a list of subnets which when joined make up the current subnet. - The optional ``prefixlen_diff`` argument specifies how many bits the prefix - length should be increased by. Given a /24 network and prefixlen_diff=3, - for example, 8 subnets of size /27 will be returned. + The optional *prefixlen_diff* argument specifies how many bits the prefix + length should be increased by. Given a /24 network and + ``prefixlen_diff=3``, for example, 8 subnets of size /27 will be returned. If called on a host IP address rather than a network, a list containing the host itself will be returned. - Raises :exc:`PrefixlenDiffInvalidError` if the prefixlen_diff is out of + Raises :exc:`PrefixlenDiffInvalidError` if the *prefixlen_diff* is out of range. @@ -220,9 +219,10 @@ Returns a single IP object representing the supernet containing the current network. - The optional ``prefixlen_diff`` argument specifies how many bits the prefix - length should be decreased by. Given a /24 network and prefixlen_diff=3, - for example, a supernet with a 21 bit netmask is returned. + The optional *prefixlen_diff* argument specifies how many bits the prefix + length should be decreased by. Given a /24 network and + ``prefixlen_diff=3``, for example, a supernet with a 21 bit netmask is + returned. Raises :exc:`PrefixlenDiffInvalidError` if the prefixlen_diff is out of range. @@ -269,9 +269,10 @@ .netmask_ext: 64 .prefixlen: 64 - .. data:: is_site_local + .. attr:: is_site_local - True if the address was reserved as site-local in :rfc:`3513` section 2.5.6. + True if the address was reserved as site-local in :rfc:`3513` section + 2.5.6. .. note:: @@ -279,9 +280,10 @@ Use :data:`is_private` to test if this address is in the space of unique local addresses as defined by :rfc:`4193`. - .. data:: is_unspecified + .. attr:: is_unspecified - True if this is the unspecified address as defined in :rfc:`2373` section 2.5.2. + True if this is the unspecified address as defined in :rfc:`2373` section + 2.5.2. The following exceptions are defined by this module: @@ -316,12 +318,12 @@ .. exception:: PrefixlenDiffInvalidError - Raised when :meth:`BaseIP.subnet` or :meth:`BaseIP.supernet` is called with a bad - ``prefixlen_diff``. + Raised when :meth:`BaseIP.subnet` or :meth:`BaseIP.supernet` is called with a + bad ``prefixlen_diff``. .. seealso:: http://code.google.com/p/ipaddr-py/ - The original source of this module and a place to download it as - a package for use on earlier versions of Python. + The original source of this module and a place to download it as a package + for use on earlier versions of Python. From python-checkins at python.org Fri May 1 23:30:25 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 1 May 2009 23:30:25 +0200 (CEST) Subject: [Python-checkins] r72184 - python/trunk/Doc/library/ipaddr.rst Message-ID: <20090501213025.EC8361E405B@bag.python.org> Author: georg.brandl Date: Fri May 1 23:30:25 2009 New Revision: 72184 Log: Fix directive name. Modified: python/trunk/Doc/library/ipaddr.rst Modified: python/trunk/Doc/library/ipaddr.rst ============================================================================== --- python/trunk/Doc/library/ipaddr.rst (original) +++ python/trunk/Doc/library/ipaddr.rst Fri May 1 23:30:25 2009 @@ -58,85 +58,85 @@ The following properties are available on all IP address objects: - .. attr:: broadcast + .. attribute:: broadcast Integer representation of the broadcast address. Read only. - .. attr:: broadcast_ext + .. attribute:: broadcast_ext Dotted decimal or colon string version of the broadcast address. Read only. - .. attr:: hostmask + .. attribute:: hostmask Integer representation of the hostmask. Read only. - .. attr:: hostmask_ext + .. attribute:: hostmask_ext Dotted decimal or colon string version of the hostmask. Read only. - .. attr:: ip + .. attribute:: ip Integer representation of the IP address. Read only. - .. attr:: ip_ext + .. attribute:: ip_ext Dotted decimal or colon string version of the IP address. Read only. - .. attr:: ip_ext_full + .. attribute:: ip_ext_full Canonical string version of the IP address. Read only. - .. attr:: is_loopback + .. attribute:: is_loopback True if the address is a loopback address as defined in IPv4 :rfc:`3330` or IPv6 :rfc:`2373` section 2.5.3. - .. attr:: is_link_local + .. attribute:: is_link_local True if the address is a link-local address as defined in IPv4 :rfc:`3927` or IPv6 :rfc:`4291`. - .. attr:: is_multicast + .. attribute:: is_multicast True if the address is reserved for multicast use. See IPv4 :rfc:`3171` or IPv6 :rfc:`2373` section 2.7 for details. - .. attr:: is_private + .. attribute:: is_private True if the address is reserved for private networks as defined in IPv4 :rfc:`1918` or IPv6 :rfc:`4193`. - .. attr:: netmask + .. attribute:: netmask Integer representation of the netmask. Read only. - .. attr:: netmask_ext + .. attribute:: netmask_ext Dotted decimal or colon string version of the netmask. Read only. - .. attr:: network + .. attribute:: network Integer representation of the network. Read only. - .. attr:: network_ext + .. attribute:: network_ext Dotted decimal or colon string version of the network. Read only. - .. attr:: numhosts + .. attribute:: numhosts Number of hosts in the current subnet. Read only. - .. attr:: packed + .. attribute:: packed The packed network byte order representation of this network address. Read only. - .. attr:: prefixlen + .. attribute:: prefixlen A property to get and set the prefix length. Readable and writeable. - .. attr:: version + .. attribute:: version Integer IP version number. Read only. @@ -269,7 +269,7 @@ .netmask_ext: 64 .prefixlen: 64 - .. attr:: is_site_local + .. attribute:: is_site_local True if the address was reserved as site-local in :rfc:`3513` section 2.5.6. @@ -280,7 +280,7 @@ Use :data:`is_private` to test if this address is in the space of unique local addresses as defined by :rfc:`4193`. - .. attr:: is_unspecified + .. attribute:: is_unspecified True if this is the unspecified address as defined in :rfc:`2373` section 2.5.2. From python-checkins at python.org Fri May 1 23:42:23 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 1 May 2009 23:42:23 +0200 (CEST) Subject: [Python-checkins] r72185 - python/branches/py3k/PC/msvcrtmodule.c Message-ID: <20090501214223.58B5D1E4051@bag.python.org> Author: benjamin.peterson Date: Fri May 1 23:42:23 2009 New Revision: 72185 Log: use C character code to simplify #5410 Modified: python/branches/py3k/PC/msvcrtmodule.c Modified: python/branches/py3k/PC/msvcrtmodule.c ============================================================================== --- python/branches/py3k/PC/msvcrtmodule.c (original) +++ python/branches/py3k/PC/msvcrtmodule.c Fri May 1 23:42:23 2009 @@ -220,18 +220,12 @@ static PyObject * msvcrt_putwch(PyObject *self, PyObject *args) { - Py_UNICODE *ch; - int size; + int ch; - if (!PyArg_ParseTuple(args, "u#:putwch", &ch, &size)) + if (!PyArg_ParseTuple(args, "C:putwch", &ch)) return NULL; - if (size == 0) { - PyErr_SetString(PyExc_ValueError, - "Expected unicode string of length 1"); - return NULL; - } - _putwch(*ch); + _putwch(ch); Py_RETURN_NONE; } @@ -255,12 +249,12 @@ static PyObject * msvcrt_ungetwch(PyObject *self, PyObject *args) { - Py_UNICODE ch; + int ch; - if (!PyArg_ParseTuple(args, "u:ungetwch", &ch)) + if (!PyArg_ParseTuple(args, "C:ungetwch", &ch)) return NULL; - if (_ungetch(ch) == EOF) + if (_ungetwch(ch) == WEOF) return PyErr_SetFromErrno(PyExc_IOError); Py_INCREF(Py_None); return Py_None; From buildbot at python.org Fri May 1 23:55:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 May 2009 21:55:05 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.0 Message-ID: <20090501215505.808571E4051@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.0/builds/282 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: walter.doerwald BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_doctest make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri May 1 23:55:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 01 May 2009 21:55:57 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090501215557.A67291E4666@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1222 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_time ====================================================================== FAIL: test_tzset (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_time.py", line 161, in test_tzset self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) AssertionError: time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) == time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat May 2 00:13:49 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sat, 2 May 2009 00:13:49 +0200 (CEST) Subject: [Python-checkins] r72186 - in python/branches/py3k: Doc/library/ipaddr.rst Lib/ipaddr.py Lib/test/test_ipaddr.py Misc/NEWS Message-ID: <20090501221349.081331E4051@bag.python.org> Author: gregory.p.smith Date: Sat May 2 00:13:48 2009 New Revision: 72186 Log: Merged revisions 72173 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72173 | gregory.p.smith | 2009-05-01 12:59:52 -0700 (Fri, 01 May 2009) | 5 lines Adds the ipaddr module to the standard library. Issue #3959. Based off of subversion r69 from http://code.google.com/p/ipaddr-py/ This code is 2to3 safe, I'll merge it into py3k later this afternoon. ........ Added: python/branches/py3k/Doc/library/ipaddr.rst - copied unchanged from r72173, /python/trunk/Doc/library/ipaddr.rst python/branches/py3k/Lib/ipaddr.py - copied, changed from r72173, /python/trunk/Lib/ipaddr.py python/branches/py3k/Lib/test/test_ipaddr.py - copied unchanged from r72173, /python/trunk/Lib/test/test_ipaddr.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS Copied: python/branches/py3k/Lib/ipaddr.py (from r72173, /python/trunk/Lib/ipaddr.py) ============================================================================== --- /python/trunk/Lib/ipaddr.py (original) +++ python/branches/py3k/Lib/ipaddr.py Sat May 2 00:13:48 2009 @@ -583,7 +583,7 @@ self._version = 4 # Efficient constructor from integer. - if isinstance(ipaddr, int) or isinstance(ipaddr, long): + if isinstance(ipaddr, int) or isinstance(ipaddr, int): self.ip = ipaddr self._prefixlen = 32 self.netmask = self._ALL_ONES @@ -815,7 +815,7 @@ """ octets = [] - for _ in xrange(4): + for _ in range(4): octets.insert(0, str(ip_int & 0xFF)) ip_int >>= 8 return '.'.join(octets) @@ -922,7 +922,7 @@ self._version = 6 # Efficient constructor from integer. - if isinstance(ipaddr, long) or isinstance(ipaddr, int): + if isinstance(ipaddr, int) or isinstance(ipaddr, int): self.ip = ipaddr self._prefixlen = 128 self.netmask = self._ALL_ONES @@ -1157,7 +1157,7 @@ sep = len(hextet[0].split(':')) + len(hextet[1].split(':')) new_ip = hextet[0].split(':') - for _ in xrange(8 - sep): + for _ in range(8 - sep): new_ip.append('0000') new_ip += hextet[1].split(':') @@ -1266,7 +1266,7 @@ ipv4_string = fields.pop() ipv4_int = IPv4(ipv4_string).ip octets = [] - for _ in xrange(2): + for _ in range(2): octets.append(hex(ipv4_int & 0xFFFF).lstrip('0x').rstrip('L')) ipv4_int >>= 16 fields.extend(reversed(octets)) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 2 00:13:48 2009 @@ -107,6 +107,9 @@ Library ------- +- Issue #3959: The ipaddr module has been added to the standard library. + Contributed by Google. + - Issue #3002: ``shutil.copyfile()`` and ``shutil.copytree()`` now raise an error when a named pipe is encountered, rather than blocking infinitely. From nnorwitz at gmail.com Sat May 2 00:44:11 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 1 May 2009 18:44:11 -0400 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090501224411.GA1583@python.psfb.org> rm -rf build/* rm -rf tools/sphinx Checking out Sphinx... svn: PROPFIND request failed on '/projects/external/Sphinx-0.6.1/sphinx' svn: PROPFIND of '/projects/external/Sphinx-0.6.1/sphinx': Could not read status line: Connection reset by peer (http://svn.python.org) make: *** [checkout] Error 1 From nnorwitz at gmail.com Sat May 2 02:40:09 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 1 May 2009 20:40:09 -0400 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090502004009.GA2042@python.psfb.org> rm -rf build/* rm -rf tools/sphinx Checking out Sphinx... svn: REPORT request failed on '/projects/!svn/vcc/default' svn: Can't find a temporary directory: Internal error make: *** [checkout] Error 1 From nnorwitz at gmail.com Sat May 2 07:20:10 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 2 May 2009 01:20:10 -0400 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090502052010.GA2993@python.psfb.org> rm -rf build/* rm -rf tools/sphinx Checking out Sphinx... svn: REPORT request failed on '/projects/!svn/vcc/default' svn: Can't find a temporary directory: Internal error make: *** [checkout] Error 1 From nnorwitz at gmail.com Sat May 2 07:20:10 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 2 May 2009 01:20:10 -0400 Subject: [Python-checkins] Python Regression Test Failures doc dist (1) Message-ID: <20090502052010.GA3037@python.psfb.org> rm -rf dist mkdir -p dist # archive the HTML make html make[1]: Entering directory `/home/neal/python/r26/Doc' mkdir -p build/html build/doctrees python tools/sphinx-build.py -b html -d build/doctrees -D latex_paper_size= . build/html Traceback (most recent call last): File "tools/sphinx-build.py", line 23, in from sphinx import main ImportError: No module named sphinx make[1]: *** [build] Error 1 make[1]: Leaving directory `/home/neal/python/r26/Doc' make: *** [dist] Error 2 From python-checkins at python.org Sat May 2 08:15:19 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sat, 2 May 2009 08:15:19 +0200 (CEST) Subject: [Python-checkins] r72187 - in python/branches/py3k: Doc/library/internet.rst Doc/library/ipaddr.rst Message-ID: <20090502061519.78D8E1E4010@bag.python.org> Author: gregory.p.smith Date: Sat May 2 08:15:18 2009 New Revision: 72187 Log: Merged revisions 72183-72184 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72183 | georg.brandl | 2009-05-01 14:28:35 -0700 (Fri, 01 May 2009) | 2 lines Review ipaddr docs and add them in the TOC under "Internet protocols". ........ r72184 | georg.brandl | 2009-05-01 14:30:25 -0700 (Fri, 01 May 2009) | 1 line Fix directive name. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/internet.rst python/branches/py3k/Doc/library/ipaddr.rst Modified: python/branches/py3k/Doc/library/internet.rst ============================================================================== --- python/branches/py3k/Doc/library/internet.rst (original) +++ python/branches/py3k/Doc/library/internet.rst Sat May 2 08:15:18 2009 @@ -37,6 +37,7 @@ smtpd.rst telnetlib.rst uuid.rst + ipaddr.rst socketserver.rst http.server.rst http.cookies.rst Modified: python/branches/py3k/Doc/library/ipaddr.rst ============================================================================== --- python/branches/py3k/Doc/library/ipaddr.rst (original) +++ python/branches/py3k/Doc/library/ipaddr.rst Sat May 2 08:15:18 2009 @@ -1,4 +1,3 @@ - :mod:`ipaddr` --- IP address manipulation library ================================================= @@ -19,125 +18,125 @@ .. function:: IP(ipaddr) - Take an IP string or int and return an object of the correct type. - Returns an :class:`IPv4` or :class:`IPv6` object. + Take an IP string or int and return an object of the correct type. Returns + an :class:`IPv4` or :class:`IPv6` object. - The ``ipaddr`` parameter must be a string or integer representing the IP - address. Either IPv4 or IPv6 addresses may be supplied. Integers less - than 2**32 will be considered to be IPv4. + The *ipaddr* parameter must be a string or integer representing the IP + address. Either IPv4 or IPv6 addresses may be supplied. Integers less than + 2**32 will be considered to be IPv4. - Raises :exc:`ValueError` if the ipaddr passed is not either an IPv4 or an + Raises :exc:`ValueError` if the *ipaddr* passed is not either an IPv4 or an IPv6 address. .. function:: collapse_address_list(addresses) - Collapses a sequence of :class:`IPv4` or :class:`IPv6` objects into - the most concise representation. Returns a list of :class:`IPv4` - or :class:`IPv6` objects. + Collapse a sequence of :class:`IPv4` or :class:`IPv6` objects into the most + concise representation. Returns a list of :class:`IPv4` or :class:`IPv6` + objects. -Example usage:: + Example usage:: - >>> collapse_address_list([IPv4('1.1.0.0/24'), IPv4('1.1.1.0/24')]) - [IPv4('1.1.0.0/23')] + >>> collapse_address_list([IPv4('1.1.0.0/24'), IPv4('1.1.1.0/24')]) + [IPv4('1.1.0.0/23')] .. class:: BaseIP() A generic IP address object. This base class defines the API and contains common code. Most authors should either use the :func:`IP` function or - create :class:`IPv4` or :class:`IPv6` objects directly rather than using - this base class. - + create :class:`IPv4` or :class:`IPv6` objects directly rather than using this + base class. IP address objects support the following python operators: ``=``, ``!=``, ``<``, ``>``, ``<=``, ``>=``, and ``in``. - An IP address object may be used as a sequence index or as a hash key - and can be converted back to an integer representation using ``int()``. - It may also be used as a sequence that yeilds the string - representation of every IP address within the object's subnet. - + An IP address object may be used as a sequence index or as a hash key and can + be converted back to an integer representation using :func:`int`. It may + also be used as a sequence that yields the string representation of every IP + address within the object's subnet. The following properties are available on all IP address objects: - .. data:: broadcast + .. attribute:: broadcast Integer representation of the broadcast address. Read only. - .. data:: broadcast_ext + .. attribute:: broadcast_ext - Dotted decimal or colon string version of the broadcast address. Read only. + Dotted decimal or colon string version of the broadcast address. Read + only. - .. data:: hostmask + .. attribute:: hostmask Integer representation of the hostmask. Read only. - .. data:: hostmask_ext + .. attribute:: hostmask_ext Dotted decimal or colon string version of the hostmask. Read only. - .. data:: ip + .. attribute:: ip Integer representation of the IP address. Read only. - .. data:: ip_ext + .. attribute:: ip_ext Dotted decimal or colon string version of the IP address. Read only. - .. data:: ip_ext_full + .. attribute:: ip_ext_full Canonical string version of the IP address. Read only. - .. data:: is_loopback + .. attribute:: is_loopback True if the address is a loopback address as defined in IPv4 :rfc:`3330` or IPv6 :rfc:`2373` section 2.5.3. - .. data:: is_link_local + .. attribute:: is_link_local True if the address is a link-local address as defined in IPv4 :rfc:`3927` or IPv6 :rfc:`4291`. - .. data:: is_multicast + .. attribute:: is_multicast - True if the address is reserved for multicast use. - See IPv4 :rfc:`3171` or IPv6 :rfc:`2373` section 2.7 for details. + True if the address is reserved for multicast use. See IPv4 :rfc:`3171` + or IPv6 :rfc:`2373` section 2.7 for details. - .. data:: is_private + .. attribute:: is_private - True if the address is reserved for private networks as defined in - IPv4 :rfc:`1918` or IPv6 :rfc:`4193`. + True if the address is reserved for private networks as defined in IPv4 + :rfc:`1918` or IPv6 :rfc:`4193`. - .. data:: netmask + .. attribute:: netmask Integer representation of the netmask. Read only. - .. data:: netmask_ext + .. attribute:: netmask_ext Dotted decimal or colon string version of the netmask. Read only. - .. data:: network + .. attribute:: network Integer representation of the network. Read only. - .. data:: network_ext + .. attribute:: network_ext Dotted decimal or colon string version of the network. Read only. - .. data:: numhosts + .. attribute:: numhosts Number of hosts in the current subnet. Read only. - .. data:: packed + .. attribute:: packed - The packed network byte order representation of this network address. Read only. + The packed network byte order representation of this network address. + Read only. - .. data:: prefixlen + .. attribute:: prefixlen A property to get and set the prefix length. Readable and writeable. - .. data:: version + .. attribute:: version Integer IP version number. Read only. @@ -146,23 +145,23 @@ .. method:: address_exclude(other) - Remove an address from within a larger block. - Returns a sorted list of IP address objects representing networks. + Remove an address from within a larger block. Returns a sorted list of IP + address objects representing networks. - Examples:: + Examples:: - >>> addr1 = IP('10.1.1.0/24') - >>> addr2 = IP('10.1.1.0/26') - >>> addr1.address_exclude(addr2) - [IP('10.1.1.64/26'), IP('10.1.1.128/25')] - - >>> addr1 = IP('::1/32') - >>> addr2 = IP('::1/128') - >>> addr1.address_exclude(addr2) - [IP('::0/128'), IP('::2/127'), IP('::4/126'), IP('::8/125'), - ... IP('0:0:8000::/33')] + >>> addr1 = IP('10.1.1.0/24') + >>> addr2 = IP('10.1.1.0/26') + >>> addr1.address_exclude(addr2) + [IP('10.1.1.64/26'), IP('10.1.1.128/25')] + + >>> addr1 = IP('::1/32') + >>> addr2 = IP('::1/128') + >>> addr1.address_exclude(addr2) + [IP('::0/128'), IP('::2/127'), IP('::4/126'), IP('::8/125'), + ... IP('0:0:8000::/33')] - Raises :exc:`ValueError` if `other` is not completely contained by self. + Raises :exc:`ValueError` if *other* is not completely contained by *self*. .. method:: compare_networks(other) @@ -170,9 +169,9 @@ Compare this IP object's network to another IP network. Returns -1, 0 or 1. - This compares the integer representation of the network addresses. - The host bits are not considered by this method. - If you want to compare host bits, you can use ``host_a.ip < host_b.ip``. + This compares the integer representation of the network addresses. The + host bits are not considered by this method. If you want to compare host + bits, you can use ``host_a.ip < host_b.ip``. If the IP versions of self and other are the same, returns: @@ -204,14 +203,14 @@ Returns a list of subnets which when joined make up the current subnet. - The optional ``prefixlen_diff`` argument specifies how many bits the prefix - length should be increased by. Given a /24 network and prefixlen_diff=3, - for example, 8 subnets of size /27 will be returned. + The optional *prefixlen_diff* argument specifies how many bits the prefix + length should be increased by. Given a /24 network and + ``prefixlen_diff=3``, for example, 8 subnets of size /27 will be returned. If called on a host IP address rather than a network, a list containing the host itself will be returned. - Raises :exc:`PrefixlenDiffInvalidError` if the prefixlen_diff is out of + Raises :exc:`PrefixlenDiffInvalidError` if the *prefixlen_diff* is out of range. @@ -220,9 +219,10 @@ Returns a single IP object representing the supernet containing the current network. - The optional ``prefixlen_diff`` argument specifies how many bits the prefix - length should be decreased by. Given a /24 network and prefixlen_diff=3, - for example, a supernet with a 21 bit netmask is returned. + The optional *prefixlen_diff* argument specifies how many bits the prefix + length should be decreased by. Given a /24 network and + ``prefixlen_diff=3``, for example, a supernet with a 21 bit netmask is + returned. Raises :exc:`PrefixlenDiffInvalidError` if the prefixlen_diff is out of range. @@ -269,9 +269,10 @@ .netmask_ext: 64 .prefixlen: 64 - .. data:: is_site_local + .. attribute:: is_site_local - True if the address was reserved as site-local in :rfc:`3513` section 2.5.6. + True if the address was reserved as site-local in :rfc:`3513` section + 2.5.6. .. note:: @@ -279,9 +280,10 @@ Use :data:`is_private` to test if this address is in the space of unique local addresses as defined by :rfc:`4193`. - .. data:: is_unspecified + .. attribute:: is_unspecified - True if this is the unspecified address as defined in :rfc:`2373` section 2.5.2. + True if this is the unspecified address as defined in :rfc:`2373` section + 2.5.2. The following exceptions are defined by this module: @@ -316,12 +318,12 @@ .. exception:: PrefixlenDiffInvalidError - Raised when :meth:`BaseIP.subnet` or :meth:`BaseIP.supernet` is called with a bad - ``prefixlen_diff``. + Raised when :meth:`BaseIP.subnet` or :meth:`BaseIP.supernet` is called with a + bad ``prefixlen_diff``. .. seealso:: http://code.google.com/p/ipaddr-py/ - The original source of this module and a place to download it as - a package for use on earlier versions of Python. + The original source of this module and a place to download it as a package + for use on earlier versions of Python. From nnorwitz at gmail.com Sat May 2 11:26:15 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 2 May 2009 05:26:15 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090502092615.GA25403@python.psfb.org> More important issues: ---------------------- test_softspace leaked [0, -69, 0] references, sum=-69 Less important issues: ---------------------- test_cmd_line leaked [-25, 0, 50] references, sum=25 test_smtplib leaked [0, 0, 88] references, sum=88 test_socketserver leaked [0, 0, 69] references, sum=69 test_sys leaked [-42, 42, -42] references, sum=-42 test_threading leaked [48, 46, 50] references, sum=144 test_urllib2_localnet leaked [272, -266, 3] references, sum=9 From python-checkins at python.org Sat May 2 11:41:21 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 2 May 2009 11:41:21 +0200 (CEST) Subject: [Python-checkins] r72188 - in python/branches/pep-0383: Doc/library/codecs.rst Lib/test/test_codecs.py Objects/unicodeobject.c Python/codecs.c Message-ID: <20090502094121.C2EFF1E4018@bag.python.org> Author: martin.v.loewis Date: Sat May 2 11:41:19 2009 New Revision: 72188 Log: Fix issues from Benjamin's review (rietveld issue 52081). Modified: python/branches/pep-0383/Doc/library/codecs.rst python/branches/pep-0383/Lib/test/test_codecs.py python/branches/pep-0383/Objects/unicodeobject.c python/branches/pep-0383/Python/codecs.c Modified: python/branches/pep-0383/Doc/library/codecs.rst ============================================================================== --- python/branches/pep-0383/Doc/library/codecs.rst (original) +++ python/branches/pep-0383/Doc/library/codecs.rst Sat May 2 11:41:19 2009 @@ -323,8 +323,7 @@ | | (only for encoding). | +-------------------------+-----------------------------------------------+ -In addition, the following error handlers are specific to only selected -codecs: +In addition, the following error handlers are specific to a single codec: +------------------+---------+--------------------------------------------+ | Value | Codec | Meaning | @@ -333,6 +332,9 @@ | | | codes in UTF-8. | +------------------+---------+--------------------------------------------+ +.. versionadded:: 3.1 + The ``'surrogates'`` error handler. + The set of allowed values can be extended via :meth:`register_error`. Modified: python/branches/pep-0383/Lib/test/test_codecs.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_codecs.py (original) +++ python/branches/pep-0383/Lib/test/test_codecs.py Sat May 2 11:41:19 2009 @@ -541,9 +541,11 @@ self.check_state_handling_decode(self.encoding, u, u.encode(self.encoding)) - def test_surrogates(self): + def test_lone_surrogates(self): self.assertRaises(UnicodeEncodeError, "\ud800".encode, "utf-8") self.assertRaises(UnicodeDecodeError, b"\xed\xa0\x80".decode, "utf-8") + + def test_surrogates_handler(self): self.assertEquals("abc\ud800def".encode("utf-8", "surrogates"), b"abc\xed\xa0\x80def") self.assertEquals(b"abc\xed\xa0\x80def".decode("utf-8", "surrogates"), Modified: python/branches/pep-0383/Objects/unicodeobject.c ============================================================================== --- python/branches/pep-0383/Objects/unicodeobject.c (original) +++ python/branches/pep-0383/Objects/unicodeobject.c Sat May 2 11:41:19 2009 @@ -155,11 +155,9 @@ }; static PyObject *unicode_encode_call_errorhandler(const char *errors, - PyObject **errorHandler, - const char *encoding, const char *reason, - const Py_UNICODE *unicode, Py_ssize_t size, PyObject **exceptionObject, - Py_ssize_t startpos, Py_ssize_t endpos, - Py_ssize_t *newpos); + PyObject **errorHandler,const char *encoding, const char *reason, + const Py_UNICODE *unicode, Py_ssize_t size, PyObject **exceptionObject, + Py_ssize_t startpos, Py_ssize_t endpos, Py_ssize_t *newpos); /* Same for linebreaks */ static unsigned char ascii_linebreak[] = { @@ -2376,6 +2374,7 @@ Py_ssize_t nneeded; /* number of result bytes needed */ char stackbuf[MAX_SHORT_UNICHARS * 4]; PyObject *errorHandler = NULL; + PyObject *exc = NULL; assert(s != NULL); assert(size >= 0); @@ -2430,7 +2429,6 @@ } #endif if (ch >= 0xd800 && ch <= 0xdfff) { - PyObject *exc = NULL; Py_ssize_t newpos; PyObject *rep; char *prep; @@ -2486,9 +2484,11 @@ _PyBytes_Resize(&result, nneeded); } Py_XDECREF(errorHandler); + Py_XDECREF(exc); return result; error: Py_XDECREF(errorHandler); + Py_XDECREF(exc); Py_XDECREF(result); return NULL; Modified: python/branches/pep-0383/Python/codecs.c ============================================================================== --- python/branches/pep-0383/Python/codecs.c (original) +++ python/branches/pep-0383/Python/codecs.c Sat May 2 11:41:19 2009 @@ -767,8 +767,10 @@ return NULL; startp = PyUnicode_AS_UNICODE(object); res = PyBytes_FromStringAndSize(NULL, 3*(end-start)); - if (!res) + if (!res) { + Py_DECREF(object); return NULL; + } outp = PyBytes_AsString(res); for (p = startp+start; p < startp+end; p++) { Py_UNICODE ch = *p; From python-checkins at python.org Sat May 2 11:58:09 2009 From: python-checkins at python.org (eric.smith) Date: Sat, 2 May 2009 11:58:09 +0200 (CEST) Subject: [Python-checkins] r72189 - python/trunk/Objects/stringlib/formatter.h Message-ID: <20090502095809.D5E2D1E4018@bag.python.org> Author: eric.smith Date: Sat May 2 11:58:09 2009 New Revision: 72189 Log: Keep py3k and trunk code in sync. Modified: python/trunk/Objects/stringlib/formatter.h Modified: python/trunk/Objects/stringlib/formatter.h ============================================================================== --- python/trunk/Objects/stringlib/formatter.h (original) +++ python/trunk/Objects/stringlib/formatter.h Sat May 2 11:58:09 2009 @@ -934,8 +934,12 @@ if (precision < 0) precision = 6; + +#if PY_VERSION_HEX < 0x03010000 + /* 3.1 no longer converts large 'f' to 'g'. */ if ((type == 'f' || type == 'F') && fabs(val) >= 1e50) type = 'g'; +#endif /* Cast "type", because if we're in unicode we need to pass a 8-bit char. This is safe, because we've restricted what "type" From python-checkins at python.org Sat May 2 11:58:50 2009 From: python-checkins at python.org (eric.smith) Date: Sat, 2 May 2009 11:58:50 +0200 (CEST) Subject: [Python-checkins] r72190 - python/branches/release26-maint Message-ID: <20090502095850.945C31E4018@bag.python.org> Author: eric.smith Date: Sat May 2 11:58:50 2009 New Revision: 72190 Log: Blocked revisions 72189 via svnmerge ........ r72189 | eric.smith | 2009-05-02 05:58:09 -0400 (Sat, 02 May 2009) | 1 line Keep py3k and trunk code in sync. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sat May 2 13:43:07 2009 From: python-checkins at python.org (michael.foord) Date: Sat, 2 May 2009 13:43:07 +0200 (CEST) Subject: [Python-checkins] r72191 - in python/trunk: Doc/library/unittest.rst Doc/whatsnew/2.7.rst Lib/test/test_unittest.py Lib/unittest.py Message-ID: <20090502114307.A6AE41E401F@bag.python.org> Author: michael.foord Date: Sat May 2 13:43:06 2009 New Revision: 72191 Log: Adds an exit parameter to unittest.main(). If False main no longer calls sys.exit. Closes issue 3379. Michael Foord Modified: python/trunk/Doc/library/unittest.rst python/trunk/Doc/whatsnew/2.7.rst python/trunk/Lib/test/test_unittest.py python/trunk/Lib/unittest.py Modified: python/trunk/Doc/library/unittest.rst ============================================================================== --- python/trunk/Doc/library/unittest.rst (original) +++ python/trunk/Doc/library/unittest.rst Sat May 2 13:43:06 2009 @@ -1364,7 +1364,7 @@ subclasses to provide a custom ``TestResult``. -.. function:: main([module[, defaultTest[, argv[, testRunner[, testLoader]]]]]) +.. function:: main([module[, defaultTest[, argv[, testRunner[, testLoader[, exit]]]]]]) A command-line program that runs a set of tests; this is primarily for making test modules conveniently executable. The simplest use for this function is to @@ -1374,4 +1374,18 @@ unittest.main() The *testRunner* argument can either be a test runner class or an already - created instance of it. + created instance of it. By default ``main`` calls :func:`sys.exit` with + an exit code indicating success or failure of the tests run. + + ``main`` supports being used from the interactive interpreter by passing in the + argument ``exit=False``. This displays the result on standard output without + calling :func:`sys.exit`:: + + >>> from unittest import main + >>> main(module='test_module', exit=False) + + Calling ``main`` actually returns an instance of the ``TestProgram`` class. + This stores the result of the tests run as the ``result`` attribute. + + .. versionchanged:: 2.7 + The ``exit`` parameter was added. Modified: python/trunk/Doc/whatsnew/2.7.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.7.rst (original) +++ python/trunk/Doc/whatsnew/2.7.rst Sat May 2 13:43:06 2009 @@ -477,6 +477,10 @@ to provide additional information about why the two objects are matching, much as the new sequence comparison methods do. + :func:`unittest.main` now takes an optional ``exit`` argument. + If False ``main`` doesn't call :func:`sys.exit` allowing it to + be used from the interactive interpreter. :issue:`3379`. + * The :func:`is_zipfile` function in the :mod:`zipfile` module will now accept a file object, in addition to the path names accepted in earlier versions. (Contributed by Gabriel Genellina; :issue:`4756`.) Modified: python/trunk/Lib/test/test_unittest.py ============================================================================== --- python/trunk/Lib/test/test_unittest.py (original) +++ python/trunk/Lib/test/test_unittest.py Sat May 2 13:43:06 2009 @@ -9,9 +9,10 @@ import re from test import test_support import unittest -from unittest import TestCase +from unittest import TestCase, TestProgram import types from copy import deepcopy +from cStringIO import StringIO ### Support code ################################################################ @@ -3040,6 +3041,73 @@ "^unexpectedly identical: None : oops$"]) +class Test_TestProgram(TestCase): + + # Horrible white box test + def testNoExit(self): + result = object() + test = object() + + class FakeRunner(object): + def run(self, test): + self.test = test + return result + + runner = FakeRunner() + + try: + oldParseArgs = TestProgram.parseArgs + TestProgram.parseArgs = lambda *args: None + TestProgram.test = test + + program = TestProgram(testRunner=runner, exit=False) + + self.assertEqual(program.result, result) + self.assertEqual(runner.test, test) + + finally: + TestProgram.parseArgs = oldParseArgs + del TestProgram.test + + + class FooBar(unittest.TestCase): + def testPass(self): + assert True + def testFail(self): + assert False + + class FooBarLoader(unittest.TestLoader): + """Test loader that returns a suite containing FooBar.""" + def loadTestsFromModule(self, module): + return self.suiteClass( + [self.loadTestsFromTestCase(Test_TestProgram.FooBar)]) + + + def test_NonExit(self): + program = unittest.main(exit=False, + testRunner=unittest.TextTestRunner(stream=StringIO()), + testLoader=self.FooBarLoader()) + self.assertTrue(hasattr(program, 'result')) + + + def test_Exit(self): + self.assertRaises( + SystemExit, + unittest.main, + testRunner=unittest.TextTestRunner(stream=StringIO()), + exit=True, + testLoader=self.FooBarLoader()) + + + def test_ExitAsDefault(self): + self.assertRaises( + SystemExit, + unittest.main, + testRunner=unittest.TextTestRunner(stream=StringIO()), + testLoader=self.FooBarLoader()) + + + ###################################################################### ## Main ###################################################################### @@ -3047,7 +3115,8 @@ def test_main(): test_support.run_unittest(Test_TestCase, Test_TestLoader, Test_TestSuite, Test_TestResult, Test_FunctionTestCase, - Test_TestSkipping, Test_Assertions, TestLongMessage) + Test_TestSkipping, Test_Assertions, TestLongMessage, + Test_TestProgram) if __name__ == "__main__": test_main() Modified: python/trunk/Lib/unittest.py ============================================================================== --- python/trunk/Lib/unittest.py (original) +++ python/trunk/Lib/unittest.py Sat May 2 13:43:06 2009 @@ -1015,7 +1015,7 @@ def __eq__(self, other): if not isinstance(other, self.__class__): return NotImplemented - return self._tests == other._tests + return list(self) == list(other) def __ne__(self, other): return not self == other @@ -1469,7 +1469,7 @@ """ def __init__(self, module='__main__', defaultTest=None, argv=None, testRunner=TextTestRunner, - testLoader=defaultTestLoader): + testLoader=defaultTestLoader, exit=True): if isinstance(module, basestring): self.module = __import__(module) for part in module.split('.')[1:]: @@ -1478,6 +1478,8 @@ self.module = module if argv is None: argv = sys.argv + + self.exit = exit self.verbosity = 1 self.defaultTest = defaultTest self.testRunner = testRunner @@ -1529,15 +1531,12 @@ else: # it is assumed to be a TestRunner instance testRunner = self.testRunner - result = testRunner.run(self.test) - sys.exit(not result.wasSuccessful()) + self.result = testRunner.run(self.test) + if self.exit: + sys.exit(not self.result.wasSuccessful()) main = TestProgram -############################################################################## -# Executing this module from the command line -############################################################################## - if __name__ == "__main__": main(module=None) From buildbot at python.org Sat May 2 14:07:16 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 May 2009 12:07:16 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090502120716.8AAA01E401C@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1224 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: michael.foord BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_time test_unittest ====================================================================== FAIL: test_tzset (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_time.py", line 161, in test_tzset self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) AssertionError: time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) == time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) Traceback (most recent call last): File "./Lib/test/regrtest.py", line 576, in runtest_inner indirect_test() File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_unittest.py", line 3119, in test_main Test_TestProgram) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_support.py", line 880, in run_unittest _run_suite(suite) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_support.py", line 855, in _run_suite result = runner.run(suite) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/unittest.py", line 1410, in run test(result) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/unittest.py", line 1058, in __call__ return self.run(*args, **kwds) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/unittest.py", line 1054, in run test(result) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/unittest.py", line 1058, in __call__ return self.run(*args, **kwds) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/unittest.py", line 1091, in run result = super(ClassTestSuite, self).run(result) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/unittest.py", line 1054, in run test(result) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/unittest.py", line 471, in __call__ return self.run(*args, **kwds) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/unittest.py", line 446, in run testMethod() File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_unittest.py", line 3089, in test_NonExit testLoader=self.FooBarLoader()) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/unittest.py", line 1488, in __init__ self.parseArgs(argv) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/unittest.py", line 1518, in parseArgs self.usageExit(msg) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/unittest.py", line 1495, in usageExit sys.exit(2) SystemExit: 2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat May 2 14:12:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 May 2009 12:12:05 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090502121205.739F11E401C@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/4910 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: michael.foord BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_unittest Traceback (most recent call last): File "./Lib/test/regrtest.py", line 576, in runtest_inner indirect_test() File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_unittest.py", line 3119, in test_main Test_TestProgram) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_support.py", line 880, in run_unittest _run_suite(suite) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_support.py", line 855, in _run_suite result = runner.run(suite) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/unittest.py", line 1410, in run test(result) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/unittest.py", line 1058, in __call__ return self.run(*args, **kwds) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/unittest.py", line 1054, in run test(result) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/unittest.py", line 1058, in __call__ return self.run(*args, **kwds) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/unittest.py", line 1091, in run result = super(ClassTestSuite, self).run(result) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/unittest.py", line 1054, in run test(result) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/unittest.py", line 471, in __call__ return self.run(*args, **kwds) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/unittest.py", line 446, in run testMethod() File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_unittest.py", line 3089, in test_NonExit testLoader=self.FooBarLoader()) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/unittest.py", line 1488, in __init__ self.parseArgs(argv) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/unittest.py", line 1518, in parseArgs self.usageExit(msg) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/unittest.py", line 1495, in usageExit sys.exit(2) SystemExit: 2 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat May 2 14:15:40 2009 From: python-checkins at python.org (eric.smith) Date: Sat, 2 May 2009 14:15:40 +0200 (CEST) Subject: [Python-checkins] r72192 - in python/branches/py3k: Objects/stringlib/formatter.h Message-ID: <20090502121540.6D2EB1E401F@bag.python.org> Author: eric.smith Date: Sat May 2 14:15:39 2009 New Revision: 72192 Log: Merged revisions 72189 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72189 | eric.smith | 2009-05-02 05:58:09 -0400 (Sat, 02 May 2009) | 1 line Keep py3k and trunk code in sync. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Objects/stringlib/formatter.h Modified: python/branches/py3k/Objects/stringlib/formatter.h ============================================================================== --- python/branches/py3k/Objects/stringlib/formatter.h (original) +++ python/branches/py3k/Objects/stringlib/formatter.h Sat May 2 14:15:39 2009 @@ -935,6 +935,12 @@ if (precision < 0) precision = 6; +#if PY_VERSION_HEX < 0x03010000 + /* 3.1 no longer converts large 'f' to 'g'. */ + if ((type == 'f' || type == 'F') && fabs(val) >= 1e50) + type = 'g'; +#endif + /* Cast "type", because if we're in unicode we need to pass a 8-bit char. This is safe, because we've restricted what "type" can be. */ From python-checkins at python.org Sat May 2 14:16:28 2009 From: python-checkins at python.org (eric.smith) Date: Sat, 2 May 2009 14:16:28 +0200 (CEST) Subject: [Python-checkins] r72193 - python/branches/release30-maint Message-ID: <20090502121628.5FE091E401C@bag.python.org> Author: eric.smith Date: Sat May 2 14:16:28 2009 New Revision: 72193 Log: Blocked revisions 72192 via svnmerge ................ r72192 | eric.smith | 2009-05-02 08:15:39 -0400 (Sat, 02 May 2009) | 9 lines Merged revisions 72189 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72189 | eric.smith | 2009-05-02 05:58:09 -0400 (Sat, 02 May 2009) | 1 line Keep py3k and trunk code in sync. ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sat May 2 14:36:45 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 2 May 2009 14:36:45 +0200 (CEST) Subject: [Python-checkins] r72194 - in python/branches/py3k: Doc/library/json.rst Lib/json/__init__.py Lib/json/decoder.py Lib/json/encoder.py Lib/json/scanner.py Lib/json/tests/test_decode.py Lib/json/tests/test_dump.py Lib/json/tests/test_encode_basestring_ascii.py Lib/json/tests/test_fail.py Lib/json/tests/test_float.py Lib/json/tests/test_scanstring.py Lib/json/tests/test_unicode.py Lib/json/tool.py Misc/NEWS Modules/_json.c Message-ID: <20090502123645.C11AF1E401F@bag.python.org> Author: benjamin.peterson Date: Sat May 2 14:36:44 2009 New Revision: 72194 Log: port simplejson upgrade from the trunk #4136 json also now works only with unicode strings Patch by Antoine Pitrou; updated by me Modified: python/branches/py3k/Doc/library/json.rst python/branches/py3k/Lib/json/__init__.py python/branches/py3k/Lib/json/decoder.py python/branches/py3k/Lib/json/encoder.py python/branches/py3k/Lib/json/scanner.py python/branches/py3k/Lib/json/tests/test_decode.py python/branches/py3k/Lib/json/tests/test_dump.py python/branches/py3k/Lib/json/tests/test_encode_basestring_ascii.py python/branches/py3k/Lib/json/tests/test_fail.py python/branches/py3k/Lib/json/tests/test_float.py python/branches/py3k/Lib/json/tests/test_scanstring.py python/branches/py3k/Lib/json/tests/test_unicode.py python/branches/py3k/Lib/json/tool.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_json.c Modified: python/branches/py3k/Doc/library/json.rst ============================================================================== --- python/branches/py3k/Doc/library/json.rst (original) +++ python/branches/py3k/Doc/library/json.rst Sat May 2 14:36:44 2009 @@ -112,7 +112,7 @@ Basic Usage ----------- -.. function:: dump(obj, fp[, skipkeys[, ensure_ascii[, check_circular[, allow_nan[, cls[, indent[, separators[, encoding[, default[, **kw]]]]]]]]]]) +.. function:: dump(obj, fp[, skipkeys[, ensure_ascii[, check_circular[, allow_nan[, cls[, indent[, separators[, default[, **kw]]]]]]]]]]) Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-supporting file-like object). @@ -122,11 +122,10 @@ :class:`float`, :class:`bool`, ``None``) will be skipped instead of raising a :exc:`TypeError`. - If *ensure_ascii* is ``False`` (default: ``True``), then some chunks written - to *fp* may be :class:`unicode` instances, subject to normal Python - :class:`str` to :class:`unicode` coercion rules. Unless ``fp.write()`` - explicitly understands :class:`unicode` (as in :func:`codecs.getwriter`) this - is likely to cause an error. + The :mod:`json` module always produces :class:`str` objects, not + :class:`bytes` objects. Therefore, ``fp.write()`` must support :class:`str` + input. + If *check_circular* is ``False`` (default: ``True``), then the circular reference check for container types will be skipped and a circular reference @@ -146,8 +145,6 @@ will be used instead of the default ``(', ', ': ')`` separators. ``(',', ':')`` is the most compact JSON representation. - *encoding* is the character encoding for str instances, default is UTF-8. - *default(obj)* is a function that should return a serializable version of *obj* or raise :exc:`TypeError`. The default simply raises :exc:`TypeError`. @@ -156,26 +153,17 @@ *cls* kwarg. -.. function:: dumps(obj[, skipkeys[, ensure_ascii[, check_circular[, allow_nan[, cls[, indent[, separators[, encoding[, default[, **kw]]]]]]]]]]) +.. function:: dumps(obj[, skipkeys[, ensure_ascii[, check_circular[, allow_nan[, cls[, indent[, separators[, default[, **kw]]]]]]]]]]) - Serialize *obj* to a JSON formatted :class:`str`. + Serialize *obj* to a JSON formatted :class:`str`. The arguments have the + same meaning as in :func:`dump`. - If *ensure_ascii* is ``False``, then the return value will be a - :class:`unicode` instance. The other arguments have the same meaning as in - :func:`dump`. - -.. function:: load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, object_pairs_hook[, **kw]]]]]]]]) +.. function:: load(fp[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, object_pairs_hook[, **kw]]]]]]]]) Deserialize *fp* (a ``.read()``-supporting file-like object containing a JSON document) to a Python object. - If the contents of *fp* are encoded with an ASCII based encoding other than - UTF-8 (e.g. latin-1), then an appropriate *encoding* name must be specified. - Encodings that are not ASCII based (such as UCS-2) are not allowed, and - should be wrapped with ``codecs.getreader(encoding)(fp)``, or simply decoded - to a :class:`unicode` object and passed to :func:`loads`. - *object_hook* is an optional function that will be called with the result of any object literal decode (a :class:`dict`). The return value of *object_hook* will be used instead of the :class:`dict`. This feature can be used @@ -241,7 +229,7 @@ +---------------+-------------------+ | array | list | +---------------+-------------------+ - | string | unicode | + | string | str | +---------------+-------------------+ | number (int) | int | +---------------+-------------------+ @@ -257,13 +245,6 @@ It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float`` values, which is outside the JSON spec. - *encoding* determines the encoding used to interpret any :class:`str` objects - decoded by this instance (UTF-8 by default). It has no effect when decoding - :class:`unicode` objects. - - Note that currently only encodings that are a superset of ASCII work, strings - of other encodings should be passed in as :class:`unicode`. - *object_hook*, if specified, will be called with the result of every JSON object decoded and its return value will be used in place of the given :class:`dict`. This can be used to provide custom deserializations (e.g. to @@ -298,20 +279,20 @@ .. method:: decode(s) - Return the Python representation of *s* (a :class:`str` or - :class:`unicode` instance containing a JSON document) + Return the Python representation of *s* (a :class:`str` instance + containing a JSON document) .. method:: raw_decode(s) - Decode a JSON document from *s* (a :class:`str` or :class:`unicode` - beginning with a JSON document) and return a 2-tuple of the Python - representation and the index in *s* where the document ended. + Decode a JSON document from *s* (a :class:`str` beginning with a + JSON document) and return a 2-tuple of the Python representation + and the index in *s* where the document ended. This can be used to decode a JSON document from a string that may have extraneous data at the end. -.. class:: JSONEncoder([skipkeys[, ensure_ascii[, check_circular[, allow_nan[, sort_keys[, indent[, separators[, encoding[, default]]]]]]]]]) +.. class:: JSONEncoder([skipkeys[, ensure_ascii[, check_circular[, allow_nan[, sort_keys[, indent[, separators[, default]]]]]]]]) Extensible JSON encoder for Python data structures. @@ -324,7 +305,7 @@ +-------------------+---------------+ | list, tuple | array | +-------------------+---------------+ - | str, unicode | string | + | str | string | +-------------------+---------------+ | int, float | number | +-------------------+---------------+ @@ -344,9 +325,9 @@ attempt encoding of keys that are not str, int, float or None. If *skipkeys* is ``True``, such items are simply skipped. - If *ensure_ascii* is ``True`` (the default), the output is guaranteed to be - :class:`str` objects with all incoming unicode characters escaped. If - *ensure_ascii* is ``False``, the output will be a unicode object. + If *ensure_ascii* is ``True`` (the default), the output is guaranteed to + have all incoming non-ASCII characters escaped. If *ensure_ascii* is + ``False``, these characters will be output as-is. If *check_circular* is ``True`` (the default), then lists, dicts, and custom encoded objects will be checked for circular references during encoding to @@ -376,10 +357,6 @@ otherwise be serialized. It should return a JSON encodable version of the object or raise a :exc:`TypeError`. - If *encoding* is not ``None``, then all input strings will be transformed - into unicode using that encoding prior to JSON-encoding. The default is - UTF-8. - .. method:: default(o) Modified: python/branches/py3k/Lib/json/__init__.py ============================================================================== --- python/branches/py3k/Lib/json/__init__.py (original) +++ python/branches/py3k/Lib/json/__init__.py Sat May 2 14:36:44 2009 @@ -1,11 +1,13 @@ -r"""A simple, fast, extensible JSON encoder and decoder - -JSON (JavaScript Object Notation) is a subset of +r"""JSON (JavaScript Object Notation) is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. -json exposes an API familiar to uses of the standard library -marshal and pickle modules. +:mod:`json` exposes an API familiar to users of the standard library +:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained +version of the :mod:`json` library contained in Python 2.6, but maintains +compatibility with Python 2.4 and Python 2.5 and (currently) has +significant performance advantages, even without using the optional C +extension for speedups. Encoding basic Python object hierarchies:: @@ -32,23 +34,28 @@ >>> json.dumps([1,2,3,{'4': 5, '6': 7}], separators=(',',':')) '[1,2,3,{"4":5,"6":7}]' -Pretty printing (using repr() because of extraneous whitespace in the output):: +Pretty printing:: >>> import json - >>> print(repr(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4))) - '{\n "4": 5, \n "6": 7\n}' + >>> s = json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4) + >>> print('\n'.join([l.rstrip() for l in s.splitlines()])) + { + "4": 5, + "6": 7 + } Decoding JSON:: >>> import json - >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') - ['foo', {'bar': ['baz', None, 1.0, 2]}] - >>> json.loads('"\\"foo\\bar"') - '"foo\x08ar' + >>> obj = ['foo', {'bar': ['baz', None, 1.0, 2]}] + >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') == obj + True + >>> json.loads('"\\"foo\\bar"') == '"foo\x08ar' + True >>> from io import StringIO >>> io = StringIO('["streaming API"]') - >>> json.load(io) - ['streaming API'] + >>> json.load(io)[0] == 'streaming API' + True Specializing JSON object decoding:: @@ -61,43 +68,36 @@ >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', ... object_hook=as_complex) (1+2j) - >>> import decimal - >>> json.loads('1.1', parse_float=decimal.Decimal) - Decimal('1.1') + >>> from decimal import Decimal + >>> json.loads('1.1', parse_float=Decimal) == Decimal('1.1') + True -Extending JSONEncoder:: +Specializing JSON object encoding:: >>> import json - >>> class ComplexEncoder(json.JSONEncoder): - ... def default(self, obj): - ... if isinstance(obj, complex): - ... return [obj.real, obj.imag] - ... return json.JSONEncoder.default(self, obj) + >>> def encode_complex(obj): + ... if isinstance(obj, complex): + ... return [obj.real, obj.imag] + ... raise TypeError(repr(o) + " is not JSON serializable") ... - >>> dumps(2 + 1j, cls=ComplexEncoder) + >>> json.dumps(2 + 1j, default=encode_complex) + '[2.0, 1.0]' + >>> json.JSONEncoder(default=encode_complex).encode(2 + 1j) '[2.0, 1.0]' - >>> ComplexEncoder().encode(2 + 1j) + >>> ''.join(json.JSONEncoder(default=encode_complex).iterencode(2 + 1j)) '[2.0, 1.0]' - >>> list(ComplexEncoder().iterencode(2 + 1j)) - ['[', '2.0', ', ', '1.0', ']'] -Using json.tool from the shell to validate and -pretty-print:: +Using json.tool from the shell to validate and pretty-print:: - $ echo '{"json":"obj"}' | python -mjson.tool + $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } - $ echo '{ 1.2:3.4}' | python -mjson.tool + $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name: line 1 column 2 (char 2) - -Note that the JSON produced by this module's default settings -is a subset of YAML, so it may be used as a serializer for that as well. - """ - -__version__ = '1.9' +__version__ = '2.0.9' __all__ = [ 'dump', 'dumps', 'load', 'loads', 'JSONDecoder', 'JSONEncoder', @@ -115,45 +115,43 @@ allow_nan=True, indent=None, separators=None, - encoding='utf-8', default=None, ) def dump(obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, - encoding='utf-8', default=None, **kw): + default=None, **kw): """Serialize ``obj`` as a JSON formatted stream to ``fp`` (a ``.write()``-supporting file-like object). - If ``skipkeys`` is ``True`` then ``dict`` keys that are not basic types - (``str``, ``unicode``, ``int``, ``long``, ``float``, ``bool``, ``None``) - will be skipped instead of raising a ``TypeError``. + If ``skipkeys`` is true then ``dict`` keys that are not basic types + (``str``, ``unicode``, ``int``, ``float``, ``bool``, ``None``) will be + skipped instead of raising a ``TypeError``. - If ``ensure_ascii`` is ``False``, then the some chunks written to ``fp`` + If ``ensure_ascii`` is false, then the some chunks written to ``fp`` may be ``unicode`` instances, subject to normal Python ``str`` to ``unicode`` coercion rules. Unless ``fp.write()`` explicitly understands ``unicode`` (as in ``codecs.getwriter()``) this is likely to cause an error. - If ``check_circular`` is ``False``, then the circular reference check + If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). - If ``allow_nan`` is ``False``, then it will be a ``ValueError`` to + If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). - If ``indent`` is a non-negative integer, then JSON array elements and object - members will be pretty-printed with that indent level. An indent level - of 0 will only insert newlines. ``None`` is the most compact representation. + If ``indent`` is a non-negative integer, then JSON array elements and + object members will be pretty-printed with that indent level. An indent + level of 0 will only insert newlines. ``None`` is the most compact + representation. If ``separators`` is an ``(item_separator, dict_separator)`` tuple then it will be used instead of the default ``(', ', ': ')`` separators. ``(',', ':')`` is the most compact JSON representation. - ``encoding`` is the character encoding for str instances, default is UTF-8. - ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. @@ -163,17 +161,17 @@ """ # cached encoder - if (skipkeys is False and ensure_ascii is True and - check_circular is True and allow_nan is True and + if (not skipkeys and ensure_ascii and + check_circular and allow_nan and cls is None and indent is None and separators is None and - encoding == 'utf-8' and default is None and not kw): + default is None and not kw): iterable = _default_encoder.iterencode(obj) else: if cls is None: cls = JSONEncoder iterable = cls(skipkeys=skipkeys, ensure_ascii=ensure_ascii, check_circular=check_circular, allow_nan=allow_nan, indent=indent, - separators=separators, encoding=encoding, + separators=separators, default=default, **kw).iterencode(obj) # could accelerate with writelines in some versions of Python, at # a debuggability cost @@ -183,22 +181,22 @@ def dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, - encoding='utf-8', default=None, **kw): + default=None, **kw): """Serialize ``obj`` to a JSON formatted ``str``. - If ``skipkeys`` is ``True`` then ``dict`` keys that are not basic types - (``str``, ``unicode``, ``int``, ``long``, ``float``, ``bool``, ``None``) - will be skipped instead of raising a ``TypeError``. + If ``skipkeys`` is false then ``dict`` keys that are not basic types + (``str``, ``unicode``, ``int``, ``float``, ``bool``, ``None``) will be + skipped instead of raising a ``TypeError``. - If ``ensure_ascii`` is ``False``, then the return value will be a + If ``ensure_ascii`` is false, then the return value will be a ``unicode`` instance subject to normal Python ``str`` to ``unicode`` coercion rules instead of being escaped to an ASCII ``str``. - If ``check_circular`` is ``False``, then the circular reference check + If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). - If ``allow_nan`` is ``False``, then it will be a ``ValueError`` to + If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). @@ -212,8 +210,6 @@ then it will be used instead of the default ``(', ', ': ')`` separators. ``(',', ':')`` is the most compact JSON representation. - ``encoding`` is the character encoding for str instances, default is UTF-8. - ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. @@ -223,35 +219,27 @@ """ # cached encoder - if (skipkeys is False and ensure_ascii is True and - check_circular is True and allow_nan is True and + if (not skipkeys and ensure_ascii and + check_circular and allow_nan and cls is None and indent is None and separators is None and - encoding == 'utf-8' and default is None and not kw): + default is None and not kw): return _default_encoder.encode(obj) if cls is None: cls = JSONEncoder return cls( skipkeys=skipkeys, ensure_ascii=ensure_ascii, check_circular=check_circular, allow_nan=allow_nan, indent=indent, - separators=separators, encoding=encoding, default=default, + separators=separators, default=default, **kw).encode(obj) -_default_decoder = JSONDecoder(encoding=None, object_hook=None, - object_pairs_hook=None) +_default_decoder = JSONDecoder(object_hook=None, object_pairs_hook=None) -def load(fp, encoding=None, cls=None, object_hook=None, parse_float=None, +def load(fp, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw): - """Deserialize ``fp`` (a ``.read()``-supporting file-like object - containing a JSON document) to a Python object. - - If the contents of ``fp`` is encoded with an ASCII based encoding other - than utf-8 (e.g. latin-1), then an appropriate ``encoding`` name must - be specified. Encodings that are not ASCII based (such as UCS-2) are - not allowed, and should be wrapped with - ``codecs.getreader(fp)(encoding)``, or simply decoded to a ``unicode`` - object and passed to ``loads()`` + """Deserialize ``fp`` (a ``.read()``-supporting file-like object containing + a JSON document) to a Python object. ``object_hook`` is an optional function that will be called with the result of any object literal decode (a ``dict``). The return value of @@ -263,21 +251,16 @@ """ return loads(fp.read(), - encoding=encoding, cls=cls, object_hook=object_hook, + cls=cls, object_hook=object_hook, parse_float=parse_float, parse_int=parse_int, parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) def loads(s, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw): - """Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a JSON + """Deserialize ``s`` (a ``str`` instance containing a JSON document) to a Python object. - If ``s`` is a ``str`` instance and is encoded with an ASCII based encoding - other than utf-8 (e.g. latin-1) then an appropriate ``encoding`` name - must be specified. Encodings that are not ASCII based (such as UCS-2) - are not allowed and should be decoded to ``unicode`` first. - ``object_hook`` is an optional function that will be called with the result of any object literal decode (a ``dict``). The return value of ``object_hook`` will be used instead of the ``dict``. This feature @@ -302,7 +285,7 @@ kwarg. """ - if (cls is None and encoding is None and object_hook is None and + if (cls is None and object_hook is None and parse_int is None and parse_float is None and parse_constant is None and object_pairs_hook is None and not kw): return _default_decoder.decode(s) @@ -318,4 +301,4 @@ kw['parse_int'] = parse_int if parse_constant is not None: kw['parse_constant'] = parse_constant - return cls(encoding=encoding, **kw).decode(s) + return cls(**kw).decode(s) Modified: python/branches/py3k/Lib/json/decoder.py ============================================================================== --- python/branches/py3k/Lib/json/decoder.py (original) +++ python/branches/py3k/Lib/json/decoder.py Sat May 2 14:36:44 2009 @@ -1,10 +1,11 @@ """Implementation of JSONDecoder """ - +import binascii import re import sys +import struct -from json.scanner import Scanner, pattern +from json.scanner import make_scanner try: from _json import scanstring as c_scanstring except ImportError: @@ -14,7 +15,14 @@ FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL -NaN, PosInf, NegInf = float('nan'), float('inf'), float('-inf') +def _floatconstants(): + _BYTES = binascii.unhexlify(b'7FF80000000000007FF0000000000000') + if sys.byteorder != 'big': + _BYTES = _BYTES[:8][::-1] + _BYTES[8:][::-1] + nan, inf = struct.unpack('dd', _BYTES) + return nan, inf, -inf + +NaN, PosInf, NegInf = _floatconstants() def linecol(doc, pos): @@ -31,61 +39,43 @@ def errmsg(msg, doc, pos, end=None): + # Note that this function is called from _json lineno, colno = linecol(doc, pos) if end is None: fmt = '{0}: line {1} column {2} (char {3})' return fmt.format(msg, lineno, colno, pos) + #fmt = '%s: line %d column %d (char %d)' + #return fmt % (msg, lineno, colno, pos) endlineno, endcolno = linecol(doc, end) fmt = '{0}: line {1} column {2} - line {3} column {4} (char {5} - {6})' return fmt.format(msg, lineno, colno, endlineno, endcolno, pos, end) + #fmt = '%s: line %d column %d - line %d column %d (char %d - %d)' + #return fmt % (msg, lineno, colno, endlineno, endcolno, pos, end) _CONSTANTS = { '-Infinity': NegInf, 'Infinity': PosInf, 'NaN': NaN, - 'true': True, - 'false': False, - 'null': None, } -def JSONConstant(match, context, c=_CONSTANTS): - s = match.group(0) - fn = getattr(context, 'parse_constant', None) - if fn is None: - rval = c[s] - else: - rval = fn(s) - return rval, None -pattern('(-?Infinity|NaN|true|false|null)')(JSONConstant) - - -def JSONNumber(match, context): - match = JSONNumber.regex.match(match.string, *match.span()) - integer, frac, exp = match.groups() - if frac or exp: - fn = getattr(context, 'parse_float', None) or float - res = fn(integer + (frac or '') + (exp or '')) - else: - fn = getattr(context, 'parse_int', None) or int - res = fn(integer) - return res, None -pattern(r'(-?(?:0|[1-9][0-9]*))(\.[0-9]+)?([eE][-+]?[0-9]+)?')(JSONNumber) - - STRINGCHUNK = re.compile(r'(.*?)(["\\\x00-\x1f])', FLAGS) BACKSLASH = { '"': '"', '\\': '\\', '/': '/', 'b': '\b', 'f': '\f', 'n': '\n', 'r': '\r', 't': '\t', } -DEFAULT_ENCODING = "utf-8" - +def py_scanstring(s, end, strict=True, + _b=BACKSLASH, _m=STRINGCHUNK.match): + """Scan the string s for a JSON string. End is the index of the + character in s after the quote that started the JSON string. + Unescapes all valid JSON string escape sequences and raises ValueError + on attempt to decode an invalid string. If strict is False then literal + control characters are allowed in the string. -def py_scanstring(s, end, encoding=None, strict=True, _b=BACKSLASH, _m=STRINGCHUNK.match): - if encoding is None: - encoding = DEFAULT_ENCODING + Returns a tuple of the decoded string and the index of the character in s + after the end quote.""" chunks = [] _append = chunks.append begin = end - 1 @@ -96,14 +86,16 @@ errmsg("Unterminated string starting at", s, begin)) end = chunk.end() content, terminator = chunk.groups() + # Content is contains zero or more unescaped string characters if content: - if not isinstance(content, str): - content = str(content, encoding) _append(content) + # Terminator is the end of string, a literal control character, + # or a backslash denoting that an escape sequence follows if terminator == '"': break elif terminator != '\\': if strict: + #msg = "Invalid control character %r at" % (terminator,) msg = "Invalid control character {0!r} at".format(terminator) raise ValueError(errmsg(msg, s, end)) else: @@ -114,9 +106,10 @@ except IndexError: raise ValueError( errmsg("Unterminated string starting at", s, begin)) + # If not a unicode escape sequence, must be in the lookup table if esc != 'u': try: - m = _b[esc] + char = _b[esc] except KeyError: msg = "Invalid \\escape: {0!r}".format(esc) raise ValueError(errmsg(msg, s, end)) @@ -124,131 +117,138 @@ else: esc = s[end + 1:end + 5] next_end = end + 5 - msg = "Invalid \\uXXXX escape" - try: - if len(esc) != 4: - raise ValueError - uni = int(esc, 16) - if 0xd800 <= uni <= 0xdbff and sys.maxunicode > 65535: - msg = "Invalid \\uXXXX\\uXXXX surrogate pair" - if not s[end + 5:end + 7] == '\\u': - raise ValueError - esc2 = s[end + 7:end + 11] - if len(esc2) != 4: - raise ValueError - uni2 = int(esc2, 16) - uni = 0x10000 + (((uni - 0xd800) << 10) | (uni2 - 0xdc00)) - next_end += 6 - m = chr(uni) - except ValueError: + if len(esc) != 4: + msg = "Invalid \\uXXXX escape" raise ValueError(errmsg(msg, s, end)) + uni = int(esc, 16) + # Check for surrogate pair on UCS-4 systems + if 0xd800 <= uni <= 0xdbff and sys.maxunicode > 65535: + msg = "Invalid \\uXXXX\\uXXXX surrogate pair" + if not s[end + 5:end + 7] == '\\u': + raise ValueError(errmsg(msg, s, end)) + esc2 = s[end + 7:end + 11] + if len(esc2) != 4: + raise ValueError(errmsg(msg, s, end)) + uni2 = int(esc2, 16) + uni = 0x10000 + (((uni - 0xd800) << 10) | (uni2 - 0xdc00)) + next_end += 6 + char = chr(uni) + end = next_end - _append(m) + _append(char) return ''.join(chunks), end -# Use speedup -if c_scanstring is not None: - scanstring = c_scanstring -else: - scanstring = py_scanstring - -def JSONString(match, context): - encoding = getattr(context, 'encoding', None) - strict = getattr(context, 'strict', True) - return scanstring(match.string, match.end(), encoding, strict) -pattern(r'"')(JSONString) +# Use speedup if available +scanstring = c_scanstring or py_scanstring +WHITESPACE = re.compile(r'[ \t\n\r]*', FLAGS) +WHITESPACE_STR = ' \t\n\r' -WHITESPACE = re.compile(r'\s*', FLAGS) - -def JSONObject(match, context, _w=WHITESPACE.match): +def JSONObject(s_and_end, strict, scan_once, object_hook, object_pairs_hook, + _w=WHITESPACE.match, _ws=WHITESPACE_STR): + s, end = s_and_end pairs = [] pairs_append = pairs.append - s = match.string - end = _w(s, match.end()).end() + # Use a slice to prevent IndexError from being raised, the following + # check will raise a more specific ValueError if the string is empty nextchar = s[end:end + 1] - # Trivial empty object - if nextchar == '}': - return pairs, end + 1 + # Normally we expect nextchar == '"' if nextchar != '"': - raise ValueError(errmsg("Expecting property name", s, end)) + if nextchar in _ws: + end = _w(s, end).end() + nextchar = s[end:end + 1] + # Trivial empty object + if nextchar == '}': + return pairs, end + 1 + elif nextchar != '"': + raise ValueError(errmsg("Expecting property name", s, end)) end += 1 - encoding = getattr(context, 'encoding', None) - strict = getattr(context, 'strict', True) - iterscan = JSONScanner.iterscan while True: - key, end = scanstring(s, end, encoding, strict) - end = _w(s, end).end() + key, end = scanstring(s, end, strict) + # To skip some function call overhead we optimize the fast paths where + # the JSON key separator is ": " or just ":". if s[end:end + 1] != ':': - raise ValueError(errmsg("Expecting : delimiter", s, end)) - end = _w(s, end + 1).end() + end = _w(s, end).end() + if s[end:end + 1] != ':': + raise ValueError(errmsg("Expecting : delimiter", s, end)) + end += 1 + try: - value, end = next(iterscan(s, idx=end, context=context)) + if s[end] in _ws: + end += 1 + if s[end] in _ws: + end = _w(s, end + 1).end() + except IndexError: + pass + + try: + value, end = scan_once(s, end) except StopIteration: raise ValueError(errmsg("Expecting object", s, end)) pairs_append((key, value)) - end = _w(s, end).end() - nextchar = s[end:end + 1] + try: + nextchar = s[end] + if nextchar in _ws: + end = _w(s, end + 1).end() + nextchar = s[end] + except IndexError: + nextchar = '' end += 1 + if nextchar == '}': break - if nextchar != ',': + elif nextchar != ',': raise ValueError(errmsg("Expecting , delimiter", s, end - 1)) end = _w(s, end).end() nextchar = s[end:end + 1] end += 1 if nextchar != '"': raise ValueError(errmsg("Expecting property name", s, end - 1)) - object_pairs_hook = getattr(context, 'object_pairs_hook', None) if object_pairs_hook is not None: result = object_pairs_hook(pairs) return result, end pairs = dict(pairs) - object_hook = getattr(context, 'object_hook', None) if object_hook is not None: pairs = object_hook(pairs) return pairs, end -pattern(r'{')(JSONObject) - -def JSONArray(match, context, _w=WHITESPACE.match): +def JSONArray(s_and_end, scan_once, context, _w=WHITESPACE.match): + s, end = s_and_end values = [] - s = match.string - end = _w(s, match.end()).end() - # Look-ahead for trivial empty array nextchar = s[end:end + 1] + if nextchar in _ws: + end = _w(s, end + 1).end() + nextchar = s[end:end + 1] + # Look-ahead for trivial empty array if nextchar == ']': return values, end + 1 - iterscan = JSONScanner.iterscan + _append = values.append while True: try: - value, end = next(iterscan(s, idx=end, context=context)) + value, end = scan_once(s, end) except StopIteration: raise ValueError(errmsg("Expecting object", s, end)) - values.append(value) - end = _w(s, end).end() + _append(value) nextchar = s[end:end + 1] + if nextchar in _ws: + end = _w(s, end + 1).end() + nextchar = s[end:end + 1] end += 1 if nextchar == ']': break - if nextchar != ',': + elif nextchar != ',': raise ValueError(errmsg("Expecting , delimiter", s, end)) - end = _w(s, end).end() - return values, end -pattern(r'\[')(JSONArray) - - -ANYTHING = [ - JSONObject, - JSONArray, - JSONString, - JSONConstant, - JSONNumber, -] + try: + if s[end] in _ws: + end += 1 + if s[end] in _ws: + end = _w(s, end + 1).end() + except IndexError: + pass -JSONScanner = Scanner(ANYTHING) + return values, end class JSONDecoder(object): @@ -278,23 +278,14 @@ It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float`` values, which is outside the JSON spec. - """ - _scanner = Scanner(ANYTHING) - __all__ = ['__init__', 'decode', 'raw_decode'] + """ - def __init__(self, encoding=None, object_hook=None, parse_float=None, + def __init__(self, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None): - """``encoding`` determines the encoding used to interpret any ``str`` - objects decoded by this instance (utf-8 by default). It has no - effect when decoding ``unicode`` objects. - - Note that currently only encodings that are a superset of ASCII work, - strings of other encodings should be passed in as ``unicode``. - - ``object_hook``, if specified, will be called with the result of - every JSON object decoded and its return value will be used in + """``object_hook``, if specified, will be called with the result + of every JSON object decoded and its return value will be used in place of the given ``dict``. This can be used to provide custom deserializations (e.g. to support JSON-RPC class hinting). @@ -309,22 +300,25 @@ for JSON integers (e.g. float). ``parse_constant``, if specified, will be called with one of the - following strings: -Infinity, Infinity, NaN, null, true, false. + following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered. """ - self.encoding = encoding self.object_hook = object_hook - self.object_pairs_hook = object_pairs_hook - self.parse_float = parse_float - self.parse_int = parse_int - self.parse_constant = parse_constant + self.parse_float = parse_float or float + self.parse_int = parse_int or int + self.parse_constant = parse_constant or _CONSTANTS.__getitem__ self.strict = strict + self.object_pairs_hook = object_pairs_hook + self.parse_object = JSONObject + self.parse_array = JSONArray + self.parse_string = scanstring + self.scan_once = make_scanner(self) + def decode(self, s, _w=WHITESPACE.match): - """ - Return the Python representation of ``s`` (a ``str`` or ``unicode`` + """Return the Python representation of ``s`` (a ``str`` or ``unicode`` instance containing a JSON document) """ @@ -334,18 +328,17 @@ raise ValueError(errmsg("Extra data", s, end, len(s))) return obj - def raw_decode(self, s, **kw): - """Decode a JSON document from ``s`` (a ``str`` or ``unicode`` beginning - with a JSON document) and return a 2-tuple of the Python + def raw_decode(self, s, idx=0): + """Decode a JSON document from ``s`` (a ``str`` or ``unicode`` + beginning with a JSON document) and return a 2-tuple of the Python representation and the index in ``s`` where the document ended. This can be used to decode a JSON document from a string that may have extraneous data at the end. """ - kw.setdefault('context', self) try: - obj, end = next(self._scanner.iterscan(s, **kw)) + obj, end = self.scan_once(s, idx) except StopIteration: raise ValueError("No JSON object could be decoded") return obj, end Modified: python/branches/py3k/Lib/json/encoder.py ============================================================================== --- python/branches/py3k/Lib/json/encoder.py (original) +++ python/branches/py3k/Lib/json/encoder.py Sat May 2 14:36:44 2009 @@ -1,19 +1,19 @@ """Implementation of JSONEncoder """ - import re -import math try: from _json import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None - -__all__ = ['JSONEncoder'] +try: + from _json import make_encoder as c_make_encoder +except ImportError: + c_make_encoder = None ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]') ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])') -HAS_UTF8 = re.compile(r'[\x80-\xff]') +HAS_UTF8 = re.compile(b'[\x80-\xff]') ESCAPE_DCT = { '\\': '\\\\', '"': '\\"', @@ -25,30 +25,12 @@ } for i in range(0x20): ESCAPE_DCT.setdefault(chr(i), '\\u{0:04x}'.format(i)) + #ESCAPE_DCT.setdefault(chr(i), '\\u%04x' % (i,)) +# Assume this produces an infinity on all machines (probably not guaranteed) +INFINITY = float('1e66666') FLOAT_REPR = repr -def floatstr(o, allow_nan=True): - # Check for specials. Note that this type of test is processor- and/or - # platform-specific, so do tests which don't depend on the internals. - - if math.isnan(o): - text = 'NaN' - elif math.isinf(o): - if math.copysign(1., o) == 1.: - text = 'Infinity' - else: - text = '-Infinity' - else: - return FLOAT_REPR(o) - - if not allow_nan: - msg = "Out of range float values are not JSON compliant: " + repr(o) - raise ValueError(msg) - - return text - - def encode_basestring(s): """Return a JSON representation of a Python string @@ -59,8 +41,9 @@ def py_encode_basestring_ascii(s): - if isinstance(s, bytes): # and HAS_UTF8.search(s) is not None: - s = s.decode('utf-8') + """Return an ASCII-only JSON representation of a Python string + + """ def replace(match): s = match.group(0) try: @@ -69,20 +52,18 @@ n = ord(s) if n < 0x10000: return '\\u{0:04x}'.format(n) + #return '\\u%04x' % (n,) else: # surrogate pair n -= 0x10000 s1 = 0xd800 | ((n >> 10) & 0x3ff) s2 = 0xdc00 | (n & 0x3ff) return '\\u{0:04x}\\u{1:04x}'.format(s1, s2) - return '"' + (ESCAPE_ASCII.sub(replace, s)) + '"' + return '"' + ESCAPE_ASCII.sub(replace, s) + '"' -if c_encode_basestring_ascii is not None: - encode_basestring_ascii = c_encode_basestring_ascii -else: - encode_basestring_ascii = py_encode_basestring_ascii - +encode_basestring_ascii = ( + c_encode_basestring_ascii or py_encode_basestring_ascii) class JSONEncoder(object): """Extensible JSON encoder for Python data structures. @@ -113,33 +94,32 @@ implementation (to raise ``TypeError``). """ - __all__ = ['__init__', 'default', 'encode', 'iterencode'] item_separator = ', ' key_separator = ': ' def __init__(self, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, - indent=None, separators=None, encoding='utf-8', default=None): + indent=None, separators=None, default=None): """Constructor for JSONEncoder, with sensible defaults. - If skipkeys is False, then it is a TypeError to attempt + If skipkeys is false, then it is a TypeError to attempt encoding of keys that are not str, int, long, float or None. If skipkeys is True, such items are simply skipped. - If ensure_ascii is True, the output is guaranteed to be str + If ensure_ascii is true, the output is guaranteed to be str objects with all incoming unicode characters escaped. If ensure_ascii is false, the output will be unicode object. - If check_circular is True, then lists, dicts, and custom encoded + If check_circular is true, then lists, dicts, and custom encoded objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause an OverflowError). Otherwise, no such check takes place. - If allow_nan is True, then NaN, Infinity, and -Infinity will be + If allow_nan is true, then NaN, Infinity, and -Infinity will be encoded as such. This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders. Otherwise, it will be a ValueError to encode such floats. - If sort_keys is True, then the output of dictionaries will be + If sort_keys is true, then the output of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis. @@ -156,28 +136,130 @@ that can't otherwise be serialized. It should return a JSON encodable version of the object or raise a ``TypeError``. - If encoding is not None, then all input strings will be - transformed into unicode using that encoding prior to JSON-encoding. - The default is UTF-8. - """ + self.skipkeys = skipkeys self.ensure_ascii = ensure_ascii self.check_circular = check_circular self.allow_nan = allow_nan self.sort_keys = sort_keys self.indent = indent - self.current_indent_level = 0 if separators is not None: self.item_separator, self.key_separator = separators if default is not None: self.default = default - self.encoding = encoding - def _newline_indent(self): - return '\n' + (' ' * (self.indent * self.current_indent_level)) + def default(self, o): + """Implement this method in a subclass such that it returns + a serializable object for ``o``, or calls the base implementation + (to raise a ``TypeError``). + + For example, to support arbitrary iterators, you could + implement default like this:: + + def default(self, o): + try: + iterable = iter(o) + except TypeError: + pass + else: + return list(iterable) + return JSONEncoder.default(self, o) + + """ + raise TypeError(repr(o) + " is not JSON serializable") + + def encode(self, o): + """Return a JSON string representation of a Python data structure. + + >>> JSONEncoder().encode({"foo": ["bar", "baz"]}) + '{"foo": ["bar", "baz"]}' + + """ + # This is for extremely simple cases and benchmarks. + if isinstance(o, str): + if self.ensure_ascii: + return encode_basestring_ascii(o) + else: + return encode_basestring(o) + # This doesn't pass the iterator directly to ''.join() because the + # exceptions aren't as detailed. The list call should be roughly + # equivalent to the PySequence_Fast that ''.join() would do. + chunks = self.iterencode(o, _one_shot=True) + if not isinstance(chunks, (list, tuple)): + chunks = list(chunks) + return ''.join(chunks) + + def iterencode(self, o, _one_shot=False): + """Encode the given object and yield each string + representation as available. + + For example:: + + for chunk in JSONEncoder().iterencode(bigobject): + mysocket.write(chunk) + + """ + if self.check_circular: + markers = {} + else: + markers = None + if self.ensure_ascii: + _encoder = encode_basestring_ascii + else: + _encoder = encode_basestring + + def floatstr(o, allow_nan=self.allow_nan, + _repr=FLOAT_REPR, _inf=INFINITY, _neginf=-INFINITY): + # Check for specials. Note that this type of test is processor + # and/or platform-specific, so do tests which don't depend on the + # internals. + + if o != o: + text = 'NaN' + elif o == _inf: + text = 'Infinity' + elif o == _neginf: + text = '-Infinity' + else: + return _repr(o) - def _iterencode_list(self, lst, markers=None): + if not allow_nan: + raise ValueError( + "Out of range float values are not JSON compliant: " + + repr(o)) + + return text + + + if (_one_shot and c_make_encoder is not None + and not self.indent and not self.sort_keys): + _iterencode = c_make_encoder( + markers, self.default, _encoder, self.indent, + self.key_separator, self.item_separator, self.sort_keys, + self.skipkeys, self.allow_nan) + else: + _iterencode = _make_iterencode( + markers, self.default, _encoder, self.indent, floatstr, + self.key_separator, self.item_separator, self.sort_keys, + self.skipkeys, _one_shot) + return _iterencode(o, 0) + +def _make_iterencode(markers, _default, _encoder, _indent, _floatstr, + _key_separator, _item_separator, _sort_keys, _skipkeys, _one_shot, + ## HACK: hand-optimized bytecode; turn globals into locals + ValueError=ValueError, + dict=dict, + float=float, + id=id, + int=int, + isinstance=isinstance, + list=list, + str=str, + tuple=tuple, + ): + + def _iterencode_list(lst, _current_indent_level): if not lst: yield '[]' return @@ -186,31 +268,51 @@ if markerid in markers: raise ValueError("Circular reference detected") markers[markerid] = lst - yield '[' - if self.indent is not None: - self.current_indent_level += 1 - newline_indent = self._newline_indent() - separator = self.item_separator + newline_indent - yield newline_indent + buf = '[' + if _indent is not None: + _current_indent_level += 1 + newline_indent = '\n' + (' ' * (_indent * _current_indent_level)) + separator = _item_separator + newline_indent + buf += newline_indent else: newline_indent = None - separator = self.item_separator + separator = _item_separator first = True for value in lst: if first: first = False else: - yield separator - for chunk in self._iterencode(value, markers): - yield chunk + buf = separator + if isinstance(value, str): + yield buf + _encoder(value) + elif value is None: + yield buf + 'null' + elif value is True: + yield buf + 'true' + elif value is False: + yield buf + 'false' + elif isinstance(value, int): + yield buf + str(value) + elif isinstance(value, float): + yield buf + _floatstr(value) + else: + yield buf + if isinstance(value, (list, tuple)): + chunks = _iterencode_list(value, _current_indent_level) + elif isinstance(value, dict): + chunks = _iterencode_dict(value, _current_indent_level) + else: + chunks = _iterencode(value, _current_indent_level) + for chunk in chunks: + yield chunk if newline_indent is not None: - self.current_indent_level -= 1 - yield self._newline_indent() + _current_indent_level -= 1 + yield '\n' + (' ' * (_indent * _current_indent_level)) yield ']' if markers is not None: del markers[markerid] - def _iterencode_dict(self, dct, markers=None): + def _iterencode_dict(dct, _current_indent_level): if not dct: yield '{}' return @@ -220,78 +322,75 @@ raise ValueError("Circular reference detected") markers[markerid] = dct yield '{' - key_separator = self.key_separator - if self.indent is not None: - self.current_indent_level += 1 - newline_indent = self._newline_indent() - item_separator = self.item_separator + newline_indent + if _indent is not None: + _current_indent_level += 1 + newline_indent = '\n' + (' ' * (_indent * _current_indent_level)) + item_separator = _item_separator + newline_indent yield newline_indent else: newline_indent = None - item_separator = self.item_separator + item_separator = _item_separator first = True - if self.ensure_ascii: - encoder = encode_basestring_ascii - else: - encoder = encode_basestring - allow_nan = self.allow_nan - if self.sort_keys: - keys = list(dct.keys()) - keys.sort() - items = [(k, dct[k]) for k in keys] + if _sort_keys: + items = sorted(dct.items(), key=lambda kv: kv[0]) else: - items = iter(dct.items()) - _encoding = self.encoding - _do_decode = (_encoding is not None - and not (_encoding == 'utf-8')) + items = dct.items() for key, value in items: if isinstance(key, str): - if _do_decode: - key = key.decode(_encoding) - elif isinstance(key, str): pass # JavaScript is weakly typed for these, so it makes sense to # also allow them. Many encoders seem to do something like this. elif isinstance(key, float): - key = floatstr(key, allow_nan) - elif isinstance(key, (int, int)): - key = str(key) + key = _floatstr(key) elif key is True: key = 'true' elif key is False: key = 'false' elif key is None: key = 'null' - elif self.skipkeys: + elif isinstance(key, int): + key = str(key) + elif _skipkeys: continue else: - raise TypeError("key {0!r} is not a string".format(key)) + raise TypeError("key " + repr(key) + " is not a string") if first: first = False else: yield item_separator - yield encoder(key) - yield key_separator - for chunk in self._iterencode(value, markers): - yield chunk + yield _encoder(key) + yield _key_separator + if isinstance(value, str): + yield _encoder(value) + elif value is None: + yield 'null' + elif value is True: + yield 'true' + elif value is False: + yield 'false' + elif isinstance(value, int): + yield str(value) + elif isinstance(value, float): + yield _floatstr(value) + else: + if isinstance(value, (list, tuple)): + chunks = _iterencode_list(value, _current_indent_level) + elif isinstance(value, dict): + chunks = _iterencode_dict(value, _current_indent_level) + else: + chunks = _iterencode(value, _current_indent_level) + for chunk in chunks: + yield chunk if newline_indent is not None: - self.current_indent_level -= 1 - yield self._newline_indent() + _current_indent_level -= 1 + yield '\n' + (' ' * (_indent * _current_indent_level)) yield '}' if markers is not None: del markers[markerid] - def _iterencode(self, o, markers=None): + def _iterencode(o, _current_indent_level): if isinstance(o, str): - if self.ensure_ascii: - encoder = encode_basestring_ascii - else: - encoder = encode_basestring - _encoding = self.encoding - if (_encoding is not None and isinstance(o, str) - and not (_encoding == 'utf-8')): - o = o.decode(_encoding) - yield encoder(o) + yield _encoder(o) elif o is None: yield 'null' elif o is True: @@ -301,12 +400,12 @@ elif isinstance(o, (int, int)): yield str(o) elif isinstance(o, float): - yield floatstr(o, self.allow_nan) + yield _floatstr(o) elif isinstance(o, (list, tuple)): - for chunk in self._iterencode_list(o, markers): + for chunk in _iterencode_list(o, _current_indent_level): yield chunk elif isinstance(o, dict): - for chunk in self._iterencode_dict(o, markers): + for chunk in _iterencode_dict(o, _current_indent_level): yield chunk else: if markers is not None: @@ -314,71 +413,9 @@ if markerid in markers: raise ValueError("Circular reference detected") markers[markerid] = o - for chunk in self._iterencode_default(o, markers): + o = _default(o) + for chunk in _iterencode(o, _current_indent_level): yield chunk if markers is not None: del markers[markerid] - - def _iterencode_default(self, o, markers=None): - newobj = self.default(o) - return self._iterencode(newobj, markers) - - def default(self, o): - """Implement this method in a subclass such that it returns a serializable - object for ``o``, or calls the base implementation (to raise a - ``TypeError``). - - For example, to support arbitrary iterators, you could implement - default like this:: - - def default(self, o): - try: - iterable = iter(o) - except TypeError: - pass - else: - return list(iterable) - return JSONEncoder.default(self, o) - - """ - raise TypeError(repr(o) + " is not JSON serializable") - - def encode(self, o): - """Return a JSON string representation of a Python data structure. - - >>> JSONEncoder().encode({"foo": ["bar", "baz"]}) - '{"foo": ["bar", "baz"]}' - - """ - # This is for extremely simple cases and benchmarks. - if isinstance(o, (str, bytes)): - if isinstance(o, bytes): - _encoding = self.encoding - if (_encoding is not None - and not (_encoding == 'utf-8')): - o = o.decode(_encoding) - if self.ensure_ascii: - return encode_basestring_ascii(o) - else: - return encode_basestring(o) - # This doesn't pass the iterator directly to ''.join() because the - # exceptions aren't as detailed. The list call should be roughly - # equivalent to the PySequence_Fast that ''.join() would do. - chunks = list(self.iterencode(o)) - return ''.join(chunks) - - def iterencode(self, o): - """Encode the given object and yield each string representation as - available. - - For example:: - - for chunk in JSONEncoder().iterencode(bigobject): - mysocket.write(chunk) - - """ - if self.check_circular: - markers = {} - else: - markers = None - return self._iterencode(o, markers) + return _iterencode Modified: python/branches/py3k/Lib/json/scanner.py ============================================================================== --- python/branches/py3k/Lib/json/scanner.py (original) +++ python/branches/py3k/Lib/json/scanner.py Sat May 2 14:36:44 2009 @@ -1,69 +1,65 @@ -"""Iterator based sre token scanner - +"""JSON token scanner """ - import re -import sre_parse -import sre_compile -import sre_constants - -from re import VERBOSE, MULTILINE, DOTALL -from sre_constants import BRANCH, SUBPATTERN - -__all__ = ['Scanner', 'pattern'] - -FLAGS = (VERBOSE | MULTILINE | DOTALL) - -class Scanner(object): - def __init__(self, lexicon, flags=FLAGS): - self.actions = [None] - # Combine phrases into a compound pattern - s = sre_parse.Pattern() - s.flags = flags - p = [] - for idx, token in enumerate(lexicon): - phrase = token.pattern - try: - subpattern = sre_parse.SubPattern(s, - [(SUBPATTERN, (idx + 1, sre_parse.parse(phrase, flags)))]) - except sre_constants.error: - raise - p.append(subpattern) - self.actions.append(token) - - s.groups = len(p) + 1 # NOTE(guido): Added to make SRE validation work - p = sre_parse.SubPattern(s, [(BRANCH, (None, p))]) - self.scanner = sre_compile.compile(p) - - def iterscan(self, string, idx=0, context=None): - """Yield match, end_idx for each match - - """ - match = self.scanner.scanner(string, idx).match - actions = self.actions - lastend = idx - end = len(string) - while True: - m = match() - if m is None: - break - matchbegin, matchend = m.span() - if lastend == matchend: - break - action = actions[m.lastindex] - if action is not None: - rval, next_pos = action(m, context) - if next_pos is not None and next_pos != matchend: - # "fast forward" the scanner - matchend = next_pos - match = self.scanner.scanner(string, matchend).match - yield rval, matchend - lastend = matchend - - -def pattern(pattern, flags=FLAGS): - def decorator(fn): - fn.pattern = pattern - fn.regex = re.compile(pattern, flags) - return fn - return decorator +try: + from _json import make_scanner as c_make_scanner +except ImportError: + c_make_scanner = None + +__all__ = ['make_scanner'] + +NUMBER_RE = re.compile( + r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?', + (re.VERBOSE | re.MULTILINE | re.DOTALL)) + +def py_make_scanner(context): + parse_object = context.parse_object + parse_array = context.parse_array + parse_string = context.parse_string + match_number = NUMBER_RE.match + strict = context.strict + parse_float = context.parse_float + parse_int = context.parse_int + parse_constant = context.parse_constant + object_hook = context.object_hook + + def _scan_once(string, idx): + try: + nextchar = string[idx] + except IndexError: + raise StopIteration + + if nextchar == '"': + return parse_string(string, idx + 1, strict) + elif nextchar == '{': + return parse_object((string, idx + 1), strict, + _scan_once, object_hook, object_pairs_hook) + elif nextchar == '[': + return parse_array((string, idx + 1), _scan_once) + elif nextchar == 'n' and string[idx:idx + 4] == 'null': + return None, idx + 4 + elif nextchar == 't' and string[idx:idx + 4] == 'true': + return True, idx + 4 + elif nextchar == 'f' and string[idx:idx + 5] == 'false': + return False, idx + 5 + + m = match_number(string, idx) + if m is not None: + integer, frac, exp = m.groups() + if frac or exp: + res = parse_float(integer + (frac or '') + (exp or '')) + else: + res = parse_int(integer) + return res, m.end() + elif nextchar == 'N' and string[idx:idx + 3] == 'NaN': + return parse_constant('NaN'), idx + 3 + elif nextchar == 'I' and string[idx:idx + 8] == 'Infinity': + return parse_constant('Infinity'), idx + 8 + elif nextchar == '-' and string[idx:idx + 9] == '-Infinity': + return parse_constant('-Infinity'), idx + 9 + else: + raise StopIteration + + return _scan_once + +make_scanner = c_make_scanner or py_make_scanner Modified: python/branches/py3k/Lib/json/tests/test_decode.py ============================================================================== --- python/branches/py3k/Lib/json/tests/test_decode.py (original) +++ python/branches/py3k/Lib/json/tests/test_decode.py Sat May 2 14:36:44 2009 @@ -32,3 +32,10 @@ object_pairs_hook = OrderedDict, object_hook = lambda x: None), OrderedDict(p)) + + def test_decoder_optimizations(self): + # Several optimizations were made that skip over calls to + # the whitespace regex, so this test is designed to try and + # exercise the uncommon cases. The array cases are already covered. + rval = json.loads('{ "key" : "value" , "k":"v" }') + self.assertEquals(rval, {"key":"value", "k":"v"}) Modified: python/branches/py3k/Lib/json/tests/test_dump.py ============================================================================== --- python/branches/py3k/Lib/json/tests/test_dump.py (original) +++ python/branches/py3k/Lib/json/tests/test_dump.py Sat May 2 14:36:44 2009 @@ -11,3 +11,11 @@ def test_dumps(self): self.assertEquals(json.dumps({}), '{}') + + def test_encode_truefalse(self): + self.assertEquals(json.dumps( + {True: False, False: True}, sort_keys=True), + '{"false": true, "true": false}') + self.assertEquals(json.dumps( + {2: 3.0, 4.0: 5, False: 1, 6: True}, sort_keys=True), + '{"false": 1, "2": 3.0, "4.0": 5, "6": true}') Modified: python/branches/py3k/Lib/json/tests/test_encode_basestring_ascii.py ============================================================================== --- python/branches/py3k/Lib/json/tests/test_encode_basestring_ascii.py (original) +++ python/branches/py3k/Lib/json/tests/test_encode_basestring_ascii.py Sat May 2 14:36:44 2009 @@ -3,22 +3,20 @@ import json.encoder CASES = [ - ('/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', b'"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'), - ('\u0123\u4567\u89ab\ucdef\uabcd\uef4a', b'"\\u0123\\u4567\\u89ab\\ucdef\\uabcd\\uef4a"'), - ('controls', b'"controls"'), - ('\x08\x0c\n\r\t', b'"\\b\\f\\n\\r\\t"'), - ('{"object with 1 member":["array with 1 element"]}', b'"{\\"object with 1 member\\":[\\"array with 1 element\\"]}"'), - (' s p a c e d ', b'" s p a c e d "'), - ('\U0001d120', b'"\\ud834\\udd20"'), - ('\u03b1\u03a9', b'"\\u03b1\\u03a9"'), - (b'\xce\xb1\xce\xa9', b'"\\u03b1\\u03a9"'), - ('\u03b1\u03a9', b'"\\u03b1\\u03a9"'), - (b'\xce\xb1\xce\xa9', b'"\\u03b1\\u03a9"'), - ('\u03b1\u03a9', b'"\\u03b1\\u03a9"'), - ('\u03b1\u03a9', b'"\\u03b1\\u03a9"'), - ("`1~!@#$%^&*()_+-={':[,]}|;.?", b'"`1~!@#$%^&*()_+-={\':[,]}|;.?"'), - ('\x08\x0c\n\r\t', b'"\\b\\f\\n\\r\\t"'), - ('\u0123\u4567\u89ab\ucdef\uabcd\uef4a', b'"\\u0123\\u4567\\u89ab\\ucdef\\uabcd\\uef4a"'), + ('/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'), + ('\u0123\u4567\u89ab\ucdef\uabcd\uef4a', '"\\u0123\\u4567\\u89ab\\ucdef\\uabcd\\uef4a"'), + ('controls', '"controls"'), + ('\x08\x0c\n\r\t', '"\\b\\f\\n\\r\\t"'), + ('{"object with 1 member":["array with 1 element"]}', '"{\\"object with 1 member\\":[\\"array with 1 element\\"]}"'), + (' s p a c e d ', '" s p a c e d "'), + ('\U0001d120', '"\\ud834\\udd20"'), + ('\u03b1\u03a9', '"\\u03b1\\u03a9"'), + ('\u03b1\u03a9', '"\\u03b1\\u03a9"'), + ('\u03b1\u03a9', '"\\u03b1\\u03a9"'), + ('\u03b1\u03a9', '"\\u03b1\\u03a9"'), + ("`1~!@#$%^&*()_+-={':[,]}|;.?", '"`1~!@#$%^&*()_+-={\':[,]}|;.?"'), + ('\x08\x0c\n\r\t', '"\\b\\f\\n\\r\\t"'), + ('\u0123\u4567\u89ab\ucdef\uabcd\uef4a', '"\\u0123\\u4567\\u89ab\\ucdef\\uabcd\\uef4a"'), ] class TestEncodeBaseStringAscii(TestCase): @@ -26,12 +24,14 @@ self._test_encode_basestring_ascii(json.encoder.py_encode_basestring_ascii) def test_c_encode_basestring_ascii(self): - if json.encoder.c_encode_basestring_ascii is not None: - self._test_encode_basestring_ascii(json.encoder.c_encode_basestring_ascii) + if not json.encoder.c_encode_basestring_ascii: + return + self._test_encode_basestring_ascii(json.encoder.c_encode_basestring_ascii) def _test_encode_basestring_ascii(self, encode_basestring_ascii): fname = encode_basestring_ascii.__name__ for input_string, expect in CASES: result = encode_basestring_ascii(input_string) - result = result.encode("ascii") - self.assertEquals(result, expect) + self.assertEquals(result, expect, + '{0!r} != {1!r} for {2}({3!r})'.format( + result, expect, fname, input_string)) Modified: python/branches/py3k/Lib/json/tests/test_fail.py ============================================================================== --- python/branches/py3k/Lib/json/tests/test_fail.py (original) +++ python/branches/py3k/Lib/json/tests/test_fail.py Sat May 2 14:36:44 2009 @@ -73,4 +73,4 @@ except ValueError: pass else: - self.fail("Expected failure for fail%d.json: %r" % (idx, doc)) + self.fail("Expected failure for fail{0}.json: {1!r}".format(idx, doc)) Modified: python/branches/py3k/Lib/json/tests/test_float.py ============================================================================== --- python/branches/py3k/Lib/json/tests/test_float.py (original) +++ python/branches/py3k/Lib/json/tests/test_float.py Sat May 2 14:36:44 2009 @@ -5,5 +5,11 @@ class TestFloat(TestCase): def test_floats(self): - for num in [1617161771.7650001, math.pi, math.pi**100, math.pi**-100]: + for num in [1617161771.7650001, math.pi, math.pi**100, math.pi**-100, 3.1]: self.assertEquals(float(json.dumps(num)), num) + self.assertEquals(json.loads(json.dumps(num)), num) + + def test_ints(self): + for num in [1, 1<<32, 1<<64]: + self.assertEquals(json.dumps(num), str(num)) + self.assertEquals(int(json.dumps(num)), num) Modified: python/branches/py3k/Lib/json/tests/test_scanstring.py ============================================================================== --- python/branches/py3k/Lib/json/tests/test_scanstring.py (original) +++ python/branches/py3k/Lib/json/tests/test_scanstring.py Sat May 2 14:36:44 2009 @@ -15,96 +15,90 @@ def _test_scanstring(self, scanstring): self.assertEquals( - scanstring('"z\\ud834\\udd20x"', 1, None, True), + scanstring('"z\\ud834\\udd20x"', 1, True), ('z\U0001d120x', 16)) if sys.maxunicode == 65535: self.assertEquals( - scanstring('"z\U0001d120x"', 1, None, True), + scanstring('"z\U0001d120x"', 1, True), ('z\U0001d120x', 6)) else: self.assertEquals( - scanstring('"z\U0001d120x"', 1, None, True), + scanstring('"z\U0001d120x"', 1, True), ('z\U0001d120x', 5)) self.assertEquals( - scanstring('"\\u007b"', 1, None, True), + scanstring('"\\u007b"', 1, True), ('{', 8)) self.assertEquals( - scanstring('"A JSON payload should be an object or array, not a string."', 1, None, True), + scanstring('"A JSON payload should be an object or array, not a string."', 1, True), ('A JSON payload should be an object or array, not a string.', 60)) self.assertEquals( - scanstring('["Unclosed array"', 2, None, True), + scanstring('["Unclosed array"', 2, True), ('Unclosed array', 17)) self.assertEquals( - scanstring('["extra comma",]', 2, None, True), + scanstring('["extra comma",]', 2, True), ('extra comma', 14)) self.assertEquals( - scanstring('["double extra comma",,]', 2, None, True), + scanstring('["double extra comma",,]', 2, True), ('double extra comma', 21)) self.assertEquals( - scanstring('["Comma after the close"],', 2, None, True), + scanstring('["Comma after the close"],', 2, True), ('Comma after the close', 24)) self.assertEquals( - scanstring('["Extra close"]]', 2, None, True), + scanstring('["Extra close"]]', 2, True), ('Extra close', 14)) self.assertEquals( - scanstring('{"Extra comma": true,}', 2, None, True), + scanstring('{"Extra comma": true,}', 2, True), ('Extra comma', 14)) self.assertEquals( - scanstring('{"Extra value after close": true} "misplaced quoted value"', 2, None, True), + scanstring('{"Extra value after close": true} "misplaced quoted value"', 2, True), ('Extra value after close', 26)) self.assertEquals( - scanstring('{"Illegal expression": 1 + 2}', 2, None, True), + scanstring('{"Illegal expression": 1 + 2}', 2, True), ('Illegal expression', 21)) self.assertEquals( - scanstring('{"Illegal invocation": alert()}', 2, None, True), + scanstring('{"Illegal invocation": alert()}', 2, True), ('Illegal invocation', 21)) self.assertEquals( - scanstring('{"Numbers cannot have leading zeroes": 013}', 2, None, True), + scanstring('{"Numbers cannot have leading zeroes": 013}', 2, True), ('Numbers cannot have leading zeroes', 37)) self.assertEquals( - scanstring('{"Numbers cannot be hex": 0x14}', 2, None, True), + scanstring('{"Numbers cannot be hex": 0x14}', 2, True), ('Numbers cannot be hex', 24)) self.assertEquals( - scanstring('[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]', 21, None, True), + scanstring('[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]', 21, True), ('Too deep', 30)) self.assertEquals( - scanstring('{"Missing colon" null}', 2, None, True), + scanstring('{"Missing colon" null}', 2, True), ('Missing colon', 16)) self.assertEquals( - scanstring('{"Double colon":: null}', 2, None, True), + scanstring('{"Double colon":: null}', 2, True), ('Double colon', 15)) self.assertEquals( - scanstring('{"Comma instead of colon", null}', 2, None, True), + scanstring('{"Comma instead of colon", null}', 2, True), ('Comma instead of colon', 25)) self.assertEquals( - scanstring('["Colon instead of comma": false]', 2, None, True), + scanstring('["Colon instead of comma": false]', 2, True), ('Colon instead of comma', 25)) self.assertEquals( - scanstring('["Bad value", truth]', 2, None, True), + scanstring('["Bad value", truth]', 2, True), ('Bad value', 12)) - - def test_issue3623(self): - self.assertRaises(ValueError, json.decoder.scanstring, b"xxx", 1, - "xxx") - self.assertRaises(UnicodeDecodeError, - json.encoder.encode_basestring_ascii, b"xx\xff") Modified: python/branches/py3k/Lib/json/tests/test_unicode.py ============================================================================== --- python/branches/py3k/Lib/json/tests/test_unicode.py (original) +++ python/branches/py3k/Lib/json/tests/test_unicode.py Sat May 2 14:36:44 2009 @@ -4,20 +4,8 @@ from collections import OrderedDict class TestUnicode(TestCase): - def test_encoding1(self): - encoder = json.JSONEncoder(encoding='utf-8') - u = '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}' - s = u.encode('utf-8') - ju = encoder.encode(u) - js = encoder.encode(s) - self.assertEquals(ju, js) - - def test_encoding2(self): - u = '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}' - s = u.encode('utf-8') - ju = json.dumps(u, encoding='utf-8') - js = json.dumps(s, encoding='utf-8') - self.assertEquals(ju, js) + # test_encoding1 and test_encoding2 from 2.x are irrelevant (only str + # is supported as input, not bytes). def test_encoding3(self): u = '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}' @@ -52,8 +40,22 @@ def test_unicode_decode(self): for i in range(0, 0xd7ff): u = chr(i) - js = '"\\u{0:04x}"'.format(i) - self.assertEquals(json.loads(js), u) + s = '"\\u{0:04x}"'.format(i) + self.assertEquals(json.loads(s), u) + + def test_unicode_preservation(self): + self.assertEquals(type(json.loads('""')), str) + self.assertEquals(type(json.loads('"a"')), str) + self.assertEquals(type(json.loads('["a"]')[0]), str) + + def test_bytes_encode(self): + self.assertRaises(TypeError, json.dumps, b"hi") + self.assertRaises(TypeError, json.dumps, [b"hi"]) + + def test_bytes_decode(self): + self.assertRaises(TypeError, json.loads, b'"hi"') + self.assertRaises(TypeError, json.loads, b'["hi"]') + def test_object_pairs_hook_with_unicode(self): s = '{"xkd":1, "kcw":2, "art":3, "hxm":4, "qrt":5, "pad":6, "hoy":7}' Modified: python/branches/py3k/Lib/json/tool.py ============================================================================== --- python/branches/py3k/Lib/json/tool.py (original) +++ python/branches/py3k/Lib/json/tool.py Sat May 2 14:36:44 2009 @@ -2,11 +2,11 @@ Usage:: - $ echo '{"json":"obj"}' | python -mjson.tool + $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } - $ echo '{ 1.2:3.4}' | python -mjson.tool + $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name: line 1 column 2 (char 2) """ @@ -24,7 +24,7 @@ infile = open(sys.argv[1], 'rb') outfile = open(sys.argv[2], 'wb') else: - raise SystemExit("{0} [infile [outfile]]".format(sys.argv[0])) + raise SystemExit(sys.argv[0] + " [infile [outfile]]") try: obj = json.load(infile) except ValueError as e: Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 2 14:36:44 2009 @@ -107,6 +107,8 @@ Library ------- +- The json module now works exclusively with str and not bytes. + - Issue #3959: The ipaddr module has been added to the standard library. Contributed by Google. Modified: python/branches/py3k/Modules/_json.c ============================================================================== --- python/branches/py3k/Modules/_json.c (original) +++ python/branches/py3k/Modules/_json.c Sat May 2 14:36:44 2009 @@ -1,23 +1,160 @@ #include "Python.h" +#include "structmember.h" +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TYPE) +#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) +#endif +#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) +typedef int Py_ssize_t; +#define PY_SSIZE_T_MAX INT_MAX +#define PY_SSIZE_T_MIN INT_MIN +#define PyInt_FromSsize_t PyInt_FromLong +#define PyInt_AsSsize_t PyInt_AsLong +#endif +#ifndef Py_IS_FINITE +#define Py_IS_FINITE(X) (!Py_IS_INFINITY(X) && !Py_IS_NAN(X)) +#endif + +#ifdef __GNUC__ +#define UNUSED __attribute__((__unused__)) +#else +#define UNUSED +#endif + +#define PyScanner_Check(op) PyObject_TypeCheck(op, &PyScannerType) +#define PyScanner_CheckExact(op) (Py_TYPE(op) == &PyScannerType) +#define PyEncoder_Check(op) PyObject_TypeCheck(op, &PyEncoderType) +#define PyEncoder_CheckExact(op) (Py_TYPE(op) == &PyEncoderType) + +static PyTypeObject PyScannerType; +static PyTypeObject PyEncoderType; + +typedef struct _PyScannerObject { + PyObject_HEAD + PyObject *strict; + PyObject *object_hook; + PyObject *object_pairs_hook; + PyObject *parse_float; + PyObject *parse_int; + PyObject *parse_constant; +} PyScannerObject; + +static PyMemberDef scanner_members[] = { + {"strict", T_OBJECT, offsetof(PyScannerObject, strict), READONLY, "strict"}, + {"object_hook", T_OBJECT, offsetof(PyScannerObject, object_hook), READONLY, "object_hook"}, + {"object_pairs_hook", T_OBJECT, offsetof(PyScannerObject, object_pairs_hook), READONLY}, + {"parse_float", T_OBJECT, offsetof(PyScannerObject, parse_float), READONLY, "parse_float"}, + {"parse_int", T_OBJECT, offsetof(PyScannerObject, parse_int), READONLY, "parse_int"}, + {"parse_constant", T_OBJECT, offsetof(PyScannerObject, parse_constant), READONLY, "parse_constant"}, + {NULL} +}; + +typedef struct _PyEncoderObject { + PyObject_HEAD + PyObject *markers; + PyObject *defaultfn; + PyObject *encoder; + PyObject *indent; + PyObject *key_separator; + PyObject *item_separator; + PyObject *sort_keys; + PyObject *skipkeys; + int fast_encode; + int allow_nan; +} PyEncoderObject; + +static PyMemberDef encoder_members[] = { + {"markers", T_OBJECT, offsetof(PyEncoderObject, markers), READONLY, "markers"}, + {"default", T_OBJECT, offsetof(PyEncoderObject, defaultfn), READONLY, "default"}, + {"encoder", T_OBJECT, offsetof(PyEncoderObject, encoder), READONLY, "encoder"}, + {"indent", T_OBJECT, offsetof(PyEncoderObject, indent), READONLY, "indent"}, + {"key_separator", T_OBJECT, offsetof(PyEncoderObject, key_separator), READONLY, "key_separator"}, + {"item_separator", T_OBJECT, offsetof(PyEncoderObject, item_separator), READONLY, "item_separator"}, + {"sort_keys", T_OBJECT, offsetof(PyEncoderObject, sort_keys), READONLY, "sort_keys"}, + {"skipkeys", T_OBJECT, offsetof(PyEncoderObject, skipkeys), READONLY, "skipkeys"}, + {NULL} +}; + +static PyObject * +ascii_escape_unicode(PyObject *pystr); +static PyObject * +py_encode_basestring_ascii(PyObject* self UNUSED, PyObject *pystr); +void init_json(void); +static PyObject * +scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr); +static PyObject * +_build_rval_index_tuple(PyObject *rval, Py_ssize_t idx); +static PyObject * +scanner_new(PyTypeObject *type, PyObject *args, PyObject *kwds); +static int +scanner_init(PyObject *self, PyObject *args, PyObject *kwds); +static void +scanner_dealloc(PyObject *self); +static int +scanner_clear(PyObject *self); +static PyObject * +encoder_new(PyTypeObject *type, PyObject *args, PyObject *kwds); +static int +encoder_init(PyObject *self, PyObject *args, PyObject *kwds); +static void +encoder_dealloc(PyObject *self); +static int +encoder_clear(PyObject *self); +static int +encoder_listencode_list(PyEncoderObject *s, PyObject *rval, PyObject *seq, Py_ssize_t indent_level); +static int +encoder_listencode_obj(PyEncoderObject *s, PyObject *rval, PyObject *obj, Py_ssize_t indent_level); +static int +encoder_listencode_dict(PyEncoderObject *s, PyObject *rval, PyObject *dct, Py_ssize_t indent_level); +static PyObject * +_encoded_const(PyObject *const); +static void +raise_errmsg(char *msg, PyObject *s, Py_ssize_t end); +static PyObject * +encoder_encode_string(PyEncoderObject *s, PyObject *obj); +static int +_convertPyInt_AsSsize_t(PyObject *o, Py_ssize_t *size_ptr); +static PyObject * +_convertPyInt_FromSsize_t(Py_ssize_t *size_ptr); +static PyObject * +encoder_encode_float(PyEncoderObject *s, PyObject *obj); -#define DEFAULT_ENCODING "utf-8" #define S_CHAR(c) (c >= ' ' && c <= '~' && c != '\\' && c != '"') -#define MIN_EXPANSION 6 +#define IS_WHITESPACE(c) (((c) == ' ') || ((c) == '\t') || ((c) == '\n') || ((c) == '\r')) +#define MIN_EXPANSION 6 #ifdef Py_UNICODE_WIDE #define MAX_EXPANSION (2 * MIN_EXPANSION) #else #define MAX_EXPANSION MIN_EXPANSION #endif +static int +_convertPyInt_AsSsize_t(PyObject *o, Py_ssize_t *size_ptr) +{ + /* PyObject to Py_ssize_t converter */ + *size_ptr = PyLong_AsSsize_t(o); + if (*size_ptr == -1 && PyErr_Occurred()); + return 1; + return 0; +} + +static PyObject * +_convertPyInt_FromSsize_t(Py_ssize_t *size_ptr) +{ + /* Py_ssize_t to PyObject converter */ + return PyLong_FromSsize_t(*size_ptr); +} + static Py_ssize_t -ascii_escape_char(Py_UNICODE c, char *output, Py_ssize_t chars) +ascii_escape_unichar(Py_UNICODE c, Py_UNICODE *output, Py_ssize_t chars) { - Py_UNICODE x; + /* Escape unicode code point c to ASCII escape sequences + in char *output. output must have at least 12 bytes unused to + accommodate an escaped surrogate pair "\uXXXX\uXXXX" */ output[chars++] = '\\'; switch (c) { - case '\\': output[chars++] = (char)c; break; - case '"': output[chars++] = (char)c; break; + case '\\': output[chars++] = c; break; + case '"': output[chars++] = c; break; case '\b': output[chars++] = 'b'; break; case '\f': output[chars++] = 'f'; break; case '\n': output[chars++] = 'n'; break; @@ -30,27 +167,19 @@ Py_UNICODE v = c - 0x10000; c = 0xd800 | ((v >> 10) & 0x3ff); output[chars++] = 'u'; - x = (c & 0xf000) >> 12; - output[chars++] = (x < 10) ? '0' + x : 'a' + (x - 10); - x = (c & 0x0f00) >> 8; - output[chars++] = (x < 10) ? '0' + x : 'a' + (x - 10); - x = (c & 0x00f0) >> 4; - output[chars++] = (x < 10) ? '0' + x : 'a' + (x - 10); - x = (c & 0x000f); - output[chars++] = (x < 10) ? '0' + x : 'a' + (x - 10); + output[chars++] = "0123456789abcdef"[(c >> 12) & 0xf]; + output[chars++] = "0123456789abcdef"[(c >> 8) & 0xf]; + output[chars++] = "0123456789abcdef"[(c >> 4) & 0xf]; + output[chars++] = "0123456789abcdef"[(c ) & 0xf]; c = 0xdc00 | (v & 0x3ff); output[chars++] = '\\'; } #endif output[chars++] = 'u'; - x = (c & 0xf000) >> 12; - output[chars++] = (x < 10) ? '0' + x : 'a' + (x - 10); - x = (c & 0x0f00) >> 8; - output[chars++] = (x < 10) ? '0' + x : 'a' + (x - 10); - x = (c & 0x00f0) >> 4; - output[chars++] = (x < 10) ? '0' + x : 'a' + (x - 10); - x = (c & 0x000f); - output[chars++] = (x < 10) ? '0' + x : 'a' + (x - 10); + output[chars++] = "0123456789abcdef"[(c >> 12) & 0xf]; + output[chars++] = "0123456789abcdef"[(c >> 8) & 0xf]; + output[chars++] = "0123456789abcdef"[(c >> 4) & 0xf]; + output[chars++] = "0123456789abcdef"[(c ) & 0xf]; } return chars; } @@ -58,118 +187,66 @@ static PyObject * ascii_escape_unicode(PyObject *pystr) { + /* Take a PyUnicode pystr and return a new ASCII-only escaped PyUnicode */ Py_ssize_t i; Py_ssize_t input_chars; Py_ssize_t output_size; + Py_ssize_t max_output_size; Py_ssize_t chars; PyObject *rval; - char *output; + Py_UNICODE *output; Py_UNICODE *input_unicode; input_chars = PyUnicode_GET_SIZE(pystr); input_unicode = PyUnicode_AS_UNICODE(pystr); + /* One char input can be up to 6 chars output, estimate 4 of these */ output_size = 2 + (MIN_EXPANSION * 4) + input_chars; - rval = PyBytes_FromStringAndSize(NULL, output_size); + max_output_size = 2 + (input_chars * MAX_EXPANSION); + rval = PyUnicode_FromStringAndSize(NULL, output_size); if (rval == NULL) { return NULL; } - output = PyBytes_AS_STRING(rval); + output = PyUnicode_AS_UNICODE(rval); chars = 0; output[chars++] = '"'; for (i = 0; i < input_chars; i++) { Py_UNICODE c = input_unicode[i]; if (S_CHAR(c)) { - output[chars++] = (char)c; + output[chars++] = c; } - else { - chars = ascii_escape_char(c, output, chars); + else { + chars = ascii_escape_unichar(c, output, chars); } if (output_size - chars < (1 + MAX_EXPANSION)) { /* There's more than four, so let's resize by a lot */ - output_size *= 2; + Py_ssize_t new_output_size = output_size * 2; /* This is an upper bound */ - if (output_size > 2 + (input_chars * MAX_EXPANSION)) { - output_size = 2 + (input_chars * MAX_EXPANSION); - } - if (_PyBytes_Resize(&rval, output_size) == -1) { - return NULL; - } - output = PyBytes_AS_STRING(rval); - } - } - output[chars++] = '"'; - if (_PyBytes_Resize(&rval, chars) == -1) { - return NULL; - } - return rval; -} - -static PyObject * -ascii_escape_str(PyObject *pystr) -{ - Py_ssize_t i; - Py_ssize_t input_chars; - Py_ssize_t output_size; - Py_ssize_t chars; - PyObject *rval; - char *output; - char *input_str; - - input_chars = PyBytes_GET_SIZE(pystr); - input_str = PyBytes_AS_STRING(pystr); - /* One char input can be up to 6 chars output, estimate 4 of these */ - output_size = 2 + (MIN_EXPANSION * 4) + input_chars; - rval = PyBytes_FromStringAndSize(NULL, output_size); - if (rval == NULL) { - return NULL; - } - output = PyBytes_AS_STRING(rval); - chars = 0; - output[chars++] = '"'; - for (i = 0; i < input_chars; i++) { - Py_UNICODE c = (Py_UNICODE)input_str[i]; - if (S_CHAR(c)) { - output[chars++] = (char)c; - } - else if (c > 0x7F) { - /* We hit a non-ASCII character, bail to unicode mode */ - PyObject *uni; - Py_DECREF(rval); - uni = PyUnicode_DecodeUTF8(input_str, input_chars, "strict"); - if (uni == NULL) { - return NULL; - } - rval = ascii_escape_unicode(uni); - Py_DECREF(uni); - return rval; - } - else { - chars = ascii_escape_char(c, output, chars); - } - /* An ASCII char can't possibly expand to a surrogate! */ - if (output_size - chars < (1 + MIN_EXPANSION)) { - /* There's more than four, so let's resize by a lot */ - output_size *= 2; - if (output_size > 2 + (input_chars * MIN_EXPANSION)) { - output_size = 2 + (input_chars * MIN_EXPANSION); + if (new_output_size > max_output_size) { + new_output_size = max_output_size; } - if (_PyBytes_Resize(&rval, output_size) == -1) { - return NULL; + /* Make sure that the output size changed before resizing */ + if (new_output_size != output_size) { + output_size = new_output_size; + if (PyUnicode_Resize(&rval, output_size) == -1) { + return NULL; + } + output = PyUnicode_AS_UNICODE(rval); } - output = PyBytes_AS_STRING(rval); } } output[chars++] = '"'; - if (_PyBytes_Resize(&rval, chars) == -1) { + if (PyUnicode_Resize(&rval, chars) == -1) { return NULL; } return rval; } -void +static void raise_errmsg(char *msg, PyObject *s, Py_ssize_t end) { + /* Use the Python function json.decoder.errmsg to raise a nice + looking ValueError exception */ static PyObject *errmsg_fn = NULL; PyObject *pymsg; if (errmsg_fn == NULL) { @@ -177,63 +254,73 @@ if (decoder == NULL) return; errmsg_fn = PyObject_GetAttrString(decoder, "errmsg"); + Py_DECREF(decoder); if (errmsg_fn == NULL) return; - Py_DECREF(decoder); } - pymsg = PyObject_CallFunction(errmsg_fn, "(zOn)", msg, s, end); + pymsg = PyObject_CallFunction(errmsg_fn, "(zOO&)", msg, s, _convertPyInt_FromSsize_t, &end); if (pymsg) { PyErr_SetObject(PyExc_ValueError, pymsg); Py_DECREF(pymsg); } -/* - -def linecol(doc, pos): - lineno = doc.count('\n', 0, pos) + 1 - if lineno == 1: - colno = pos - else: - colno = pos - doc.rindex('\n', 0, pos) - return lineno, colno - -def errmsg(msg, doc, pos, end=None): - lineno, colno = linecol(doc, pos) - if end is None: - return '%s: line %d column %d (char %d)' % (msg, lineno, colno, pos) - endlineno, endcolno = linecol(doc, end) - return '%s: line %d column %d - line %d column %d (char %d - %d)' % ( - msg, lineno, colno, endlineno, endcolno, pos, end) - -*/ } static PyObject * join_list_unicode(PyObject *lst) { - static PyObject *ustr = NULL; - static PyObject *joinstr = NULL; - if (ustr == NULL) { - Py_UNICODE c = 0; - ustr = PyUnicode_FromUnicode(&c, 0); + /* return u''.join(lst) */ + static PyObject *sep = NULL; + if (sep == NULL) { + sep = PyUnicode_FromStringAndSize("", 0); + if (sep == NULL) + return NULL; + } + return PyUnicode_Join(sep, lst); +} + +static PyObject * +_build_rval_index_tuple(PyObject *rval, Py_ssize_t idx) { + /* return (rval, idx) tuple, stealing reference to rval */ + PyObject *tpl; + PyObject *pyidx; + /* + steal a reference to rval, returns (rval, idx) + */ + if (rval == NULL) { + return NULL; } - if (joinstr == NULL) { - joinstr = PyUnicode_InternFromString("join"); + pyidx = PyLong_FromSsize_t(idx); + if (pyidx == NULL) { + Py_DECREF(rval); + return NULL; } - if (joinstr == NULL || ustr == NULL) { + tpl = PyTuple_New(2); + if (tpl == NULL) { + Py_DECREF(pyidx); + Py_DECREF(rval); return NULL; } - return PyObject_CallMethodObjArgs(ustr, joinstr, lst, NULL); + PyTuple_SET_ITEM(tpl, 0, rval); + PyTuple_SET_ITEM(tpl, 1, pyidx); + return tpl; } static PyObject * -scanstring_str(PyObject *pystr, Py_ssize_t end, char *encoding, int strict) +scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next_end_ptr) { + /* Read the JSON string from PyUnicode pystr. + end is the index of the first character after the quote. + if strict is zero then literal control characters are allowed + *next_end_ptr is a return-by-reference index of the character + after the end quote + + Return value is a new PyUnicode + */ PyObject *rval; - Py_ssize_t len = PyBytes_GET_SIZE(pystr); + Py_ssize_t len = PyUnicode_GET_SIZE(pystr); Py_ssize_t begin = end - 1; Py_ssize_t next = begin; - char *buf = PyBytes_AS_STRING(pystr); - Py_buffer info; + const Py_UNICODE *buf = PyUnicode_AS_UNICODE(pystr); PyObject *chunks = PyList_New(0); if (chunks == NULL) { goto bail; @@ -262,16 +349,7 @@ } /* Pick up this chunk if it's not zero length */ if (next != end) { - PyObject *strchunk; - if (PyBuffer_FillInfo(&info, NULL, &buf[end], next - end, 1, 0) < 0) { - goto bail; - } - strchunk = PyMemoryView_FromBuffer(&info); - if (strchunk == NULL) { - goto bail; - } - chunk = PyUnicode_FromEncodedObject(strchunk, encoding, NULL); - Py_DECREF(strchunk); + chunk = PyUnicode_FromUnicode(&buf[end], next - end); if (chunk == NULL) { goto bail; } @@ -320,18 +398,18 @@ } /* Decode 4 hex digits */ for (; next < end; next++) { - Py_ssize_t shl = (end - next - 1) << 2; Py_UNICODE digit = buf[next]; + c <<= 4; switch (digit) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - c |= (digit - '0') << shl; break; + c |= (digit - '0'); break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': - c |= (digit - 'a' + 10) << shl; break; + c |= (digit - 'a' + 10); break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - c |= (digit - 'A' + 10) << shl; break; + c |= (digit - 'A' + 10); break; default: raise_errmsg("Invalid \\uXXXX escape", pystr, end - 5); goto bail; @@ -339,38 +417,46 @@ } #ifdef Py_UNICODE_WIDE /* Surrogate pair */ - if (c >= 0xd800 && c <= 0xdbff) { + if ((c & 0xfc00) == 0xd800) { Py_UNICODE c2 = 0; if (end + 6 >= len) { - raise_errmsg("Invalid \\uXXXX\\uXXXX surrogate pair", pystr, - end - 5); + raise_errmsg("Unpaired high surrogate", pystr, end - 5); + goto bail; } if (buf[next++] != '\\' || buf[next++] != 'u') { - raise_errmsg("Invalid \\uXXXX\\uXXXX surrogate pair", pystr, - end - 5); + raise_errmsg("Unpaired high surrogate", pystr, end - 5); + goto bail; } end += 6; /* Decode 4 hex digits */ for (; next < end; next++) { - Py_ssize_t shl = (end - next - 1) << 2; + c2 <<= 4; Py_UNICODE digit = buf[next]; switch (digit) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - c2 |= (digit - '0') << shl; break; + c2 |= (digit - '0'); break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': - c2 |= (digit - 'a' + 10) << shl; break; + c2 |= (digit - 'a' + 10); break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - c2 |= (digit - 'A' + 10) << shl; break; + c2 |= (digit - 'A' + 10); break; default: raise_errmsg("Invalid \\uXXXX escape", pystr, end - 5); goto bail; } } + if ((c2 & 0xfc00) != 0xdc00) { + raise_errmsg("Unpaired high surrogate", pystr, end - 5); + goto bail; + } c = 0x10000 + (((c - 0xd800) << 10) | (c2 - 0xdc00)); } + else if ((c & 0xfc00) == 0xdc00) { + raise_errmsg("Unpaired low surrogate", pystr, end - 5); + goto bail; + } #endif } chunk = PyUnicode_FromUnicode(&c, 1); @@ -388,237 +474,1176 @@ if (rval == NULL) { goto bail; } - Py_CLEAR(chunks); - return Py_BuildValue("(Nn)", rval, end); + Py_DECREF(chunks); + *next_end_ptr = end; + return rval; bail: + *next_end_ptr = -1; Py_XDECREF(chunks); return NULL; } +PyDoc_STRVAR(pydoc_scanstring, + "scanstring(basestring, end, strict=True) -> (bytes, end)\n" + "\n" + "Scan the string s for a JSON string. End is the index of the\n" + "character in s after the quote that started the JSON string.\n" + "Unescapes all valid JSON string escape sequences and raises ValueError\n" + "on attempt to decode an invalid string. If strict is False then literal\n" + "control characters are allowed in the string.\n" + "\n" + "Returns a tuple of the decoded string and the index of the character in s\n" + "after the end quote." +); static PyObject * -scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict) +py_scanstring(PyObject* self UNUSED, PyObject *args) { + PyObject *pystr; PyObject *rval; - Py_ssize_t len = PyUnicode_GET_SIZE(pystr); - Py_ssize_t begin = end - 1; - Py_ssize_t next = begin; - const Py_UNICODE *buf = PyUnicode_AS_UNICODE(pystr); - PyObject *chunks = PyList_New(0); - if (chunks == NULL) { - goto bail; + Py_ssize_t end; + Py_ssize_t next_end = -1; + int strict = 1; + if (!PyArg_ParseTuple(args, "OO&|i:scanstring", &pystr, _convertPyInt_AsSsize_t, &end, &strict)) { + return NULL; } - if (end < 0 || len <= end) { - PyErr_SetString(PyExc_ValueError, "end is out of bounds"); - goto bail; + if (PyUnicode_Check(pystr)) { + rval = scanstring_unicode(pystr, end, strict, &next_end); } - while (1) { - /* Find the end of the string or the next escape */ - Py_UNICODE c = 0; - PyObject *chunk = NULL; - for (next = end; next < len; next++) { - c = buf[next]; - if (c == '"' || c == '\\') { - break; - } - else if (strict && c <= 0x1f) { - raise_errmsg("Invalid control character at", pystr, next); + else { + PyErr_Format(PyExc_TypeError, + "first argument must be a string or bytes, not %.80s", + Py_TYPE(pystr)->tp_name); + return NULL; + } + return _build_rval_index_tuple(rval, next_end); +} + +PyDoc_STRVAR(pydoc_encode_basestring_ascii, + "encode_basestring_ascii(basestring) -> bytes\n" + "\n" + "Return an ASCII-only JSON representation of a Python string" +); + +static PyObject * +py_encode_basestring_ascii(PyObject* self UNUSED, PyObject *pystr) +{ + PyObject *rval; + /* Return an ASCII-only JSON representation of a Python string */ + /* METH_O */ + if (PyUnicode_Check(pystr)) { + rval = ascii_escape_unicode(pystr); + } + else { + PyErr_Format(PyExc_TypeError, + "first argument must be a string, not %.80s", + Py_TYPE(pystr)->tp_name); + return NULL; + } + return rval; +} + +static void +scanner_dealloc(PyObject *self) +{ + /* Deallocate scanner object */ + scanner_clear(self); + Py_TYPE(self)->tp_free(self); +} + +static int +scanner_traverse(PyObject *self, visitproc visit, void *arg) +{ + PyScannerObject *s; + assert(PyScanner_Check(self)); + s = (PyScannerObject *)self; + Py_VISIT(s->strict); + Py_VISIT(s->object_hook); + Py_VISIT(s->object_pairs_hook); + Py_VISIT(s->parse_float); + Py_VISIT(s->parse_int); + Py_VISIT(s->parse_constant); + return 0; +} + +static int +scanner_clear(PyObject *self) +{ + PyScannerObject *s; + assert(PyScanner_Check(self)); + s = (PyScannerObject *)self; + Py_CLEAR(s->strict); + Py_CLEAR(s->object_hook); + Py_CLEAR(s->object_pairs_hook); + Py_CLEAR(s->parse_float); + Py_CLEAR(s->parse_int); + Py_CLEAR(s->parse_constant); + return 0; +} + +static PyObject * +_parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr) { + /* Read a JSON object from PyUnicode pystr. + idx is the index of the first character after the opening curly brace. + *next_idx_ptr is a return-by-reference index to the first character after + the closing curly brace. + + Returns a new PyObject (usually a dict, but object_hook can change that) + */ + Py_UNICODE *str = PyUnicode_AS_UNICODE(pystr); + Py_ssize_t end_idx = PyUnicode_GET_SIZE(pystr) - 1; + PyObject *val = NULL; + PyObject *rval = PyList_New(0); + PyObject *key = NULL; + int strict = PyObject_IsTrue(s->strict); + Py_ssize_t next_idx; + if (rval == NULL) + return NULL; + + /* skip whitespace after { */ + while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; + + /* only loop if the object is non-empty */ + if (idx <= end_idx && str[idx] != '}') { + while (idx <= end_idx) { + /* read key */ + if (str[idx] != '"') { + raise_errmsg("Expecting property name", pystr, idx); goto bail; } - } - if (!(c == '"' || c == '\\')) { - raise_errmsg("Unterminated string starting at", pystr, begin); - goto bail; - } - /* Pick up this chunk if it's not zero length */ - if (next != end) { - chunk = PyUnicode_FromUnicode(&buf[end], next - end); - if (chunk == NULL) { + key = scanstring_unicode(pystr, idx + 1, strict, &next_idx); + if (key == NULL) + goto bail; + idx = next_idx; + + /* skip whitespace between key and : delimiter, read :, skip whitespace */ + while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; + if (idx > end_idx || str[idx] != ':') { + raise_errmsg("Expecting : delimiter", pystr, idx); goto bail; } - if (PyList_Append(chunks, chunk)) { - Py_DECREF(chunk); + idx++; + while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; + + /* read any JSON term */ + val = scan_once_unicode(s, pystr, idx, &next_idx); + if (val == NULL) goto bail; + + { + PyObject *tuple = PyTuple_Pack(2, key, val); + if (tuple == NULL) + goto bail; + if (PyList_Append(rval, tuple) == -1) { + Py_DECREF(tuple); + goto bail; + } + Py_DECREF(tuple); } - Py_DECREF(chunk); - } - next++; - if (c == '"') { - end = next; - break; - } - if (next == len) { - raise_errmsg("Unterminated string starting at", pystr, begin); - goto bail; - } - c = buf[next]; - if (c != 'u') { - /* Non-unicode backslash escapes */ - end = next + 1; - switch (c) { - case '"': break; - case '\\': break; - case '/': break; - case 'b': c = '\b'; break; - case 'f': c = '\f'; break; - case 'n': c = '\n'; break; - case 'r': c = '\r'; break; - case 't': c = '\t'; break; - default: c = 0; + + Py_CLEAR(key); + Py_CLEAR(val); + idx = next_idx; + + /* skip whitespace before } or , */ + while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; + + /* bail if the object is closed or we didn't get the , delimiter */ + if (idx > end_idx) break; + if (str[idx] == '}') { + break; } - if (c == 0) { - raise_errmsg("Invalid \\escape", pystr, end - 2); + else if (str[idx] != ',') { + raise_errmsg("Expecting , delimiter", pystr, idx); goto bail; } + idx++; + + /* skip whitespace after , delimiter */ + while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; } - else { - c = 0; - next++; - end = next + 4; - if (end >= len) { - raise_errmsg("Invalid \\uXXXX escape", pystr, next - 1); + } + + /* verify that idx < end_idx, str[idx] should be '}' */ + if (idx > end_idx || str[idx] != '}') { + raise_errmsg("Expecting object", pystr, end_idx); + goto bail; + } + + *next_idx_ptr = idx + 1; + + if (s->object_pairs_hook != Py_None) { + val = PyObject_CallFunctionObjArgs(s->object_pairs_hook, rval, NULL); + if (val == NULL) + goto bail; + Py_DECREF(rval); + return val; + } + + val = PyDict_New(); + if (val == NULL) + goto bail; + if (PyDict_MergeFromSeq2(val, rval, 1) == -1) + goto bail; + Py_DECREF(rval); + rval = val; + + /* if object_hook is not None: rval = object_hook(rval) */ + if (s->object_hook != Py_None) { + val = PyObject_CallFunctionObjArgs(s->object_hook, rval, NULL); + if (val == NULL) + goto bail; + Py_DECREF(rval); + rval = val; + val = NULL; + } + return rval; +bail: + Py_XDECREF(key); + Py_XDECREF(val); + Py_DECREF(rval); + return NULL; +} + +static PyObject * +_parse_array_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr) { + /* Read a JSON array from PyString pystr. + idx is the index of the first character after the opening brace. + *next_idx_ptr is a return-by-reference index to the first character after + the closing brace. + + Returns a new PyList + */ + Py_UNICODE *str = PyUnicode_AS_UNICODE(pystr); + Py_ssize_t end_idx = PyUnicode_GET_SIZE(pystr) - 1; + PyObject *val = NULL; + PyObject *rval = PyList_New(0); + Py_ssize_t next_idx; + if (rval == NULL) + return NULL; + + /* skip whitespace after [ */ + while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; + + /* only loop if the array is non-empty */ + if (idx <= end_idx && str[idx] != ']') { + while (idx <= end_idx) { + + /* read any JSON term */ + val = scan_once_unicode(s, pystr, idx, &next_idx); + if (val == NULL) goto bail; + + if (PyList_Append(rval, val) == -1) + goto bail; + + Py_CLEAR(val); + idx = next_idx; + + /* skip whitespace between term and , */ + while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; + + /* bail if the array is closed or we didn't get the , delimiter */ + if (idx > end_idx) break; + if (str[idx] == ']') { + break; } - /* Decode 4 hex digits */ - for (; next < end; next++) { - Py_ssize_t shl = (end - next - 1) << 2; - Py_UNICODE digit = buf[next]; - switch (digit) { - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - c |= (digit - '0') << shl; break; - case 'a': case 'b': case 'c': case 'd': case 'e': - case 'f': - c |= (digit - 'a' + 10) << shl; break; - case 'A': case 'B': case 'C': case 'D': case 'E': - case 'F': - c |= (digit - 'A' + 10) << shl; break; - default: - raise_errmsg("Invalid \\uXXXX escape", pystr, end - 5); - goto bail; - } - } -#ifdef Py_UNICODE_WIDE - /* Surrogate pair */ - if (c >= 0xd800 && c <= 0xdbff) { - Py_UNICODE c2 = 0; - if (end + 6 >= len) { - raise_errmsg("Invalid \\uXXXX\\uXXXX surrogate pair", pystr, - end - 5); - } - if (buf[next++] != '\\' || buf[next++] != 'u') { - raise_errmsg("Invalid \\uXXXX\\uXXXX surrogate pair", pystr, - end - 5); - } - end += 6; - /* Decode 4 hex digits */ - for (; next < end; next++) { - Py_ssize_t shl = (end - next - 1) << 2; - Py_UNICODE digit = buf[next]; - switch (digit) { - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - c2 |= (digit - '0') << shl; break; - case 'a': case 'b': case 'c': case 'd': case 'e': - case 'f': - c2 |= (digit - 'a' + 10) << shl; break; - case 'A': case 'B': case 'C': case 'D': case 'E': - case 'F': - c2 |= (digit - 'A' + 10) << shl; break; - default: - raise_errmsg("Invalid \\uXXXX escape", pystr, end - 5); - goto bail; - } - } - c = 0x10000 + (((c - 0xd800) << 10) | (c2 - 0xdc00)); + else if (str[idx] != ',') { + raise_errmsg("Expecting , delimiter", pystr, idx); + goto bail; } -#endif - } - chunk = PyUnicode_FromUnicode(&c, 1); - if (chunk == NULL) { - goto bail; - } - if (PyList_Append(chunks, chunk)) { - Py_DECREF(chunk); - goto bail; + idx++; + + /* skip whitespace after , */ + while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; } - Py_DECREF(chunk); } - rval = join_list_unicode(chunks); - if (rval == NULL) { + /* verify that idx < end_idx, str[idx] should be ']' */ + if (idx > end_idx || str[idx] != ']') { + raise_errmsg("Expecting object", pystr, end_idx); goto bail; } - Py_CLEAR(chunks); - return Py_BuildValue("(Nn)", rval, end); + *next_idx_ptr = idx + 1; + return rval; bail: - Py_XDECREF(chunks); + Py_XDECREF(val); + Py_DECREF(rval); return NULL; } -PyDoc_STRVAR(pydoc_scanstring, -"scanstring(str_or_bytes, end, encoding) -> (bytes, end)\n"); +static PyObject * +_parse_constant(PyScannerObject *s, char *constant, Py_ssize_t idx, Py_ssize_t *next_idx_ptr) { + /* Read a JSON constant from PyString pystr. + constant is the constant string that was found + ("NaN", "Infinity", "-Infinity"). + idx is the index of the first character of the constant + *next_idx_ptr is a return-by-reference index to the first character after + the constant. + + Returns the result of parse_constant + */ + PyObject *cstr; + PyObject *rval; + /* constant is "NaN", "Infinity", or "-Infinity" */ + cstr = PyUnicode_InternFromString(constant); + if (cstr == NULL) + return NULL; + + /* rval = parse_constant(constant) */ + rval = PyObject_CallFunctionObjArgs(s->parse_constant, cstr, NULL); + idx += PyUnicode_GET_SIZE(cstr); + Py_DECREF(cstr); + *next_idx_ptr = idx; + return rval; +} static PyObject * -py_scanstring(PyObject* self, PyObject *args) -{ - PyObject *pystr; - Py_ssize_t end; - char *encoding = NULL; - int strict = 0; - if (!PyArg_ParseTuple(args, "On|zi:scanstring", &pystr, &end, &encoding, &strict)) { +_match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_ssize_t *next_idx_ptr) { + /* Read a JSON number from PyUnicode pystr. + idx is the index of the first character of the number + *next_idx_ptr is a return-by-reference index to the first character after + the number. + + Returns a new PyObject representation of that number: + PyInt, PyLong, or PyFloat. + May return other types if parse_int or parse_float are set + */ + Py_UNICODE *str = PyUnicode_AS_UNICODE(pystr); + Py_ssize_t end_idx = PyUnicode_GET_SIZE(pystr) - 1; + Py_ssize_t idx = start; + int is_float = 0; + PyObject *rval; + PyObject *numstr; + + /* read a sign if it's there, make sure it's not the end of the string */ + if (str[idx] == '-') { + idx++; + if (idx > end_idx) { + PyErr_SetNone(PyExc_StopIteration); + return NULL; + } + } + + /* read as many integer digits as we find as long as it doesn't start with 0 */ + if (str[idx] >= '1' && str[idx] <= '9') { + idx++; + while (idx <= end_idx && str[idx] >= '0' && str[idx] <= '9') idx++; + } + /* if it starts with 0 we only expect one integer digit */ + else if (str[idx] == '0') { + idx++; + } + /* no integer digits, error */ + else { + PyErr_SetNone(PyExc_StopIteration); return NULL; } - if (encoding == NULL) { - encoding = DEFAULT_ENCODING; + + /* if the next char is '.' followed by a digit then read all float digits */ + if (idx < end_idx && str[idx] == '.' && str[idx + 1] >= '0' && str[idx + 1] <= '9') { + is_float = 1; + idx += 2; + while (idx <= end_idx && str[idx] >= '0' && str[idx] <= '9') idx++; + } + + /* if the next char is 'e' or 'E' then maybe read the exponent (or backtrack) */ + if (idx < end_idx && (str[idx] == 'e' || str[idx] == 'E')) { + Py_ssize_t e_start = idx; + idx++; + + /* read an exponent sign if present */ + if (idx < end_idx && (str[idx] == '-' || str[idx] == '+')) idx++; + + /* read all digits */ + while (idx <= end_idx && str[idx] >= '0' && str[idx] <= '9') idx++; + + /* if we got a digit, then parse as float. if not, backtrack */ + if (str[idx - 1] >= '0' && str[idx - 1] <= '9') { + is_float = 1; + } + else { + idx = e_start; + } } - if (PyBytes_Check(pystr)) { - return scanstring_str(pystr, end, encoding, strict); + + /* copy the section we determined to be a number */ + numstr = PyUnicode_FromUnicode(&str[start], idx - start); + if (numstr == NULL) + return NULL; + if (is_float) { + /* parse as a float using a fast path if available, otherwise call user defined method */ + if (s->parse_float != (PyObject *)&PyFloat_Type) { + rval = PyObject_CallFunctionObjArgs(s->parse_float, numstr, NULL); + } + else { + rval = PyFloat_FromString(numstr); + } + } + else { + /* no fast path for unicode -> int, just call */ + rval = PyObject_CallFunctionObjArgs(s->parse_int, numstr, NULL); + } + Py_DECREF(numstr); + *next_idx_ptr = idx; + return rval; +} + +static PyObject * +scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr) +{ + /* Read one JSON term (of any kind) from PyUnicode pystr. + idx is the index of the first character of the term + *next_idx_ptr is a return-by-reference index to the first character after + the number. + + Returns a new PyObject representation of the term. + */ + Py_UNICODE *str = PyUnicode_AS_UNICODE(pystr); + Py_ssize_t length = PyUnicode_GET_SIZE(pystr); + if (idx >= length) { + PyErr_SetNone(PyExc_StopIteration); + return NULL; } - else if (PyUnicode_Check(pystr)) { - return scanstring_unicode(pystr, end, strict); + switch (str[idx]) { + case '"': + /* string */ + return scanstring_unicode(pystr, idx + 1, + PyObject_IsTrue(s->strict), + next_idx_ptr); + case '{': + /* object */ + return _parse_object_unicode(s, pystr, idx + 1, next_idx_ptr); + case '[': + /* array */ + return _parse_array_unicode(s, pystr, idx + 1, next_idx_ptr); + case 'n': + /* null */ + if ((idx + 3 < length) && str[idx + 1] == 'u' && str[idx + 2] == 'l' && str[idx + 3] == 'l') { + Py_INCREF(Py_None); + *next_idx_ptr = idx + 4; + return Py_None; + } + break; + case 't': + /* true */ + if ((idx + 3 < length) && str[idx + 1] == 'r' && str[idx + 2] == 'u' && str[idx + 3] == 'e') { + Py_INCREF(Py_True); + *next_idx_ptr = idx + 4; + return Py_True; + } + break; + case 'f': + /* false */ + if ((idx + 4 < length) && str[idx + 1] == 'a' && str[idx + 2] == 'l' && str[idx + 3] == 's' && str[idx + 4] == 'e') { + Py_INCREF(Py_False); + *next_idx_ptr = idx + 5; + return Py_False; + } + break; + case 'N': + /* NaN */ + if ((idx + 2 < length) && str[idx + 1] == 'a' && str[idx + 2] == 'N') { + return _parse_constant(s, "NaN", idx, next_idx_ptr); + } + break; + case 'I': + /* Infinity */ + if ((idx + 7 < length) && str[idx + 1] == 'n' && str[idx + 2] == 'f' && str[idx + 3] == 'i' && str[idx + 4] == 'n' && str[idx + 5] == 'i' && str[idx + 6] == 't' && str[idx + 7] == 'y') { + return _parse_constant(s, "Infinity", idx, next_idx_ptr); + } + break; + case '-': + /* -Infinity */ + if ((idx + 8 < length) && str[idx + 1] == 'I' && str[idx + 2] == 'n' && str[idx + 3] == 'f' && str[idx + 4] == 'i' && str[idx + 5] == 'n' && str[idx + 6] == 'i' && str[idx + 7] == 't' && str[idx + 8] == 'y') { + return _parse_constant(s, "-Infinity", idx, next_idx_ptr); + } + break; + } + /* Didn't find a string, object, array, or named constant. Look for a number. */ + return _match_number_unicode(s, pystr, idx, next_idx_ptr); +} + +static PyObject * +scanner_call(PyObject *self, PyObject *args, PyObject *kwds) +{ + /* Python callable interface to scan_once_{str,unicode} */ + PyObject *pystr; + PyObject *rval; + Py_ssize_t idx; + Py_ssize_t next_idx = -1; + static char *kwlist[] = {"string", "idx", NULL}; + PyScannerObject *s; + assert(PyScanner_Check(self)); + s = (PyScannerObject *)self; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO&:scan_once", kwlist, &pystr, _convertPyInt_AsSsize_t, &idx)) + return NULL; + + if (PyUnicode_Check(pystr)) { + rval = scan_once_unicode(s, pystr, idx, &next_idx); } else { - PyErr_Format(PyExc_TypeError, - "first argument must be a string or bytes, not %.80s", - Py_TYPE(pystr)->tp_name); + PyErr_Format(PyExc_TypeError, + "first argument must be a string, not %.80s", + Py_TYPE(pystr)->tp_name); return NULL; } + return _build_rval_index_tuple(rval, next_idx); } -PyDoc_STRVAR(pydoc_encode_basestring_ascii, -"encode_basestring_ascii(str_or_bytes) -> bytes\n"); +static PyObject * +scanner_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + PyScannerObject *s; + s = (PyScannerObject *)type->tp_alloc(type, 0); + if (s != NULL) { + s->strict = NULL; + s->object_hook = NULL; + s->object_pairs_hook = NULL; + s->parse_float = NULL; + s->parse_int = NULL; + s->parse_constant = NULL; + } + return (PyObject *)s; +} + +static int +scanner_init(PyObject *self, PyObject *args, PyObject *kwds) +{ + /* Initialize Scanner object */ + PyObject *ctx; + static char *kwlist[] = {"context", NULL}; + PyScannerObject *s; + + assert(PyScanner_Check(self)); + s = (PyScannerObject *)self; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:make_scanner", kwlist, &ctx)) + return -1; + + /* All of these will fail "gracefully" so we don't need to verify them */ + s->strict = PyObject_GetAttrString(ctx, "strict"); + if (s->strict == NULL) + goto bail; + s->object_hook = PyObject_GetAttrString(ctx, "object_hook"); + if (s->object_hook == NULL) + goto bail; + s->object_pairs_hook = PyObject_GetAttrString(ctx, "object_pairs_hook"); + if (s->object_pairs_hook == NULL) + goto bail; + s->parse_float = PyObject_GetAttrString(ctx, "parse_float"); + if (s->parse_float == NULL) + goto bail; + s->parse_int = PyObject_GetAttrString(ctx, "parse_int"); + if (s->parse_int == NULL) + goto bail; + s->parse_constant = PyObject_GetAttrString(ctx, "parse_constant"); + if (s->parse_constant == NULL) + goto bail; + + return 0; + +bail: + Py_CLEAR(s->strict); + Py_CLEAR(s->object_hook); + Py_CLEAR(s->object_pairs_hook); + Py_CLEAR(s->parse_float); + Py_CLEAR(s->parse_int); + Py_CLEAR(s->parse_constant); + return -1; +} + +PyDoc_STRVAR(scanner_doc, "JSON scanner object"); + +static +PyTypeObject PyScannerType = { + PyVarObject_HEAD_INIT(NULL, 0) + "_json.Scanner", /* tp_name */ + sizeof(PyScannerObject), /* tp_basicsize */ + 0, /* tp_itemsize */ + scanner_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + scanner_call, /* tp_call */ + 0, /* tp_str */ + 0,/* PyObject_GenericGetAttr, */ /* tp_getattro */ + 0,/* PyObject_GenericSetAttr, */ /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */ + scanner_doc, /* tp_doc */ + scanner_traverse, /* tp_traverse */ + scanner_clear, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + scanner_members, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + scanner_init, /* tp_init */ + 0,/* PyType_GenericAlloc, */ /* tp_alloc */ + scanner_new, /* tp_new */ + 0,/* PyObject_GC_Del, */ /* tp_free */ +}; static PyObject * -py_encode_basestring_ascii(PyObject* self, PyObject *pystr) +encoder_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + PyEncoderObject *s; + s = (PyEncoderObject *)type->tp_alloc(type, 0); + if (s != NULL) { + s->markers = NULL; + s->defaultfn = NULL; + s->encoder = NULL; + s->indent = NULL; + s->key_separator = NULL; + s->item_separator = NULL; + s->sort_keys = NULL; + s->skipkeys = NULL; + } + return (PyObject *)s; +} + +static int +encoder_init(PyObject *self, PyObject *args, PyObject *kwds) { + /* initialize Encoder object */ + static char *kwlist[] = {"markers", "default", "encoder", "indent", "key_separator", "item_separator", "sort_keys", "skipkeys", "allow_nan", NULL}; + + PyEncoderObject *s; + PyObject *allow_nan; + + assert(PyEncoder_Check(self)); + s = (PyEncoderObject *)self; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "OOOOOOOOO:make_encoder", kwlist, + &s->markers, &s->defaultfn, &s->encoder, &s->indent, &s->key_separator, &s->item_separator, &s->sort_keys, &s->skipkeys, &allow_nan)) + return -1; + + Py_INCREF(s->markers); + Py_INCREF(s->defaultfn); + Py_INCREF(s->encoder); + Py_INCREF(s->indent); + Py_INCREF(s->key_separator); + Py_INCREF(s->item_separator); + Py_INCREF(s->sort_keys); + Py_INCREF(s->skipkeys); + s->fast_encode = (PyCFunction_Check(s->encoder) && PyCFunction_GetFunction(s->encoder) == (PyCFunction)py_encode_basestring_ascii); + s->allow_nan = PyObject_IsTrue(allow_nan); + return 0; +} + +static PyObject * +encoder_call(PyObject *self, PyObject *args, PyObject *kwds) +{ + /* Python callable interface to encode_listencode_obj */ + static char *kwlist[] = {"obj", "_current_indent_level", NULL}; + PyObject *obj; PyObject *rval; - /* METH_O */ - if (PyBytes_Check(pystr)) { - rval = ascii_escape_str(pystr); + Py_ssize_t indent_level; + PyEncoderObject *s; + assert(PyEncoder_Check(self)); + s = (PyEncoderObject *)self; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO&:_iterencode", kwlist, + &obj, _convertPyInt_AsSsize_t, &indent_level)) + return NULL; + rval = PyList_New(0); + if (rval == NULL) + return NULL; + if (encoder_listencode_obj(s, rval, obj, indent_level)) { + Py_DECREF(rval); + return NULL; } - else if (PyUnicode_Check(pystr)) { - rval = ascii_escape_unicode(pystr); + return rval; +} + +static PyObject * +_encoded_const(PyObject *obj) +{ + /* Return the JSON string representation of None, True, False */ + if (obj == Py_None) { + static PyObject *s_null = NULL; + if (s_null == NULL) { + s_null = PyUnicode_InternFromString("null"); + } + Py_INCREF(s_null); + return s_null; + } + else if (obj == Py_True) { + static PyObject *s_true = NULL; + if (s_true == NULL) { + s_true = PyUnicode_InternFromString("true"); + } + Py_INCREF(s_true); + return s_true; + } + else if (obj == Py_False) { + static PyObject *s_false = NULL; + if (s_false == NULL) { + s_false = PyUnicode_InternFromString("false"); + } + Py_INCREF(s_false); + return s_false; } else { - PyErr_Format(PyExc_TypeError, - "first argument must be a string or unicode, not %.80s", - Py_TYPE(pystr)->tp_name); + PyErr_SetString(PyExc_ValueError, "not a const"); return NULL; } - if (rval != NULL && PyBytes_Check(rval)) { - PyObject *urval = PyUnicode_DecodeASCII(PyBytes_AS_STRING(rval), PyBytes_GET_SIZE(rval), NULL); - Py_DECREF(rval); - return urval; +} + +static PyObject * +encoder_encode_float(PyEncoderObject *s, PyObject *obj) +{ + /* Return the JSON representation of a PyFloat */ + double i = PyFloat_AS_DOUBLE(obj); + if (!Py_IS_FINITE(i)) { + if (!s->allow_nan) { + PyErr_SetString(PyExc_ValueError, "Out of range float values are not JSON compliant"); + return NULL; + } + if (i > 0) { + return PyUnicode_FromString("Infinity"); + } + else if (i < 0) { + return PyUnicode_FromString("-Infinity"); + } + else { + return PyUnicode_FromString("NaN"); + } } + /* Use a better float format here? */ + return PyObject_Repr(obj); +} + +static PyObject * +encoder_encode_string(PyEncoderObject *s, PyObject *obj) +{ + /* Return the JSON representation of a string */ + if (s->fast_encode) + return py_encode_basestring_ascii(NULL, obj); + else + return PyObject_CallFunctionObjArgs(s->encoder, obj, NULL); +} + +static int +_steal_list_append(PyObject *lst, PyObject *stolen) +{ + /* Append stolen and then decrement its reference count */ + int rval = PyList_Append(lst, stolen); + Py_DECREF(stolen); return rval; } -static PyMethodDef json_methods[] = { - {"encode_basestring_ascii", (PyCFunction)py_encode_basestring_ascii, - METH_O, pydoc_encode_basestring_ascii}, - {"scanstring", (PyCFunction)py_scanstring, METH_VARARGS, - pydoc_scanstring}, +static int +encoder_listencode_obj(PyEncoderObject *s, PyObject *rval, PyObject *obj, Py_ssize_t indent_level) +{ + /* Encode Python object obj to a JSON term, rval is a PyList */ + PyObject *newobj; + int rv; + + if (obj == Py_None || obj == Py_True || obj == Py_False) { + PyObject *cstr = _encoded_const(obj); + if (cstr == NULL) + return -1; + return _steal_list_append(rval, cstr); + } + else if (PyUnicode_Check(obj)) + { + PyObject *encoded = encoder_encode_string(s, obj); + if (encoded == NULL) + return -1; + return _steal_list_append(rval, encoded); + } + else if (PyLong_Check(obj)) { + PyObject *encoded = PyObject_Str(obj); + if (encoded == NULL) + return -1; + return _steal_list_append(rval, encoded); + } + else if (PyFloat_Check(obj)) { + PyObject *encoded = encoder_encode_float(s, obj); + if (encoded == NULL) + return -1; + return _steal_list_append(rval, encoded); + } + else if (PyList_Check(obj) || PyTuple_Check(obj)) { + return encoder_listencode_list(s, rval, obj, indent_level); + } + else if (PyDict_Check(obj)) { + return encoder_listencode_dict(s, rval, obj, indent_level); + } + else { + PyObject *ident = NULL; + if (s->markers != Py_None) { + int has_key; + ident = PyLong_FromVoidPtr(obj); + if (ident == NULL) + return -1; + has_key = PyDict_Contains(s->markers, ident); + if (has_key) { + if (has_key != -1) + PyErr_SetString(PyExc_ValueError, "Circular reference detected"); + Py_DECREF(ident); + return -1; + } + if (PyDict_SetItem(s->markers, ident, obj)) { + Py_DECREF(ident); + return -1; + } + } + newobj = PyObject_CallFunctionObjArgs(s->defaultfn, obj, NULL); + if (newobj == NULL) { + Py_XDECREF(ident); + return -1; + } + rv = encoder_listencode_obj(s, rval, newobj, indent_level); + Py_DECREF(newobj); + if (rv) { + Py_XDECREF(ident); + return -1; + } + if (ident != NULL) { + if (PyDict_DelItem(s->markers, ident)) { + Py_XDECREF(ident); + return -1; + } + Py_XDECREF(ident); + } + return rv; + } +} + +static int +encoder_listencode_dict(PyEncoderObject *s, PyObject *rval, PyObject *dct, Py_ssize_t indent_level) +{ + /* Encode Python dict dct a JSON term, rval is a PyList */ + static PyObject *open_dict = NULL; + static PyObject *close_dict = NULL; + static PyObject *empty_dict = NULL; + PyObject *kstr = NULL; + PyObject *ident = NULL; + PyObject *key, *value; + Py_ssize_t pos; + int skipkeys; + Py_ssize_t idx; + + if (open_dict == NULL || close_dict == NULL || empty_dict == NULL) { + open_dict = PyUnicode_InternFromString("{"); + close_dict = PyUnicode_InternFromString("}"); + empty_dict = PyUnicode_InternFromString("{}"); + if (open_dict == NULL || close_dict == NULL || empty_dict == NULL) + return -1; + } + if (PyDict_Size(dct) == 0) + return PyList_Append(rval, empty_dict); + + if (s->markers != Py_None) { + int has_key; + ident = PyLong_FromVoidPtr(dct); + if (ident == NULL) + goto bail; + has_key = PyDict_Contains(s->markers, ident); + if (has_key) { + if (has_key != -1) + PyErr_SetString(PyExc_ValueError, "Circular reference detected"); + goto bail; + } + if (PyDict_SetItem(s->markers, ident, dct)) { + goto bail; + } + } + + if (PyList_Append(rval, open_dict)) + goto bail; + + if (s->indent != Py_None) { + /* TODO: DOES NOT RUN */ + indent_level += 1; + /* + newline_indent = '\n' + (' ' * (_indent * _current_indent_level)) + separator = _item_separator + newline_indent + buf += newline_indent + */ + } + + /* TODO: C speedup not implemented for sort_keys */ + + pos = 0; + skipkeys = PyObject_IsTrue(s->skipkeys); + idx = 0; + while (PyDict_Next(dct, &pos, &key, &value)) { + PyObject *encoded; + + if (PyUnicode_Check(key)) { + Py_INCREF(key); + kstr = key; + } + else if (PyFloat_Check(key)) { + kstr = encoder_encode_float(s, key); + if (kstr == NULL) + goto bail; + } + else if (PyLong_Check(key)) { + kstr = PyObject_Str(key); + if (kstr == NULL) + goto bail; + } + else if (key == Py_True || key == Py_False || key == Py_None) { + kstr = _encoded_const(key); + if (kstr == NULL) + goto bail; + } + else if (skipkeys) { + continue; + } + else { + /* TODO: include repr of key */ + PyErr_SetString(PyExc_ValueError, "keys must be a string"); + goto bail; + } + + if (idx) { + if (PyList_Append(rval, s->item_separator)) + goto bail; + } + + encoded = encoder_encode_string(s, kstr); + Py_CLEAR(kstr); + if (encoded == NULL) + goto bail; + if (PyList_Append(rval, encoded)) { + Py_DECREF(encoded); + goto bail; + } + Py_DECREF(encoded); + if (PyList_Append(rval, s->key_separator)) + goto bail; + if (encoder_listencode_obj(s, rval, value, indent_level)) + goto bail; + idx += 1; + } + if (ident != NULL) { + if (PyDict_DelItem(s->markers, ident)) + goto bail; + Py_CLEAR(ident); + } + if (s->indent != Py_None) { + /* TODO: DOES NOT RUN */ + indent_level -= 1; + /* + yield '\n' + (' ' * (_indent * _current_indent_level)) + */ + } + if (PyList_Append(rval, close_dict)) + goto bail; + return 0; + +bail: + Py_XDECREF(kstr); + Py_XDECREF(ident); + return -1; +} + + +static int +encoder_listencode_list(PyEncoderObject *s, PyObject *rval, PyObject *seq, Py_ssize_t indent_level) +{ + /* Encode Python list seq to a JSON term, rval is a PyList */ + static PyObject *open_array = NULL; + static PyObject *close_array = NULL; + static PyObject *empty_array = NULL; + PyObject *ident = NULL; + PyObject *s_fast = NULL; + Py_ssize_t num_items; + PyObject **seq_items; + Py_ssize_t i; + + if (open_array == NULL || close_array == NULL || empty_array == NULL) { + open_array = PyUnicode_InternFromString("["); + close_array = PyUnicode_InternFromString("]"); + empty_array = PyUnicode_InternFromString("[]"); + if (open_array == NULL || close_array == NULL || empty_array == NULL) + return -1; + } + ident = NULL; + s_fast = PySequence_Fast(seq, "_iterencode_list needs a sequence"); + if (s_fast == NULL) + return -1; + num_items = PySequence_Fast_GET_SIZE(s_fast); + if (num_items == 0) { + Py_DECREF(s_fast); + return PyList_Append(rval, empty_array); + } + + if (s->markers != Py_None) { + int has_key; + ident = PyLong_FromVoidPtr(seq); + if (ident == NULL) + goto bail; + has_key = PyDict_Contains(s->markers, ident); + if (has_key) { + if (has_key != -1) + PyErr_SetString(PyExc_ValueError, "Circular reference detected"); + goto bail; + } + if (PyDict_SetItem(s->markers, ident, seq)) { + goto bail; + } + } + + seq_items = PySequence_Fast_ITEMS(s_fast); + if (PyList_Append(rval, open_array)) + goto bail; + if (s->indent != Py_None) { + /* TODO: DOES NOT RUN */ + indent_level += 1; + /* + newline_indent = '\n' + (' ' * (_indent * _current_indent_level)) + separator = _item_separator + newline_indent + buf += newline_indent + */ + } + for (i = 0; i < num_items; i++) { + PyObject *obj = seq_items[i]; + if (i) { + if (PyList_Append(rval, s->item_separator)) + goto bail; + } + if (encoder_listencode_obj(s, rval, obj, indent_level)) + goto bail; + } + if (ident != NULL) { + if (PyDict_DelItem(s->markers, ident)) + goto bail; + Py_CLEAR(ident); + } + if (s->indent != Py_None) { + /* TODO: DOES NOT RUN */ + indent_level -= 1; + /* + yield '\n' + (' ' * (_indent * _current_indent_level)) + */ + } + if (PyList_Append(rval, close_array)) + goto bail; + Py_DECREF(s_fast); + return 0; + +bail: + Py_XDECREF(ident); + Py_DECREF(s_fast); + return -1; +} + +static void +encoder_dealloc(PyObject *self) +{ + /* Deallocate Encoder */ + encoder_clear(self); + Py_TYPE(self)->tp_free(self); +} + +static int +encoder_traverse(PyObject *self, visitproc visit, void *arg) +{ + PyEncoderObject *s; + assert(PyEncoder_Check(self)); + s = (PyEncoderObject *)self; + Py_VISIT(s->markers); + Py_VISIT(s->defaultfn); + Py_VISIT(s->encoder); + Py_VISIT(s->indent); + Py_VISIT(s->key_separator); + Py_VISIT(s->item_separator); + Py_VISIT(s->sort_keys); + Py_VISIT(s->skipkeys); + return 0; +} + +static int +encoder_clear(PyObject *self) +{ + /* Deallocate Encoder */ + PyEncoderObject *s; + assert(PyEncoder_Check(self)); + s = (PyEncoderObject *)self; + Py_CLEAR(s->markers); + Py_CLEAR(s->defaultfn); + Py_CLEAR(s->encoder); + Py_CLEAR(s->indent); + Py_CLEAR(s->key_separator); + Py_CLEAR(s->item_separator); + Py_CLEAR(s->sort_keys); + Py_CLEAR(s->skipkeys); + return 0; +} + +PyDoc_STRVAR(encoder_doc, "_iterencode(obj, _current_indent_level) -> iterable"); + +static +PyTypeObject PyEncoderType = { + PyVarObject_HEAD_INIT(NULL, 0) + "_json.Encoder", /* tp_name */ + sizeof(PyEncoderObject), /* tp_basicsize */ + 0, /* tp_itemsize */ + encoder_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + encoder_call, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */ + encoder_doc, /* tp_doc */ + encoder_traverse, /* tp_traverse */ + encoder_clear, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + encoder_members, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + encoder_init, /* tp_init */ + 0, /* tp_alloc */ + encoder_new, /* tp_new */ + 0, /* tp_free */ +}; + +static PyMethodDef speedups_methods[] = { + {"encode_basestring_ascii", + (PyCFunction)py_encode_basestring_ascii, + METH_O, + pydoc_encode_basestring_ascii}, + {"scanstring", + (PyCFunction)py_scanstring, + METH_VARARGS, + pydoc_scanstring}, {NULL, NULL, 0, NULL} }; @@ -630,7 +1655,7 @@ "_json", module_doc, -1, - json_methods, + speedups_methods, NULL, NULL, NULL, @@ -640,5 +1665,27 @@ PyObject* PyInit__json(void) { - return PyModule_Create(&jsonmodule); + PyObject *m = PyModule_Create(&jsonmodule); + if (!m) + return NULL; + PyScannerType.tp_new = PyType_GenericNew; + if (PyType_Ready(&PyScannerType) < 0) + goto fail; + PyEncoderType.tp_new = PyType_GenericNew; + if (PyType_Ready(&PyEncoderType) < 0) + goto fail; + Py_INCREF((PyObject*)&PyScannerType); + if (PyModule_AddObject(m, "make_scanner", (PyObject*)&PyScannerType) < 0) { + Py_DECREF((PyObject*)&PyScannerType); + goto fail; + } + Py_INCREF((PyObject*)&PyEncoderType); + if (PyModule_AddObject(m, "make_encoder", (PyObject*)&PyEncoderType) < 0) { + Py_DECREF((PyObject*)&PyEncoderType); + goto fail; + } + return m; + fail: + Py_DECREF(m); + return NULL; } From buildbot at python.org Sat May 2 16:56:51 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 May 2009 14:56:51 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090502145651.9AF951E401C@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/678 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_os ====================================================================== FAIL: test_update2 (test.test_os.EnvironTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_os.py", line 382, in test_update2 self.assertEquals(value, "World") AssertionError: '' != 'World' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat May 2 17:28:37 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 2 May 2009 17:28:37 +0200 (CEST) Subject: [Python-checkins] r72195 - python/branches/py3k Message-ID: <20090502152837.D4C921E401C@bag.python.org> Author: benjamin.peterson Date: Sat May 2 17:28:37 2009 New Revision: 72195 Log: Blocked revisions 70443,70471,70702 via svnmerge ........ r70443 | bob.ippolito | 2009-03-17 18:19:00 -0500 (Tue, 17 Mar 2009) | 1 line merge json library with simplejson 2.0.9 (issue 4136) ........ r70471 | raymond.hettinger | 2009-03-19 14:19:03 -0500 (Thu, 19 Mar 2009) | 3 lines Issue 5381: Add object_pairs_hook to the json module. ........ r70702 | bob.ippolito | 2009-03-29 17:33:58 -0500 (Sun, 29 Mar 2009) | 1 line Issue 5381: fix regression in pure python code path, Issue 5584: fix a decoder bug for unicode float literals outside of a container ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat May 2 17:55:19 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sat, 2 May 2009 17:55:19 +0200 (CEST) Subject: [Python-checkins] r72196 - python/branches/py3k/Modules/_json.c Message-ID: <20090502155519.CE10A1E401F@bag.python.org> Author: hirokazu.yamamoto Date: Sat May 2 17:55:19 2009 New Revision: 72196 Log: Fixed warning. (Should not use *const* as variable name) Modified: python/branches/py3k/Modules/_json.c Modified: python/branches/py3k/Modules/_json.c ============================================================================== --- python/branches/py3k/Modules/_json.c (original) +++ python/branches/py3k/Modules/_json.c Sat May 2 17:55:19 2009 @@ -106,7 +106,7 @@ static int encoder_listencode_dict(PyEncoderObject *s, PyObject *rval, PyObject *dct, Py_ssize_t indent_level); static PyObject * -_encoded_const(PyObject *const); +_encoded_const(PyObject *obj); static void raise_errmsg(char *msg, PyObject *s, Py_ssize_t end); static PyObject * From python-checkins at python.org Sat May 2 18:24:37 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 2 May 2009 18:24:37 +0200 (CEST) Subject: [Python-checkins] r72197 - python/trunk/Lib/test/test_unittest.py Message-ID: <20090502162437.4E58E1E4030@bag.python.org> Author: benjamin.peterson Date: Sat May 2 18:24:37 2009 New Revision: 72197 Log: don't let sys.argv be used in the tests Modified: python/trunk/Lib/test/test_unittest.py Modified: python/trunk/Lib/test/test_unittest.py ============================================================================== --- python/trunk/Lib/test/test_unittest.py (original) +++ python/trunk/Lib/test/test_unittest.py Sat May 2 18:24:37 2009 @@ -3085,8 +3085,9 @@ def test_NonExit(self): program = unittest.main(exit=False, - testRunner=unittest.TextTestRunner(stream=StringIO()), - testLoader=self.FooBarLoader()) + argv=["foobar"], + testRunner=unittest.TextTestRunner(stream=StringIO()), + testLoader=self.FooBarLoader()) self.assertTrue(hasattr(program, 'result')) @@ -3094,6 +3095,7 @@ self.assertRaises( SystemExit, unittest.main, + argv=["foobar"], testRunner=unittest.TextTestRunner(stream=StringIO()), exit=True, testLoader=self.FooBarLoader()) @@ -3103,6 +3105,7 @@ self.assertRaises( SystemExit, unittest.main, + argv=["foobar"], testRunner=unittest.TextTestRunner(stream=StringIO()), testLoader=self.FooBarLoader()) From python-checkins at python.org Sat May 2 19:12:15 2009 From: python-checkins at python.org (andrew.kuchling) Date: Sat, 2 May 2009 19:12:15 +0200 (CEST) Subject: [Python-checkins] r72198 - python/trunk/Doc/whatsnew/2.7.rst Message-ID: <20090502171215.E70661E4030@bag.python.org> Author: andrew.kuchling Date: Sat May 2 19:12:15 2009 New Revision: 72198 Log: Add items Modified: python/trunk/Doc/whatsnew/2.7.rst Modified: python/trunk/Doc/whatsnew/2.7.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.7.rst (original) +++ python/trunk/Doc/whatsnew/2.7.rst Sat May 2 19:12:15 2009 @@ -121,6 +121,31 @@ (Contributed by Fredrik Johansson and Victor Stinner; :issue:`3439`.) +* Conversions from long integers and regular integers to floating + point now round differently, returning the floating-point number + closest to the number. This doesn't matter for small integers that + can be converted exactly, but for large numbers that will + unavoidably lose precision, Python 2.7 will now approximate more + closely. For example, Python 2.6 computed the following:: + + >>> n = 295147905179352891391 + >>> float(n) + 2.9514790517935283e+20 + >>> n - long(float(n)) + 65535L + + Python 2.7's floating-point result is larger, but much closer to the + true value:: + + >>> n = 295147905179352891391 + >>> float(n) + 2.9514790517935289e+20 + >>> n-long(float(n) + ... ) + -1L + + (Implemented by Mark Dickinson; :issue:`3166`.) + * The :class:`bytearray` type's :meth:`translate` method will now accept ``None`` as its first argument. (Fixed by Georg Brandl; :issue:`4759`.) @@ -298,6 +323,10 @@ ``Decimal('0.1000000000000000055511151231257827021181583404541015625')``. (Implemented by Raymond Hettinger; :issue:`4796`.) +* The :class:`Fraction` class will now accept two rational numbers + as arguments to its constructor. + (Implemented by Mark Dickinson; :issue:`5812`.) + * New function: the :mod:`gc` module's :func:`is_tracked` returns true if a given instance is tracked by the garbage collector, false otherwise. (Contributed by Antoine Pitrou; :issue:`4688`.) @@ -561,6 +590,10 @@ is particularly useful for asynchronous IO operations. (Contributed by Kristjan Valur Jonsson; :issue:`4293`.) +* Global symbols defined by the :mod:`ctypes` module are now prefixed + with ``Py`, or with ``_ctypes``. (Implemented by Thomas + Heller; :issue:`3102`.) + * The :program:`configure` script now checks for floating-point rounding bugs on certain 32-bit Intel chips and defines a :cmacro:`X87_DOUBLE_ROUNDING` preprocessor definition. No code currently uses this definition, @@ -599,10 +632,10 @@ * When importing a module from a :file:`.pyc` or :file:`.pyo` file with an existing :file:`.py` counterpart, the :attr:`co_filename` - attributes of all code objects if the original filename is obsolete, - which can happen if the file has been renamed, moved, or is accessed - through different paths. (Patch by Ziga Seilnacht and Jean-Paul - Calderone; :issue:`1180193`.) + attributes of the resulting code objects are overwritten when the + original filename is obsolete. This can happen if the file has been + renamed, moved, or is accessed through different paths. (Patch by + Ziga Seilnacht and Jean-Paul Calderone; :issue:`1180193`.) * The :file:`regrtest.py` script now takes a :option:`--randseed=` switch that takes an integer that will be used as the random seed From python-checkins at python.org Sat May 2 19:33:02 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 2 May 2009 19:33:02 +0200 (CEST) Subject: [Python-checkins] r72199 - in python/trunk/Lib: ipaddr.py test/test_ipaddr.py zipfile.py Message-ID: <20090502173302.1A91A1E4030@bag.python.org> Author: benjamin.peterson Date: Sat May 2 19:33:01 2009 New Revision: 72199 Log: remove py3k compat code Modified: python/trunk/Lib/ipaddr.py python/trunk/Lib/test/test_ipaddr.py python/trunk/Lib/zipfile.py Modified: python/trunk/Lib/ipaddr.py ============================================================================== --- python/trunk/Lib/ipaddr.py (original) +++ python/trunk/Lib/ipaddr.py Sat May 2 19:33:01 2009 @@ -193,17 +193,6 @@ sorted(addresses, key=BaseIP._get_networks_key)) -# Test whether this Python implementation supports byte objects that -# are not identical to str ones. -# We need to exclude platforms where bytes == str so that we can -# distinguish between packed representations and strings, for example -# b'12::' (the IPv4 address 49.50.58.58) and '12::' (an IPv6 address). -try: - _compat_has_real_bytes = bytes != str -except NameError: # 1 and targetpath[-2] == ":"): targetpath = targetpath[:-1] # don't include leading "/" from file name if present From python-checkins at python.org Sat May 2 19:35:39 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 2 May 2009 19:35:39 +0200 (CEST) Subject: [Python-checkins] r72200 - python/trunk/Lib/zipfile.py Message-ID: <20090502173539.E46E41E421B@bag.python.org> Author: benjamin.peterson Date: Sat May 2 19:35:39 2009 New Revision: 72200 Log: revert unrelated change Modified: python/trunk/Lib/zipfile.py Modified: python/trunk/Lib/zipfile.py ============================================================================== --- python/trunk/Lib/zipfile.py (original) +++ python/trunk/Lib/zipfile.py Sat May 2 19:35:39 2009 @@ -952,9 +952,7 @@ """ # build the destination pathname, replacing # forward slashes to platform specific separators. - # Don't strip it if it is a drive. - if targetpath[-1:] in (os.path.sep, os.path.altsep) and \ - not (len(targetpath) > 1 and targetpath[-2] == ":"): + if targetpath[-1:] in (os.path.sep, os.path.altsep): targetpath = targetpath[:-1] # don't include leading "/" from file name if present From python-checkins at python.org Sat May 2 19:38:06 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 2 May 2009 19:38:06 +0200 (CEST) Subject: [Python-checkins] r72201 - python/branches/py3k Message-ID: <20090502173806.83F651E4030@bag.python.org> Author: benjamin.peterson Date: Sat May 2 19:38:06 2009 New Revision: 72201 Log: Blocked revisions 72199-72200 via svnmerge ........ r72199 | benjamin.peterson | 2009-05-02 12:33:01 -0500 (Sat, 02 May 2009) | 1 line remove py3k compat code ........ r72200 | benjamin.peterson | 2009-05-02 12:35:39 -0500 (Sat, 02 May 2009) | 1 line revert unrelated change ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat May 2 19:55:01 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 2 May 2009 19:55:01 +0200 (CEST) Subject: [Python-checkins] r72202 - python/trunk/Objects/longobject.c Message-ID: <20090502175501.5A2DB1E4030@bag.python.org> Author: mark.dickinson Date: Sat May 2 19:55:01 2009 New Revision: 72202 Log: Remove unnecessary use of context for long getters. (Related to issue #5880). Modified: python/trunk/Objects/longobject.c Modified: python/trunk/Objects/longobject.c ============================================================================== --- python/trunk/Objects/longobject.c (original) +++ python/trunk/Objects/longobject.c Sat May 2 19:55:01 2009 @@ -3595,8 +3595,13 @@ } static PyObject * -long_getN(PyLongObject *v, void *context) { - return PyLong_FromLong((Py_intptr_t)context); +long_get0(PyLongObject *v, void *context) { + return PyLong_FromLong(0L); +} + +static PyObject * +long_get1(PyLongObject *v, void *context) { + return PyLong_FromLong(1L); } static PyObject * @@ -3729,22 +3734,22 @@ }; static PyGetSetDef long_getset[] = { - {"real", + {"real", (getter)long_long, (setter)NULL, "the real part of a complex number", NULL}, - {"imag", - (getter)long_getN, (setter)NULL, + {"imag", + (getter)long_get0, (setter)NULL, "the imaginary part of a complex number", - (void*)0}, - {"numerator", + NULL}, + {"numerator", (getter)long_long, (setter)NULL, "the numerator of a rational number in lowest terms", NULL}, - {"denominator", - (getter)long_getN, (setter)NULL, + {"denominator", + (getter)long_get1, (setter)NULL, "the denominator of a rational number in lowest terms", - (void*)1}, + NULL}, {NULL} /* Sentinel */ }; From python-checkins at python.org Sat May 2 19:57:53 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 2 May 2009 19:57:53 +0200 (CEST) Subject: [Python-checkins] r72203 - in python/branches/py3k: Objects/longobject.c Message-ID: <20090502175753.3B1201E4030@bag.python.org> Author: mark.dickinson Date: Sat May 2 19:57:52 2009 New Revision: 72203 Log: Merged revisions 72202 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72202 | mark.dickinson | 2009-05-02 18:55:01 +0100 (Sat, 02 May 2009) | 3 lines Remove unnecessary use of context for long getters. (Related to issue #5880). ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Objects/longobject.c Modified: python/branches/py3k/Objects/longobject.c ============================================================================== --- python/branches/py3k/Objects/longobject.c (original) +++ python/branches/py3k/Objects/longobject.c Sat May 2 19:57:52 2009 @@ -3832,8 +3832,13 @@ } static PyObject * -long_getN(PyLongObject *v, void *context) { - return PyLong_FromLong((Py_intptr_t)context); +long_get0(PyLongObject *v, void *context) { + return PyLong_FromLong(0L); +} + +static PyObject * +long_get1(PyLongObject *v, void *context) { + return PyLong_FromLong(1L); } static PyObject * @@ -4091,22 +4096,22 @@ }; static PyGetSetDef long_getset[] = { - {"real", + {"real", (getter)long_long, (setter)NULL, "the real part of a complex number", NULL}, - {"imag", - (getter)long_getN, (setter)NULL, + {"imag", + (getter)long_get0, (setter)NULL, "the imaginary part of a complex number", - (void*)0}, - {"numerator", + NULL}, + {"numerator", (getter)long_long, (setter)NULL, "the numerator of a rational number in lowest terms", NULL}, - {"denominator", - (getter)long_getN, (setter)NULL, + {"denominator", + (getter)long_get1, (setter)NULL, "the denominator of a rational number in lowest terms", - (void*)1}, + NULL}, {NULL} /* Sentinel */ }; From buildbot at python.org Sat May 2 20:10:08 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 May 2009 18:10:08 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090502181011.D67631E4030@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/861 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_os make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat May 2 20:10:38 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 2 May 2009 20:10:38 +0200 (CEST) Subject: [Python-checkins] r72204 - in python/branches/py3k/Lib: ipaddr.py test/test_ipaddr.py Message-ID: <20090502181038.6E6271E4030@bag.python.org> Author: benjamin.peterson Date: Sat May 2 20:10:37 2009 New Revision: 72204 Log: make py3k compat code explicitly on Modified: python/branches/py3k/Lib/ipaddr.py python/branches/py3k/Lib/test/test_ipaddr.py Modified: python/branches/py3k/Lib/ipaddr.py ============================================================================== --- python/branches/py3k/Lib/ipaddr.py (original) +++ python/branches/py3k/Lib/ipaddr.py Sat May 2 20:10:37 2009 @@ -193,17 +193,6 @@ sorted(addresses, key=BaseIP._get_networks_key)) -# Test whether this Python implementation supports byte objects that -# are not identical to str ones. -# We need to exclude platforms where bytes == str so that we can -# distinguish between packed representations and strings, for example -# b'12::' (the IPv4 address 49.50.58.58) and '12::' (an IPv6 address). -try: - _compat_has_real_bytes = bytes != str -except NameError: # Author: mark.dickinson Date: Sat May 2 20:21:40 2009 New Revision: 72205 Log: Blocked revisions 72202 via svnmerge ........ r72202 | mark.dickinson | 2009-05-02 18:55:01 +0100 (Sat, 02 May 2009) | 3 lines Remove unnecessary use of context for long getters. (Related to issue #5880). ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sat May 2 20:22:34 2009 From: python-checkins at python.org (mark.dickinson) Date: Sat, 2 May 2009 20:22:34 +0200 (CEST) Subject: [Python-checkins] r72206 - python/branches/release30-maint Message-ID: <20090502182234.990241E4025@bag.python.org> Author: mark.dickinson Date: Sat May 2 20:22:34 2009 New Revision: 72206 Log: Blocked revisions 72203 via svnmerge ................ r72203 | mark.dickinson | 2009-05-02 18:57:52 +0100 (Sat, 02 May 2009) | 10 lines Merged revisions 72202 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72202 | mark.dickinson | 2009-05-02 18:55:01 +0100 (Sat, 02 May 2009) | 3 lines Remove unnecessary use of context for long getters. (Related to issue #5880). ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Sat May 2 20:23:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 May 2009 18:23:37 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090502182337.7F37B1E4025@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/446 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling,benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_os make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat May 2 20:35:58 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sat, 2 May 2009 20:35:58 +0200 (CEST) Subject: [Python-checkins] r72207 - python/branches/py3k/Lib/ipaddr.py Message-ID: <20090502183558.AB7E51E4025@bag.python.org> Author: gregory.p.smith Date: Sat May 2 20:35:58 2009 New Revision: 72207 Log: ipaddr cleanup for python 3.x: * Get rid of __hex__. * Support bytearray as well as bytes. * Don't double test for integer input. Modified: python/branches/py3k/Lib/ipaddr.py Modified: python/branches/py3k/Lib/ipaddr.py ============================================================================== --- python/branches/py3k/Lib/ipaddr.py (original) +++ python/branches/py3k/Lib/ipaddr.py Sat May 2 20:35:58 2009 @@ -263,9 +263,6 @@ def __int__(self): return self.ip - def __hex__(self): - return hex(int(self)) - def address_exclude(self, other): """Remove an address from a larger block. @@ -572,7 +569,7 @@ self._version = 4 # Efficient constructor from integer. - if isinstance(ipaddr, int) or isinstance(ipaddr, int): + if isinstance(ipaddr, int): self.ip = ipaddr self._prefixlen = 32 self.netmask = self._ALL_ONES @@ -580,7 +577,8 @@ raise IPv4IpValidationError(ipaddr) return - if isinstance(ipaddr, bytes) and len(ipaddr) == 4: + # Constructing from a packed address + if isinstance(ipaddr, (bytes, bytearray)) and len(ipaddr) == 4: self.ip = struct.unpack('!I', ipaddr)[0] self._prefixlen = 32 self.netmask = self._ALL_ONES @@ -909,7 +907,7 @@ self._version = 6 # Efficient constructor from integer. - if isinstance(ipaddr, int) or isinstance(ipaddr, int): + if isinstance(ipaddr, int): self.ip = ipaddr self._prefixlen = 128 self.netmask = self._ALL_ONES @@ -917,7 +915,8 @@ raise IPv6IpValidationError(ipaddr) return - if isinstance(ipaddr, bytes) and len(ipaddr) == 16: + # Constructing from a packed address + if isinstance(ipaddr, (bytes, bytearray)) and len(ipaddr) == 16: tmp = struct.unpack('!QQ', ipaddr) self.ip = (tmp[0] << 64) | tmp[1] self._prefixlen = 128 From buildbot at python.org Sat May 2 20:46:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 May 2009 18:46:09 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090502184609.BD2491E4025@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/4913 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sat May 2 20:46:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 May 2009 18:46:56 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090502184656.846F21E4025@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/616 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_importlib test_posix Traceback (most recent call last): File "./Lib/test/regrtest.py", line 620, in runtest_inner File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_importlib.py", line 6, in test_main run_unittest(importlib.test.test_suite('importlib.test')) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/__init__.py", line 22, in test_suite package_tests = getattr(sys.modules[package_name], 'test_suite')() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/source/__init__.py", line 8, in test_suite return importlib.test.test_suite('importlib.test.source', directory) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/__init__.py", line 16, in test_suite __import__(module_name, level=0) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/source/test_case_sensitivity.py", line 12, in class CaseSensitivityTest(unittest.TestCase): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/util.py", line 13, in case_insensitive_tests original_name = os.listdir('.')[0] IndexError: list index out of range ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sat May 2 20:52:14 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 2 May 2009 20:52:14 +0200 (CEST) Subject: [Python-checkins] r72208 - in python/branches/py3k: Doc/library/codecs.rst Lib/test/test_bytes.py Lib/test/test_codecs.py Lib/test/test_unicode.py Lib/test/test_unicodedata.py Misc/NEWS Objects/unicodeobject.c Python/codecs.c Python/marshal.c Message-ID: <20090502185214.E03FC1E4025@bag.python.org> Author: martin.v.loewis Date: Sat May 2 20:52:14 2009 New Revision: 72208 Log: Issue #3672: Reject surrogates in utf-8 codec; add surrogates error handler. Modified: python/branches/py3k/Doc/library/codecs.rst python/branches/py3k/Lib/test/test_bytes.py python/branches/py3k/Lib/test/test_codecs.py python/branches/py3k/Lib/test/test_unicode.py python/branches/py3k/Lib/test/test_unicodedata.py python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/unicodeobject.c python/branches/py3k/Python/codecs.c python/branches/py3k/Python/marshal.c Modified: python/branches/py3k/Doc/library/codecs.rst ============================================================================== --- python/branches/py3k/Doc/library/codecs.rst (original) +++ python/branches/py3k/Doc/library/codecs.rst Sat May 2 20:52:14 2009 @@ -323,6 +323,18 @@ | | (only for encoding). | +-------------------------+-----------------------------------------------+ +In addition, the following error handlers are specific to a single codec: + ++------------------+---------+--------------------------------------------+ +| Value | Codec | Meaning | ++==================+=========+============================================+ +| ``'surrogates'`` | utf-8 | Allow encoding and decoding of surrogate | +| | | codes in UTF-8. | ++------------------+---------+--------------------------------------------+ + +.. versionadded:: 3.1 + The ``'surrogates'`` error handler. + The set of allowed values can be extended via :meth:`register_error`. Modified: python/branches/py3k/Lib/test/test_bytes.py ============================================================================== --- python/branches/py3k/Lib/test/test_bytes.py (original) +++ python/branches/py3k/Lib/test/test_bytes.py Sat May 2 20:52:14 2009 @@ -169,13 +169,13 @@ self.assertEqual(b[start:stop:step], self.type2test(L[start:stop:step])) def test_encoding(self): - sample = "Hello world\n\u1234\u5678\u9abc\udef0" + sample = "Hello world\n\u1234\u5678\u9abc" for enc in ("utf8", "utf16"): b = self.type2test(sample, enc) self.assertEqual(b, self.type2test(sample.encode(enc))) self.assertRaises(UnicodeEncodeError, self.type2test, sample, "latin1") b = self.type2test(sample, "latin1", "ignore") - self.assertEqual(b, self.type2test(sample[:-4], "utf-8")) + self.assertEqual(b, self.type2test(sample[:-3], "utf-8")) def test_decode(self): sample = "Hello world\n\u1234\u5678\u9abc\def0\def0" Modified: python/branches/py3k/Lib/test/test_codecs.py ============================================================================== --- python/branches/py3k/Lib/test/test_codecs.py (original) +++ python/branches/py3k/Lib/test/test_codecs.py Sat May 2 20:52:14 2009 @@ -541,6 +541,17 @@ self.check_state_handling_decode(self.encoding, u, u.encode(self.encoding)) + def test_lone_surrogates(self): + self.assertRaises(UnicodeEncodeError, "\ud800".encode, "utf-8") + self.assertRaises(UnicodeDecodeError, b"\xed\xa0\x80".decode, "utf-8") + + def test_surrogates_handler(self): + self.assertEquals("abc\ud800def".encode("utf-8", "surrogates"), + b"abc\xed\xa0\x80def") + self.assertEquals(b"abc\xed\xa0\x80def".decode("utf-8", "surrogates"), + "abc\ud800def") + self.assertTrue(codecs.lookup_error("surrogates")) + class UTF7Test(ReadTest): encoding = "utf-7" @@ -1023,12 +1034,12 @@ # Skipped continue # The Unicode strings are given in UTF-8 - orig = str(orig, "utf-8") + orig = str(orig, "utf-8", "surrogates") if prepped is None: # Input contains prohibited characters self.assertRaises(UnicodeError, nameprep, orig) else: - prepped = str(prepped, "utf-8") + prepped = str(prepped, "utf-8", "surrogates") try: self.assertEquals(nameprep(orig), prepped) except Exception as e: Modified: python/branches/py3k/Lib/test/test_unicode.py ============================================================================== --- python/branches/py3k/Lib/test/test_unicode.py (original) +++ python/branches/py3k/Lib/test/test_unicode.py Sat May 2 20:52:14 2009 @@ -886,10 +886,10 @@ self.assertEqual('\u20ac'.encode('utf-8'), b'\xe2\x82\xac') self.assertEqual('\ud800\udc02'.encode('utf-8'), b'\xf0\x90\x80\x82') self.assertEqual('\ud84d\udc56'.encode('utf-8'), b'\xf0\xa3\x91\x96') - self.assertEqual('\ud800'.encode('utf-8'), b'\xed\xa0\x80') - self.assertEqual('\udc00'.encode('utf-8'), b'\xed\xb0\x80') + self.assertEqual('\ud800'.encode('utf-8', 'surrogates'), b'\xed\xa0\x80') + self.assertEqual('\udc00'.encode('utf-8', 'surrogates'), b'\xed\xb0\x80') self.assertEqual( - ('\ud800\udc02'*1000).encode('utf-8'), + ('\ud800\udc02'*1000).encode('utf-8', 'surrogates'), b'\xf0\x90\x80\x82'*1000 ) self.assertEqual( Modified: python/branches/py3k/Lib/test/test_unicodedata.py ============================================================================== --- python/branches/py3k/Lib/test/test_unicodedata.py (original) +++ python/branches/py3k/Lib/test/test_unicodedata.py Sat May 2 20:52:14 2009 @@ -13,6 +13,7 @@ import test.support encoding = 'utf-8' +errors = 'surrogates' ### Run tests @@ -61,7 +62,7 @@ (char + 'ABC').title(), ] - h.update(''.join(data).encode(encoding)) + h.update(''.join(data).encode(encoding, errors)) result = h.hexdigest() self.assertEqual(result, self.expectedchecksum) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 2 20:52:14 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #3672: Reject surrogates in utf-8 codec; add surrogates error handler. + - Issue #5883: In the io module, the BufferedIOBase and TextIOBase ABCs have received a new method, detach(). detach() disconnects the underlying stream from the buffer or text IO and returns it. Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Sat May 2 20:52:14 2009 @@ -154,6 +154,11 @@ 0, 0, 0, 0, 0, 0, 0, 0 }; +static PyObject *unicode_encode_call_errorhandler(const char *errors, + PyObject **errorHandler,const char *encoding, const char *reason, + const Py_UNICODE *unicode, Py_ssize_t size, PyObject **exceptionObject, + Py_ssize_t startpos, Py_ssize_t endpos, Py_ssize_t *newpos); + /* Same for linebreaks */ static unsigned char ascii_linebreak[] = { 0, 0, 0, 0, 0, 0, 0, 0, @@ -2214,14 +2219,7 @@ goto utf8Error; } ch = ((s[0] & 0x0f) << 12) + ((s[1] & 0x3f) << 6) + (s[2] & 0x3f); - if (ch < 0x0800) { - /* Note: UTF-8 encodings of surrogates are considered - legal UTF-8 sequences; - - XXX For wide builds (UCS-4) we should probably try - to recombine the surrogates into a single code - unit. - */ + if (ch < 0x0800 || (ch >= 0xd800 && ch <= 0xDFFF)) { errmsg = "illegal encoding"; startinpos = s-starts; endinpos = startinpos+3; @@ -2328,6 +2326,8 @@ Py_ssize_t nallocated; /* number of result bytes allocated */ Py_ssize_t nneeded; /* number of result bytes needed */ char stackbuf[MAX_SHORT_UNICHARS * 4]; + PyObject *errorHandler = NULL; + PyObject *exc = NULL; assert(s != NULL); assert(size >= 0); @@ -2367,6 +2367,7 @@ else { /* Encode UCS2 Unicode ordinals */ if (ch < 0x10000) { +#ifndef Py_UNICODE_WIDE /* Special case: check for high surrogate */ if (0xD800 <= ch && ch <= 0xDBFF && i != size) { Py_UCS4 ch2 = s[i]; @@ -2379,6 +2380,36 @@ } /* Fall through: handles isolated high surrogates */ } +#endif + if (ch >= 0xd800 && ch <= 0xdfff) { + Py_ssize_t newpos; + PyObject *rep; + char *prep; + int k; + rep = unicode_encode_call_errorhandler + (errors, &errorHandler, "utf-8", "surrogates not allowed", + s, size, &exc, i-1, i, &newpos); + if (!rep) + goto error; + /* Implementation limitations: only support error handler that return + bytes, and only support up to four replacement bytes. */ + if (!PyBytes_Check(rep)) { + PyErr_SetString(PyExc_TypeError, "error handler should have returned bytes"); + Py_DECREF(rep); + goto error; + } + if (PyBytes_Size(rep) > 4) { + PyErr_SetString(PyExc_TypeError, "error handler returned too many bytes"); + Py_DECREF(rep); + goto error; + } + prep = PyBytes_AsString(rep); + for(k = PyBytes_Size(rep); k > 0; k--) + *p++ = *prep++; + Py_DECREF(rep); + continue; + + } *p++ = (char)(0xe0 | (ch >> 12)); *p++ = (char)(0x80 | ((ch >> 6) & 0x3f)); *p++ = (char)(0x80 | (ch & 0x3f)); @@ -2405,7 +2436,14 @@ assert(nneeded <= nallocated); _PyBytes_Resize(&result, nneeded); } + Py_XDECREF(errorHandler); + Py_XDECREF(exc); return result; + error: + Py_XDECREF(errorHandler); + Py_XDECREF(exc); + Py_XDECREF(result); + return NULL; #undef MAX_SHORT_UNICHARS } @@ -3897,7 +3935,7 @@ Py_ssize_t startpos, Py_ssize_t endpos, Py_ssize_t *newpos) { - static char *argparse = "O!n;encoding error handler must return (str, int) tuple"; + static char *argparse = "On;encoding error handler must return (str/bytes, int) tuple"; PyObject *restuple; PyObject *resunicode; @@ -3918,15 +3956,20 @@ if (restuple == NULL) return NULL; if (!PyTuple_Check(restuple)) { - PyErr_SetString(PyExc_TypeError, &argparse[4]); + PyErr_SetString(PyExc_TypeError, &argparse[3]); Py_DECREF(restuple); return NULL; } - if (!PyArg_ParseTuple(restuple, argparse, &PyUnicode_Type, + if (!PyArg_ParseTuple(restuple, argparse, &resunicode, newpos)) { Py_DECREF(restuple); return NULL; } + if (!PyUnicode_Check(resunicode) && !PyBytes_Check(resunicode)) { + PyErr_SetString(PyExc_TypeError, &argparse[3]); + Py_DECREF(restuple); + return NULL; + } if (*newpos<0) *newpos = size+*newpos; if (*newpos<0 || *newpos>size) { @@ -4064,6 +4107,12 @@ collstart-startp, collend-startp, &newpos); if (repunicode == NULL) goto onError; + if (!PyUnicode_Check(repunicode)) { + /* Implementation limitation: byte results not supported yet. */ + PyErr_SetString(PyExc_TypeError, "error handler should return unicode"); + Py_DECREF(repunicode); + goto onError; + } /* need more space? (at least enough for what we have+the replacement+the rest of the string, so we won't have to check space for encodable characters) */ @@ -5027,6 +5076,12 @@ collstartpos, collendpos, &newpos); if (repunicode == NULL) return -1; + if (!PyUnicode_Check(repunicode)) { + /* Implementation limitation: byte results not supported yet. */ + PyErr_SetString(PyExc_TypeError, "error handler should return unicode"); + Py_DECREF(repunicode); + return -1; + } /* generate replacement */ repsize = PyUnicode_GET_SIZE(repunicode); for (uni2 = PyUnicode_AS_UNICODE(repunicode); repsize-->0; ++uni2) { @@ -5588,6 +5643,12 @@ collstart-s, collend-s, &newpos); if (repunicode == NULL) goto onError; + if (!PyUnicode_Check(repunicode)) { + /* Implementation limitation: byte results not supported yet. */ + PyErr_SetString(PyExc_TypeError, "error handler should return unicode"); + Py_DECREF(repunicode); + goto onError; + } /* generate replacement */ repsize = PyUnicode_GET_SIZE(repunicode); for (uni2 = PyUnicode_AS_UNICODE(repunicode); repsize-->0; ++uni2) { Modified: python/branches/py3k/Python/codecs.c ============================================================================== --- python/branches/py3k/Python/codecs.c (original) +++ python/branches/py3k/Python/codecs.c Sat May 2 20:52:14 2009 @@ -748,6 +748,85 @@ } } +PyObject *PyCodec_SurrogateErrors(PyObject *exc) +{ + PyObject *restuple; + PyObject *object; + Py_ssize_t start; + Py_ssize_t end; + PyObject *res; + if (PyObject_IsInstance(exc, PyExc_UnicodeEncodeError)) { + Py_UNICODE *p; + Py_UNICODE *startp; + char *outp; + if (PyUnicodeEncodeError_GetStart(exc, &start)) + return NULL; + if (PyUnicodeEncodeError_GetEnd(exc, &end)) + return NULL; + if (!(object = PyUnicodeEncodeError_GetObject(exc))) + return NULL; + startp = PyUnicode_AS_UNICODE(object); + res = PyBytes_FromStringAndSize(NULL, 3*(end-start)); + if (!res) { + Py_DECREF(object); + return NULL; + } + outp = PyBytes_AsString(res); + for (p = startp+start; p < startp+end; p++) { + Py_UNICODE ch = *p; + if (ch < 0xd800 || ch > 0xdfff) { + /* Not a surrogate, fail with original exception */ + PyErr_SetObject(PyExceptionInstance_Class(exc), exc); + Py_DECREF(res); + Py_DECREF(object); + return NULL; + } + *outp++ = (char)(0xe0 | (ch >> 12)); + *outp++ = (char)(0x80 | ((ch >> 6) & 0x3f)); + *outp++ = (char)(0x80 | (ch & 0x3f)); + } + restuple = Py_BuildValue("(On)", res, end); + Py_DECREF(res); + Py_DECREF(object); + return restuple; + } + else if (PyObject_IsInstance(exc, PyExc_UnicodeDecodeError)) { + unsigned char *p; + Py_UNICODE ch = 0; + if (PyUnicodeDecodeError_GetStart(exc, &start)) + return NULL; + if (!(object = PyUnicodeDecodeError_GetObject(exc))) + return NULL; + if (!(p = (unsigned char*)PyBytes_AsString(object))) { + Py_DECREF(object); + return NULL; + } + /* Try decoding a single surrogate character. If + there are more, let the codec call us again. */ + p += start; + if ((p[0] & 0xf0) == 0xe0 || + (p[1] & 0xc0) == 0x80 || + (p[2] & 0xc0) == 0x80) { + /* it's a three-byte code */ + ch = ((p[0] & 0x0f) << 12) + ((p[1] & 0x3f) << 6) + (p[2] & 0x3f); + if (ch < 0xd800 || ch > 0xdfff) + /* it's not a surrogate - fail */ + ch = 0; + } + Py_DECREF(object); + if (ch == 0) { + PyErr_SetObject(PyExceptionInstance_Class(exc), exc); + return NULL; + } + return Py_BuildValue("(u#n)", &ch, 1, start+3); + } + else { + wrong_exception_type(exc); + return NULL; + } +} + + static PyObject *strict_errors(PyObject *self, PyObject *exc) { return PyCodec_StrictErrors(exc); @@ -777,6 +856,11 @@ return PyCodec_BackslashReplaceErrors(exc); } +static PyObject *surrogates_errors(PyObject *self, PyObject *exc) +{ + return PyCodec_SurrogateErrors(exc); +} + static int _PyCodecRegistry_Init(void) { static struct { @@ -823,6 +907,14 @@ backslashreplace_errors, METH_O } + }, + { + "surrogates", + { + "surrogates", + surrogates_errors, + METH_O + } } }; Modified: python/branches/py3k/Python/marshal.c ============================================================================== --- python/branches/py3k/Python/marshal.c (original) +++ python/branches/py3k/Python/marshal.c Sat May 2 20:52:14 2009 @@ -312,7 +312,9 @@ } else if (PyUnicode_CheckExact(v)) { PyObject *utf8; - utf8 = PyUnicode_AsUTF8String(v); + utf8 = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(v), + PyUnicode_GET_SIZE(v), + "surrogates"); if (utf8 == NULL) { p->depth--; p->error = WFERR_UNMARSHALLABLE; @@ -810,7 +812,7 @@ retval = NULL; break; } - v = PyUnicode_DecodeUTF8(buffer, n, NULL); + v = PyUnicode_DecodeUTF8(buffer, n, "surrogates"); PyMem_DEL(buffer); retval = v; break; From python-checkins at python.org Sat May 2 20:53:24 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 2 May 2009 20:53:24 +0200 (CEST) Subject: [Python-checkins] r72209 - python/branches/release30-maint Message-ID: <20090502185324.1D7661E4025@bag.python.org> Author: martin.v.loewis Date: Sat May 2 20:53:23 2009 New Revision: 72209 Log: Blocked revisions 72208 via svnmerge ........ r72208 | martin.v.loewis | 2009-05-02 20:52:14 +0200 (Sa, 02 Mai 2009) | 3 lines Issue #3672: Reject surrogates in utf-8 codec; add surrogates error handler. ........ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sat May 2 20:58:21 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sat, 2 May 2009 20:58:21 +0200 (CEST) Subject: [Python-checkins] r72210 - python/trunk/Lib/test/test_ipaddr.py Message-ID: <20090502185821.C866F1E4025@bag.python.org> Author: gregory.p.smith Date: Sat May 2 20:58:21 2009 New Revision: 72210 Log: Convert test method names to PEP8 style. Modified: python/trunk/Lib/test/test_ipaddr.py Modified: python/trunk/Lib/test/test_ipaddr.py ============================================================================== --- python/trunk/Lib/test/test_ipaddr.py (original) +++ python/trunk/Lib/test/test_ipaddr.py Sat May 2 20:58:21 2009 @@ -22,6 +22,7 @@ import ipaddr + class IpaddrUnitTest(unittest.TestCase): def setUp(self): @@ -29,11 +30,11 @@ self.ipv4_hostmask = ipaddr.IPv4('10.0.0.1/0.255.255.255') self.ipv6 = ipaddr.IPv6('2001:658:22a:cafe:200:0:0:1/64') - def testRepr(self): + def test_repr(self): self.assertEqual("IPv4('1.2.3.4/32')", repr(ipaddr.IPv4('1.2.3.4'))) self.assertEqual("IPv6('::1/128')", repr(ipaddr.IPv6('::1'))) - def testInvalidStrings(self): + def test_invalid_strings(self): self.assertRaises(ValueError, ipaddr.IP, '') self.assertRaises(ValueError, ipaddr.IP, 'www.google.com') self.assertRaises(ValueError, ipaddr.IP, '1.2.3') @@ -64,7 +65,7 @@ self.assertRaises(ipaddr.IPv6IpValidationError, ipaddr.IPv6, '1.2.3.4') - def testGetNetwork(self): + def test_get_network(self): self.assertEqual(self.ipv4.network, 16909056) self.assertEqual(self.ipv4.network_ext, '1.2.3.0') self.assertEqual(self.ipv4_hostmask.network_ext, '10.0.0.0') @@ -76,7 +77,7 @@ self.assertEqual(self.ipv6.hostmask_ext, '::ffff:ffff:ffff:ffff') - def testIpFromInt(self): + def test_ip_from_int(self): self.assertEqual(self.ipv4.ip, ipaddr.IPv4(16909060).ip) self.assertRaises(ipaddr.IPv4IpValidationError, ipaddr.IPv4, 2**32) @@ -93,7 +94,7 @@ self.assertEqual(ipaddr.IP(self.ipv4.ip).version, 4) self.assertEqual(ipaddr.IP(self.ipv6.ip).version, 6) - def testGetIp(self): + def test_get_ip(self): self.assertEqual(self.ipv4.ip, 16909060) self.assertEqual(self.ipv4.ip_ext, '1.2.3.4') self.assertEqual(self.ipv4.ip_ext_full, '1.2.3.4') @@ -105,7 +106,7 @@ self.assertEqual(self.ipv6.ip_ext_full, '2001:0658:022a:cafe:0200:0000:0000:0001') - def testGetNetmask(self): + def test_get_netmask(self): self.assertEqual(self.ipv4.netmask, 4294967040) self.assertEqual(self.ipv4.netmask_ext, '255.255.255.0') self.assertEqual(self.ipv4_hostmask.netmask_ext, '255.0.0.0') @@ -113,7 +114,7 @@ 340282366920938463444927863358058659840) self.assertEqual(self.ipv6.netmask_ext, 64) - def testZeroNetmask(self): + def test_zero_netmask(self): ipv4_zero_netmask = ipaddr.IPv4('1.2.3.4/0') self.assertEqual(ipv4_zero_netmask.netmask, 0) self.assert_(ipv4_zero_netmask._is_valid_netmask(str(0))) @@ -122,7 +123,7 @@ self.assertEqual(ipv6_zero_netmask.netmask, 0) self.assert_(ipv6_zero_netmask._is_valid_netmask(str(0))) - def testGetBroadcast(self): + def test_get_broadcast(self): self.assertEqual(self.ipv4.broadcast, 16909311) self.assertEqual(self.ipv4.broadcast_ext, '1.2.3.255') @@ -131,12 +132,12 @@ self.assertEqual(self.ipv6.broadcast_ext, '2001:658:22a:cafe:ffff:ffff:ffff:ffff') - def testGetPrefixlen(self): + def test_get_prefixlen(self): self.assertEqual(self.ipv4.prefixlen, 24) self.assertEqual(self.ipv6.prefixlen, 64) - def testGetSupernet(self): + def test_get_supernet(self): self.assertEqual(self.ipv4.supernet().prefixlen, 23) self.assertEqual(self.ipv4.supernet().network_ext, '1.2.2.0') self.assertEqual(ipaddr.IPv4('0.0.0.0/0').supernet(), @@ -147,7 +148,7 @@ '2001:658:22a:cafe::') self.assertEqual(ipaddr.IPv6('::0/0').supernet(), ipaddr.IPv6('::0/0')) - def testGetSupernet3(self): + def test_get_supernet3(self): self.assertEqual(self.ipv4.supernet(3).prefixlen, 21) self.assertEqual(self.ipv4.supernet(3).network_ext, '1.2.0.0') @@ -155,28 +156,28 @@ self.assertEqual(self.ipv6.supernet(3).network_ext, '2001:658:22a:caf8::') - def testGetSubnet(self): + def test_get_subnet(self): self.assertEqual(self.ipv4.subnet()[0].prefixlen, 25) self.assertEqual(self.ipv4.subnet()[0].network_ext, '1.2.3.0') self.assertEqual(self.ipv4.subnet()[1].network_ext, '1.2.3.128') self.assertEqual(self.ipv6.subnet()[0].prefixlen, 65) - def testGetSubnetForSingle32(self): + def test_get_subnet_for_single32(self): ip = ipaddr.IPv4('1.2.3.4/32') subnets1 = [str(x) for x in ip.subnet()] subnets2 = [str(x) for x in ip.subnet(2)] self.assertEqual(subnets1, ['1.2.3.4/32']) self.assertEqual(subnets1, subnets2) - def testGetSubnetForSingle128(self): + def test_get_subnet_for_single128(self): ip = ipaddr.IPv6('::1/128') subnets1 = [str(x) for x in ip.subnet()] subnets2 = [str(x) for x in ip.subnet(2)] self.assertEqual(subnets1, ['::1/128']) self.assertEqual(subnets1, subnets2) - def testSubnet2(self): + def test_subnet2(self): ips = [str(x) for x in self.ipv4.subnet(2)] self.assertEqual( ips, @@ -190,24 +191,24 @@ '2001:658:22a:cafe:8000::/66', '2001:658:22a:cafe:c000::/66']) - def testSubnetFailsForLargeCidrDiff(self): + def test_subnet_fails_for_large_cidr_diff(self): self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv4.subnet, 9) self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv6.subnet, 65) - def testSupernetFailsForLargeCidrDiff(self): + def test_supernet_fails_for_large_cidr_diff(self): self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv4.supernet, 25) self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv6.supernet, 65) - def testSubnetFailsForNegativeCidrDiff(self): + def test_subnet_fails_for_negative_cidr_diff(self): self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv4.subnet, -1) self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv6.subnet, -1) - def testGetNumHosts(self): + def test_get_num_hosts(self): self.assertEqual(self.ipv4.numhosts, 256) self.assertEqual(self.ipv4.subnet()[0].numhosts, 128) self.assertEqual(self.ipv4.supernet().numhosts, 512) @@ -216,7 +217,7 @@ self.assertEqual(self.ipv6.subnet()[0].numhosts, 9223372036854775808) self.assertEqual(self.ipv6.supernet().numhosts, 36893488147419103232) - def testContains(self): + def test_contains(self): self.assertTrue(ipaddr.IPv4('1.2.3.128/25') in self.ipv4) self.assertFalse(ipaddr.IPv4('1.2.4.1/24') in self.ipv4) self.assertFalse(self.ipv4 in self.ipv6) @@ -224,7 +225,7 @@ self.assertTrue(self.ipv4 in self.ipv4) self.assertTrue(self.ipv6 in self.ipv6) - def testBadAddress(self): + def test_bad_address(self): self.assertRaises(ipaddr.IPv4IpValidationError, ipaddr.IPv4, 'poop') self.assertRaises(ipaddr.IPv4IpValidationError, ipaddr.IPv4, '1.2.3.256') @@ -233,7 +234,7 @@ self.assertRaises(ipaddr.IPv4IpValidationError, ipaddr.IPv4, '1.2.3.4/32/24') - def testBadNetMask(self): + def test_bad_net_mask(self): self.assertRaises(ipaddr.IPv4NetmaskValidationError, ipaddr.IPv4, '1.2.3.4/') self.assertRaises(ipaddr.IPv4NetmaskValidationError, @@ -246,14 +247,14 @@ self.assertRaises(ipaddr.IPv6NetmaskValidationError, ipaddr.IPv6, '::1/129') - def testNth(self): + def test_nth(self): self.assertEqual(self.ipv4[5], '1.2.3.5') self.assertRaises(IndexError, self.ipv4.__getitem__, 256) self.assertEqual(self.ipv6[5], '2001:658:22a:cafe::5') - def testEquals(self): + def test_equals(self): self.assertTrue(self.ipv4 == ipaddr.IPv4('1.2.3.4/24')) self.assertFalse(self.ipv4 == ipaddr.IPv4('1.2.3.4/23')) self.assertFalse(self.ipv4 == ipaddr.IPv4('1.2.3.5/24')) @@ -273,7 +274,7 @@ self.assertFalse(self.ipv6 == []) self.assertFalse(self.ipv6 == 2) - def testNotEquals(self): + def test_not_equals(self): self.assertFalse(self.ipv4 != ipaddr.IPv4('1.2.3.4/24')) self.assertTrue(self.ipv4 != ipaddr.IPv4('1.2.3.4/23')) self.assertTrue(self.ipv4 != ipaddr.IPv4('1.2.3.5/24')) @@ -293,18 +294,18 @@ self.assertTrue(self.ipv6 != []) self.assertTrue(self.ipv6 != 2) - def testSlash32Constructor(self): + def test_slash32_constructor(self): self.assertEquals(str(ipaddr.IPv4('1.2.3.4/255.255.255.255')), '1.2.3.4/32') - def testSlash128Constructor(self): + def test_slash128_constructor(self): self.assertEquals(str(ipaddr.IPv6('::1/128')), '::1/128') - def testSlash0Constructor(self): + def test_slash0_constructor(self): self.assertEquals(str(ipaddr.IPv4('1.2.3.4/0.0.0.0')), '1.2.3.4/0') - def testCollapsing(self): + def test_collapsing(self): ip1 = ipaddr.IPv4('1.1.0.0/24') ip2 = ipaddr.IPv4('1.1.1.0/24') ip3 = ipaddr.IPv4('1.1.2.0/24') @@ -330,7 +331,7 @@ collapsed = ipaddr.collapse_address_list([ip1, ip2, ip3]) self.assertEqual(collapsed, [ip3]) - def testNetworkComparison(self): + def test_network_comparison(self): # ip1 and ip2 have the same network address ip1 = ipaddr.IPv4('1.1.1.0/24') ip2 = ipaddr.IPv4('1.1.1.1/24') @@ -361,7 +362,7 @@ self.assertTrue(ipv6 > ipv4) self.assertTrue(ipv4 < ipv6) - def testEmbeddedIpv4(self): + def test_embedded_ipv4(self): ipv4_string = '192.168.0.1' ipv4 = ipaddr.IPv4(ipv4_string) v4compat_ipv6 = ipaddr.IPv6('::%s' % ipv4_string) @@ -371,11 +372,11 @@ self.assertRaises(ipaddr.IPv6IpValidationError, ipaddr.IPv6, '2001:1.1.1.1:1.1.1.1') - def testIPVersion(self): + def test_ip_version(self): self.assertEqual(self.ipv4.version, 4) self.assertEqual(self.ipv6.version, 6) - def testPacked(self): + def test_packed(self): self.assertEqual(self.ipv4.packed, '\x01\x02\x03\x04') self.assertEqual(ipaddr.IPv4('255.254.253.252').packed, '\xff\xfe\xfd\xfc') @@ -388,18 +389,18 @@ self.assertEqual(ipaddr.IPv6('::1:0:0:0:0').packed, '\x00' * 6 + '\x00\x01' + '\x00' * 8) - def testIpStrFromPrefixlen(self): + def test_ip_str_from_prefixlen(self): ipv4 = ipaddr.IPv4('1.2.3.4/24') self.assertEquals(ipv4._ip_string_from_prefix(), '255.255.255.0') self.assertEquals(ipv4._ip_string_from_prefix(28), '255.255.255.240') - def testIpType(self): + def test_ip_type(self): ipv4 = ipaddr.IP('1.2.3.4') ipv6 = ipaddr.IP('::1.2.3.4') self.assertEquals(ipaddr.IPv4, type(ipv4)) self.assertEquals(ipaddr.IPv6, type(ipv6)) - def testReservedIpv4(self): + def test_reserved_ipv4(self): self.assertEquals(True, ipaddr.IP('224.1.1.1/31').is_multicast) self.assertEquals(False, ipaddr.IP('240.0.0.0').is_multicast) @@ -417,7 +418,7 @@ self.assertEquals(True, ipaddr.IP('127.42.0.0/16').is_loopback) self.assertEquals(False, ipaddr.IP('128.0.0.0').is_loopback) - def testReservedIpv6(self): + def test_reserved_ipv6(self): ip = ipaddr.IP self.assertEquals(True, ip('ffff::').is_multicast) @@ -449,7 +450,7 @@ self.assertEquals(False, ip('::1').is_unspecified) self.assertEquals(False, ip('::/127').is_unspecified) - def testAddrExclude(self): + def test_addr_exclude(self): addr1 = ipaddr.IP('10.1.1.0/24') addr2 = ipaddr.IP('10.1.1.0/26') addr3 = ipaddr.IP('10.2.1.0/24') @@ -458,7 +459,7 @@ ipaddr.IP('10.1.1.128/25')]) self.assertRaises(ValueError, addr1.address_exclude, addr3) - def testHash(self): + def test_hash(self): self.assertEquals(hash(ipaddr.IP('10.1.1.0/24')), hash(ipaddr.IP('10.1.1.0/24'))) dummy = {} @@ -466,7 +467,7 @@ dummy[self.ipv6] = None self.assertTrue(self.ipv4 in dummy) - def testIPv4PrefixFromInt(self): + def test_ipv4_prefix_from_int(self): addr1 = ipaddr.IP('10.1.1.0/24') addr2 = ipaddr.IPv4(addr1.ip) # clone prefix addr2.prefixlen = addr1.prefixlen @@ -478,7 +479,7 @@ self.assertEqual(addr1, addr2) self.assertEqual(str(addr1), str(addr2)) - def testIPv6PrefixFromInt(self): + def test_ipv6_prefix_from_int(self): addr1 = ipaddr.IP('2001:0658:022a:cafe:0200::1/64') addr2 = ipaddr.IPv6(addr1.ip) # clone prefix addr2.prefixlen = addr1.prefixlen @@ -490,7 +491,7 @@ self.assertEqual(addr1, addr2) self.assertEqual(str(addr1), str(addr2)) - def testCopyConstructor(self): + def test_copy_constructor(self): addr1 = ipaddr.IP('10.1.1.0/24') addr2 = ipaddr.IP(addr1) addr3 = ipaddr.IP('2001:658:22a:cafe:200::1/64') @@ -499,7 +500,7 @@ self.assertEqual(addr1, addr2) self.assertEqual(addr3, addr4) - def testCompressIPv6Address(self): + def test_compress_ipv6_address(self): test_addresses = { '1:2:3:4:5:6:7:8': '1:2:3:4:5:6:7:8/128', '2001:0:0:4:0:0:0:8': '2001:0:0:4::8/128', @@ -519,16 +520,16 @@ for uncompressed, compressed in test_addresses.items(): self.assertEquals(compressed, str(ipaddr.IPv6(uncompressed))) - def testExplodeShortHandIpStr(self): + def test_explode_short_hand_ip_str(self): addr1 = ipaddr.IPv6('2001::1') self.assertEqual('2001:0000:0000:0000:0000:0000:0000:0001', addr1._explode_shorthand_ip_string(addr1.ip_ext)) - def testIntRepresentation(self): + def test_int_representation(self): self.assertEqual(16909060, int(self.ipv4)) self.assertEqual(42540616829182469433547762482097946625, int(self.ipv6)) - def testHexRepresentation(self): + def test_hex_representation(self): self.assertEqual(hex(0x1020304), hex(self.ipv4)) self.assertEqual(hex(0x20010658022ACAFE0200000000000001), From python-checkins at python.org Sat May 2 21:01:54 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sat, 2 May 2009 21:01:54 +0200 (CEST) Subject: [Python-checkins] r72211 - in python/branches/py3k: Lib/test/test_ipaddr.py Message-ID: <20090502190154.D972D1E4030@bag.python.org> Author: gregory.p.smith Date: Sat May 2 21:01:54 2009 New Revision: 72211 Log: Merged revisions 72210 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72210 | gregory.p.smith | 2009-05-02 11:58:21 -0700 (Sat, 02 May 2009) | 2 lines Convert test method names to PEP8 style. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_ipaddr.py Modified: python/branches/py3k/Lib/test/test_ipaddr.py ============================================================================== --- python/branches/py3k/Lib/test/test_ipaddr.py (original) +++ python/branches/py3k/Lib/test/test_ipaddr.py Sat May 2 21:01:54 2009 @@ -22,6 +22,7 @@ import ipaddr + class IpaddrUnitTest(unittest.TestCase): def setUp(self): @@ -29,11 +30,11 @@ self.ipv4_hostmask = ipaddr.IPv4('10.0.0.1/0.255.255.255') self.ipv6 = ipaddr.IPv6('2001:658:22a:cafe:200:0:0:1/64') - def testRepr(self): + def test_repr(self): self.assertEqual("IPv4('1.2.3.4/32')", repr(ipaddr.IPv4('1.2.3.4'))) self.assertEqual("IPv6('::1/128')", repr(ipaddr.IPv6('::1'))) - def testInvalidStrings(self): + def test_invalid_strings(self): self.assertRaises(ValueError, ipaddr.IP, '') self.assertRaises(ValueError, ipaddr.IP, 'www.google.com') self.assertRaises(ValueError, ipaddr.IP, '1.2.3') @@ -64,7 +65,7 @@ self.assertRaises(ipaddr.IPv6IpValidationError, ipaddr.IPv6, '1.2.3.4') - def testGetNetwork(self): + def test_get_network(self): self.assertEqual(self.ipv4.network, 16909056) self.assertEqual(self.ipv4.network_ext, '1.2.3.0') self.assertEqual(self.ipv4_hostmask.network_ext, '10.0.0.0') @@ -76,7 +77,7 @@ self.assertEqual(self.ipv6.hostmask_ext, '::ffff:ffff:ffff:ffff') - def testIpFromInt(self): + def test_ip_from_int(self): self.assertEqual(self.ipv4.ip, ipaddr.IPv4(16909060).ip) self.assertRaises(ipaddr.IPv4IpValidationError, ipaddr.IPv4, 2**32) @@ -93,7 +94,7 @@ self.assertEqual(ipaddr.IP(self.ipv4.ip).version, 4) self.assertEqual(ipaddr.IP(self.ipv6.ip).version, 6) - def testIpFromPacked(self): + def test_ip_from_packed(self): ip = ipaddr.IP self.assertEqual(self.ipv4.ip, @@ -113,7 +114,7 @@ self.assertRaises(ValueError, ip, b'\x00' * 15) self.assertRaises(ValueError, ip, b'\x00' * 17) - def testGetIp(self): + def test_get_ip(self): self.assertEqual(self.ipv4.ip, 16909060) self.assertEqual(self.ipv4.ip_ext, '1.2.3.4') self.assertEqual(self.ipv4.ip_ext_full, '1.2.3.4') @@ -125,7 +126,7 @@ self.assertEqual(self.ipv6.ip_ext_full, '2001:0658:022a:cafe:0200:0000:0000:0001') - def testGetNetmask(self): + def test_get_netmask(self): self.assertEqual(self.ipv4.netmask, 4294967040) self.assertEqual(self.ipv4.netmask_ext, '255.255.255.0') self.assertEqual(self.ipv4_hostmask.netmask_ext, '255.0.0.0') @@ -133,7 +134,7 @@ 340282366920938463444927863358058659840) self.assertEqual(self.ipv6.netmask_ext, 64) - def testZeroNetmask(self): + def test_zero_netmask(self): ipv4_zero_netmask = ipaddr.IPv4('1.2.3.4/0') self.assertEqual(ipv4_zero_netmask.netmask, 0) self.assert_(ipv4_zero_netmask._is_valid_netmask(str(0))) @@ -142,7 +143,7 @@ self.assertEqual(ipv6_zero_netmask.netmask, 0) self.assert_(ipv6_zero_netmask._is_valid_netmask(str(0))) - def testGetBroadcast(self): + def test_get_broadcast(self): self.assertEqual(self.ipv4.broadcast, 16909311) self.assertEqual(self.ipv4.broadcast_ext, '1.2.3.255') @@ -151,12 +152,12 @@ self.assertEqual(self.ipv6.broadcast_ext, '2001:658:22a:cafe:ffff:ffff:ffff:ffff') - def testGetPrefixlen(self): + def test_get_prefixlen(self): self.assertEqual(self.ipv4.prefixlen, 24) self.assertEqual(self.ipv6.prefixlen, 64) - def testGetSupernet(self): + def test_get_supernet(self): self.assertEqual(self.ipv4.supernet().prefixlen, 23) self.assertEqual(self.ipv4.supernet().network_ext, '1.2.2.0') self.assertEqual(ipaddr.IPv4('0.0.0.0/0').supernet(), @@ -167,7 +168,7 @@ '2001:658:22a:cafe::') self.assertEqual(ipaddr.IPv6('::0/0').supernet(), ipaddr.IPv6('::0/0')) - def testGetSupernet3(self): + def test_get_supernet3(self): self.assertEqual(self.ipv4.supernet(3).prefixlen, 21) self.assertEqual(self.ipv4.supernet(3).network_ext, '1.2.0.0') @@ -175,28 +176,28 @@ self.assertEqual(self.ipv6.supernet(3).network_ext, '2001:658:22a:caf8::') - def testGetSubnet(self): + def test_get_subnet(self): self.assertEqual(self.ipv4.subnet()[0].prefixlen, 25) self.assertEqual(self.ipv4.subnet()[0].network_ext, '1.2.3.0') self.assertEqual(self.ipv4.subnet()[1].network_ext, '1.2.3.128') self.assertEqual(self.ipv6.subnet()[0].prefixlen, 65) - def testGetSubnetForSingle32(self): + def test_get_subnet_for_single32(self): ip = ipaddr.IPv4('1.2.3.4/32') subnets1 = [str(x) for x in ip.subnet()] subnets2 = [str(x) for x in ip.subnet(2)] self.assertEqual(subnets1, ['1.2.3.4/32']) self.assertEqual(subnets1, subnets2) - def testGetSubnetForSingle128(self): + def test_get_subnet_for_single128(self): ip = ipaddr.IPv6('::1/128') subnets1 = [str(x) for x in ip.subnet()] subnets2 = [str(x) for x in ip.subnet(2)] self.assertEqual(subnets1, ['::1/128']) self.assertEqual(subnets1, subnets2) - def testSubnet2(self): + def test_subnet2(self): ips = [str(x) for x in self.ipv4.subnet(2)] self.assertEqual( ips, @@ -210,24 +211,24 @@ '2001:658:22a:cafe:8000::/66', '2001:658:22a:cafe:c000::/66']) - def testSubnetFailsForLargeCidrDiff(self): + def test_subnet_fails_for_large_cidr_diff(self): self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv4.subnet, 9) self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv6.subnet, 65) - def testSupernetFailsForLargeCidrDiff(self): + def test_supernet_fails_for_large_cidr_diff(self): self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv4.supernet, 25) self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv6.supernet, 65) - def testSubnetFailsForNegativeCidrDiff(self): + def test_subnet_fails_for_negative_cidr_diff(self): self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv4.subnet, -1) self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv6.subnet, -1) - def testGetNumHosts(self): + def test_get_num_hosts(self): self.assertEqual(self.ipv4.numhosts, 256) self.assertEqual(self.ipv4.subnet()[0].numhosts, 128) self.assertEqual(self.ipv4.supernet().numhosts, 512) @@ -236,7 +237,7 @@ self.assertEqual(self.ipv6.subnet()[0].numhosts, 9223372036854775808) self.assertEqual(self.ipv6.supernet().numhosts, 36893488147419103232) - def testContains(self): + def test_contains(self): self.assertTrue(ipaddr.IPv4('1.2.3.128/25') in self.ipv4) self.assertFalse(ipaddr.IPv4('1.2.4.1/24') in self.ipv4) self.assertFalse(self.ipv4 in self.ipv6) @@ -244,7 +245,7 @@ self.assertTrue(self.ipv4 in self.ipv4) self.assertTrue(self.ipv6 in self.ipv6) - def testBadAddress(self): + def test_bad_address(self): self.assertRaises(ipaddr.IPv4IpValidationError, ipaddr.IPv4, 'poop') self.assertRaises(ipaddr.IPv4IpValidationError, ipaddr.IPv4, '1.2.3.256') @@ -253,7 +254,7 @@ self.assertRaises(ipaddr.IPv4IpValidationError, ipaddr.IPv4, '1.2.3.4/32/24') - def testBadNetMask(self): + def test_bad_net_mask(self): self.assertRaises(ipaddr.IPv4NetmaskValidationError, ipaddr.IPv4, '1.2.3.4/') self.assertRaises(ipaddr.IPv4NetmaskValidationError, @@ -266,14 +267,14 @@ self.assertRaises(ipaddr.IPv6NetmaskValidationError, ipaddr.IPv6, '::1/129') - def testNth(self): + def test_nth(self): self.assertEqual(self.ipv4[5], '1.2.3.5') self.assertRaises(IndexError, self.ipv4.__getitem__, 256) self.assertEqual(self.ipv6[5], '2001:658:22a:cafe::5') - def testEquals(self): + def test_equals(self): self.assertTrue(self.ipv4 == ipaddr.IPv4('1.2.3.4/24')) self.assertFalse(self.ipv4 == ipaddr.IPv4('1.2.3.4/23')) self.assertFalse(self.ipv4 == ipaddr.IPv4('1.2.3.5/24')) @@ -293,7 +294,7 @@ self.assertFalse(self.ipv6 == []) self.assertFalse(self.ipv6 == 2) - def testNotEquals(self): + def test_not_equals(self): self.assertFalse(self.ipv4 != ipaddr.IPv4('1.2.3.4/24')) self.assertTrue(self.ipv4 != ipaddr.IPv4('1.2.3.4/23')) self.assertTrue(self.ipv4 != ipaddr.IPv4('1.2.3.5/24')) @@ -313,18 +314,18 @@ self.assertTrue(self.ipv6 != []) self.assertTrue(self.ipv6 != 2) - def testSlash32Constructor(self): + def test_slash32_constructor(self): self.assertEquals(str(ipaddr.IPv4('1.2.3.4/255.255.255.255')), '1.2.3.4/32') - def testSlash128Constructor(self): + def test_slash128_constructor(self): self.assertEquals(str(ipaddr.IPv6('::1/128')), '::1/128') - def testSlash0Constructor(self): + def test_slash0_constructor(self): self.assertEquals(str(ipaddr.IPv4('1.2.3.4/0.0.0.0')), '1.2.3.4/0') - def testCollapsing(self): + def test_collapsing(self): ip1 = ipaddr.IPv4('1.1.0.0/24') ip2 = ipaddr.IPv4('1.1.1.0/24') ip3 = ipaddr.IPv4('1.1.2.0/24') @@ -350,7 +351,7 @@ collapsed = ipaddr.collapse_address_list([ip1, ip2, ip3]) self.assertEqual(collapsed, [ip3]) - def testNetworkComparison(self): + def test_network_comparison(self): # ip1 and ip2 have the same network address ip1 = ipaddr.IPv4('1.1.1.0/24') ip2 = ipaddr.IPv4('1.1.1.1/24') @@ -381,7 +382,7 @@ self.assertTrue(ipv6 > ipv4) self.assertTrue(ipv4 < ipv6) - def testEmbeddedIpv4(self): + def test_embedded_ipv4(self): ipv4_string = '192.168.0.1' ipv4 = ipaddr.IPv4(ipv4_string) v4compat_ipv6 = ipaddr.IPv6('::%s' % ipv4_string) @@ -391,11 +392,11 @@ self.assertRaises(ipaddr.IPv6IpValidationError, ipaddr.IPv6, '2001:1.1.1.1:1.1.1.1') - def testIPVersion(self): + def test_ip_version(self): self.assertEqual(self.ipv4.version, 4) self.assertEqual(self.ipv6.version, 6) - def testPacked(self): + def test_packed(self): self.assertEqual(self.ipv4.packed, b'\x01\x02\x03\x04') self.assertEqual(ipaddr.IPv4('255.254.253.252').packed, @@ -409,18 +410,18 @@ self.assertEqual(ipaddr.IPv6('::1:0:0:0:0').packed, b'\x00' * 6 + b'\x00\x01' + b'\x00' * 8) - def testIpStrFromPrefixlen(self): + def test_ip_str_from_prefixlen(self): ipv4 = ipaddr.IPv4('1.2.3.4/24') self.assertEquals(ipv4._ip_string_from_prefix(), '255.255.255.0') self.assertEquals(ipv4._ip_string_from_prefix(28), '255.255.255.240') - def testIpType(self): + def test_ip_type(self): ipv4 = ipaddr.IP('1.2.3.4') ipv6 = ipaddr.IP('::1.2.3.4') self.assertEquals(ipaddr.IPv4, type(ipv4)) self.assertEquals(ipaddr.IPv6, type(ipv6)) - def testReservedIpv4(self): + def test_reserved_ipv4(self): self.assertEquals(True, ipaddr.IP('224.1.1.1/31').is_multicast) self.assertEquals(False, ipaddr.IP('240.0.0.0').is_multicast) @@ -438,7 +439,7 @@ self.assertEquals(True, ipaddr.IP('127.42.0.0/16').is_loopback) self.assertEquals(False, ipaddr.IP('128.0.0.0').is_loopback) - def testReservedIpv6(self): + def test_reserved_ipv6(self): ip = ipaddr.IP self.assertEquals(True, ip('ffff::').is_multicast) @@ -470,7 +471,7 @@ self.assertEquals(False, ip('::1').is_unspecified) self.assertEquals(False, ip('::/127').is_unspecified) - def testAddrExclude(self): + def test_addr_exclude(self): addr1 = ipaddr.IP('10.1.1.0/24') addr2 = ipaddr.IP('10.1.1.0/26') addr3 = ipaddr.IP('10.2.1.0/24') @@ -479,7 +480,7 @@ ipaddr.IP('10.1.1.128/25')]) self.assertRaises(ValueError, addr1.address_exclude, addr3) - def testHash(self): + def test_hash(self): self.assertEquals(hash(ipaddr.IP('10.1.1.0/24')), hash(ipaddr.IP('10.1.1.0/24'))) dummy = {} @@ -487,7 +488,7 @@ dummy[self.ipv6] = None self.assertTrue(self.ipv4 in dummy) - def testIPv4PrefixFromInt(self): + def test_ipv4_prefix_from_int(self): addr1 = ipaddr.IP('10.1.1.0/24') addr2 = ipaddr.IPv4(addr1.ip) # clone prefix addr2.prefixlen = addr1.prefixlen @@ -499,7 +500,7 @@ self.assertEqual(addr1, addr2) self.assertEqual(str(addr1), str(addr2)) - def testIPv6PrefixFromInt(self): + def test_ipv6_prefix_from_int(self): addr1 = ipaddr.IP('2001:0658:022a:cafe:0200::1/64') addr2 = ipaddr.IPv6(addr1.ip) # clone prefix addr2.prefixlen = addr1.prefixlen @@ -511,7 +512,7 @@ self.assertEqual(addr1, addr2) self.assertEqual(str(addr1), str(addr2)) - def testCopyConstructor(self): + def test_copy_constructor(self): addr1 = ipaddr.IP('10.1.1.0/24') addr2 = ipaddr.IP(addr1) addr3 = ipaddr.IP('2001:658:22a:cafe:200::1/64') @@ -520,7 +521,7 @@ self.assertEqual(addr1, addr2) self.assertEqual(addr3, addr4) - def testCompressIPv6Address(self): + def test_compress_ipv6_address(self): test_addresses = { '1:2:3:4:5:6:7:8': '1:2:3:4:5:6:7:8/128', '2001:0:0:4:0:0:0:8': '2001:0:0:4::8/128', @@ -540,16 +541,16 @@ for uncompressed, compressed in test_addresses.items(): self.assertEquals(compressed, str(ipaddr.IPv6(uncompressed))) - def testExplodeShortHandIpStr(self): + def test_explode_short_hand_ip_str(self): addr1 = ipaddr.IPv6('2001::1') self.assertEqual('2001:0000:0000:0000:0000:0000:0000:0001', addr1._explode_shorthand_ip_string(addr1.ip_ext)) - def testIntRepresentation(self): + def test_int_representation(self): self.assertEqual(16909060, int(self.ipv4)) self.assertEqual(42540616829182469433547762482097946625, int(self.ipv6)) - def testHexRepresentation(self): + def test_hex_representation(self): self.assertEqual(hex(0x1020304), hex(self.ipv4)) self.assertEqual(hex(0x20010658022ACAFE0200000000000001), From python-checkins at python.org Sat May 2 21:15:23 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 2 May 2009 21:15:23 +0200 (CEST) Subject: [Python-checkins] r72212 - python/branches/py3k Message-ID: <20090502191523.79FD11E405F@bag.python.org> Author: benjamin.peterson Date: Sat May 2 21:15:23 2009 New Revision: 72212 Log: Blocked revisions 71780,71961,72117,72155 via svnmerge ........ r71780 | senthil.kumaran | 2009-04-20 22:24:19 -0500 (Mon, 20 Apr 2009) | 3 lines Fix for the Issue918368 - urllib doesn't correct server returned urls ........ r71961 | georg.brandl | 2009-04-26 04:57:29 -0500 (Sun, 26 Apr 2009) | 2 lines Update pydoc topics. ........ r72117 | benjamin.peterson | 2009-04-29 15:36:25 -0500 (Wed, 29 Apr 2009) | 1 line run autoconf ........ r72155 | senthil.kumaran | 2009-05-01 00:59:52 -0500 (Fri, 01 May 2009) | 4 lines Fix for Issue1648102, based on the MSDN spec: If this parameter specifies the "" macro as the only entry, this function bypasses any host name that does not contain a period. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat May 2 21:17:29 2009 From: python-checkins at python.org (andrew.kuchling) Date: Sat, 2 May 2009 21:17:29 +0200 (CEST) Subject: [Python-checkins] r72213 - in python/trunk/Lib: mailbox.py test/test_mailbox.py Message-ID: <20090502191729.544661E4025@bag.python.org> Author: andrew.kuchling Date: Sat May 2 21:17:28 2009 New Revision: 72213 Log: #1607951: Make mailbox.Maildir re-read the directories less frequently. This is done by recording the current time -1sec, and not re-reading unless the directory mod. times are >= the recorded time. Modified: python/trunk/Lib/mailbox.py python/trunk/Lib/test/test_mailbox.py Modified: python/trunk/Lib/mailbox.py ============================================================================== --- python/trunk/Lib/mailbox.py (original) +++ python/trunk/Lib/mailbox.py Sat May 2 21:17:28 2009 @@ -237,6 +237,7 @@ else: raise NoSuchMailboxError(self._path) self._toc = {} + self._last_read = None # Records last time we read cur/new def add(self, message): """Add message and return assigned key.""" @@ -461,16 +462,35 @@ def _refresh(self): """Update table of contents mapping.""" + new_mtime = os.path.getmtime(os.path.join(self._path, 'new')) + cur_mtime = os.path.getmtime(os.path.join(self._path, 'cur')) + + if (self._last_read is not None and + new_mtime <= self._last_read and cur_mtime <= self._last_read): + return + self._toc = {} - for subdir in ('new', 'cur'): - subdir_path = os.path.join(self._path, subdir) - for entry in os.listdir(subdir_path): - p = os.path.join(subdir_path, entry) + def update_dir (subdir): + path = os.path.join(self._path, subdir) + for entry in os.listdir(path): + p = os.path.join(path, entry) if os.path.isdir(p): continue uniq = entry.split(self.colon)[0] self._toc[uniq] = os.path.join(subdir, entry) + update_dir('new') + update_dir('cur') + + # We record the current time - 1sec so that, if _refresh() is called + # again in the same second, we will always re-read the mailbox + # just in case it's been modified. (os.path.mtime() only has + # 1sec resolution.) This results in a few unnecessary re-reads + # when _refresh() is called multiple times in the same second, + # but once the clock ticks over, we will only re-read as needed. + now = int(time.time() - 1) + self._last_read = time.time() - 1 + def _lookup(self, key): """Use TOC to return subpath for given key, or raise a KeyError.""" try: Modified: python/trunk/Lib/test/test_mailbox.py ============================================================================== --- python/trunk/Lib/test/test_mailbox.py (original) +++ python/trunk/Lib/test/test_mailbox.py Sat May 2 21:17:28 2009 @@ -747,6 +747,37 @@ perms = st.st_mode self.assertFalse((perms & 0111)) # Execute bits should all be off. + def test_reread(self): + # Wait for 2 seconds + time.sleep(2) + + # Initially, the mailbox has not been read and the time is null. + assert getattr(self._box, '_last_read', None) is None + + # Refresh mailbox; the times should now be set to something. + self._box._refresh() + assert getattr(self._box, '_last_read', None) is not None + + # Try calling _refresh() again; the modification times shouldn't have + # changed, so the mailbox should not be re-reading. Re-reading causes + # the ._toc attribute to be assigned a new dictionary object, so + # we'll check that the ._toc attribute isn't a different object. + orig_toc = self._box._toc + def refreshed(): + return self._box._toc is not orig_toc + + time.sleep(1) # Wait 1sec to ensure time.time()'s value changes + self._box._refresh() + assert not refreshed() + + # Now, write something into cur and remove it. This changes + # the mtime and should cause a re-read. + filename = os.path.join(self._path, 'cur', 'stray-file') + f = open(filename, 'w') + f.close() + os.unlink(filename) + self._box._refresh() + assert refreshed() class _TestMboxMMDF(TestMailbox): From python-checkins at python.org Sat May 2 21:20:59 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 2 May 2009 21:20:59 +0200 (CEST) Subject: [Python-checkins] r72214 - in python/branches/pep-0383: Doc/library/internet.rst Doc/library/io.rst Doc/library/ipaddr.rst Doc/library/json.rst Doc/library/stdtypes.rst Doc/library/test.rst Lib/_pyio.py Lib/io.py Lib/ipaddr.py Lib/json/__init__.py Lib/json/decoder.py Lib/json/encoder.py Lib/json/scanner.py Lib/json/tests/test_decode.py Lib/json/tests/test_dump.py Lib/json/tests/test_encode_basestring_ascii.py Lib/json/tests/test_fail.py Lib/json/tests/test_float.py Lib/json/tests/test_scanstring.py Lib/json/tests/test_unicode.py Lib/json/tool.py Lib/shutil.py Lib/test/formatfloat_testcases.txt Lib/test/string_tests.py Lib/test/support.py Lib/test/test_getopt.py Lib/test/test_gettext.py Lib/test/test_io.py Lib/test/test_ipaddr.py Lib/test/test_memoryio.py Lib/test/test_ntpath.py Lib/test/test_optparse.py Lib/test/test_posixpath.py Lib/test/test_shutil.py Lib/test/test_tcl.py Lib/test/test_tempfile.py Lib/test/test_types.py Lib/test/test_xmlrpc.py Lib/urllib/request.py Misc/NEWS Modules/_io/bufferedio.c Modules/_io/textio.c Modules/_json.c Modules/ld_so_aix Objects/longobject.c Objects/stringlib/formatter.h Objects/stringlib/string_format.h Objects/unicodeobject.c PC/msvcrtmodule.c Python/pystrtod.c Message-ID: <20090502192059.A6F111E4025@bag.python.org> Author: martin.v.loewis Date: Sat May 2 21:20:57 2009 New Revision: 72214 Log: Merged revisions 72156,72160-72161,72165,72172,72175-72177,72179,72181,72185-72187,72192,72194-72196,72201,72203-72204,72207 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72156 | senthil.kumaran | 2009-05-01 08:00:23 +0200 (Fr, 01 Mai 2009) | 5 lines Fix for Issue1648102, based on the MSDN spec: If this parameter specifies the "" macro as the only entry, this function bypasses any host name that does not contain a period. ................ r72160 | georg.brandl | 2009-05-01 10:59:13 +0200 (Fr, 01 Mai 2009) | 9 lines Merged revisions 72159 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72159 | georg.brandl | 2009-05-01 10:51:37 +0200 (Fr, 01 Mai 2009) | 2 lines #5889: remove comma at the end of a list that some C compilers don't like. ........ ................ r72161 | mark.dickinson | 2009-05-01 13:42:00 +0200 (Fr, 01 Mai 2009) | 5 lines Issue #5859: Remove use of fixed-length buffers for float formatting in unicodeobject.c and the fallback version of PyOS_double_to_string. As a result, operations like '%.120e' % 12.34 no longer raise an exception. ................ r72165 | mark.dickinson | 2009-05-01 17:37:04 +0200 (Fr, 01 Mai 2009) | 2 lines Issue #5859: Remove '%f' to '%g' formatting switch for large floats. ................ r72172 | walter.doerwald | 2009-05-01 21:58:58 +0200 (Fr, 01 Mai 2009) | 12 lines Merged revisions 72167 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72167 | walter.doerwald | 2009-05-01 19:35:37 +0200 (Fr, 01 Mai 2009) | 5 lines Make test.test_support.EnvironmentVarGuard behave like a dictionary. All changes are mirrored to the underlying os.environ dict, but rolled back on exit from the with block. ........ ................ r72175 | benjamin.peterson | 2009-05-01 22:40:59 +0200 (Fr, 01 Mai 2009) | 1 line implement a detach() method for BufferedIOBase and TextIOBase #5883 ................ r72176 | benjamin.peterson | 2009-05-01 22:45:43 +0200 (Fr, 01 Mai 2009) | 1 line add myself ................ r72177 | benjamin.peterson | 2009-05-01 22:48:14 +0200 (Fr, 01 Mai 2009) | 1 line versionadded ................ r72179 | antoine.pitrou | 2009-05-01 23:09:44 +0200 (Fr, 01 Mai 2009) | 10 lines Merged revisions 72178 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72178 | antoine.pitrou | 2009-05-01 22:55:35 +0200 (ven., 01 mai 2009) | 4 lines Issue #3002: `shutil.copyfile()` and `shutil.copytree()` now raise an error when a named pipe is encountered, rather than blocking infinitely. ........ ................ r72181 | antoine.pitrou | 2009-05-01 23:18:27 +0200 (Fr, 01 Mai 2009) | 10 lines Merged revisions 72180 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72180 | antoine.pitrou | 2009-05-01 23:16:14 +0200 (ven., 01 mai 2009) | 4 lines Issue #5726: Make Modules/ld_so_aix return the actual exit code of the linker, rather than always exit successfully. Patch by Floris Bruynooghe. ........ ................ r72185 | benjamin.peterson | 2009-05-01 23:42:23 +0200 (Fr, 01 Mai 2009) | 1 line use C character code to simplify #5410 ................ r72186 | gregory.p.smith | 2009-05-02 00:13:48 +0200 (Sa, 02 Mai 2009) | 12 lines Merged revisions 72173 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72173 | gregory.p.smith | 2009-05-01 12:59:52 -0700 (Fri, 01 May 2009) | 5 lines Adds the ipaddr module to the standard library. Issue #3959. Based off of subversion r69 from http://code.google.com/p/ipaddr-py/ This code is 2to3 safe, I'll merge it into py3k later this afternoon. ........ ................ r72187 | gregory.p.smith | 2009-05-02 08:15:18 +0200 (Sa, 02 Mai 2009) | 13 lines Merged revisions 72183-72184 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72183 | georg.brandl | 2009-05-01 14:28:35 -0700 (Fri, 01 May 2009) | 2 lines Review ipaddr docs and add them in the TOC under "Internet protocols". ........ r72184 | georg.brandl | 2009-05-01 14:30:25 -0700 (Fri, 01 May 2009) | 1 line Fix directive name. ........ ................ r72192 | eric.smith | 2009-05-02 14:15:39 +0200 (Sa, 02 Mai 2009) | 9 lines Merged revisions 72189 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72189 | eric.smith | 2009-05-02 05:58:09 -0400 (Sat, 02 May 2009) | 1 line Keep py3k and trunk code in sync. ........ ................ r72194 | benjamin.peterson | 2009-05-02 14:36:44 +0200 (Sa, 02 Mai 2009) | 6 lines port simplejson upgrade from the trunk #4136 json also now works only with unicode strings Patch by Antoine Pitrou; updated by me ................ r72195 | benjamin.peterson | 2009-05-02 17:28:37 +0200 (Sa, 02 Mai 2009) | 16 lines Blocked revisions 70443,70471,70702 via svnmerge ........ r70443 | bob.ippolito | 2009-03-17 18:19:00 -0500 (Tue, 17 Mar 2009) | 1 line merge json library with simplejson 2.0.9 (issue 4136) ........ r70471 | raymond.hettinger | 2009-03-19 14:19:03 -0500 (Thu, 19 Mar 2009) | 3 lines Issue 5381: Add object_pairs_hook to the json module. ........ r70702 | bob.ippolito | 2009-03-29 17:33:58 -0500 (Sun, 29 Mar 2009) | 1 line Issue 5381: fix regression in pure python code path, Issue 5584: fix a decoder bug for unicode float literals outside of a container ........ ................ r72196 | hirokazu.yamamoto | 2009-05-02 17:55:19 +0200 (Sa, 02 Mai 2009) | 1 line Fixed warning. (Should not use *const* as variable name) ................ r72201 | benjamin.peterson | 2009-05-02 19:38:06 +0200 (Sa, 02 Mai 2009) | 12 lines Blocked revisions 72199-72200 via svnmerge ........ r72199 | benjamin.peterson | 2009-05-02 12:33:01 -0500 (Sat, 02 May 2009) | 1 line remove py3k compat code ........ r72200 | benjamin.peterson | 2009-05-02 12:35:39 -0500 (Sat, 02 May 2009) | 1 line revert unrelated change ........ ................ r72203 | mark.dickinson | 2009-05-02 19:57:52 +0200 (Sa, 02 Mai 2009) | 10 lines Merged revisions 72202 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72202 | mark.dickinson | 2009-05-02 18:55:01 +0100 (Sat, 02 May 2009) | 3 lines Remove unnecessary use of context for long getters. (Related to issue #5880). ........ ................ r72204 | benjamin.peterson | 2009-05-02 20:10:37 +0200 (Sa, 02 Mai 2009) | 1 line make py3k compat code explicitly on ................ r72207 | gregory.p.smith | 2009-05-02 20:35:58 +0200 (Sa, 02 Mai 2009) | 5 lines ipaddr cleanup for python 3.x: * Get rid of __hex__. * Support bytearray as well as bytes. * Don't double test for integer input. ................ Added: python/branches/pep-0383/Doc/library/ipaddr.rst - copied unchanged from r72207, /python/branches/py3k/Doc/library/ipaddr.rst python/branches/pep-0383/Lib/ipaddr.py - copied unchanged from r72207, /python/branches/py3k/Lib/ipaddr.py python/branches/pep-0383/Lib/test/test_ipaddr.py - copied unchanged from r72207, /python/branches/py3k/Lib/test/test_ipaddr.py Modified: python/branches/pep-0383/ (props changed) python/branches/pep-0383/Doc/library/internet.rst python/branches/pep-0383/Doc/library/io.rst python/branches/pep-0383/Doc/library/json.rst python/branches/pep-0383/Doc/library/stdtypes.rst python/branches/pep-0383/Doc/library/test.rst python/branches/pep-0383/Lib/_pyio.py python/branches/pep-0383/Lib/io.py python/branches/pep-0383/Lib/json/__init__.py python/branches/pep-0383/Lib/json/decoder.py python/branches/pep-0383/Lib/json/encoder.py python/branches/pep-0383/Lib/json/scanner.py python/branches/pep-0383/Lib/json/tests/test_decode.py python/branches/pep-0383/Lib/json/tests/test_dump.py python/branches/pep-0383/Lib/json/tests/test_encode_basestring_ascii.py python/branches/pep-0383/Lib/json/tests/test_fail.py python/branches/pep-0383/Lib/json/tests/test_float.py python/branches/pep-0383/Lib/json/tests/test_scanstring.py python/branches/pep-0383/Lib/json/tests/test_unicode.py python/branches/pep-0383/Lib/json/tool.py python/branches/pep-0383/Lib/shutil.py python/branches/pep-0383/Lib/test/formatfloat_testcases.txt python/branches/pep-0383/Lib/test/string_tests.py python/branches/pep-0383/Lib/test/support.py python/branches/pep-0383/Lib/test/test_getopt.py python/branches/pep-0383/Lib/test/test_gettext.py python/branches/pep-0383/Lib/test/test_io.py python/branches/pep-0383/Lib/test/test_memoryio.py python/branches/pep-0383/Lib/test/test_ntpath.py python/branches/pep-0383/Lib/test/test_optparse.py python/branches/pep-0383/Lib/test/test_posixpath.py python/branches/pep-0383/Lib/test/test_shutil.py python/branches/pep-0383/Lib/test/test_tcl.py python/branches/pep-0383/Lib/test/test_tempfile.py python/branches/pep-0383/Lib/test/test_types.py python/branches/pep-0383/Lib/test/test_xmlrpc.py python/branches/pep-0383/Lib/urllib/request.py python/branches/pep-0383/Misc/NEWS python/branches/pep-0383/Modules/_io/bufferedio.c python/branches/pep-0383/Modules/_io/textio.c python/branches/pep-0383/Modules/_json.c python/branches/pep-0383/Modules/ld_so_aix python/branches/pep-0383/Objects/longobject.c python/branches/pep-0383/Objects/stringlib/formatter.h python/branches/pep-0383/Objects/stringlib/string_format.h python/branches/pep-0383/Objects/unicodeobject.c python/branches/pep-0383/PC/msvcrtmodule.c python/branches/pep-0383/Python/pystrtod.c Modified: python/branches/pep-0383/Doc/library/internet.rst ============================================================================== --- python/branches/pep-0383/Doc/library/internet.rst (original) +++ python/branches/pep-0383/Doc/library/internet.rst Sat May 2 21:20:57 2009 @@ -37,6 +37,7 @@ smtpd.rst telnetlib.rst uuid.rst + ipaddr.rst socketserver.rst http.server.rst http.cookies.rst Modified: python/branches/pep-0383/Doc/library/io.rst ============================================================================== --- python/branches/pep-0383/Doc/library/io.rst (original) +++ python/branches/pep-0383/Doc/library/io.rst Sat May 2 21:20:57 2009 @@ -8,6 +8,7 @@ .. moduleauthor:: Mark Russell .. moduleauthor:: Antoine Pitrou .. moduleauthor:: Amaury Forgeot d'Arc +.. moduleauthor:: Benjamin Peterson .. sectionauthor:: Benjamin Peterson The :mod:`io` module provides the Python interfaces to stream handling. The @@ -361,6 +362,19 @@ :class:`BufferedIOBase` provides or overrides these methods in addition to those from :class:`IOBase`: + .. method:: detach() + + Separate the underlying raw stream from the buffer and return it. + + After the raw stream has been detached, the buffer is in an unusable + state. + + Some buffers, like :class:`BytesIO`, do not have the concept of a single + raw stream to return from this method. They raise + :exc:`UnsupportedOperation`. + + .. versionadded:: 3.1 + .. method:: read([n]) Read and return up to *n* bytes. If the argument is omitted, ``None``, or @@ -547,7 +561,9 @@ *max_buffer_size* is unused and deprecated. - :class:`BufferedRWPair` implements all of :class:`BufferedIOBase`\'s methods. + :class:`BufferedRWPair` implements all of :class:`BufferedIOBase`\'s methods + except for :meth:`~BufferedIOBase.detach`, which raises + :exc:`UnsupportedOperation`. .. class:: BufferedRandom(raw[, buffer_size[, max_buffer_size]]) @@ -588,6 +604,19 @@ A string, a tuple of strings, or ``None``, indicating the newlines translated so far. + .. method:: detach() + + Separate the underlying buffer from the :class:`TextIOBase` and return it. + + After the underlying buffer has been detached, the :class:`TextIOBase` is + in an unusable state. + + Some :class:`TextIOBase` implementations, like :class:`StringIO`, may not + have the concept of an underlying buffer and calling this method will + raise :exc:`UnsupportedOperation`. + + .. versionadded:: 3.1 + .. method:: read(n) Read and return at most *n* characters from the stream as a single Modified: python/branches/pep-0383/Doc/library/json.rst ============================================================================== --- python/branches/pep-0383/Doc/library/json.rst (original) +++ python/branches/pep-0383/Doc/library/json.rst Sat May 2 21:20:57 2009 @@ -112,7 +112,7 @@ Basic Usage ----------- -.. function:: dump(obj, fp[, skipkeys[, ensure_ascii[, check_circular[, allow_nan[, cls[, indent[, separators[, encoding[, default[, **kw]]]]]]]]]]) +.. function:: dump(obj, fp[, skipkeys[, ensure_ascii[, check_circular[, allow_nan[, cls[, indent[, separators[, default[, **kw]]]]]]]]]]) Serialize *obj* as a JSON formatted stream to *fp* (a ``.write()``-supporting file-like object). @@ -122,11 +122,10 @@ :class:`float`, :class:`bool`, ``None``) will be skipped instead of raising a :exc:`TypeError`. - If *ensure_ascii* is ``False`` (default: ``True``), then some chunks written - to *fp* may be :class:`unicode` instances, subject to normal Python - :class:`str` to :class:`unicode` coercion rules. Unless ``fp.write()`` - explicitly understands :class:`unicode` (as in :func:`codecs.getwriter`) this - is likely to cause an error. + The :mod:`json` module always produces :class:`str` objects, not + :class:`bytes` objects. Therefore, ``fp.write()`` must support :class:`str` + input. + If *check_circular* is ``False`` (default: ``True``), then the circular reference check for container types will be skipped and a circular reference @@ -146,8 +145,6 @@ will be used instead of the default ``(', ', ': ')`` separators. ``(',', ':')`` is the most compact JSON representation. - *encoding* is the character encoding for str instances, default is UTF-8. - *default(obj)* is a function that should return a serializable version of *obj* or raise :exc:`TypeError`. The default simply raises :exc:`TypeError`. @@ -156,26 +153,17 @@ *cls* kwarg. -.. function:: dumps(obj[, skipkeys[, ensure_ascii[, check_circular[, allow_nan[, cls[, indent[, separators[, encoding[, default[, **kw]]]]]]]]]]) +.. function:: dumps(obj[, skipkeys[, ensure_ascii[, check_circular[, allow_nan[, cls[, indent[, separators[, default[, **kw]]]]]]]]]]) - Serialize *obj* to a JSON formatted :class:`str`. + Serialize *obj* to a JSON formatted :class:`str`. The arguments have the + same meaning as in :func:`dump`. - If *ensure_ascii* is ``False``, then the return value will be a - :class:`unicode` instance. The other arguments have the same meaning as in - :func:`dump`. - -.. function:: load(fp[, encoding[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, object_pairs_hook[, **kw]]]]]]]]) +.. function:: load(fp[, cls[, object_hook[, parse_float[, parse_int[, parse_constant[, object_pairs_hook[, **kw]]]]]]]]) Deserialize *fp* (a ``.read()``-supporting file-like object containing a JSON document) to a Python object. - If the contents of *fp* are encoded with an ASCII based encoding other than - UTF-8 (e.g. latin-1), then an appropriate *encoding* name must be specified. - Encodings that are not ASCII based (such as UCS-2) are not allowed, and - should be wrapped with ``codecs.getreader(encoding)(fp)``, or simply decoded - to a :class:`unicode` object and passed to :func:`loads`. - *object_hook* is an optional function that will be called with the result of any object literal decode (a :class:`dict`). The return value of *object_hook* will be used instead of the :class:`dict`. This feature can be used @@ -241,7 +229,7 @@ +---------------+-------------------+ | array | list | +---------------+-------------------+ - | string | unicode | + | string | str | +---------------+-------------------+ | number (int) | int | +---------------+-------------------+ @@ -257,13 +245,6 @@ It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float`` values, which is outside the JSON spec. - *encoding* determines the encoding used to interpret any :class:`str` objects - decoded by this instance (UTF-8 by default). It has no effect when decoding - :class:`unicode` objects. - - Note that currently only encodings that are a superset of ASCII work, strings - of other encodings should be passed in as :class:`unicode`. - *object_hook*, if specified, will be called with the result of every JSON object decoded and its return value will be used in place of the given :class:`dict`. This can be used to provide custom deserializations (e.g. to @@ -298,20 +279,20 @@ .. method:: decode(s) - Return the Python representation of *s* (a :class:`str` or - :class:`unicode` instance containing a JSON document) + Return the Python representation of *s* (a :class:`str` instance + containing a JSON document) .. method:: raw_decode(s) - Decode a JSON document from *s* (a :class:`str` or :class:`unicode` - beginning with a JSON document) and return a 2-tuple of the Python - representation and the index in *s* where the document ended. + Decode a JSON document from *s* (a :class:`str` beginning with a + JSON document) and return a 2-tuple of the Python representation + and the index in *s* where the document ended. This can be used to decode a JSON document from a string that may have extraneous data at the end. -.. class:: JSONEncoder([skipkeys[, ensure_ascii[, check_circular[, allow_nan[, sort_keys[, indent[, separators[, encoding[, default]]]]]]]]]) +.. class:: JSONEncoder([skipkeys[, ensure_ascii[, check_circular[, allow_nan[, sort_keys[, indent[, separators[, default]]]]]]]]) Extensible JSON encoder for Python data structures. @@ -324,7 +305,7 @@ +-------------------+---------------+ | list, tuple | array | +-------------------+---------------+ - | str, unicode | string | + | str | string | +-------------------+---------------+ | int, float | number | +-------------------+---------------+ @@ -344,9 +325,9 @@ attempt encoding of keys that are not str, int, float or None. If *skipkeys* is ``True``, such items are simply skipped. - If *ensure_ascii* is ``True`` (the default), the output is guaranteed to be - :class:`str` objects with all incoming unicode characters escaped. If - *ensure_ascii* is ``False``, the output will be a unicode object. + If *ensure_ascii* is ``True`` (the default), the output is guaranteed to + have all incoming non-ASCII characters escaped. If *ensure_ascii* is + ``False``, these characters will be output as-is. If *check_circular* is ``True`` (the default), then lists, dicts, and custom encoded objects will be checked for circular references during encoding to @@ -376,10 +357,6 @@ otherwise be serialized. It should return a JSON encodable version of the object or raise a :exc:`TypeError`. - If *encoding* is not ``None``, then all input strings will be transformed - into unicode using that encoding prior to JSON-encoding. The default is - UTF-8. - .. method:: default(o) Modified: python/branches/pep-0383/Doc/library/stdtypes.rst ============================================================================== --- python/branches/pep-0383/Doc/library/stdtypes.rst (original) +++ python/branches/pep-0383/Doc/library/stdtypes.rst Sat May 2 21:20:57 2009 @@ -1321,9 +1321,9 @@ .. XXX Examples? -For safety reasons, floating point precisions are clipped to 50; ``%f`` -conversions for numbers whose absolute value is over 1e50 are replaced by ``%g`` -conversions. [#]_ All other errors raise exceptions. +.. versionchanged:: 3.1 + ``%f`` conversions for numbers whose absolute value is over 1e50 are no + longer replaced by ``%g`` conversions. .. index:: module: string @@ -2723,10 +2723,6 @@ .. [#] To format only a tuple you should therefore provide a singleton tuple whose only element is the tuple to be formatted. -.. [#] These numbers are fairly arbitrary. They are intended to avoid printing endless - strings of meaningless digits without hampering correct use and without having - to know the exact precision of floating point values on a particular machine. - .. [#] The advantage of leaving the newline on is that returning an empty string is then an unambiguous EOF indication. It is also possible (in cases where it might matter, for example, if you want to make an exact copy of a file while Modified: python/branches/pep-0383/Doc/library/test.rst ============================================================================== --- python/branches/pep-0383/Doc/library/test.rst (original) +++ python/branches/pep-0383/Doc/library/test.rst Sat May 2 21:20:57 2009 @@ -384,8 +384,13 @@ .. class:: EnvironmentVarGuard() Class used to temporarily set or unset environment variables. Instances can be - used as a context manager. + used as a context manager and have a complete dictionary interface for + querying/modifying the underlying ``os.environ``. After exit from the context + manager all changes to environment variables done through this instance will + be rolled back. + .. versionchanged:: 2.7 + Added dictionary interface. .. method:: EnvironmentVarGuard.set(envvar, value) @@ -396,6 +401,7 @@ Temporarily unset the environment variable ``envvar``. + .. class:: WarningsRecorder() Class used to record warnings for unit tests. See documentation of Modified: python/branches/pep-0383/Lib/_pyio.py ============================================================================== --- python/branches/pep-0383/Lib/_pyio.py (original) +++ python/branches/pep-0383/Lib/_pyio.py Sat May 2 21:20:57 2009 @@ -642,6 +642,15 @@ """ self._unsupported("write") + def detach(self) -> None: + """ + Separate the underlying raw stream from the buffer and return it. + + After the raw stream has been detached, the buffer is in an unusable + state. + """ + self._unsupported("detach") + io.BufferedIOBase.register(BufferedIOBase) @@ -689,13 +698,21 @@ self.raw.flush() def close(self): - if not self.closed: + if not self.closed and self.raw is not None: try: self.flush() except IOError: pass # If flush() fails, just give up self.raw.close() + def detach(self): + if self.raw is None: + raise ValueError("raw stream already detached") + self.flush() + raw = self.raw + self.raw = None + return raw + ### Inquiries ### def seekable(self): @@ -1236,6 +1253,15 @@ """ self._unsupported("readline") + def detach(self) -> None: + """ + Separate the underlying buffer from the TextIOBase and return it. + + After the underlying buffer has been detached, the TextIO is in an + unusable state. + """ + self._unsupported("detach") + @property def encoding(self): """Subclasses should override.""" @@ -1448,11 +1474,12 @@ self._telling = self._seekable def close(self): - try: - self.flush() - except IOError: - pass # If flush() fails, just give up - self.buffer.close() + if self.buffer is not None: + try: + self.flush() + except IOError: + pass # If flush() fails, just give up + self.buffer.close() @property def closed(self): @@ -1647,6 +1674,14 @@ self.seek(pos) return self.buffer.truncate() + def detach(self): + if self.buffer is None: + raise ValueError("buffer is already detached") + self.flush() + buffer = self.buffer + self.buffer = None + return buffer + def seek(self, cookie, whence=0): if self.closed: raise ValueError("tell on closed file") @@ -1865,3 +1900,7 @@ @property def encoding(self): return None + + def detach(self): + # This doesn't make sense on StringIO. + self._unsupported("detach") Modified: python/branches/pep-0383/Lib/io.py ============================================================================== --- python/branches/pep-0383/Lib/io.py (original) +++ python/branches/pep-0383/Lib/io.py Sat May 2 21:20:57 2009 @@ -47,7 +47,8 @@ "Mike Verdone , " "Mark Russell , " "Antoine Pitrou , " - "Amaury Forgeot d'Arc ") + "Amaury Forgeot d'Arc , " + "Benjamin Peterson ") __all__ = ["BlockingIOError", "open", "IOBase", "RawIOBase", "FileIO", "BytesIO", "StringIO", "BufferedIOBase", Modified: python/branches/pep-0383/Lib/json/__init__.py ============================================================================== --- python/branches/pep-0383/Lib/json/__init__.py (original) +++ python/branches/pep-0383/Lib/json/__init__.py Sat May 2 21:20:57 2009 @@ -1,11 +1,13 @@ -r"""A simple, fast, extensible JSON encoder and decoder - -JSON (JavaScript Object Notation) is a subset of +r"""JSON (JavaScript Object Notation) is a subset of JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data interchange format. -json exposes an API familiar to uses of the standard library -marshal and pickle modules. +:mod:`json` exposes an API familiar to users of the standard library +:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained +version of the :mod:`json` library contained in Python 2.6, but maintains +compatibility with Python 2.4 and Python 2.5 and (currently) has +significant performance advantages, even without using the optional C +extension for speedups. Encoding basic Python object hierarchies:: @@ -32,23 +34,28 @@ >>> json.dumps([1,2,3,{'4': 5, '6': 7}], separators=(',',':')) '[1,2,3,{"4":5,"6":7}]' -Pretty printing (using repr() because of extraneous whitespace in the output):: +Pretty printing:: >>> import json - >>> print(repr(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4))) - '{\n "4": 5, \n "6": 7\n}' + >>> s = json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4) + >>> print('\n'.join([l.rstrip() for l in s.splitlines()])) + { + "4": 5, + "6": 7 + } Decoding JSON:: >>> import json - >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') - ['foo', {'bar': ['baz', None, 1.0, 2]}] - >>> json.loads('"\\"foo\\bar"') - '"foo\x08ar' + >>> obj = ['foo', {'bar': ['baz', None, 1.0, 2]}] + >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') == obj + True + >>> json.loads('"\\"foo\\bar"') == '"foo\x08ar' + True >>> from io import StringIO >>> io = StringIO('["streaming API"]') - >>> json.load(io) - ['streaming API'] + >>> json.load(io)[0] == 'streaming API' + True Specializing JSON object decoding:: @@ -61,43 +68,36 @@ >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}', ... object_hook=as_complex) (1+2j) - >>> import decimal - >>> json.loads('1.1', parse_float=decimal.Decimal) - Decimal('1.1') + >>> from decimal import Decimal + >>> json.loads('1.1', parse_float=Decimal) == Decimal('1.1') + True -Extending JSONEncoder:: +Specializing JSON object encoding:: >>> import json - >>> class ComplexEncoder(json.JSONEncoder): - ... def default(self, obj): - ... if isinstance(obj, complex): - ... return [obj.real, obj.imag] - ... return json.JSONEncoder.default(self, obj) + >>> def encode_complex(obj): + ... if isinstance(obj, complex): + ... return [obj.real, obj.imag] + ... raise TypeError(repr(o) + " is not JSON serializable") ... - >>> dumps(2 + 1j, cls=ComplexEncoder) + >>> json.dumps(2 + 1j, default=encode_complex) + '[2.0, 1.0]' + >>> json.JSONEncoder(default=encode_complex).encode(2 + 1j) '[2.0, 1.0]' - >>> ComplexEncoder().encode(2 + 1j) + >>> ''.join(json.JSONEncoder(default=encode_complex).iterencode(2 + 1j)) '[2.0, 1.0]' - >>> list(ComplexEncoder().iterencode(2 + 1j)) - ['[', '2.0', ', ', '1.0', ']'] -Using json.tool from the shell to validate and -pretty-print:: +Using json.tool from the shell to validate and pretty-print:: - $ echo '{"json":"obj"}' | python -mjson.tool + $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } - $ echo '{ 1.2:3.4}' | python -mjson.tool + $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name: line 1 column 2 (char 2) - -Note that the JSON produced by this module's default settings -is a subset of YAML, so it may be used as a serializer for that as well. - """ - -__version__ = '1.9' +__version__ = '2.0.9' __all__ = [ 'dump', 'dumps', 'load', 'loads', 'JSONDecoder', 'JSONEncoder', @@ -115,45 +115,43 @@ allow_nan=True, indent=None, separators=None, - encoding='utf-8', default=None, ) def dump(obj, fp, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, - encoding='utf-8', default=None, **kw): + default=None, **kw): """Serialize ``obj`` as a JSON formatted stream to ``fp`` (a ``.write()``-supporting file-like object). - If ``skipkeys`` is ``True`` then ``dict`` keys that are not basic types - (``str``, ``unicode``, ``int``, ``long``, ``float``, ``bool``, ``None``) - will be skipped instead of raising a ``TypeError``. + If ``skipkeys`` is true then ``dict`` keys that are not basic types + (``str``, ``unicode``, ``int``, ``float``, ``bool``, ``None``) will be + skipped instead of raising a ``TypeError``. - If ``ensure_ascii`` is ``False``, then the some chunks written to ``fp`` + If ``ensure_ascii`` is false, then the some chunks written to ``fp`` may be ``unicode`` instances, subject to normal Python ``str`` to ``unicode`` coercion rules. Unless ``fp.write()`` explicitly understands ``unicode`` (as in ``codecs.getwriter()``) this is likely to cause an error. - If ``check_circular`` is ``False``, then the circular reference check + If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). - If ``allow_nan`` is ``False``, then it will be a ``ValueError`` to + If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). - If ``indent`` is a non-negative integer, then JSON array elements and object - members will be pretty-printed with that indent level. An indent level - of 0 will only insert newlines. ``None`` is the most compact representation. + If ``indent`` is a non-negative integer, then JSON array elements and + object members will be pretty-printed with that indent level. An indent + level of 0 will only insert newlines. ``None`` is the most compact + representation. If ``separators`` is an ``(item_separator, dict_separator)`` tuple then it will be used instead of the default ``(', ', ': ')`` separators. ``(',', ':')`` is the most compact JSON representation. - ``encoding`` is the character encoding for str instances, default is UTF-8. - ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. @@ -163,17 +161,17 @@ """ # cached encoder - if (skipkeys is False and ensure_ascii is True and - check_circular is True and allow_nan is True and + if (not skipkeys and ensure_ascii and + check_circular and allow_nan and cls is None and indent is None and separators is None and - encoding == 'utf-8' and default is None and not kw): + default is None and not kw): iterable = _default_encoder.iterencode(obj) else: if cls is None: cls = JSONEncoder iterable = cls(skipkeys=skipkeys, ensure_ascii=ensure_ascii, check_circular=check_circular, allow_nan=allow_nan, indent=indent, - separators=separators, encoding=encoding, + separators=separators, default=default, **kw).iterencode(obj) # could accelerate with writelines in some versions of Python, at # a debuggability cost @@ -183,22 +181,22 @@ def dumps(obj, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, - encoding='utf-8', default=None, **kw): + default=None, **kw): """Serialize ``obj`` to a JSON formatted ``str``. - If ``skipkeys`` is ``True`` then ``dict`` keys that are not basic types - (``str``, ``unicode``, ``int``, ``long``, ``float``, ``bool``, ``None``) - will be skipped instead of raising a ``TypeError``. + If ``skipkeys`` is false then ``dict`` keys that are not basic types + (``str``, ``unicode``, ``int``, ``float``, ``bool``, ``None``) will be + skipped instead of raising a ``TypeError``. - If ``ensure_ascii`` is ``False``, then the return value will be a + If ``ensure_ascii`` is false, then the return value will be a ``unicode`` instance subject to normal Python ``str`` to ``unicode`` coercion rules instead of being escaped to an ASCII ``str``. - If ``check_circular`` is ``False``, then the circular reference check + If ``check_circular`` is false, then the circular reference check for container types will be skipped and a circular reference will result in an ``OverflowError`` (or worse). - If ``allow_nan`` is ``False``, then it will be a ``ValueError`` to + If ``allow_nan`` is false, then it will be a ``ValueError`` to serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in strict compliance of the JSON specification, instead of using the JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``). @@ -212,8 +210,6 @@ then it will be used instead of the default ``(', ', ': ')`` separators. ``(',', ':')`` is the most compact JSON representation. - ``encoding`` is the character encoding for str instances, default is UTF-8. - ``default(obj)`` is a function that should return a serializable version of obj or raise TypeError. The default simply raises TypeError. @@ -223,35 +219,27 @@ """ # cached encoder - if (skipkeys is False and ensure_ascii is True and - check_circular is True and allow_nan is True and + if (not skipkeys and ensure_ascii and + check_circular and allow_nan and cls is None and indent is None and separators is None and - encoding == 'utf-8' and default is None and not kw): + default is None and not kw): return _default_encoder.encode(obj) if cls is None: cls = JSONEncoder return cls( skipkeys=skipkeys, ensure_ascii=ensure_ascii, check_circular=check_circular, allow_nan=allow_nan, indent=indent, - separators=separators, encoding=encoding, default=default, + separators=separators, default=default, **kw).encode(obj) -_default_decoder = JSONDecoder(encoding=None, object_hook=None, - object_pairs_hook=None) +_default_decoder = JSONDecoder(object_hook=None, object_pairs_hook=None) -def load(fp, encoding=None, cls=None, object_hook=None, parse_float=None, +def load(fp, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw): - """Deserialize ``fp`` (a ``.read()``-supporting file-like object - containing a JSON document) to a Python object. - - If the contents of ``fp`` is encoded with an ASCII based encoding other - than utf-8 (e.g. latin-1), then an appropriate ``encoding`` name must - be specified. Encodings that are not ASCII based (such as UCS-2) are - not allowed, and should be wrapped with - ``codecs.getreader(fp)(encoding)``, or simply decoded to a ``unicode`` - object and passed to ``loads()`` + """Deserialize ``fp`` (a ``.read()``-supporting file-like object containing + a JSON document) to a Python object. ``object_hook`` is an optional function that will be called with the result of any object literal decode (a ``dict``). The return value of @@ -263,21 +251,16 @@ """ return loads(fp.read(), - encoding=encoding, cls=cls, object_hook=object_hook, + cls=cls, object_hook=object_hook, parse_float=parse_float, parse_int=parse_int, parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) def loads(s, encoding=None, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw): - """Deserialize ``s`` (a ``str`` or ``unicode`` instance containing a JSON + """Deserialize ``s`` (a ``str`` instance containing a JSON document) to a Python object. - If ``s`` is a ``str`` instance and is encoded with an ASCII based encoding - other than utf-8 (e.g. latin-1) then an appropriate ``encoding`` name - must be specified. Encodings that are not ASCII based (such as UCS-2) - are not allowed and should be decoded to ``unicode`` first. - ``object_hook`` is an optional function that will be called with the result of any object literal decode (a ``dict``). The return value of ``object_hook`` will be used instead of the ``dict``. This feature @@ -302,7 +285,7 @@ kwarg. """ - if (cls is None and encoding is None and object_hook is None and + if (cls is None and object_hook is None and parse_int is None and parse_float is None and parse_constant is None and object_pairs_hook is None and not kw): return _default_decoder.decode(s) @@ -318,4 +301,4 @@ kw['parse_int'] = parse_int if parse_constant is not None: kw['parse_constant'] = parse_constant - return cls(encoding=encoding, **kw).decode(s) + return cls(**kw).decode(s) Modified: python/branches/pep-0383/Lib/json/decoder.py ============================================================================== --- python/branches/pep-0383/Lib/json/decoder.py (original) +++ python/branches/pep-0383/Lib/json/decoder.py Sat May 2 21:20:57 2009 @@ -1,10 +1,11 @@ """Implementation of JSONDecoder """ - +import binascii import re import sys +import struct -from json.scanner import Scanner, pattern +from json.scanner import make_scanner try: from _json import scanstring as c_scanstring except ImportError: @@ -14,7 +15,14 @@ FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL -NaN, PosInf, NegInf = float('nan'), float('inf'), float('-inf') +def _floatconstants(): + _BYTES = binascii.unhexlify(b'7FF80000000000007FF0000000000000') + if sys.byteorder != 'big': + _BYTES = _BYTES[:8][::-1] + _BYTES[8:][::-1] + nan, inf = struct.unpack('dd', _BYTES) + return nan, inf, -inf + +NaN, PosInf, NegInf = _floatconstants() def linecol(doc, pos): @@ -31,61 +39,43 @@ def errmsg(msg, doc, pos, end=None): + # Note that this function is called from _json lineno, colno = linecol(doc, pos) if end is None: fmt = '{0}: line {1} column {2} (char {3})' return fmt.format(msg, lineno, colno, pos) + #fmt = '%s: line %d column %d (char %d)' + #return fmt % (msg, lineno, colno, pos) endlineno, endcolno = linecol(doc, end) fmt = '{0}: line {1} column {2} - line {3} column {4} (char {5} - {6})' return fmt.format(msg, lineno, colno, endlineno, endcolno, pos, end) + #fmt = '%s: line %d column %d - line %d column %d (char %d - %d)' + #return fmt % (msg, lineno, colno, endlineno, endcolno, pos, end) _CONSTANTS = { '-Infinity': NegInf, 'Infinity': PosInf, 'NaN': NaN, - 'true': True, - 'false': False, - 'null': None, } -def JSONConstant(match, context, c=_CONSTANTS): - s = match.group(0) - fn = getattr(context, 'parse_constant', None) - if fn is None: - rval = c[s] - else: - rval = fn(s) - return rval, None -pattern('(-?Infinity|NaN|true|false|null)')(JSONConstant) - - -def JSONNumber(match, context): - match = JSONNumber.regex.match(match.string, *match.span()) - integer, frac, exp = match.groups() - if frac or exp: - fn = getattr(context, 'parse_float', None) or float - res = fn(integer + (frac or '') + (exp or '')) - else: - fn = getattr(context, 'parse_int', None) or int - res = fn(integer) - return res, None -pattern(r'(-?(?:0|[1-9][0-9]*))(\.[0-9]+)?([eE][-+]?[0-9]+)?')(JSONNumber) - - STRINGCHUNK = re.compile(r'(.*?)(["\\\x00-\x1f])', FLAGS) BACKSLASH = { '"': '"', '\\': '\\', '/': '/', 'b': '\b', 'f': '\f', 'n': '\n', 'r': '\r', 't': '\t', } -DEFAULT_ENCODING = "utf-8" - +def py_scanstring(s, end, strict=True, + _b=BACKSLASH, _m=STRINGCHUNK.match): + """Scan the string s for a JSON string. End is the index of the + character in s after the quote that started the JSON string. + Unescapes all valid JSON string escape sequences and raises ValueError + on attempt to decode an invalid string. If strict is False then literal + control characters are allowed in the string. -def py_scanstring(s, end, encoding=None, strict=True, _b=BACKSLASH, _m=STRINGCHUNK.match): - if encoding is None: - encoding = DEFAULT_ENCODING + Returns a tuple of the decoded string and the index of the character in s + after the end quote.""" chunks = [] _append = chunks.append begin = end - 1 @@ -96,14 +86,16 @@ errmsg("Unterminated string starting at", s, begin)) end = chunk.end() content, terminator = chunk.groups() + # Content is contains zero or more unescaped string characters if content: - if not isinstance(content, str): - content = str(content, encoding) _append(content) + # Terminator is the end of string, a literal control character, + # or a backslash denoting that an escape sequence follows if terminator == '"': break elif terminator != '\\': if strict: + #msg = "Invalid control character %r at" % (terminator,) msg = "Invalid control character {0!r} at".format(terminator) raise ValueError(errmsg(msg, s, end)) else: @@ -114,9 +106,10 @@ except IndexError: raise ValueError( errmsg("Unterminated string starting at", s, begin)) + # If not a unicode escape sequence, must be in the lookup table if esc != 'u': try: - m = _b[esc] + char = _b[esc] except KeyError: msg = "Invalid \\escape: {0!r}".format(esc) raise ValueError(errmsg(msg, s, end)) @@ -124,131 +117,138 @@ else: esc = s[end + 1:end + 5] next_end = end + 5 - msg = "Invalid \\uXXXX escape" - try: - if len(esc) != 4: - raise ValueError - uni = int(esc, 16) - if 0xd800 <= uni <= 0xdbff and sys.maxunicode > 65535: - msg = "Invalid \\uXXXX\\uXXXX surrogate pair" - if not s[end + 5:end + 7] == '\\u': - raise ValueError - esc2 = s[end + 7:end + 11] - if len(esc2) != 4: - raise ValueError - uni2 = int(esc2, 16) - uni = 0x10000 + (((uni - 0xd800) << 10) | (uni2 - 0xdc00)) - next_end += 6 - m = chr(uni) - except ValueError: + if len(esc) != 4: + msg = "Invalid \\uXXXX escape" raise ValueError(errmsg(msg, s, end)) + uni = int(esc, 16) + # Check for surrogate pair on UCS-4 systems + if 0xd800 <= uni <= 0xdbff and sys.maxunicode > 65535: + msg = "Invalid \\uXXXX\\uXXXX surrogate pair" + if not s[end + 5:end + 7] == '\\u': + raise ValueError(errmsg(msg, s, end)) + esc2 = s[end + 7:end + 11] + if len(esc2) != 4: + raise ValueError(errmsg(msg, s, end)) + uni2 = int(esc2, 16) + uni = 0x10000 + (((uni - 0xd800) << 10) | (uni2 - 0xdc00)) + next_end += 6 + char = chr(uni) + end = next_end - _append(m) + _append(char) return ''.join(chunks), end -# Use speedup -if c_scanstring is not None: - scanstring = c_scanstring -else: - scanstring = py_scanstring - -def JSONString(match, context): - encoding = getattr(context, 'encoding', None) - strict = getattr(context, 'strict', True) - return scanstring(match.string, match.end(), encoding, strict) -pattern(r'"')(JSONString) +# Use speedup if available +scanstring = c_scanstring or py_scanstring +WHITESPACE = re.compile(r'[ \t\n\r]*', FLAGS) +WHITESPACE_STR = ' \t\n\r' -WHITESPACE = re.compile(r'\s*', FLAGS) - -def JSONObject(match, context, _w=WHITESPACE.match): +def JSONObject(s_and_end, strict, scan_once, object_hook, object_pairs_hook, + _w=WHITESPACE.match, _ws=WHITESPACE_STR): + s, end = s_and_end pairs = [] pairs_append = pairs.append - s = match.string - end = _w(s, match.end()).end() + # Use a slice to prevent IndexError from being raised, the following + # check will raise a more specific ValueError if the string is empty nextchar = s[end:end + 1] - # Trivial empty object - if nextchar == '}': - return pairs, end + 1 + # Normally we expect nextchar == '"' if nextchar != '"': - raise ValueError(errmsg("Expecting property name", s, end)) + if nextchar in _ws: + end = _w(s, end).end() + nextchar = s[end:end + 1] + # Trivial empty object + if nextchar == '}': + return pairs, end + 1 + elif nextchar != '"': + raise ValueError(errmsg("Expecting property name", s, end)) end += 1 - encoding = getattr(context, 'encoding', None) - strict = getattr(context, 'strict', True) - iterscan = JSONScanner.iterscan while True: - key, end = scanstring(s, end, encoding, strict) - end = _w(s, end).end() + key, end = scanstring(s, end, strict) + # To skip some function call overhead we optimize the fast paths where + # the JSON key separator is ": " or just ":". if s[end:end + 1] != ':': - raise ValueError(errmsg("Expecting : delimiter", s, end)) - end = _w(s, end + 1).end() + end = _w(s, end).end() + if s[end:end + 1] != ':': + raise ValueError(errmsg("Expecting : delimiter", s, end)) + end += 1 + try: - value, end = next(iterscan(s, idx=end, context=context)) + if s[end] in _ws: + end += 1 + if s[end] in _ws: + end = _w(s, end + 1).end() + except IndexError: + pass + + try: + value, end = scan_once(s, end) except StopIteration: raise ValueError(errmsg("Expecting object", s, end)) pairs_append((key, value)) - end = _w(s, end).end() - nextchar = s[end:end + 1] + try: + nextchar = s[end] + if nextchar in _ws: + end = _w(s, end + 1).end() + nextchar = s[end] + except IndexError: + nextchar = '' end += 1 + if nextchar == '}': break - if nextchar != ',': + elif nextchar != ',': raise ValueError(errmsg("Expecting , delimiter", s, end - 1)) end = _w(s, end).end() nextchar = s[end:end + 1] end += 1 if nextchar != '"': raise ValueError(errmsg("Expecting property name", s, end - 1)) - object_pairs_hook = getattr(context, 'object_pairs_hook', None) if object_pairs_hook is not None: result = object_pairs_hook(pairs) return result, end pairs = dict(pairs) - object_hook = getattr(context, 'object_hook', None) if object_hook is not None: pairs = object_hook(pairs) return pairs, end -pattern(r'{')(JSONObject) - -def JSONArray(match, context, _w=WHITESPACE.match): +def JSONArray(s_and_end, scan_once, context, _w=WHITESPACE.match): + s, end = s_and_end values = [] - s = match.string - end = _w(s, match.end()).end() - # Look-ahead for trivial empty array nextchar = s[end:end + 1] + if nextchar in _ws: + end = _w(s, end + 1).end() + nextchar = s[end:end + 1] + # Look-ahead for trivial empty array if nextchar == ']': return values, end + 1 - iterscan = JSONScanner.iterscan + _append = values.append while True: try: - value, end = next(iterscan(s, idx=end, context=context)) + value, end = scan_once(s, end) except StopIteration: raise ValueError(errmsg("Expecting object", s, end)) - values.append(value) - end = _w(s, end).end() + _append(value) nextchar = s[end:end + 1] + if nextchar in _ws: + end = _w(s, end + 1).end() + nextchar = s[end:end + 1] end += 1 if nextchar == ']': break - if nextchar != ',': + elif nextchar != ',': raise ValueError(errmsg("Expecting , delimiter", s, end)) - end = _w(s, end).end() - return values, end -pattern(r'\[')(JSONArray) - - -ANYTHING = [ - JSONObject, - JSONArray, - JSONString, - JSONConstant, - JSONNumber, -] + try: + if s[end] in _ws: + end += 1 + if s[end] in _ws: + end = _w(s, end + 1).end() + except IndexError: + pass -JSONScanner = Scanner(ANYTHING) + return values, end class JSONDecoder(object): @@ -278,23 +278,14 @@ It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as their corresponding ``float`` values, which is outside the JSON spec. - """ - _scanner = Scanner(ANYTHING) - __all__ = ['__init__', 'decode', 'raw_decode'] + """ - def __init__(self, encoding=None, object_hook=None, parse_float=None, + def __init__(self, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, strict=True, object_pairs_hook=None): - """``encoding`` determines the encoding used to interpret any ``str`` - objects decoded by this instance (utf-8 by default). It has no - effect when decoding ``unicode`` objects. - - Note that currently only encodings that are a superset of ASCII work, - strings of other encodings should be passed in as ``unicode``. - - ``object_hook``, if specified, will be called with the result of - every JSON object decoded and its return value will be used in + """``object_hook``, if specified, will be called with the result + of every JSON object decoded and its return value will be used in place of the given ``dict``. This can be used to provide custom deserializations (e.g. to support JSON-RPC class hinting). @@ -309,22 +300,25 @@ for JSON integers (e.g. float). ``parse_constant``, if specified, will be called with one of the - following strings: -Infinity, Infinity, NaN, null, true, false. + following strings: -Infinity, Infinity, NaN. This can be used to raise an exception if invalid JSON numbers are encountered. """ - self.encoding = encoding self.object_hook = object_hook - self.object_pairs_hook = object_pairs_hook - self.parse_float = parse_float - self.parse_int = parse_int - self.parse_constant = parse_constant + self.parse_float = parse_float or float + self.parse_int = parse_int or int + self.parse_constant = parse_constant or _CONSTANTS.__getitem__ self.strict = strict + self.object_pairs_hook = object_pairs_hook + self.parse_object = JSONObject + self.parse_array = JSONArray + self.parse_string = scanstring + self.scan_once = make_scanner(self) + def decode(self, s, _w=WHITESPACE.match): - """ - Return the Python representation of ``s`` (a ``str`` or ``unicode`` + """Return the Python representation of ``s`` (a ``str`` or ``unicode`` instance containing a JSON document) """ @@ -334,18 +328,17 @@ raise ValueError(errmsg("Extra data", s, end, len(s))) return obj - def raw_decode(self, s, **kw): - """Decode a JSON document from ``s`` (a ``str`` or ``unicode`` beginning - with a JSON document) and return a 2-tuple of the Python + def raw_decode(self, s, idx=0): + """Decode a JSON document from ``s`` (a ``str`` or ``unicode`` + beginning with a JSON document) and return a 2-tuple of the Python representation and the index in ``s`` where the document ended. This can be used to decode a JSON document from a string that may have extraneous data at the end. """ - kw.setdefault('context', self) try: - obj, end = next(self._scanner.iterscan(s, **kw)) + obj, end = self.scan_once(s, idx) except StopIteration: raise ValueError("No JSON object could be decoded") return obj, end Modified: python/branches/pep-0383/Lib/json/encoder.py ============================================================================== --- python/branches/pep-0383/Lib/json/encoder.py (original) +++ python/branches/pep-0383/Lib/json/encoder.py Sat May 2 21:20:57 2009 @@ -1,19 +1,19 @@ """Implementation of JSONEncoder """ - import re -import math try: from _json import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None - -__all__ = ['JSONEncoder'] +try: + from _json import make_encoder as c_make_encoder +except ImportError: + c_make_encoder = None ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]') ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])') -HAS_UTF8 = re.compile(r'[\x80-\xff]') +HAS_UTF8 = re.compile(b'[\x80-\xff]') ESCAPE_DCT = { '\\': '\\\\', '"': '\\"', @@ -25,30 +25,12 @@ } for i in range(0x20): ESCAPE_DCT.setdefault(chr(i), '\\u{0:04x}'.format(i)) + #ESCAPE_DCT.setdefault(chr(i), '\\u%04x' % (i,)) +# Assume this produces an infinity on all machines (probably not guaranteed) +INFINITY = float('1e66666') FLOAT_REPR = repr -def floatstr(o, allow_nan=True): - # Check for specials. Note that this type of test is processor- and/or - # platform-specific, so do tests which don't depend on the internals. - - if math.isnan(o): - text = 'NaN' - elif math.isinf(o): - if math.copysign(1., o) == 1.: - text = 'Infinity' - else: - text = '-Infinity' - else: - return FLOAT_REPR(o) - - if not allow_nan: - msg = "Out of range float values are not JSON compliant: " + repr(o) - raise ValueError(msg) - - return text - - def encode_basestring(s): """Return a JSON representation of a Python string @@ -59,8 +41,9 @@ def py_encode_basestring_ascii(s): - if isinstance(s, bytes): # and HAS_UTF8.search(s) is not None: - s = s.decode('utf-8') + """Return an ASCII-only JSON representation of a Python string + + """ def replace(match): s = match.group(0) try: @@ -69,20 +52,18 @@ n = ord(s) if n < 0x10000: return '\\u{0:04x}'.format(n) + #return '\\u%04x' % (n,) else: # surrogate pair n -= 0x10000 s1 = 0xd800 | ((n >> 10) & 0x3ff) s2 = 0xdc00 | (n & 0x3ff) return '\\u{0:04x}\\u{1:04x}'.format(s1, s2) - return '"' + (ESCAPE_ASCII.sub(replace, s)) + '"' + return '"' + ESCAPE_ASCII.sub(replace, s) + '"' -if c_encode_basestring_ascii is not None: - encode_basestring_ascii = c_encode_basestring_ascii -else: - encode_basestring_ascii = py_encode_basestring_ascii - +encode_basestring_ascii = ( + c_encode_basestring_ascii or py_encode_basestring_ascii) class JSONEncoder(object): """Extensible JSON encoder for Python data structures. @@ -113,33 +94,32 @@ implementation (to raise ``TypeError``). """ - __all__ = ['__init__', 'default', 'encode', 'iterencode'] item_separator = ', ' key_separator = ': ' def __init__(self, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, - indent=None, separators=None, encoding='utf-8', default=None): + indent=None, separators=None, default=None): """Constructor for JSONEncoder, with sensible defaults. - If skipkeys is False, then it is a TypeError to attempt + If skipkeys is false, then it is a TypeError to attempt encoding of keys that are not str, int, long, float or None. If skipkeys is True, such items are simply skipped. - If ensure_ascii is True, the output is guaranteed to be str + If ensure_ascii is true, the output is guaranteed to be str objects with all incoming unicode characters escaped. If ensure_ascii is false, the output will be unicode object. - If check_circular is True, then lists, dicts, and custom encoded + If check_circular is true, then lists, dicts, and custom encoded objects will be checked for circular references during encoding to prevent an infinite recursion (which would cause an OverflowError). Otherwise, no such check takes place. - If allow_nan is True, then NaN, Infinity, and -Infinity will be + If allow_nan is true, then NaN, Infinity, and -Infinity will be encoded as such. This behavior is not JSON specification compliant, but is consistent with most JavaScript based encoders and decoders. Otherwise, it will be a ValueError to encode such floats. - If sort_keys is True, then the output of dictionaries will be + If sort_keys is true, then the output of dictionaries will be sorted by key; this is useful for regression tests to ensure that JSON serializations can be compared on a day-to-day basis. @@ -156,28 +136,130 @@ that can't otherwise be serialized. It should return a JSON encodable version of the object or raise a ``TypeError``. - If encoding is not None, then all input strings will be - transformed into unicode using that encoding prior to JSON-encoding. - The default is UTF-8. - """ + self.skipkeys = skipkeys self.ensure_ascii = ensure_ascii self.check_circular = check_circular self.allow_nan = allow_nan self.sort_keys = sort_keys self.indent = indent - self.current_indent_level = 0 if separators is not None: self.item_separator, self.key_separator = separators if default is not None: self.default = default - self.encoding = encoding - def _newline_indent(self): - return '\n' + (' ' * (self.indent * self.current_indent_level)) + def default(self, o): + """Implement this method in a subclass such that it returns + a serializable object for ``o``, or calls the base implementation + (to raise a ``TypeError``). + + For example, to support arbitrary iterators, you could + implement default like this:: + + def default(self, o): + try: + iterable = iter(o) + except TypeError: + pass + else: + return list(iterable) + return JSONEncoder.default(self, o) + + """ + raise TypeError(repr(o) + " is not JSON serializable") + + def encode(self, o): + """Return a JSON string representation of a Python data structure. + + >>> JSONEncoder().encode({"foo": ["bar", "baz"]}) + '{"foo": ["bar", "baz"]}' + + """ + # This is for extremely simple cases and benchmarks. + if isinstance(o, str): + if self.ensure_ascii: + return encode_basestring_ascii(o) + else: + return encode_basestring(o) + # This doesn't pass the iterator directly to ''.join() because the + # exceptions aren't as detailed. The list call should be roughly + # equivalent to the PySequence_Fast that ''.join() would do. + chunks = self.iterencode(o, _one_shot=True) + if not isinstance(chunks, (list, tuple)): + chunks = list(chunks) + return ''.join(chunks) + + def iterencode(self, o, _one_shot=False): + """Encode the given object and yield each string + representation as available. + + For example:: + + for chunk in JSONEncoder().iterencode(bigobject): + mysocket.write(chunk) + + """ + if self.check_circular: + markers = {} + else: + markers = None + if self.ensure_ascii: + _encoder = encode_basestring_ascii + else: + _encoder = encode_basestring + + def floatstr(o, allow_nan=self.allow_nan, + _repr=FLOAT_REPR, _inf=INFINITY, _neginf=-INFINITY): + # Check for specials. Note that this type of test is processor + # and/or platform-specific, so do tests which don't depend on the + # internals. + + if o != o: + text = 'NaN' + elif o == _inf: + text = 'Infinity' + elif o == _neginf: + text = '-Infinity' + else: + return _repr(o) - def _iterencode_list(self, lst, markers=None): + if not allow_nan: + raise ValueError( + "Out of range float values are not JSON compliant: " + + repr(o)) + + return text + + + if (_one_shot and c_make_encoder is not None + and not self.indent and not self.sort_keys): + _iterencode = c_make_encoder( + markers, self.default, _encoder, self.indent, + self.key_separator, self.item_separator, self.sort_keys, + self.skipkeys, self.allow_nan) + else: + _iterencode = _make_iterencode( + markers, self.default, _encoder, self.indent, floatstr, + self.key_separator, self.item_separator, self.sort_keys, + self.skipkeys, _one_shot) + return _iterencode(o, 0) + +def _make_iterencode(markers, _default, _encoder, _indent, _floatstr, + _key_separator, _item_separator, _sort_keys, _skipkeys, _one_shot, + ## HACK: hand-optimized bytecode; turn globals into locals + ValueError=ValueError, + dict=dict, + float=float, + id=id, + int=int, + isinstance=isinstance, + list=list, + str=str, + tuple=tuple, + ): + + def _iterencode_list(lst, _current_indent_level): if not lst: yield '[]' return @@ -186,31 +268,51 @@ if markerid in markers: raise ValueError("Circular reference detected") markers[markerid] = lst - yield '[' - if self.indent is not None: - self.current_indent_level += 1 - newline_indent = self._newline_indent() - separator = self.item_separator + newline_indent - yield newline_indent + buf = '[' + if _indent is not None: + _current_indent_level += 1 + newline_indent = '\n' + (' ' * (_indent * _current_indent_level)) + separator = _item_separator + newline_indent + buf += newline_indent else: newline_indent = None - separator = self.item_separator + separator = _item_separator first = True for value in lst: if first: first = False else: - yield separator - for chunk in self._iterencode(value, markers): - yield chunk + buf = separator + if isinstance(value, str): + yield buf + _encoder(value) + elif value is None: + yield buf + 'null' + elif value is True: + yield buf + 'true' + elif value is False: + yield buf + 'false' + elif isinstance(value, int): + yield buf + str(value) + elif isinstance(value, float): + yield buf + _floatstr(value) + else: + yield buf + if isinstance(value, (list, tuple)): + chunks = _iterencode_list(value, _current_indent_level) + elif isinstance(value, dict): + chunks = _iterencode_dict(value, _current_indent_level) + else: + chunks = _iterencode(value, _current_indent_level) + for chunk in chunks: + yield chunk if newline_indent is not None: - self.current_indent_level -= 1 - yield self._newline_indent() + _current_indent_level -= 1 + yield '\n' + (' ' * (_indent * _current_indent_level)) yield ']' if markers is not None: del markers[markerid] - def _iterencode_dict(self, dct, markers=None): + def _iterencode_dict(dct, _current_indent_level): if not dct: yield '{}' return @@ -220,78 +322,75 @@ raise ValueError("Circular reference detected") markers[markerid] = dct yield '{' - key_separator = self.key_separator - if self.indent is not None: - self.current_indent_level += 1 - newline_indent = self._newline_indent() - item_separator = self.item_separator + newline_indent + if _indent is not None: + _current_indent_level += 1 + newline_indent = '\n' + (' ' * (_indent * _current_indent_level)) + item_separator = _item_separator + newline_indent yield newline_indent else: newline_indent = None - item_separator = self.item_separator + item_separator = _item_separator first = True - if self.ensure_ascii: - encoder = encode_basestring_ascii - else: - encoder = encode_basestring - allow_nan = self.allow_nan - if self.sort_keys: - keys = list(dct.keys()) - keys.sort() - items = [(k, dct[k]) for k in keys] + if _sort_keys: + items = sorted(dct.items(), key=lambda kv: kv[0]) else: - items = iter(dct.items()) - _encoding = self.encoding - _do_decode = (_encoding is not None - and not (_encoding == 'utf-8')) + items = dct.items() for key, value in items: if isinstance(key, str): - if _do_decode: - key = key.decode(_encoding) - elif isinstance(key, str): pass # JavaScript is weakly typed for these, so it makes sense to # also allow them. Many encoders seem to do something like this. elif isinstance(key, float): - key = floatstr(key, allow_nan) - elif isinstance(key, (int, int)): - key = str(key) + key = _floatstr(key) elif key is True: key = 'true' elif key is False: key = 'false' elif key is None: key = 'null' - elif self.skipkeys: + elif isinstance(key, int): + key = str(key) + elif _skipkeys: continue else: - raise TypeError("key {0!r} is not a string".format(key)) + raise TypeError("key " + repr(key) + " is not a string") if first: first = False else: yield item_separator - yield encoder(key) - yield key_separator - for chunk in self._iterencode(value, markers): - yield chunk + yield _encoder(key) + yield _key_separator + if isinstance(value, str): + yield _encoder(value) + elif value is None: + yield 'null' + elif value is True: + yield 'true' + elif value is False: + yield 'false' + elif isinstance(value, int): + yield str(value) + elif isinstance(value, float): + yield _floatstr(value) + else: + if isinstance(value, (list, tuple)): + chunks = _iterencode_list(value, _current_indent_level) + elif isinstance(value, dict): + chunks = _iterencode_dict(value, _current_indent_level) + else: + chunks = _iterencode(value, _current_indent_level) + for chunk in chunks: + yield chunk if newline_indent is not None: - self.current_indent_level -= 1 - yield self._newline_indent() + _current_indent_level -= 1 + yield '\n' + (' ' * (_indent * _current_indent_level)) yield '}' if markers is not None: del markers[markerid] - def _iterencode(self, o, markers=None): + def _iterencode(o, _current_indent_level): if isinstance(o, str): - if self.ensure_ascii: - encoder = encode_basestring_ascii - else: - encoder = encode_basestring - _encoding = self.encoding - if (_encoding is not None and isinstance(o, str) - and not (_encoding == 'utf-8')): - o = o.decode(_encoding) - yield encoder(o) + yield _encoder(o) elif o is None: yield 'null' elif o is True: @@ -301,12 +400,12 @@ elif isinstance(o, (int, int)): yield str(o) elif isinstance(o, float): - yield floatstr(o, self.allow_nan) + yield _floatstr(o) elif isinstance(o, (list, tuple)): - for chunk in self._iterencode_list(o, markers): + for chunk in _iterencode_list(o, _current_indent_level): yield chunk elif isinstance(o, dict): - for chunk in self._iterencode_dict(o, markers): + for chunk in _iterencode_dict(o, _current_indent_level): yield chunk else: if markers is not None: @@ -314,71 +413,9 @@ if markerid in markers: raise ValueError("Circular reference detected") markers[markerid] = o - for chunk in self._iterencode_default(o, markers): + o = _default(o) + for chunk in _iterencode(o, _current_indent_level): yield chunk if markers is not None: del markers[markerid] - - def _iterencode_default(self, o, markers=None): - newobj = self.default(o) - return self._iterencode(newobj, markers) - - def default(self, o): - """Implement this method in a subclass such that it returns a serializable - object for ``o``, or calls the base implementation (to raise a - ``TypeError``). - - For example, to support arbitrary iterators, you could implement - default like this:: - - def default(self, o): - try: - iterable = iter(o) - except TypeError: - pass - else: - return list(iterable) - return JSONEncoder.default(self, o) - - """ - raise TypeError(repr(o) + " is not JSON serializable") - - def encode(self, o): - """Return a JSON string representation of a Python data structure. - - >>> JSONEncoder().encode({"foo": ["bar", "baz"]}) - '{"foo": ["bar", "baz"]}' - - """ - # This is for extremely simple cases and benchmarks. - if isinstance(o, (str, bytes)): - if isinstance(o, bytes): - _encoding = self.encoding - if (_encoding is not None - and not (_encoding == 'utf-8')): - o = o.decode(_encoding) - if self.ensure_ascii: - return encode_basestring_ascii(o) - else: - return encode_basestring(o) - # This doesn't pass the iterator directly to ''.join() because the - # exceptions aren't as detailed. The list call should be roughly - # equivalent to the PySequence_Fast that ''.join() would do. - chunks = list(self.iterencode(o)) - return ''.join(chunks) - - def iterencode(self, o): - """Encode the given object and yield each string representation as - available. - - For example:: - - for chunk in JSONEncoder().iterencode(bigobject): - mysocket.write(chunk) - - """ - if self.check_circular: - markers = {} - else: - markers = None - return self._iterencode(o, markers) + return _iterencode Modified: python/branches/pep-0383/Lib/json/scanner.py ============================================================================== --- python/branches/pep-0383/Lib/json/scanner.py (original) +++ python/branches/pep-0383/Lib/json/scanner.py Sat May 2 21:20:57 2009 @@ -1,69 +1,65 @@ -"""Iterator based sre token scanner - +"""JSON token scanner """ - import re -import sre_parse -import sre_compile -import sre_constants - -from re import VERBOSE, MULTILINE, DOTALL -from sre_constants import BRANCH, SUBPATTERN - -__all__ = ['Scanner', 'pattern'] - -FLAGS = (VERBOSE | MULTILINE | DOTALL) - -class Scanner(object): - def __init__(self, lexicon, flags=FLAGS): - self.actions = [None] - # Combine phrases into a compound pattern - s = sre_parse.Pattern() - s.flags = flags - p = [] - for idx, token in enumerate(lexicon): - phrase = token.pattern - try: - subpattern = sre_parse.SubPattern(s, - [(SUBPATTERN, (idx + 1, sre_parse.parse(phrase, flags)))]) - except sre_constants.error: - raise - p.append(subpattern) - self.actions.append(token) - - s.groups = len(p) + 1 # NOTE(guido): Added to make SRE validation work - p = sre_parse.SubPattern(s, [(BRANCH, (None, p))]) - self.scanner = sre_compile.compile(p) - - def iterscan(self, string, idx=0, context=None): - """Yield match, end_idx for each match - - """ - match = self.scanner.scanner(string, idx).match - actions = self.actions - lastend = idx - end = len(string) - while True: - m = match() - if m is None: - break - matchbegin, matchend = m.span() - if lastend == matchend: - break - action = actions[m.lastindex] - if action is not None: - rval, next_pos = action(m, context) - if next_pos is not None and next_pos != matchend: - # "fast forward" the scanner - matchend = next_pos - match = self.scanner.scanner(string, matchend).match - yield rval, matchend - lastend = matchend - - -def pattern(pattern, flags=FLAGS): - def decorator(fn): - fn.pattern = pattern - fn.regex = re.compile(pattern, flags) - return fn - return decorator +try: + from _json import make_scanner as c_make_scanner +except ImportError: + c_make_scanner = None + +__all__ = ['make_scanner'] + +NUMBER_RE = re.compile( + r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?', + (re.VERBOSE | re.MULTILINE | re.DOTALL)) + +def py_make_scanner(context): + parse_object = context.parse_object + parse_array = context.parse_array + parse_string = context.parse_string + match_number = NUMBER_RE.match + strict = context.strict + parse_float = context.parse_float + parse_int = context.parse_int + parse_constant = context.parse_constant + object_hook = context.object_hook + + def _scan_once(string, idx): + try: + nextchar = string[idx] + except IndexError: + raise StopIteration + + if nextchar == '"': + return parse_string(string, idx + 1, strict) + elif nextchar == '{': + return parse_object((string, idx + 1), strict, + _scan_once, object_hook, object_pairs_hook) + elif nextchar == '[': + return parse_array((string, idx + 1), _scan_once) + elif nextchar == 'n' and string[idx:idx + 4] == 'null': + return None, idx + 4 + elif nextchar == 't' and string[idx:idx + 4] == 'true': + return True, idx + 4 + elif nextchar == 'f' and string[idx:idx + 5] == 'false': + return False, idx + 5 + + m = match_number(string, idx) + if m is not None: + integer, frac, exp = m.groups() + if frac or exp: + res = parse_float(integer + (frac or '') + (exp or '')) + else: + res = parse_int(integer) + return res, m.end() + elif nextchar == 'N' and string[idx:idx + 3] == 'NaN': + return parse_constant('NaN'), idx + 3 + elif nextchar == 'I' and string[idx:idx + 8] == 'Infinity': + return parse_constant('Infinity'), idx + 8 + elif nextchar == '-' and string[idx:idx + 9] == '-Infinity': + return parse_constant('-Infinity'), idx + 9 + else: + raise StopIteration + + return _scan_once + +make_scanner = c_make_scanner or py_make_scanner Modified: python/branches/pep-0383/Lib/json/tests/test_decode.py ============================================================================== --- python/branches/pep-0383/Lib/json/tests/test_decode.py (original) +++ python/branches/pep-0383/Lib/json/tests/test_decode.py Sat May 2 21:20:57 2009 @@ -32,3 +32,10 @@ object_pairs_hook = OrderedDict, object_hook = lambda x: None), OrderedDict(p)) + + def test_decoder_optimizations(self): + # Several optimizations were made that skip over calls to + # the whitespace regex, so this test is designed to try and + # exercise the uncommon cases. The array cases are already covered. + rval = json.loads('{ "key" : "value" , "k":"v" }') + self.assertEquals(rval, {"key":"value", "k":"v"}) Modified: python/branches/pep-0383/Lib/json/tests/test_dump.py ============================================================================== --- python/branches/pep-0383/Lib/json/tests/test_dump.py (original) +++ python/branches/pep-0383/Lib/json/tests/test_dump.py Sat May 2 21:20:57 2009 @@ -11,3 +11,11 @@ def test_dumps(self): self.assertEquals(json.dumps({}), '{}') + + def test_encode_truefalse(self): + self.assertEquals(json.dumps( + {True: False, False: True}, sort_keys=True), + '{"false": true, "true": false}') + self.assertEquals(json.dumps( + {2: 3.0, 4.0: 5, False: 1, 6: True}, sort_keys=True), + '{"false": 1, "2": 3.0, "4.0": 5, "6": true}') Modified: python/branches/pep-0383/Lib/json/tests/test_encode_basestring_ascii.py ============================================================================== --- python/branches/pep-0383/Lib/json/tests/test_encode_basestring_ascii.py (original) +++ python/branches/pep-0383/Lib/json/tests/test_encode_basestring_ascii.py Sat May 2 21:20:57 2009 @@ -3,22 +3,20 @@ import json.encoder CASES = [ - ('/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', b'"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'), - ('\u0123\u4567\u89ab\ucdef\uabcd\uef4a', b'"\\u0123\\u4567\\u89ab\\ucdef\\uabcd\\uef4a"'), - ('controls', b'"controls"'), - ('\x08\x0c\n\r\t', b'"\\b\\f\\n\\r\\t"'), - ('{"object with 1 member":["array with 1 element"]}', b'"{\\"object with 1 member\\":[\\"array with 1 element\\"]}"'), - (' s p a c e d ', b'" s p a c e d "'), - ('\U0001d120', b'"\\ud834\\udd20"'), - ('\u03b1\u03a9', b'"\\u03b1\\u03a9"'), - (b'\xce\xb1\xce\xa9', b'"\\u03b1\\u03a9"'), - ('\u03b1\u03a9', b'"\\u03b1\\u03a9"'), - (b'\xce\xb1\xce\xa9', b'"\\u03b1\\u03a9"'), - ('\u03b1\u03a9', b'"\\u03b1\\u03a9"'), - ('\u03b1\u03a9', b'"\\u03b1\\u03a9"'), - ("`1~!@#$%^&*()_+-={':[,]}|;.?", b'"`1~!@#$%^&*()_+-={\':[,]}|;.?"'), - ('\x08\x0c\n\r\t', b'"\\b\\f\\n\\r\\t"'), - ('\u0123\u4567\u89ab\ucdef\uabcd\uef4a', b'"\\u0123\\u4567\\u89ab\\ucdef\\uabcd\\uef4a"'), + ('/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'), + ('\u0123\u4567\u89ab\ucdef\uabcd\uef4a', '"\\u0123\\u4567\\u89ab\\ucdef\\uabcd\\uef4a"'), + ('controls', '"controls"'), + ('\x08\x0c\n\r\t', '"\\b\\f\\n\\r\\t"'), + ('{"object with 1 member":["array with 1 element"]}', '"{\\"object with 1 member\\":[\\"array with 1 element\\"]}"'), + (' s p a c e d ', '" s p a c e d "'), + ('\U0001d120', '"\\ud834\\udd20"'), + ('\u03b1\u03a9', '"\\u03b1\\u03a9"'), + ('\u03b1\u03a9', '"\\u03b1\\u03a9"'), + ('\u03b1\u03a9', '"\\u03b1\\u03a9"'), + ('\u03b1\u03a9', '"\\u03b1\\u03a9"'), + ("`1~!@#$%^&*()_+-={':[,]}|;.?", '"`1~!@#$%^&*()_+-={\':[,]}|;.?"'), + ('\x08\x0c\n\r\t', '"\\b\\f\\n\\r\\t"'), + ('\u0123\u4567\u89ab\ucdef\uabcd\uef4a', '"\\u0123\\u4567\\u89ab\\ucdef\\uabcd\\uef4a"'), ] class TestEncodeBaseStringAscii(TestCase): @@ -26,12 +24,14 @@ self._test_encode_basestring_ascii(json.encoder.py_encode_basestring_ascii) def test_c_encode_basestring_ascii(self): - if json.encoder.c_encode_basestring_ascii is not None: - self._test_encode_basestring_ascii(json.encoder.c_encode_basestring_ascii) + if not json.encoder.c_encode_basestring_ascii: + return + self._test_encode_basestring_ascii(json.encoder.c_encode_basestring_ascii) def _test_encode_basestring_ascii(self, encode_basestring_ascii): fname = encode_basestring_ascii.__name__ for input_string, expect in CASES: result = encode_basestring_ascii(input_string) - result = result.encode("ascii") - self.assertEquals(result, expect) + self.assertEquals(result, expect, + '{0!r} != {1!r} for {2}({3!r})'.format( + result, expect, fname, input_string)) Modified: python/branches/pep-0383/Lib/json/tests/test_fail.py ============================================================================== --- python/branches/pep-0383/Lib/json/tests/test_fail.py (original) +++ python/branches/pep-0383/Lib/json/tests/test_fail.py Sat May 2 21:20:57 2009 @@ -73,4 +73,4 @@ except ValueError: pass else: - self.fail("Expected failure for fail%d.json: %r" % (idx, doc)) + self.fail("Expected failure for fail{0}.json: {1!r}".format(idx, doc)) Modified: python/branches/pep-0383/Lib/json/tests/test_float.py ============================================================================== --- python/branches/pep-0383/Lib/json/tests/test_float.py (original) +++ python/branches/pep-0383/Lib/json/tests/test_float.py Sat May 2 21:20:57 2009 @@ -5,5 +5,11 @@ class TestFloat(TestCase): def test_floats(self): - for num in [1617161771.7650001, math.pi, math.pi**100, math.pi**-100]: + for num in [1617161771.7650001, math.pi, math.pi**100, math.pi**-100, 3.1]: self.assertEquals(float(json.dumps(num)), num) + self.assertEquals(json.loads(json.dumps(num)), num) + + def test_ints(self): + for num in [1, 1<<32, 1<<64]: + self.assertEquals(json.dumps(num), str(num)) + self.assertEquals(int(json.dumps(num)), num) Modified: python/branches/pep-0383/Lib/json/tests/test_scanstring.py ============================================================================== --- python/branches/pep-0383/Lib/json/tests/test_scanstring.py (original) +++ python/branches/pep-0383/Lib/json/tests/test_scanstring.py Sat May 2 21:20:57 2009 @@ -15,96 +15,90 @@ def _test_scanstring(self, scanstring): self.assertEquals( - scanstring('"z\\ud834\\udd20x"', 1, None, True), + scanstring('"z\\ud834\\udd20x"', 1, True), ('z\U0001d120x', 16)) if sys.maxunicode == 65535: self.assertEquals( - scanstring('"z\U0001d120x"', 1, None, True), + scanstring('"z\U0001d120x"', 1, True), ('z\U0001d120x', 6)) else: self.assertEquals( - scanstring('"z\U0001d120x"', 1, None, True), + scanstring('"z\U0001d120x"', 1, True), ('z\U0001d120x', 5)) self.assertEquals( - scanstring('"\\u007b"', 1, None, True), + scanstring('"\\u007b"', 1, True), ('{', 8)) self.assertEquals( - scanstring('"A JSON payload should be an object or array, not a string."', 1, None, True), + scanstring('"A JSON payload should be an object or array, not a string."', 1, True), ('A JSON payload should be an object or array, not a string.', 60)) self.assertEquals( - scanstring('["Unclosed array"', 2, None, True), + scanstring('["Unclosed array"', 2, True), ('Unclosed array', 17)) self.assertEquals( - scanstring('["extra comma",]', 2, None, True), + scanstring('["extra comma",]', 2, True), ('extra comma', 14)) self.assertEquals( - scanstring('["double extra comma",,]', 2, None, True), + scanstring('["double extra comma",,]', 2, True), ('double extra comma', 21)) self.assertEquals( - scanstring('["Comma after the close"],', 2, None, True), + scanstring('["Comma after the close"],', 2, True), ('Comma after the close', 24)) self.assertEquals( - scanstring('["Extra close"]]', 2, None, True), + scanstring('["Extra close"]]', 2, True), ('Extra close', 14)) self.assertEquals( - scanstring('{"Extra comma": true,}', 2, None, True), + scanstring('{"Extra comma": true,}', 2, True), ('Extra comma', 14)) self.assertEquals( - scanstring('{"Extra value after close": true} "misplaced quoted value"', 2, None, True), + scanstring('{"Extra value after close": true} "misplaced quoted value"', 2, True), ('Extra value after close', 26)) self.assertEquals( - scanstring('{"Illegal expression": 1 + 2}', 2, None, True), + scanstring('{"Illegal expression": 1 + 2}', 2, True), ('Illegal expression', 21)) self.assertEquals( - scanstring('{"Illegal invocation": alert()}', 2, None, True), + scanstring('{"Illegal invocation": alert()}', 2, True), ('Illegal invocation', 21)) self.assertEquals( - scanstring('{"Numbers cannot have leading zeroes": 013}', 2, None, True), + scanstring('{"Numbers cannot have leading zeroes": 013}', 2, True), ('Numbers cannot have leading zeroes', 37)) self.assertEquals( - scanstring('{"Numbers cannot be hex": 0x14}', 2, None, True), + scanstring('{"Numbers cannot be hex": 0x14}', 2, True), ('Numbers cannot be hex', 24)) self.assertEquals( - scanstring('[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]', 21, None, True), + scanstring('[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]]', 21, True), ('Too deep', 30)) self.assertEquals( - scanstring('{"Missing colon" null}', 2, None, True), + scanstring('{"Missing colon" null}', 2, True), ('Missing colon', 16)) self.assertEquals( - scanstring('{"Double colon":: null}', 2, None, True), + scanstring('{"Double colon":: null}', 2, True), ('Double colon', 15)) self.assertEquals( - scanstring('{"Comma instead of colon", null}', 2, None, True), + scanstring('{"Comma instead of colon", null}', 2, True), ('Comma instead of colon', 25)) self.assertEquals( - scanstring('["Colon instead of comma": false]', 2, None, True), + scanstring('["Colon instead of comma": false]', 2, True), ('Colon instead of comma', 25)) self.assertEquals( - scanstring('["Bad value", truth]', 2, None, True), + scanstring('["Bad value", truth]', 2, True), ('Bad value', 12)) - - def test_issue3623(self): - self.assertRaises(ValueError, json.decoder.scanstring, b"xxx", 1, - "xxx") - self.assertRaises(UnicodeDecodeError, - json.encoder.encode_basestring_ascii, b"xx\xff") Modified: python/branches/pep-0383/Lib/json/tests/test_unicode.py ============================================================================== --- python/branches/pep-0383/Lib/json/tests/test_unicode.py (original) +++ python/branches/pep-0383/Lib/json/tests/test_unicode.py Sat May 2 21:20:57 2009 @@ -4,20 +4,8 @@ from collections import OrderedDict class TestUnicode(TestCase): - def test_encoding1(self): - encoder = json.JSONEncoder(encoding='utf-8') - u = '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}' - s = u.encode('utf-8') - ju = encoder.encode(u) - js = encoder.encode(s) - self.assertEquals(ju, js) - - def test_encoding2(self): - u = '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}' - s = u.encode('utf-8') - ju = json.dumps(u, encoding='utf-8') - js = json.dumps(s, encoding='utf-8') - self.assertEquals(ju, js) + # test_encoding1 and test_encoding2 from 2.x are irrelevant (only str + # is supported as input, not bytes). def test_encoding3(self): u = '\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}' @@ -52,8 +40,22 @@ def test_unicode_decode(self): for i in range(0, 0xd7ff): u = chr(i) - js = '"\\u{0:04x}"'.format(i) - self.assertEquals(json.loads(js), u) + s = '"\\u{0:04x}"'.format(i) + self.assertEquals(json.loads(s), u) + + def test_unicode_preservation(self): + self.assertEquals(type(json.loads('""')), str) + self.assertEquals(type(json.loads('"a"')), str) + self.assertEquals(type(json.loads('["a"]')[0]), str) + + def test_bytes_encode(self): + self.assertRaises(TypeError, json.dumps, b"hi") + self.assertRaises(TypeError, json.dumps, [b"hi"]) + + def test_bytes_decode(self): + self.assertRaises(TypeError, json.loads, b'"hi"') + self.assertRaises(TypeError, json.loads, b'["hi"]') + def test_object_pairs_hook_with_unicode(self): s = '{"xkd":1, "kcw":2, "art":3, "hxm":4, "qrt":5, "pad":6, "hoy":7}' Modified: python/branches/pep-0383/Lib/json/tool.py ============================================================================== --- python/branches/pep-0383/Lib/json/tool.py (original) +++ python/branches/pep-0383/Lib/json/tool.py Sat May 2 21:20:57 2009 @@ -2,11 +2,11 @@ Usage:: - $ echo '{"json":"obj"}' | python -mjson.tool + $ echo '{"json":"obj"}' | python -m json.tool { "json": "obj" } - $ echo '{ 1.2:3.4}' | python -mjson.tool + $ echo '{ 1.2:3.4}' | python -m json.tool Expecting property name: line 1 column 2 (char 2) """ @@ -24,7 +24,7 @@ infile = open(sys.argv[1], 'rb') outfile = open(sys.argv[2], 'wb') else: - raise SystemExit("{0} [infile [outfile]]".format(sys.argv[0])) + raise SystemExit(sys.argv[0] + " [infile [outfile]]") try: obj = json.load(infile) except ValueError as e: Modified: python/branches/pep-0383/Lib/shutil.py ============================================================================== --- python/branches/pep-0383/Lib/shutil.py (original) +++ python/branches/pep-0383/Lib/shutil.py Sat May 2 21:20:57 2009 @@ -11,11 +11,15 @@ import fnmatch __all__ = ["copyfileobj","copyfile","copymode","copystat","copy","copy2", - "copytree","move","rmtree","Error"] + "copytree","move","rmtree","Error", "SpecialFileError"] class Error(EnvironmentError): pass +class SpecialFileError(EnvironmentError): + """Raised when trying to do a kind of operation (e.g. copying) which is + not supported on a special file (e.g. a named pipe)""" + try: WindowsError except NameError: @@ -48,6 +52,15 @@ fsrc = None fdst = None + for fn in [src, dst]: + try: + st = os.stat(fn) + except OSError: + # File most likely does not exist + pass + # XXX What about other special files? (sockets, devices...) + if stat.S_ISFIFO(st.st_mode): + raise SpecialFileError("`%s` is a named pipe" % fn) try: fsrc = open(src, 'rb') fdst = open(dst, 'wb') @@ -157,14 +170,14 @@ elif os.path.isdir(srcname): copytree(srcname, dstname, symlinks, ignore) else: + # Will raise a SpecialFileError for unsupported file types copy2(srcname, dstname) - # XXX What about devices, sockets etc.? - except (IOError, os.error) as why: - errors.append((srcname, dstname, str(why))) # catch the Error from the recursive copytree so that we can # continue with other files except Error as err: errors.extend(err.args[0]) + except EnvironmentError as why: + errors.append((srcname, dstname, str(why))) try: copystat(src, dst) except OSError as why: Modified: python/branches/pep-0383/Lib/test/formatfloat_testcases.txt ============================================================================== --- python/branches/pep-0383/Lib/test/formatfloat_testcases.txt (original) +++ python/branches/pep-0383/Lib/test/formatfloat_testcases.txt Sat May 2 21:20:57 2009 @@ -22,8 +22,8 @@ %.0f 123.456 -> 123 %.0f 1234.56 -> 1235 %.0f 1e49 -> 9999999999999999464902769475481793196872414789632 --- %.0f 1e50 -> 100000000000000007629769841091887003294964970946560 %.0f 9.9999999999999987e+49 -> 99999999999999986860582406952576489172979654066176 +%.0f 1e50 -> 100000000000000007629769841091887003294964970946560 -- precision 1 %.1f 0.0001 -> 0.0 Modified: python/branches/pep-0383/Lib/test/string_tests.py ============================================================================== --- python/branches/pep-0383/Lib/test/string_tests.py (original) +++ python/branches/pep-0383/Lib/test/string_tests.py Sat May 2 21:20:57 2009 @@ -1105,14 +1105,7 @@ value = 0.01 for x in range(60): value = value * 3.141592655 / 3.0 * 10.0 - # The formatfloat() code in stringobject.c and - # unicodeobject.c uses a 120 byte buffer and switches from - # 'f' formatting to 'g' at precision 50, so we expect - # OverflowErrors for the ranges x < 50 and prec >= 67. - if x < 50 and prec >= 67: - self.checkraises(OverflowError, format, "__mod__", value) - else: - self.checkcall(format, "__mod__", value) + self.checkcall(format, "__mod__", value) def test_inplace_rewrites(self): # Check that strings don't copy and modify cached single-character strings Modified: python/branches/pep-0383/Lib/test/support.py ============================================================================== --- python/branches/pep-0383/Lib/test/support.py (original) +++ python/branches/pep-0383/Lib/test/support.py Sat May 2 21:20:57 2009 @@ -13,6 +13,7 @@ import warnings import unittest import importlib +import collections __all__ = ["Error", "TestFailed", "ResourceDenied", "import_module", "verbose", "use_resources", "max_memuse", "record_original_stdout", @@ -510,26 +511,45 @@ sys.modules.update(self.original_modules) -class EnvironmentVarGuard(object): +class EnvironmentVarGuard(collections.MutableMapping): """Class to help protect the environment variable properly. Can be used as a context manager.""" def __init__(self): + self._environ = os.environ self._changed = {} - def set(self, envvar, value): + def __getitem__(self, envvar): + return self._environ[envvar] + + def __setitem__(self, envvar, value): # Remember the initial value on the first access if envvar not in self._changed: - self._changed[envvar] = os.environ.get(envvar) - os.environ[envvar] = value + self._changed[envvar] = self._environ.get(envvar) + self._environ[envvar] = value - def unset(self, envvar): + def __delitem__(self, envvar): # Remember the initial value on the first access if envvar not in self._changed: - self._changed[envvar] = os.environ.get(envvar) - if envvar in os.environ: - del os.environ[envvar] + self._changed[envvar] = self._environ.get(envvar) + if envvar in self._environ: + del self._environ[envvar] + + def keys(self): + return self._environ.keys() + + def __iter__(self): + return iter(self._environ) + + def __len__(self): + return len(self._environ) + + def set(self, envvar, value): + self[envvar] = value + + def unset(self, envvar): + del self[envvar] def __enter__(self): return self @@ -537,10 +557,11 @@ def __exit__(self, *ignore_exc): for (k, v) in self._changed.items(): if v is None: - if k in os.environ: - del os.environ[k] + if k in self._environ: + del self._environ[k] else: - os.environ[k] = v + self._environ[k] = v + class TransientResource(object): Modified: python/branches/pep-0383/Lib/test/test_getopt.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_getopt.py (original) +++ python/branches/pep-0383/Lib/test/test_getopt.py Sat May 2 21:20:57 2009 @@ -1,7 +1,7 @@ # test_getopt.py # David Goodger 2000-08-19 -from test.support import verbose, run_doctest, run_unittest +from test.support import verbose, run_doctest, run_unittest, EnvironmentVarGuard import unittest import getopt @@ -11,15 +11,13 @@ class GetoptTests(unittest.TestCase): def setUp(self): - self.old_posixly_correct = os.environ.get("POSIXLY_CORRECT", sentinel) - if self.old_posixly_correct is not sentinel: - del os.environ["POSIXLY_CORRECT"] + self.env = EnvironmentVarGuard() + if "POSIXLY_CORRECT" in self.env: + del self.env["POSIXLY_CORRECT"] def tearDown(self): - if self.old_posixly_correct is sentinel: - os.environ.pop("POSIXLY_CORRECT", None) - else: - os.environ["POSIXLY_CORRECT"] = self.old_posixly_correct + self.env.__exit__() + del self.env def assertError(self, *args, **kwargs): self.assertRaises(getopt.GetoptError, *args, **kwargs) @@ -135,7 +133,7 @@ self.assertEqual(args, ['arg1', '-b', '1', '--alpha', '--beta=2']) # Posix style via POSIXLY_CORRECT - os.environ["POSIXLY_CORRECT"] = "1" + self.env["POSIXLY_CORRECT"] = "1" opts, args = getopt.gnu_getopt(cmdline, 'ab:', ['alpha', 'beta=']) self.assertEqual(opts, [('-a', '')]) self.assertEqual(args, ['arg1', '-b', '1', '--alpha', '--beta=2']) Modified: python/branches/pep-0383/Lib/test/test_gettext.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_gettext.py (original) +++ python/branches/pep-0383/Lib/test/test_gettext.py Sat May 2 21:20:57 2009 @@ -58,10 +58,6 @@ MOFILE = os.path.join(LOCALEDIR, 'gettext.mo') UMOFILE = os.path.join(LOCALEDIR, 'ugettext.mo') MMOFILE = os.path.join(LOCALEDIR, 'metadata.mo') -try: - LANG = os.environ['LANGUAGE'] -except: - LANG = 'en' class GettextBaseTest(unittest.TestCase): @@ -77,10 +73,12 @@ fp = open(MMOFILE, 'wb') fp.write(base64.decodestring(MMO_DATA)) fp.close() - os.environ['LANGUAGE'] = 'xx' + self.env = support.EnvironmentVarGuard() + self.env['LANGUAGE'] = 'xx' def tearDown(self): - os.environ['LANGUAGE'] = LANG + self.env.__exit__() + del self.env shutil.rmtree(os.path.split(LOCALEDIR)[0]) Modified: python/branches/pep-0383/Lib/test/test_io.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_io.py (original) +++ python/branches/pep-0383/Lib/test/test_io.py Sat May 2 21:20:57 2009 @@ -526,6 +526,12 @@ class CommonBufferedTests: # Tests common to BufferedReader, BufferedWriter and BufferedRandom + def test_detach(self): + raw = self.MockRawIO() + buf = self.tp(raw) + self.assertIs(buf.detach(), raw) + self.assertRaises(ValueError, buf.detach) + def test_fileno(self): rawio = self.MockRawIO() bufio = self.tp(rawio) @@ -811,6 +817,14 @@ bufio.flush() self.assertEquals(b"".join(rawio._write_stack), b"abcghi") + def test_detach_flush(self): + raw = self.MockRawIO() + buf = self.tp(raw) + buf.write(b"howdy!") + self.assertFalse(raw._write_stack) + buf.detach() + self.assertEqual(raw._write_stack, [b"howdy!"]) + def test_write(self): # Write to the buffered IO but don't overflow the buffer. writer = self.MockRawIO() @@ -1052,6 +1066,10 @@ pair = self.tp(self.MockRawIO(), self.MockRawIO()) self.assertFalse(pair.closed) + def test_detach(self): + pair = self.tp(self.MockRawIO(), self.MockRawIO()) + self.assertRaises(self.UnsupportedOperation, pair.detach) + def test_constructor_max_buffer_size_deprecation(self): with support.check_warnings() as w: warnings.simplefilter("always", DeprecationWarning) @@ -1480,6 +1498,19 @@ self.assertRaises(TypeError, t.__init__, b, newline=42) self.assertRaises(ValueError, t.__init__, b, newline='xyzzy') + def test_detach(self): + r = self.BytesIO() + b = self.BufferedWriter(r) + t = self.TextIOWrapper(b) + self.assertIs(t.detach(), b) + + t = self.TextIOWrapper(b, encoding="ascii") + t.write("howdy") + self.assertFalse(r.getvalue()) + t.detach() + self.assertEqual(r.getvalue(), b"howdy") + self.assertRaises(ValueError, t.detach) + def test_repr(self): raw = self.BytesIO("hello".encode("utf-8")) b = self.BufferedReader(raw) Modified: python/branches/pep-0383/Lib/test/test_memoryio.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_memoryio.py (original) +++ python/branches/pep-0383/Lib/test/test_memoryio.py Sat May 2 21:20:57 2009 @@ -57,6 +57,10 @@ class MemoryTestMixin: + def test_detach(self): + buf = self.ioclass() + self.assertRaises(self.UnsupportedOperation, buf.detach) + def write_ops(self, f, t): self.assertEqual(f.write(t("blah.")), 5) self.assertEqual(f.seek(0), 0) @@ -336,6 +340,9 @@ class PyBytesIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase): + + UnsupportedOperation = pyio.UnsupportedOperation + @staticmethod def buftype(s): return s.encode("ascii") @@ -413,6 +420,7 @@ class PyStringIOTest(MemoryTestMixin, MemorySeekTestMixin, unittest.TestCase): buftype = str ioclass = pyio.StringIO + UnsupportedOperation = pyio.UnsupportedOperation EOF = "" # TextIO-specific behaviour. @@ -518,9 +526,11 @@ class CBytesIOTest(PyBytesIOTest): ioclass = io.BytesIO + UnsupportedOperation = io.UnsupportedOperation class CStringIOTest(PyStringIOTest): ioclass = io.StringIO + UnsupportedOperation = io.UnsupportedOperation # XXX: For the Python version of io.StringIO, this is highly # dependent on the encoding used for the underlying buffer. Modified: python/branches/pep-0383/Lib/test/test_ntpath.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_ntpath.py (original) +++ python/branches/pep-0383/Lib/test/test_ntpath.py Sat May 2 21:20:57 2009 @@ -141,12 +141,11 @@ tester("ntpath.normpath('//machine/share//a/b')", r'\\machine\share\a\b') def test_expandvars(self): - oldenv = os.environ.copy() - try: - os.environ.clear() - os.environ["foo"] = "bar" - os.environ["{foo"] = "baz1" - os.environ["{foo}"] = "baz2" + with support.EnvironmentVarGuard() as env: + env.clear() + env["foo"] = "bar" + env["{foo"] = "baz1" + env["{foo}"] = "baz2" tester('ntpath.expandvars("foo")', "foo") tester('ntpath.expandvars("$foo bar")', "bar bar") tester('ntpath.expandvars("${foo}bar")', "barbar") @@ -166,9 +165,6 @@ tester('ntpath.expandvars("%?bar%")', "%?bar%") tester('ntpath.expandvars("%foo%%bar")', "bar%bar") tester('ntpath.expandvars("\'%foo%\'%bar")', "\'%foo%\'%bar") - finally: - os.environ.clear() - os.environ.update(oldenv) def test_abspath(self): # ntpath.abspath() can only be used on a system with the "nt" module Modified: python/branches/pep-0383/Lib/test/test_optparse.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_optparse.py (original) +++ python/branches/pep-0383/Lib/test/test_optparse.py Sat May 2 21:20:57 2009 @@ -1449,7 +1449,7 @@ # screws things up for other tests when it's part of the Python # test suite. with support.EnvironmentVarGuard() as env: - env.set('COLUMNS', str(columns)) + env['COLUMNS'] = str(columns) return InterceptingOptionParser(option_list=options) def assertHelpEquals(self, expected_output): @@ -1474,7 +1474,7 @@ def test_help_title_formatter(self): with support.EnvironmentVarGuard() as env: - env.set("COLUMNS", "80") + env["COLUMNS"] = "80" self.parser.formatter = TitledHelpFormatter() self.assertHelpEquals(_expected_help_title_formatter) Modified: python/branches/pep-0383/Lib/test/test_posixpath.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_posixpath.py (original) +++ python/branches/pep-0383/Lib/test/test_posixpath.py Sat May 2 21:20:57 2009 @@ -420,18 +420,17 @@ self.assert_(isinstance(posixpath.expanduser(b"~foo/"), bytes)) with support.EnvironmentVarGuard() as env: - env.set('HOME', '/') + env['HOME'] = '/' self.assertEqual(posixpath.expanduser("~"), "/") self.assertRaises(TypeError, posixpath.expanduser) def test_expandvars(self): - oldenv = os.environ.copy() - try: - os.environ.clear() - os.environ["foo"] = "bar" - os.environ["{foo"] = "baz1" - os.environ["{foo}"] = "baz2" + with support.EnvironmentVarGuard() as env: + env.clear() + env["foo"] = "bar" + env["{foo"] = "baz1" + env["{foo}"] = "baz2" self.assertEqual(posixpath.expandvars("foo"), "foo") self.assertEqual(posixpath.expandvars("$foo bar"), "bar bar") self.assertEqual(posixpath.expandvars("${foo}bar"), "barbar") @@ -457,11 +456,7 @@ self.assertEqual(posixpath.expandvars(b"${{foo}}"), b"baz1}") self.assertEqual(posixpath.expandvars(b"$foo$foo"), b"barbar") self.assertEqual(posixpath.expandvars(b"$bar$bar"), b"$bar$bar") - finally: - os.environ.clear() - os.environ.update(oldenv) - - self.assertRaises(TypeError, posixpath.expandvars) + self.assertRaises(TypeError, posixpath.expandvars) def test_normpath(self): self.assertEqual(posixpath.normpath(""), ".") Modified: python/branches/pep-0383/Lib/test/test_shutil.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_shutil.py (original) +++ python/branches/pep-0383/Lib/test/test_shutil.py Sat May 2 21:20:57 2009 @@ -9,6 +9,7 @@ import os.path from test import support from test.support import TESTFN +TESTFN2 = TESTFN + "2" class TestShutil(unittest.TestCase): def test_rmtree_errors(self): @@ -226,6 +227,38 @@ finally: shutil.rmtree(TESTFN, ignore_errors=True) + if hasattr(os, "mkfifo"): + # Issue #3002: copyfile and copytree block indefinitely on named pipes + def test_copyfile_named_pipe(self): + os.mkfifo(TESTFN) + try: + self.assertRaises(shutil.SpecialFileError, + shutil.copyfile, TESTFN, TESTFN2) + self.assertRaises(shutil.SpecialFileError, + shutil.copyfile, __file__, TESTFN) + finally: + os.remove(TESTFN) + + def test_copytree_named_pipe(self): + os.mkdir(TESTFN) + try: + subdir = os.path.join(TESTFN, "subdir") + os.mkdir(subdir) + pipe = os.path.join(subdir, "mypipe") + os.mkfifo(pipe) + try: + shutil.copytree(TESTFN, TESTFN2) + except shutil.Error as e: + errors = e.args[0] + self.assertEqual(len(errors), 1) + src, dst, error_msg = errors[0] + self.assertEqual("`%s` is a named pipe" % pipe, error_msg) + else: + self.fail("shutil.Error should have been raised") + finally: + shutil.rmtree(TESTFN, ignore_errors=True) + shutil.rmtree(TESTFN2, ignore_errors=True) + class TestMove(unittest.TestCase): Modified: python/branches/pep-0383/Lib/test/test_tcl.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_tcl.py (original) +++ python/branches/pep-0383/Lib/test/test_tcl.py Sat May 2 21:20:57 2009 @@ -144,23 +144,20 @@ import sys if sys.platform.startswith(('win', 'darwin', 'cygwin')): return # no failure possible on windows? - if 'DISPLAY' in os.environ: - old_display = os.environ['DISPLAY'] - del os.environ['DISPLAY'] - # on some platforms, deleting environment variables - # doesn't actually carry through to the process level - # because they don't support unsetenv - # If that's the case, abort. - display = os.popen('echo $DISPLAY').read().strip() - if display: - return - try: + with support.EnvironmentVarGuard() as env: + if 'DISPLAY' in os.environ: + del env['DISPLAY'] + # on some platforms, deleting environment variables + # doesn't actually carry through to the process level + # because they don't support unsetenv + # If that's the case, abort. + display = os.popen('echo $DISPLAY').read().strip() + if display: + return + tcl = Tcl() self.assertRaises(TclError, tcl.winfo_geometry) self.assertRaises(TclError, tcl.loadtk) - finally: - if old_display is not None: - os.environ['DISPLAY'] = old_display def test_main(): support.run_unittest(TclTest, TkinterTest) Modified: python/branches/pep-0383/Lib/test/test_tempfile.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_tempfile.py (original) +++ python/branches/pep-0383/Lib/test/test_tempfile.py Sat May 2 21:20:57 2009 @@ -153,7 +153,7 @@ for envname in 'TMPDIR', 'TEMP', 'TMP': dirname = os.getenv(envname) if not dirname: - env.set(envname, os.path.abspath(envname)) + env[envname] = os.path.abspath(envname) cand = tempfile._candidate_tempdir_list() Modified: python/branches/pep-0383/Lib/test/test_types.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_types.py (original) +++ python/branches/pep-0383/Lib/test/test_types.py Sat May 2 21:20:57 2009 @@ -538,10 +538,25 @@ test(-1.0, ' f', '-1.000000') test( 1.0, '+f', '+1.000000') test(-1.0, '+f', '-1.000000') - test(1.1234e90, 'f', '1.1234e+90') - test(1.1234e90, 'F', '1.1234e+90') - test(1.1234e200, 'f', '1.1234e+200') - test(1.1234e200, 'F', '1.1234e+200') + + # Python versions <= 3.0 switched from 'f' to 'g' formatting for + # values larger than 1e50. No longer. + f = 1.1234e90 + for fmt in 'f', 'F': + # don't do a direct equality check, since on some + # platforms only the first few digits of dtoa + # will be reliable + result = f.__format__(fmt) + self.assertEqual(len(result), 98) + self.assertEqual(result[-7], '.') + self.assert_(result[:12] in ('112340000000', '112339999999')) + f = 1.1234e200 + for fmt in 'f', 'F': + result = f.__format__(fmt) + self.assertEqual(len(result), 208) + self.assertEqual(result[-7], '.') + self.assert_(result[:12] in ('112340000000', '112339999999')) + test( 1.0, 'e', '1.000000e+00') test(-1.0, 'e', '-1.000000e+00') Modified: python/branches/pep-0383/Lib/test/test_xmlrpc.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_xmlrpc.py (original) +++ python/branches/pep-0383/Lib/test/test_xmlrpc.py Sat May 2 21:20:57 2009 @@ -572,7 +572,7 @@ def test_cgi_get(self): with support.EnvironmentVarGuard() as env: - env.set('REQUEST_METHOD', 'GET') + env['REQUEST_METHOD'] = 'GET' # if the method is GET and no request_text is given, it runs handle_get # get sysout output tmp = sys.stdout @@ -613,7 +613,7 @@ sys.stdout = open(support.TESTFN, "w") with support.EnvironmentVarGuard() as env: - env.set('CONTENT_LENGTH', str(len(data))) + env['CONTENT_LENGTH'] = str(len(data)) self.cgi.handle_request() sys.stdin.close() Modified: python/branches/pep-0383/Lib/urllib/request.py ============================================================================== --- python/branches/pep-0383/Lib/urllib/request.py (original) +++ python/branches/pep-0383/Lib/urllib/request.py Sat May 2 21:20:57 2009 @@ -2244,18 +2244,11 @@ # '' string by the localhost entry and the corresponding # canonical entry. proxyOverride = proxyOverride.split(';') - i = 0 - while i < len(proxyOverride): - if proxyOverride[i] == '': - proxyOverride[i:i+1] = ['localhost', - '127.0.0.1', - socket.gethostname(), - socket.gethostbyname( - socket.gethostname())] - i += 1 - # print proxyOverride # now check if we match one of the registry values. for test in proxyOverride: + if test == '': + if '.' not in rawHost: + return 1 test = test.replace(".", r"\.") # mask dots test = test.replace("*", r".*") # change glob sequence test = test.replace("?", r".") # change glob char Modified: python/branches/pep-0383/Misc/NEWS ============================================================================== --- python/branches/pep-0383/Misc/NEWS (original) +++ python/branches/pep-0383/Misc/NEWS Sat May 2 21:20:57 2009 @@ -12,6 +12,15 @@ Core and Builtins ----------------- +- Issue #5883: In the io module, the BufferedIOBase and TextIOBase ABCs have + received a new method, detach(). detach() disconnects the underlying stream + from the buffer or text IO and returns it. + +- Issue #5859: Remove switch from '%f' to '%g'-style formatting for + floats with absolute value over 1e50. Also remove length + restrictions for float formatting: '%.67f' % 12.34 and '%.120e' % + 12.34 no longer raise an exception. + - Issue #1588: Add complex.__format__. For example, format(complex(1, 2./3), '.5') now produces a sensible result. @@ -98,6 +107,14 @@ Library ------- +- The json module now works exclusively with str and not bytes. + +- Issue #3959: The ipaddr module has been added to the standard library. + Contributed by Google. + +- Issue #3002: ``shutil.copyfile()`` and ``shutil.copytree()`` now raise an + error when a named pipe is encountered, rather than blocking infinitely. + - Issue #5857: tokenize.tokenize() now returns named tuples. - Issue #4305: ctypes should now build again on mipsel-linux-gnu @@ -880,6 +897,9 @@ Build ----- +- Issue #5726: Make Modules/ld_so_aix return the actual exit code of the + linker, rather than always exit successfully. Patch by Floris Bruynooghe. + - Issue #4587: Add configure option --with-dbmliborder=db1:db2:... to specify the order that backends for the dbm extension are checked. Modified: python/branches/pep-0383/Modules/_io/bufferedio.c ============================================================================== --- python/branches/pep-0383/Modules/_io/bufferedio.c (original) +++ python/branches/pep-0383/Modules/_io/bufferedio.c Sat May 2 21:20:57 2009 @@ -73,6 +73,18 @@ return NULL; } +PyDoc_STRVAR(BufferedIOBase_detach_doc, + "Disconnect this buffer from its underlying raw stream and return it.\n" + "\n" + "After the raw stream has been detached, the buffer is in an unusable\n" + "state.\n"); + +static PyObject * +BufferedIOBase_detach(PyObject *self) +{ + return BufferedIOBase_unsupported("detach"); +} + PyDoc_STRVAR(BufferedIOBase_read_doc, "Read and return up to n bytes.\n" "\n" @@ -127,6 +139,7 @@ static PyMethodDef BufferedIOBase_methods[] = { + {"detach", (PyCFunction)BufferedIOBase_detach, METH_NOARGS, BufferedIOBase_detach_doc}, {"read", BufferedIOBase_read, METH_VARARGS, BufferedIOBase_read_doc}, {"read1", BufferedIOBase_read1, METH_VARARGS, BufferedIOBase_read1_doc}, {"readinto", BufferedIOBase_readinto, METH_VARARGS, NULL}, @@ -181,6 +194,7 @@ PyObject *raw; int ok; /* Initialized? */ + int detached; int readable; int writable; @@ -260,15 +274,25 @@ #define CHECK_INITIALIZED(self) \ if (self->ok <= 0) { \ - PyErr_SetString(PyExc_ValueError, \ - "I/O operation on uninitialized object"); \ + if (self->detached) { \ + PyErr_SetString(PyExc_ValueError, \ + "raw stream has been detached"); \ + } else { \ + PyErr_SetString(PyExc_ValueError, \ + "I/O operation on uninitialized object"); \ + } \ return NULL; \ } #define CHECK_INITIALIZED_INT(self) \ if (self->ok <= 0) { \ - PyErr_SetString(PyExc_ValueError, \ - "I/O operation on uninitialized object"); \ + if (self->detached) { \ + PyErr_SetString(PyExc_ValueError, \ + "raw stream has been detached"); \ + } else { \ + PyErr_SetString(PyExc_ValueError, \ + "I/O operation on uninitialized object"); \ + } \ return -1; \ } @@ -430,6 +454,24 @@ return res; } +/* detach */ + +static PyObject * +BufferedIOMixin_detach(BufferedObject *self, PyObject *args) +{ + PyObject *raw, *res; + CHECK_INITIALIZED(self) + res = PyObject_CallMethodObjArgs((PyObject *)self, _PyIO_str_flush, NULL); + if (res == NULL) + return NULL; + Py_DECREF(res); + raw = self->raw; + self->raw = NULL; + self->detached = 1; + self->ok = 0; + return raw; +} + /* Inquiries */ static PyObject * @@ -1101,6 +1143,7 @@ PyObject *raw; self->ok = 0; + self->detached = 0; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|n:BufferedReader", kwlist, &raw, &buffer_size)) { @@ -1387,6 +1430,7 @@ static PyMethodDef BufferedReader_methods[] = { /* BufferedIOMixin methods */ + {"detach", (PyCFunction)BufferedIOMixin_detach, METH_NOARGS}, {"flush", (PyCFunction)BufferedIOMixin_flush, METH_NOARGS}, {"close", (PyCFunction)BufferedIOMixin_close, METH_NOARGS}, {"seekable", (PyCFunction)BufferedIOMixin_seekable, METH_NOARGS}, @@ -1499,6 +1543,7 @@ PyObject *raw; self->ok = 0; + self->detached = 0; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|nn:BufferedReader", kwlist, &raw, &buffer_size, &max_buffer_size)) { @@ -1745,6 +1790,7 @@ static PyMethodDef BufferedWriter_methods[] = { /* BufferedIOMixin methods */ {"close", (PyCFunction)BufferedIOMixin_close, METH_NOARGS}, + {"detach", (PyCFunction)BufferedIOMixin_detach, METH_NOARGS}, {"seekable", (PyCFunction)BufferedIOMixin_seekable, METH_NOARGS}, {"readable", (PyCFunction)BufferedIOMixin_readable, METH_NOARGS}, {"writable", (PyCFunction)BufferedIOMixin_writable, METH_NOARGS}, @@ -2089,6 +2135,7 @@ PyObject *raw; self->ok = 0; + self->detached = 0; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|nn:BufferedReader", kwlist, &raw, &buffer_size, &max_buffer_size)) { @@ -2128,6 +2175,7 @@ static PyMethodDef BufferedRandom_methods[] = { /* BufferedIOMixin methods */ {"close", (PyCFunction)BufferedIOMixin_close, METH_NOARGS}, + {"detach", (PyCFunction)BufferedIOMixin_detach, METH_NOARGS}, {"seekable", (PyCFunction)BufferedIOMixin_seekable, METH_NOARGS}, {"readable", (PyCFunction)BufferedIOMixin_readable, METH_NOARGS}, {"writable", (PyCFunction)BufferedIOMixin_writable, METH_NOARGS}, Modified: python/branches/pep-0383/Modules/_io/textio.c ============================================================================== --- python/branches/pep-0383/Modules/_io/textio.c (original) +++ python/branches/pep-0383/Modules/_io/textio.c Sat May 2 21:20:57 2009 @@ -28,6 +28,19 @@ return NULL; } +PyDoc_STRVAR(TextIOBase_detach_doc, + "Separate the underlying buffer from the TextIOBase and return it.\n" + "\n" + "After the underlying buffer has been detached, the TextIO is in an\n" + "unusable state.\n" + ); + +static PyObject * +TextIOBase_detach(PyObject *self) +{ + return _unsupported("detach"); +} + PyDoc_STRVAR(TextIOBase_read_doc, "Read at most n characters from stream.\n" "\n" @@ -93,6 +106,7 @@ static PyMethodDef TextIOBase_methods[] = { + {"detach", (PyCFunction)TextIOBase_detach, METH_NOARGS, TextIOBase_detach_doc}, {"read", TextIOBase_read, METH_VARARGS, TextIOBase_read_doc}, {"readline", TextIOBase_readline, METH_VARARGS, TextIOBase_readline_doc}, {"write", TextIOBase_write, METH_VARARGS, TextIOBase_write_doc}, @@ -616,6 +630,7 @@ { PyObject_HEAD int ok; /* initialized? */ + int detached; Py_ssize_t chunk_size; PyObject *buffer; PyObject *encoding; @@ -759,6 +774,7 @@ int r; self->ok = 0; + self->detached = 0; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|zzzi:fileio", kwlist, &buffer, &encoding, &errors, &newline, &line_buffering)) @@ -1059,19 +1075,45 @@ #define CHECK_INITIALIZED(self) \ if (self->ok <= 0) { \ - PyErr_SetString(PyExc_ValueError, \ - "I/O operation on uninitialized object"); \ + if (self->detached) { \ + PyErr_SetString(PyExc_ValueError, \ + "underlying buffer has been detached"); \ + } else { \ + PyErr_SetString(PyExc_ValueError, \ + "I/O operation on uninitialized object"); \ + } \ return NULL; \ } #define CHECK_INITIALIZED_INT(self) \ if (self->ok <= 0) { \ - PyErr_SetString(PyExc_ValueError, \ - "I/O operation on uninitialized object"); \ + if (self->detached) { \ + PyErr_SetString(PyExc_ValueError, \ + "underlying buffer has been detached"); \ + } else { \ + PyErr_SetString(PyExc_ValueError, \ + "I/O operation on uninitialized object"); \ + } \ return -1; \ } +static PyObject * +TextIOWrapper_detach(PyTextIOWrapperObject *self) +{ + PyObject *buffer, *res; + CHECK_INITIALIZED(self); + res = PyObject_CallMethodObjArgs((PyObject *)self, _PyIO_str_flush, NULL); + if (res == NULL) + return NULL; + Py_DECREF(res); + buffer = self->buffer; + self->buffer = NULL; + self->detached = 1; + self->ok = 0; + return buffer; +} + Py_LOCAL_INLINE(const Py_UNICODE *) findchar(const Py_UNICODE *s, Py_ssize_t size, Py_UNICODE ch) { @@ -2341,6 +2383,7 @@ } static PyMethodDef TextIOWrapper_methods[] = { + {"detach", (PyCFunction)TextIOWrapper_detach, METH_NOARGS}, {"write", (PyCFunction)TextIOWrapper_write, METH_VARARGS}, {"read", (PyCFunction)TextIOWrapper_read, METH_VARARGS}, {"readline", (PyCFunction)TextIOWrapper_readline, METH_VARARGS}, Modified: python/branches/pep-0383/Modules/_json.c ============================================================================== --- python/branches/pep-0383/Modules/_json.c (original) +++ python/branches/pep-0383/Modules/_json.c Sat May 2 21:20:57 2009 @@ -1,23 +1,160 @@ #include "Python.h" +#include "structmember.h" +#if PY_VERSION_HEX < 0x02060000 && !defined(Py_TYPE) +#define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) +#endif +#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) +typedef int Py_ssize_t; +#define PY_SSIZE_T_MAX INT_MAX +#define PY_SSIZE_T_MIN INT_MIN +#define PyInt_FromSsize_t PyInt_FromLong +#define PyInt_AsSsize_t PyInt_AsLong +#endif +#ifndef Py_IS_FINITE +#define Py_IS_FINITE(X) (!Py_IS_INFINITY(X) && !Py_IS_NAN(X)) +#endif + +#ifdef __GNUC__ +#define UNUSED __attribute__((__unused__)) +#else +#define UNUSED +#endif + +#define PyScanner_Check(op) PyObject_TypeCheck(op, &PyScannerType) +#define PyScanner_CheckExact(op) (Py_TYPE(op) == &PyScannerType) +#define PyEncoder_Check(op) PyObject_TypeCheck(op, &PyEncoderType) +#define PyEncoder_CheckExact(op) (Py_TYPE(op) == &PyEncoderType) + +static PyTypeObject PyScannerType; +static PyTypeObject PyEncoderType; + +typedef struct _PyScannerObject { + PyObject_HEAD + PyObject *strict; + PyObject *object_hook; + PyObject *object_pairs_hook; + PyObject *parse_float; + PyObject *parse_int; + PyObject *parse_constant; +} PyScannerObject; + +static PyMemberDef scanner_members[] = { + {"strict", T_OBJECT, offsetof(PyScannerObject, strict), READONLY, "strict"}, + {"object_hook", T_OBJECT, offsetof(PyScannerObject, object_hook), READONLY, "object_hook"}, + {"object_pairs_hook", T_OBJECT, offsetof(PyScannerObject, object_pairs_hook), READONLY}, + {"parse_float", T_OBJECT, offsetof(PyScannerObject, parse_float), READONLY, "parse_float"}, + {"parse_int", T_OBJECT, offsetof(PyScannerObject, parse_int), READONLY, "parse_int"}, + {"parse_constant", T_OBJECT, offsetof(PyScannerObject, parse_constant), READONLY, "parse_constant"}, + {NULL} +}; + +typedef struct _PyEncoderObject { + PyObject_HEAD + PyObject *markers; + PyObject *defaultfn; + PyObject *encoder; + PyObject *indent; + PyObject *key_separator; + PyObject *item_separator; + PyObject *sort_keys; + PyObject *skipkeys; + int fast_encode; + int allow_nan; +} PyEncoderObject; + +static PyMemberDef encoder_members[] = { + {"markers", T_OBJECT, offsetof(PyEncoderObject, markers), READONLY, "markers"}, + {"default", T_OBJECT, offsetof(PyEncoderObject, defaultfn), READONLY, "default"}, + {"encoder", T_OBJECT, offsetof(PyEncoderObject, encoder), READONLY, "encoder"}, + {"indent", T_OBJECT, offsetof(PyEncoderObject, indent), READONLY, "indent"}, + {"key_separator", T_OBJECT, offsetof(PyEncoderObject, key_separator), READONLY, "key_separator"}, + {"item_separator", T_OBJECT, offsetof(PyEncoderObject, item_separator), READONLY, "item_separator"}, + {"sort_keys", T_OBJECT, offsetof(PyEncoderObject, sort_keys), READONLY, "sort_keys"}, + {"skipkeys", T_OBJECT, offsetof(PyEncoderObject, skipkeys), READONLY, "skipkeys"}, + {NULL} +}; + +static PyObject * +ascii_escape_unicode(PyObject *pystr); +static PyObject * +py_encode_basestring_ascii(PyObject* self UNUSED, PyObject *pystr); +void init_json(void); +static PyObject * +scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr); +static PyObject * +_build_rval_index_tuple(PyObject *rval, Py_ssize_t idx); +static PyObject * +scanner_new(PyTypeObject *type, PyObject *args, PyObject *kwds); +static int +scanner_init(PyObject *self, PyObject *args, PyObject *kwds); +static void +scanner_dealloc(PyObject *self); +static int +scanner_clear(PyObject *self); +static PyObject * +encoder_new(PyTypeObject *type, PyObject *args, PyObject *kwds); +static int +encoder_init(PyObject *self, PyObject *args, PyObject *kwds); +static void +encoder_dealloc(PyObject *self); +static int +encoder_clear(PyObject *self); +static int +encoder_listencode_list(PyEncoderObject *s, PyObject *rval, PyObject *seq, Py_ssize_t indent_level); +static int +encoder_listencode_obj(PyEncoderObject *s, PyObject *rval, PyObject *obj, Py_ssize_t indent_level); +static int +encoder_listencode_dict(PyEncoderObject *s, PyObject *rval, PyObject *dct, Py_ssize_t indent_level); +static PyObject * +_encoded_const(PyObject *obj); +static void +raise_errmsg(char *msg, PyObject *s, Py_ssize_t end); +static PyObject * +encoder_encode_string(PyEncoderObject *s, PyObject *obj); +static int +_convertPyInt_AsSsize_t(PyObject *o, Py_ssize_t *size_ptr); +static PyObject * +_convertPyInt_FromSsize_t(Py_ssize_t *size_ptr); +static PyObject * +encoder_encode_float(PyEncoderObject *s, PyObject *obj); -#define DEFAULT_ENCODING "utf-8" #define S_CHAR(c) (c >= ' ' && c <= '~' && c != '\\' && c != '"') -#define MIN_EXPANSION 6 +#define IS_WHITESPACE(c) (((c) == ' ') || ((c) == '\t') || ((c) == '\n') || ((c) == '\r')) +#define MIN_EXPANSION 6 #ifdef Py_UNICODE_WIDE #define MAX_EXPANSION (2 * MIN_EXPANSION) #else #define MAX_EXPANSION MIN_EXPANSION #endif +static int +_convertPyInt_AsSsize_t(PyObject *o, Py_ssize_t *size_ptr) +{ + /* PyObject to Py_ssize_t converter */ + *size_ptr = PyLong_AsSsize_t(o); + if (*size_ptr == -1 && PyErr_Occurred()); + return 1; + return 0; +} + +static PyObject * +_convertPyInt_FromSsize_t(Py_ssize_t *size_ptr) +{ + /* Py_ssize_t to PyObject converter */ + return PyLong_FromSsize_t(*size_ptr); +} + static Py_ssize_t -ascii_escape_char(Py_UNICODE c, char *output, Py_ssize_t chars) +ascii_escape_unichar(Py_UNICODE c, Py_UNICODE *output, Py_ssize_t chars) { - Py_UNICODE x; + /* Escape unicode code point c to ASCII escape sequences + in char *output. output must have at least 12 bytes unused to + accommodate an escaped surrogate pair "\uXXXX\uXXXX" */ output[chars++] = '\\'; switch (c) { - case '\\': output[chars++] = (char)c; break; - case '"': output[chars++] = (char)c; break; + case '\\': output[chars++] = c; break; + case '"': output[chars++] = c; break; case '\b': output[chars++] = 'b'; break; case '\f': output[chars++] = 'f'; break; case '\n': output[chars++] = 'n'; break; @@ -30,27 +167,19 @@ Py_UNICODE v = c - 0x10000; c = 0xd800 | ((v >> 10) & 0x3ff); output[chars++] = 'u'; - x = (c & 0xf000) >> 12; - output[chars++] = (x < 10) ? '0' + x : 'a' + (x - 10); - x = (c & 0x0f00) >> 8; - output[chars++] = (x < 10) ? '0' + x : 'a' + (x - 10); - x = (c & 0x00f0) >> 4; - output[chars++] = (x < 10) ? '0' + x : 'a' + (x - 10); - x = (c & 0x000f); - output[chars++] = (x < 10) ? '0' + x : 'a' + (x - 10); + output[chars++] = "0123456789abcdef"[(c >> 12) & 0xf]; + output[chars++] = "0123456789abcdef"[(c >> 8) & 0xf]; + output[chars++] = "0123456789abcdef"[(c >> 4) & 0xf]; + output[chars++] = "0123456789abcdef"[(c ) & 0xf]; c = 0xdc00 | (v & 0x3ff); output[chars++] = '\\'; } #endif output[chars++] = 'u'; - x = (c & 0xf000) >> 12; - output[chars++] = (x < 10) ? '0' + x : 'a' + (x - 10); - x = (c & 0x0f00) >> 8; - output[chars++] = (x < 10) ? '0' + x : 'a' + (x - 10); - x = (c & 0x00f0) >> 4; - output[chars++] = (x < 10) ? '0' + x : 'a' + (x - 10); - x = (c & 0x000f); - output[chars++] = (x < 10) ? '0' + x : 'a' + (x - 10); + output[chars++] = "0123456789abcdef"[(c >> 12) & 0xf]; + output[chars++] = "0123456789abcdef"[(c >> 8) & 0xf]; + output[chars++] = "0123456789abcdef"[(c >> 4) & 0xf]; + output[chars++] = "0123456789abcdef"[(c ) & 0xf]; } return chars; } @@ -58,118 +187,66 @@ static PyObject * ascii_escape_unicode(PyObject *pystr) { + /* Take a PyUnicode pystr and return a new ASCII-only escaped PyUnicode */ Py_ssize_t i; Py_ssize_t input_chars; Py_ssize_t output_size; + Py_ssize_t max_output_size; Py_ssize_t chars; PyObject *rval; - char *output; + Py_UNICODE *output; Py_UNICODE *input_unicode; input_chars = PyUnicode_GET_SIZE(pystr); input_unicode = PyUnicode_AS_UNICODE(pystr); + /* One char input can be up to 6 chars output, estimate 4 of these */ output_size = 2 + (MIN_EXPANSION * 4) + input_chars; - rval = PyBytes_FromStringAndSize(NULL, output_size); + max_output_size = 2 + (input_chars * MAX_EXPANSION); + rval = PyUnicode_FromStringAndSize(NULL, output_size); if (rval == NULL) { return NULL; } - output = PyBytes_AS_STRING(rval); + output = PyUnicode_AS_UNICODE(rval); chars = 0; output[chars++] = '"'; for (i = 0; i < input_chars; i++) { Py_UNICODE c = input_unicode[i]; if (S_CHAR(c)) { - output[chars++] = (char)c; + output[chars++] = c; } - else { - chars = ascii_escape_char(c, output, chars); + else { + chars = ascii_escape_unichar(c, output, chars); } if (output_size - chars < (1 + MAX_EXPANSION)) { /* There's more than four, so let's resize by a lot */ - output_size *= 2; + Py_ssize_t new_output_size = output_size * 2; /* This is an upper bound */ - if (output_size > 2 + (input_chars * MAX_EXPANSION)) { - output_size = 2 + (input_chars * MAX_EXPANSION); - } - if (_PyBytes_Resize(&rval, output_size) == -1) { - return NULL; - } - output = PyBytes_AS_STRING(rval); - } - } - output[chars++] = '"'; - if (_PyBytes_Resize(&rval, chars) == -1) { - return NULL; - } - return rval; -} - -static PyObject * -ascii_escape_str(PyObject *pystr) -{ - Py_ssize_t i; - Py_ssize_t input_chars; - Py_ssize_t output_size; - Py_ssize_t chars; - PyObject *rval; - char *output; - char *input_str; - - input_chars = PyBytes_GET_SIZE(pystr); - input_str = PyBytes_AS_STRING(pystr); - /* One char input can be up to 6 chars output, estimate 4 of these */ - output_size = 2 + (MIN_EXPANSION * 4) + input_chars; - rval = PyBytes_FromStringAndSize(NULL, output_size); - if (rval == NULL) { - return NULL; - } - output = PyBytes_AS_STRING(rval); - chars = 0; - output[chars++] = '"'; - for (i = 0; i < input_chars; i++) { - Py_UNICODE c = (Py_UNICODE)input_str[i]; - if (S_CHAR(c)) { - output[chars++] = (char)c; - } - else if (c > 0x7F) { - /* We hit a non-ASCII character, bail to unicode mode */ - PyObject *uni; - Py_DECREF(rval); - uni = PyUnicode_DecodeUTF8(input_str, input_chars, "strict"); - if (uni == NULL) { - return NULL; - } - rval = ascii_escape_unicode(uni); - Py_DECREF(uni); - return rval; - } - else { - chars = ascii_escape_char(c, output, chars); - } - /* An ASCII char can't possibly expand to a surrogate! */ - if (output_size - chars < (1 + MIN_EXPANSION)) { - /* There's more than four, so let's resize by a lot */ - output_size *= 2; - if (output_size > 2 + (input_chars * MIN_EXPANSION)) { - output_size = 2 + (input_chars * MIN_EXPANSION); + if (new_output_size > max_output_size) { + new_output_size = max_output_size; } - if (_PyBytes_Resize(&rval, output_size) == -1) { - return NULL; + /* Make sure that the output size changed before resizing */ + if (new_output_size != output_size) { + output_size = new_output_size; + if (PyUnicode_Resize(&rval, output_size) == -1) { + return NULL; + } + output = PyUnicode_AS_UNICODE(rval); } - output = PyBytes_AS_STRING(rval); } } output[chars++] = '"'; - if (_PyBytes_Resize(&rval, chars) == -1) { + if (PyUnicode_Resize(&rval, chars) == -1) { return NULL; } return rval; } -void +static void raise_errmsg(char *msg, PyObject *s, Py_ssize_t end) { + /* Use the Python function json.decoder.errmsg to raise a nice + looking ValueError exception */ static PyObject *errmsg_fn = NULL; PyObject *pymsg; if (errmsg_fn == NULL) { @@ -177,63 +254,73 @@ if (decoder == NULL) return; errmsg_fn = PyObject_GetAttrString(decoder, "errmsg"); + Py_DECREF(decoder); if (errmsg_fn == NULL) return; - Py_DECREF(decoder); } - pymsg = PyObject_CallFunction(errmsg_fn, "(zOn)", msg, s, end); + pymsg = PyObject_CallFunction(errmsg_fn, "(zOO&)", msg, s, _convertPyInt_FromSsize_t, &end); if (pymsg) { PyErr_SetObject(PyExc_ValueError, pymsg); Py_DECREF(pymsg); } -/* - -def linecol(doc, pos): - lineno = doc.count('\n', 0, pos) + 1 - if lineno == 1: - colno = pos - else: - colno = pos - doc.rindex('\n', 0, pos) - return lineno, colno - -def errmsg(msg, doc, pos, end=None): - lineno, colno = linecol(doc, pos) - if end is None: - return '%s: line %d column %d (char %d)' % (msg, lineno, colno, pos) - endlineno, endcolno = linecol(doc, end) - return '%s: line %d column %d - line %d column %d (char %d - %d)' % ( - msg, lineno, colno, endlineno, endcolno, pos, end) - -*/ } static PyObject * join_list_unicode(PyObject *lst) { - static PyObject *ustr = NULL; - static PyObject *joinstr = NULL; - if (ustr == NULL) { - Py_UNICODE c = 0; - ustr = PyUnicode_FromUnicode(&c, 0); + /* return u''.join(lst) */ + static PyObject *sep = NULL; + if (sep == NULL) { + sep = PyUnicode_FromStringAndSize("", 0); + if (sep == NULL) + return NULL; + } + return PyUnicode_Join(sep, lst); +} + +static PyObject * +_build_rval_index_tuple(PyObject *rval, Py_ssize_t idx) { + /* return (rval, idx) tuple, stealing reference to rval */ + PyObject *tpl; + PyObject *pyidx; + /* + steal a reference to rval, returns (rval, idx) + */ + if (rval == NULL) { + return NULL; } - if (joinstr == NULL) { - joinstr = PyUnicode_InternFromString("join"); + pyidx = PyLong_FromSsize_t(idx); + if (pyidx == NULL) { + Py_DECREF(rval); + return NULL; } - if (joinstr == NULL || ustr == NULL) { + tpl = PyTuple_New(2); + if (tpl == NULL) { + Py_DECREF(pyidx); + Py_DECREF(rval); return NULL; } - return PyObject_CallMethodObjArgs(ustr, joinstr, lst, NULL); + PyTuple_SET_ITEM(tpl, 0, rval); + PyTuple_SET_ITEM(tpl, 1, pyidx); + return tpl; } static PyObject * -scanstring_str(PyObject *pystr, Py_ssize_t end, char *encoding, int strict) +scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict, Py_ssize_t *next_end_ptr) { + /* Read the JSON string from PyUnicode pystr. + end is the index of the first character after the quote. + if strict is zero then literal control characters are allowed + *next_end_ptr is a return-by-reference index of the character + after the end quote + + Return value is a new PyUnicode + */ PyObject *rval; - Py_ssize_t len = PyBytes_GET_SIZE(pystr); + Py_ssize_t len = PyUnicode_GET_SIZE(pystr); Py_ssize_t begin = end - 1; Py_ssize_t next = begin; - char *buf = PyBytes_AS_STRING(pystr); - Py_buffer info; + const Py_UNICODE *buf = PyUnicode_AS_UNICODE(pystr); PyObject *chunks = PyList_New(0); if (chunks == NULL) { goto bail; @@ -262,16 +349,7 @@ } /* Pick up this chunk if it's not zero length */ if (next != end) { - PyObject *strchunk; - if (PyBuffer_FillInfo(&info, NULL, &buf[end], next - end, 1, 0) < 0) { - goto bail; - } - strchunk = PyMemoryView_FromBuffer(&info); - if (strchunk == NULL) { - goto bail; - } - chunk = PyUnicode_FromEncodedObject(strchunk, encoding, NULL); - Py_DECREF(strchunk); + chunk = PyUnicode_FromUnicode(&buf[end], next - end); if (chunk == NULL) { goto bail; } @@ -320,18 +398,18 @@ } /* Decode 4 hex digits */ for (; next < end; next++) { - Py_ssize_t shl = (end - next - 1) << 2; Py_UNICODE digit = buf[next]; + c <<= 4; switch (digit) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - c |= (digit - '0') << shl; break; + c |= (digit - '0'); break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': - c |= (digit - 'a' + 10) << shl; break; + c |= (digit - 'a' + 10); break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - c |= (digit - 'A' + 10) << shl; break; + c |= (digit - 'A' + 10); break; default: raise_errmsg("Invalid \\uXXXX escape", pystr, end - 5); goto bail; @@ -339,38 +417,46 @@ } #ifdef Py_UNICODE_WIDE /* Surrogate pair */ - if (c >= 0xd800 && c <= 0xdbff) { + if ((c & 0xfc00) == 0xd800) { Py_UNICODE c2 = 0; if (end + 6 >= len) { - raise_errmsg("Invalid \\uXXXX\\uXXXX surrogate pair", pystr, - end - 5); + raise_errmsg("Unpaired high surrogate", pystr, end - 5); + goto bail; } if (buf[next++] != '\\' || buf[next++] != 'u') { - raise_errmsg("Invalid \\uXXXX\\uXXXX surrogate pair", pystr, - end - 5); + raise_errmsg("Unpaired high surrogate", pystr, end - 5); + goto bail; } end += 6; /* Decode 4 hex digits */ for (; next < end; next++) { - Py_ssize_t shl = (end - next - 1) << 2; + c2 <<= 4; Py_UNICODE digit = buf[next]; switch (digit) { case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': - c2 |= (digit - '0') << shl; break; + c2 |= (digit - '0'); break; case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': - c2 |= (digit - 'a' + 10) << shl; break; + c2 |= (digit - 'a' + 10); break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': - c2 |= (digit - 'A' + 10) << shl; break; + c2 |= (digit - 'A' + 10); break; default: raise_errmsg("Invalid \\uXXXX escape", pystr, end - 5); goto bail; } } + if ((c2 & 0xfc00) != 0xdc00) { + raise_errmsg("Unpaired high surrogate", pystr, end - 5); + goto bail; + } c = 0x10000 + (((c - 0xd800) << 10) | (c2 - 0xdc00)); } + else if ((c & 0xfc00) == 0xdc00) { + raise_errmsg("Unpaired low surrogate", pystr, end - 5); + goto bail; + } #endif } chunk = PyUnicode_FromUnicode(&c, 1); @@ -388,237 +474,1176 @@ if (rval == NULL) { goto bail; } - Py_CLEAR(chunks); - return Py_BuildValue("(Nn)", rval, end); + Py_DECREF(chunks); + *next_end_ptr = end; + return rval; bail: + *next_end_ptr = -1; Py_XDECREF(chunks); return NULL; } +PyDoc_STRVAR(pydoc_scanstring, + "scanstring(basestring, end, strict=True) -> (bytes, end)\n" + "\n" + "Scan the string s for a JSON string. End is the index of the\n" + "character in s after the quote that started the JSON string.\n" + "Unescapes all valid JSON string escape sequences and raises ValueError\n" + "on attempt to decode an invalid string. If strict is False then literal\n" + "control characters are allowed in the string.\n" + "\n" + "Returns a tuple of the decoded string and the index of the character in s\n" + "after the end quote." +); static PyObject * -scanstring_unicode(PyObject *pystr, Py_ssize_t end, int strict) +py_scanstring(PyObject* self UNUSED, PyObject *args) { + PyObject *pystr; PyObject *rval; - Py_ssize_t len = PyUnicode_GET_SIZE(pystr); - Py_ssize_t begin = end - 1; - Py_ssize_t next = begin; - const Py_UNICODE *buf = PyUnicode_AS_UNICODE(pystr); - PyObject *chunks = PyList_New(0); - if (chunks == NULL) { - goto bail; + Py_ssize_t end; + Py_ssize_t next_end = -1; + int strict = 1; + if (!PyArg_ParseTuple(args, "OO&|i:scanstring", &pystr, _convertPyInt_AsSsize_t, &end, &strict)) { + return NULL; } - if (end < 0 || len <= end) { - PyErr_SetString(PyExc_ValueError, "end is out of bounds"); - goto bail; + if (PyUnicode_Check(pystr)) { + rval = scanstring_unicode(pystr, end, strict, &next_end); } - while (1) { - /* Find the end of the string or the next escape */ - Py_UNICODE c = 0; - PyObject *chunk = NULL; - for (next = end; next < len; next++) { - c = buf[next]; - if (c == '"' || c == '\\') { - break; - } - else if (strict && c <= 0x1f) { - raise_errmsg("Invalid control character at", pystr, next); + else { + PyErr_Format(PyExc_TypeError, + "first argument must be a string or bytes, not %.80s", + Py_TYPE(pystr)->tp_name); + return NULL; + } + return _build_rval_index_tuple(rval, next_end); +} + +PyDoc_STRVAR(pydoc_encode_basestring_ascii, + "encode_basestring_ascii(basestring) -> bytes\n" + "\n" + "Return an ASCII-only JSON representation of a Python string" +); + +static PyObject * +py_encode_basestring_ascii(PyObject* self UNUSED, PyObject *pystr) +{ + PyObject *rval; + /* Return an ASCII-only JSON representation of a Python string */ + /* METH_O */ + if (PyUnicode_Check(pystr)) { + rval = ascii_escape_unicode(pystr); + } + else { + PyErr_Format(PyExc_TypeError, + "first argument must be a string, not %.80s", + Py_TYPE(pystr)->tp_name); + return NULL; + } + return rval; +} + +static void +scanner_dealloc(PyObject *self) +{ + /* Deallocate scanner object */ + scanner_clear(self); + Py_TYPE(self)->tp_free(self); +} + +static int +scanner_traverse(PyObject *self, visitproc visit, void *arg) +{ + PyScannerObject *s; + assert(PyScanner_Check(self)); + s = (PyScannerObject *)self; + Py_VISIT(s->strict); + Py_VISIT(s->object_hook); + Py_VISIT(s->object_pairs_hook); + Py_VISIT(s->parse_float); + Py_VISIT(s->parse_int); + Py_VISIT(s->parse_constant); + return 0; +} + +static int +scanner_clear(PyObject *self) +{ + PyScannerObject *s; + assert(PyScanner_Check(self)); + s = (PyScannerObject *)self; + Py_CLEAR(s->strict); + Py_CLEAR(s->object_hook); + Py_CLEAR(s->object_pairs_hook); + Py_CLEAR(s->parse_float); + Py_CLEAR(s->parse_int); + Py_CLEAR(s->parse_constant); + return 0; +} + +static PyObject * +_parse_object_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr) { + /* Read a JSON object from PyUnicode pystr. + idx is the index of the first character after the opening curly brace. + *next_idx_ptr is a return-by-reference index to the first character after + the closing curly brace. + + Returns a new PyObject (usually a dict, but object_hook can change that) + */ + Py_UNICODE *str = PyUnicode_AS_UNICODE(pystr); + Py_ssize_t end_idx = PyUnicode_GET_SIZE(pystr) - 1; + PyObject *val = NULL; + PyObject *rval = PyList_New(0); + PyObject *key = NULL; + int strict = PyObject_IsTrue(s->strict); + Py_ssize_t next_idx; + if (rval == NULL) + return NULL; + + /* skip whitespace after { */ + while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; + + /* only loop if the object is non-empty */ + if (idx <= end_idx && str[idx] != '}') { + while (idx <= end_idx) { + /* read key */ + if (str[idx] != '"') { + raise_errmsg("Expecting property name", pystr, idx); goto bail; } - } - if (!(c == '"' || c == '\\')) { - raise_errmsg("Unterminated string starting at", pystr, begin); - goto bail; - } - /* Pick up this chunk if it's not zero length */ - if (next != end) { - chunk = PyUnicode_FromUnicode(&buf[end], next - end); - if (chunk == NULL) { + key = scanstring_unicode(pystr, idx + 1, strict, &next_idx); + if (key == NULL) + goto bail; + idx = next_idx; + + /* skip whitespace between key and : delimiter, read :, skip whitespace */ + while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; + if (idx > end_idx || str[idx] != ':') { + raise_errmsg("Expecting : delimiter", pystr, idx); goto bail; } - if (PyList_Append(chunks, chunk)) { - Py_DECREF(chunk); + idx++; + while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; + + /* read any JSON term */ + val = scan_once_unicode(s, pystr, idx, &next_idx); + if (val == NULL) goto bail; + + { + PyObject *tuple = PyTuple_Pack(2, key, val); + if (tuple == NULL) + goto bail; + if (PyList_Append(rval, tuple) == -1) { + Py_DECREF(tuple); + goto bail; + } + Py_DECREF(tuple); } - Py_DECREF(chunk); - } - next++; - if (c == '"') { - end = next; - break; - } - if (next == len) { - raise_errmsg("Unterminated string starting at", pystr, begin); - goto bail; - } - c = buf[next]; - if (c != 'u') { - /* Non-unicode backslash escapes */ - end = next + 1; - switch (c) { - case '"': break; - case '\\': break; - case '/': break; - case 'b': c = '\b'; break; - case 'f': c = '\f'; break; - case 'n': c = '\n'; break; - case 'r': c = '\r'; break; - case 't': c = '\t'; break; - default: c = 0; + + Py_CLEAR(key); + Py_CLEAR(val); + idx = next_idx; + + /* skip whitespace before } or , */ + while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; + + /* bail if the object is closed or we didn't get the , delimiter */ + if (idx > end_idx) break; + if (str[idx] == '}') { + break; } - if (c == 0) { - raise_errmsg("Invalid \\escape", pystr, end - 2); + else if (str[idx] != ',') { + raise_errmsg("Expecting , delimiter", pystr, idx); goto bail; } + idx++; + + /* skip whitespace after , delimiter */ + while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; } - else { - c = 0; - next++; - end = next + 4; - if (end >= len) { - raise_errmsg("Invalid \\uXXXX escape", pystr, next - 1); + } + + /* verify that idx < end_idx, str[idx] should be '}' */ + if (idx > end_idx || str[idx] != '}') { + raise_errmsg("Expecting object", pystr, end_idx); + goto bail; + } + + *next_idx_ptr = idx + 1; + + if (s->object_pairs_hook != Py_None) { + val = PyObject_CallFunctionObjArgs(s->object_pairs_hook, rval, NULL); + if (val == NULL) + goto bail; + Py_DECREF(rval); + return val; + } + + val = PyDict_New(); + if (val == NULL) + goto bail; + if (PyDict_MergeFromSeq2(val, rval, 1) == -1) + goto bail; + Py_DECREF(rval); + rval = val; + + /* if object_hook is not None: rval = object_hook(rval) */ + if (s->object_hook != Py_None) { + val = PyObject_CallFunctionObjArgs(s->object_hook, rval, NULL); + if (val == NULL) + goto bail; + Py_DECREF(rval); + rval = val; + val = NULL; + } + return rval; +bail: + Py_XDECREF(key); + Py_XDECREF(val); + Py_DECREF(rval); + return NULL; +} + +static PyObject * +_parse_array_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr) { + /* Read a JSON array from PyString pystr. + idx is the index of the first character after the opening brace. + *next_idx_ptr is a return-by-reference index to the first character after + the closing brace. + + Returns a new PyList + */ + Py_UNICODE *str = PyUnicode_AS_UNICODE(pystr); + Py_ssize_t end_idx = PyUnicode_GET_SIZE(pystr) - 1; + PyObject *val = NULL; + PyObject *rval = PyList_New(0); + Py_ssize_t next_idx; + if (rval == NULL) + return NULL; + + /* skip whitespace after [ */ + while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; + + /* only loop if the array is non-empty */ + if (idx <= end_idx && str[idx] != ']') { + while (idx <= end_idx) { + + /* read any JSON term */ + val = scan_once_unicode(s, pystr, idx, &next_idx); + if (val == NULL) goto bail; + + if (PyList_Append(rval, val) == -1) + goto bail; + + Py_CLEAR(val); + idx = next_idx; + + /* skip whitespace between term and , */ + while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; + + /* bail if the array is closed or we didn't get the , delimiter */ + if (idx > end_idx) break; + if (str[idx] == ']') { + break; } - /* Decode 4 hex digits */ - for (; next < end; next++) { - Py_ssize_t shl = (end - next - 1) << 2; - Py_UNICODE digit = buf[next]; - switch (digit) { - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - c |= (digit - '0') << shl; break; - case 'a': case 'b': case 'c': case 'd': case 'e': - case 'f': - c |= (digit - 'a' + 10) << shl; break; - case 'A': case 'B': case 'C': case 'D': case 'E': - case 'F': - c |= (digit - 'A' + 10) << shl; break; - default: - raise_errmsg("Invalid \\uXXXX escape", pystr, end - 5); - goto bail; - } - } -#ifdef Py_UNICODE_WIDE - /* Surrogate pair */ - if (c >= 0xd800 && c <= 0xdbff) { - Py_UNICODE c2 = 0; - if (end + 6 >= len) { - raise_errmsg("Invalid \\uXXXX\\uXXXX surrogate pair", pystr, - end - 5); - } - if (buf[next++] != '\\' || buf[next++] != 'u') { - raise_errmsg("Invalid \\uXXXX\\uXXXX surrogate pair", pystr, - end - 5); - } - end += 6; - /* Decode 4 hex digits */ - for (; next < end; next++) { - Py_ssize_t shl = (end - next - 1) << 2; - Py_UNICODE digit = buf[next]; - switch (digit) { - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - c2 |= (digit - '0') << shl; break; - case 'a': case 'b': case 'c': case 'd': case 'e': - case 'f': - c2 |= (digit - 'a' + 10) << shl; break; - case 'A': case 'B': case 'C': case 'D': case 'E': - case 'F': - c2 |= (digit - 'A' + 10) << shl; break; - default: - raise_errmsg("Invalid \\uXXXX escape", pystr, end - 5); - goto bail; - } - } - c = 0x10000 + (((c - 0xd800) << 10) | (c2 - 0xdc00)); + else if (str[idx] != ',') { + raise_errmsg("Expecting , delimiter", pystr, idx); + goto bail; } -#endif - } - chunk = PyUnicode_FromUnicode(&c, 1); - if (chunk == NULL) { - goto bail; - } - if (PyList_Append(chunks, chunk)) { - Py_DECREF(chunk); - goto bail; + idx++; + + /* skip whitespace after , */ + while (idx <= end_idx && IS_WHITESPACE(str[idx])) idx++; } - Py_DECREF(chunk); } - rval = join_list_unicode(chunks); - if (rval == NULL) { + /* verify that idx < end_idx, str[idx] should be ']' */ + if (idx > end_idx || str[idx] != ']') { + raise_errmsg("Expecting object", pystr, end_idx); goto bail; } - Py_CLEAR(chunks); - return Py_BuildValue("(Nn)", rval, end); + *next_idx_ptr = idx + 1; + return rval; bail: - Py_XDECREF(chunks); + Py_XDECREF(val); + Py_DECREF(rval); return NULL; } -PyDoc_STRVAR(pydoc_scanstring, -"scanstring(str_or_bytes, end, encoding) -> (bytes, end)\n"); +static PyObject * +_parse_constant(PyScannerObject *s, char *constant, Py_ssize_t idx, Py_ssize_t *next_idx_ptr) { + /* Read a JSON constant from PyString pystr. + constant is the constant string that was found + ("NaN", "Infinity", "-Infinity"). + idx is the index of the first character of the constant + *next_idx_ptr is a return-by-reference index to the first character after + the constant. + + Returns the result of parse_constant + */ + PyObject *cstr; + PyObject *rval; + /* constant is "NaN", "Infinity", or "-Infinity" */ + cstr = PyUnicode_InternFromString(constant); + if (cstr == NULL) + return NULL; + + /* rval = parse_constant(constant) */ + rval = PyObject_CallFunctionObjArgs(s->parse_constant, cstr, NULL); + idx += PyUnicode_GET_SIZE(cstr); + Py_DECREF(cstr); + *next_idx_ptr = idx; + return rval; +} static PyObject * -py_scanstring(PyObject* self, PyObject *args) -{ - PyObject *pystr; - Py_ssize_t end; - char *encoding = NULL; - int strict = 0; - if (!PyArg_ParseTuple(args, "On|zi:scanstring", &pystr, &end, &encoding, &strict)) { +_match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_ssize_t *next_idx_ptr) { + /* Read a JSON number from PyUnicode pystr. + idx is the index of the first character of the number + *next_idx_ptr is a return-by-reference index to the first character after + the number. + + Returns a new PyObject representation of that number: + PyInt, PyLong, or PyFloat. + May return other types if parse_int or parse_float are set + */ + Py_UNICODE *str = PyUnicode_AS_UNICODE(pystr); + Py_ssize_t end_idx = PyUnicode_GET_SIZE(pystr) - 1; + Py_ssize_t idx = start; + int is_float = 0; + PyObject *rval; + PyObject *numstr; + + /* read a sign if it's there, make sure it's not the end of the string */ + if (str[idx] == '-') { + idx++; + if (idx > end_idx) { + PyErr_SetNone(PyExc_StopIteration); + return NULL; + } + } + + /* read as many integer digits as we find as long as it doesn't start with 0 */ + if (str[idx] >= '1' && str[idx] <= '9') { + idx++; + while (idx <= end_idx && str[idx] >= '0' && str[idx] <= '9') idx++; + } + /* if it starts with 0 we only expect one integer digit */ + else if (str[idx] == '0') { + idx++; + } + /* no integer digits, error */ + else { + PyErr_SetNone(PyExc_StopIteration); return NULL; } - if (encoding == NULL) { - encoding = DEFAULT_ENCODING; + + /* if the next char is '.' followed by a digit then read all float digits */ + if (idx < end_idx && str[idx] == '.' && str[idx + 1] >= '0' && str[idx + 1] <= '9') { + is_float = 1; + idx += 2; + while (idx <= end_idx && str[idx] >= '0' && str[idx] <= '9') idx++; + } + + /* if the next char is 'e' or 'E' then maybe read the exponent (or backtrack) */ + if (idx < end_idx && (str[idx] == 'e' || str[idx] == 'E')) { + Py_ssize_t e_start = idx; + idx++; + + /* read an exponent sign if present */ + if (idx < end_idx && (str[idx] == '-' || str[idx] == '+')) idx++; + + /* read all digits */ + while (idx <= end_idx && str[idx] >= '0' && str[idx] <= '9') idx++; + + /* if we got a digit, then parse as float. if not, backtrack */ + if (str[idx - 1] >= '0' && str[idx - 1] <= '9') { + is_float = 1; + } + else { + idx = e_start; + } } - if (PyBytes_Check(pystr)) { - return scanstring_str(pystr, end, encoding, strict); + + /* copy the section we determined to be a number */ + numstr = PyUnicode_FromUnicode(&str[start], idx - start); + if (numstr == NULL) + return NULL; + if (is_float) { + /* parse as a float using a fast path if available, otherwise call user defined method */ + if (s->parse_float != (PyObject *)&PyFloat_Type) { + rval = PyObject_CallFunctionObjArgs(s->parse_float, numstr, NULL); + } + else { + rval = PyFloat_FromString(numstr); + } + } + else { + /* no fast path for unicode -> int, just call */ + rval = PyObject_CallFunctionObjArgs(s->parse_int, numstr, NULL); + } + Py_DECREF(numstr); + *next_idx_ptr = idx; + return rval; +} + +static PyObject * +scan_once_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t idx, Py_ssize_t *next_idx_ptr) +{ + /* Read one JSON term (of any kind) from PyUnicode pystr. + idx is the index of the first character of the term + *next_idx_ptr is a return-by-reference index to the first character after + the number. + + Returns a new PyObject representation of the term. + */ + Py_UNICODE *str = PyUnicode_AS_UNICODE(pystr); + Py_ssize_t length = PyUnicode_GET_SIZE(pystr); + if (idx >= length) { + PyErr_SetNone(PyExc_StopIteration); + return NULL; } - else if (PyUnicode_Check(pystr)) { - return scanstring_unicode(pystr, end, strict); + switch (str[idx]) { + case '"': + /* string */ + return scanstring_unicode(pystr, idx + 1, + PyObject_IsTrue(s->strict), + next_idx_ptr); + case '{': + /* object */ + return _parse_object_unicode(s, pystr, idx + 1, next_idx_ptr); + case '[': + /* array */ + return _parse_array_unicode(s, pystr, idx + 1, next_idx_ptr); + case 'n': + /* null */ + if ((idx + 3 < length) && str[idx + 1] == 'u' && str[idx + 2] == 'l' && str[idx + 3] == 'l') { + Py_INCREF(Py_None); + *next_idx_ptr = idx + 4; + return Py_None; + } + break; + case 't': + /* true */ + if ((idx + 3 < length) && str[idx + 1] == 'r' && str[idx + 2] == 'u' && str[idx + 3] == 'e') { + Py_INCREF(Py_True); + *next_idx_ptr = idx + 4; + return Py_True; + } + break; + case 'f': + /* false */ + if ((idx + 4 < length) && str[idx + 1] == 'a' && str[idx + 2] == 'l' && str[idx + 3] == 's' && str[idx + 4] == 'e') { + Py_INCREF(Py_False); + *next_idx_ptr = idx + 5; + return Py_False; + } + break; + case 'N': + /* NaN */ + if ((idx + 2 < length) && str[idx + 1] == 'a' && str[idx + 2] == 'N') { + return _parse_constant(s, "NaN", idx, next_idx_ptr); + } + break; + case 'I': + /* Infinity */ + if ((idx + 7 < length) && str[idx + 1] == 'n' && str[idx + 2] == 'f' && str[idx + 3] == 'i' && str[idx + 4] == 'n' && str[idx + 5] == 'i' && str[idx + 6] == 't' && str[idx + 7] == 'y') { + return _parse_constant(s, "Infinity", idx, next_idx_ptr); + } + break; + case '-': + /* -Infinity */ + if ((idx + 8 < length) && str[idx + 1] == 'I' && str[idx + 2] == 'n' && str[idx + 3] == 'f' && str[idx + 4] == 'i' && str[idx + 5] == 'n' && str[idx + 6] == 'i' && str[idx + 7] == 't' && str[idx + 8] == 'y') { + return _parse_constant(s, "-Infinity", idx, next_idx_ptr); + } + break; + } + /* Didn't find a string, object, array, or named constant. Look for a number. */ + return _match_number_unicode(s, pystr, idx, next_idx_ptr); +} + +static PyObject * +scanner_call(PyObject *self, PyObject *args, PyObject *kwds) +{ + /* Python callable interface to scan_once_{str,unicode} */ + PyObject *pystr; + PyObject *rval; + Py_ssize_t idx; + Py_ssize_t next_idx = -1; + static char *kwlist[] = {"string", "idx", NULL}; + PyScannerObject *s; + assert(PyScanner_Check(self)); + s = (PyScannerObject *)self; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO&:scan_once", kwlist, &pystr, _convertPyInt_AsSsize_t, &idx)) + return NULL; + + if (PyUnicode_Check(pystr)) { + rval = scan_once_unicode(s, pystr, idx, &next_idx); } else { - PyErr_Format(PyExc_TypeError, - "first argument must be a string or bytes, not %.80s", - Py_TYPE(pystr)->tp_name); + PyErr_Format(PyExc_TypeError, + "first argument must be a string, not %.80s", + Py_TYPE(pystr)->tp_name); return NULL; } + return _build_rval_index_tuple(rval, next_idx); } -PyDoc_STRVAR(pydoc_encode_basestring_ascii, -"encode_basestring_ascii(str_or_bytes) -> bytes\n"); +static PyObject * +scanner_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + PyScannerObject *s; + s = (PyScannerObject *)type->tp_alloc(type, 0); + if (s != NULL) { + s->strict = NULL; + s->object_hook = NULL; + s->object_pairs_hook = NULL; + s->parse_float = NULL; + s->parse_int = NULL; + s->parse_constant = NULL; + } + return (PyObject *)s; +} + +static int +scanner_init(PyObject *self, PyObject *args, PyObject *kwds) +{ + /* Initialize Scanner object */ + PyObject *ctx; + static char *kwlist[] = {"context", NULL}; + PyScannerObject *s; + + assert(PyScanner_Check(self)); + s = (PyScannerObject *)self; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O:make_scanner", kwlist, &ctx)) + return -1; + + /* All of these will fail "gracefully" so we don't need to verify them */ + s->strict = PyObject_GetAttrString(ctx, "strict"); + if (s->strict == NULL) + goto bail; + s->object_hook = PyObject_GetAttrString(ctx, "object_hook"); + if (s->object_hook == NULL) + goto bail; + s->object_pairs_hook = PyObject_GetAttrString(ctx, "object_pairs_hook"); + if (s->object_pairs_hook == NULL) + goto bail; + s->parse_float = PyObject_GetAttrString(ctx, "parse_float"); + if (s->parse_float == NULL) + goto bail; + s->parse_int = PyObject_GetAttrString(ctx, "parse_int"); + if (s->parse_int == NULL) + goto bail; + s->parse_constant = PyObject_GetAttrString(ctx, "parse_constant"); + if (s->parse_constant == NULL) + goto bail; + + return 0; + +bail: + Py_CLEAR(s->strict); + Py_CLEAR(s->object_hook); + Py_CLEAR(s->object_pairs_hook); + Py_CLEAR(s->parse_float); + Py_CLEAR(s->parse_int); + Py_CLEAR(s->parse_constant); + return -1; +} + +PyDoc_STRVAR(scanner_doc, "JSON scanner object"); + +static +PyTypeObject PyScannerType = { + PyVarObject_HEAD_INIT(NULL, 0) + "_json.Scanner", /* tp_name */ + sizeof(PyScannerObject), /* tp_basicsize */ + 0, /* tp_itemsize */ + scanner_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + scanner_call, /* tp_call */ + 0, /* tp_str */ + 0,/* PyObject_GenericGetAttr, */ /* tp_getattro */ + 0,/* PyObject_GenericSetAttr, */ /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */ + scanner_doc, /* tp_doc */ + scanner_traverse, /* tp_traverse */ + scanner_clear, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + scanner_members, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + scanner_init, /* tp_init */ + 0,/* PyType_GenericAlloc, */ /* tp_alloc */ + scanner_new, /* tp_new */ + 0,/* PyObject_GC_Del, */ /* tp_free */ +}; static PyObject * -py_encode_basestring_ascii(PyObject* self, PyObject *pystr) +encoder_new(PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + PyEncoderObject *s; + s = (PyEncoderObject *)type->tp_alloc(type, 0); + if (s != NULL) { + s->markers = NULL; + s->defaultfn = NULL; + s->encoder = NULL; + s->indent = NULL; + s->key_separator = NULL; + s->item_separator = NULL; + s->sort_keys = NULL; + s->skipkeys = NULL; + } + return (PyObject *)s; +} + +static int +encoder_init(PyObject *self, PyObject *args, PyObject *kwds) { + /* initialize Encoder object */ + static char *kwlist[] = {"markers", "default", "encoder", "indent", "key_separator", "item_separator", "sort_keys", "skipkeys", "allow_nan", NULL}; + + PyEncoderObject *s; + PyObject *allow_nan; + + assert(PyEncoder_Check(self)); + s = (PyEncoderObject *)self; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "OOOOOOOOO:make_encoder", kwlist, + &s->markers, &s->defaultfn, &s->encoder, &s->indent, &s->key_separator, &s->item_separator, &s->sort_keys, &s->skipkeys, &allow_nan)) + return -1; + + Py_INCREF(s->markers); + Py_INCREF(s->defaultfn); + Py_INCREF(s->encoder); + Py_INCREF(s->indent); + Py_INCREF(s->key_separator); + Py_INCREF(s->item_separator); + Py_INCREF(s->sort_keys); + Py_INCREF(s->skipkeys); + s->fast_encode = (PyCFunction_Check(s->encoder) && PyCFunction_GetFunction(s->encoder) == (PyCFunction)py_encode_basestring_ascii); + s->allow_nan = PyObject_IsTrue(allow_nan); + return 0; +} + +static PyObject * +encoder_call(PyObject *self, PyObject *args, PyObject *kwds) +{ + /* Python callable interface to encode_listencode_obj */ + static char *kwlist[] = {"obj", "_current_indent_level", NULL}; + PyObject *obj; PyObject *rval; - /* METH_O */ - if (PyBytes_Check(pystr)) { - rval = ascii_escape_str(pystr); + Py_ssize_t indent_level; + PyEncoderObject *s; + assert(PyEncoder_Check(self)); + s = (PyEncoderObject *)self; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO&:_iterencode", kwlist, + &obj, _convertPyInt_AsSsize_t, &indent_level)) + return NULL; + rval = PyList_New(0); + if (rval == NULL) + return NULL; + if (encoder_listencode_obj(s, rval, obj, indent_level)) { + Py_DECREF(rval); + return NULL; } - else if (PyUnicode_Check(pystr)) { - rval = ascii_escape_unicode(pystr); + return rval; +} + +static PyObject * +_encoded_const(PyObject *obj) +{ + /* Return the JSON string representation of None, True, False */ + if (obj == Py_None) { + static PyObject *s_null = NULL; + if (s_null == NULL) { + s_null = PyUnicode_InternFromString("null"); + } + Py_INCREF(s_null); + return s_null; + } + else if (obj == Py_True) { + static PyObject *s_true = NULL; + if (s_true == NULL) { + s_true = PyUnicode_InternFromString("true"); + } + Py_INCREF(s_true); + return s_true; + } + else if (obj == Py_False) { + static PyObject *s_false = NULL; + if (s_false == NULL) { + s_false = PyUnicode_InternFromString("false"); + } + Py_INCREF(s_false); + return s_false; } else { - PyErr_Format(PyExc_TypeError, - "first argument must be a string or unicode, not %.80s", - Py_TYPE(pystr)->tp_name); + PyErr_SetString(PyExc_ValueError, "not a const"); return NULL; } - if (rval != NULL && PyBytes_Check(rval)) { - PyObject *urval = PyUnicode_DecodeASCII(PyBytes_AS_STRING(rval), PyBytes_GET_SIZE(rval), NULL); - Py_DECREF(rval); - return urval; +} + +static PyObject * +encoder_encode_float(PyEncoderObject *s, PyObject *obj) +{ + /* Return the JSON representation of a PyFloat */ + double i = PyFloat_AS_DOUBLE(obj); + if (!Py_IS_FINITE(i)) { + if (!s->allow_nan) { + PyErr_SetString(PyExc_ValueError, "Out of range float values are not JSON compliant"); + return NULL; + } + if (i > 0) { + return PyUnicode_FromString("Infinity"); + } + else if (i < 0) { + return PyUnicode_FromString("-Infinity"); + } + else { + return PyUnicode_FromString("NaN"); + } } + /* Use a better float format here? */ + return PyObject_Repr(obj); +} + +static PyObject * +encoder_encode_string(PyEncoderObject *s, PyObject *obj) +{ + /* Return the JSON representation of a string */ + if (s->fast_encode) + return py_encode_basestring_ascii(NULL, obj); + else + return PyObject_CallFunctionObjArgs(s->encoder, obj, NULL); +} + +static int +_steal_list_append(PyObject *lst, PyObject *stolen) +{ + /* Append stolen and then decrement its reference count */ + int rval = PyList_Append(lst, stolen); + Py_DECREF(stolen); return rval; } -static PyMethodDef json_methods[] = { - {"encode_basestring_ascii", (PyCFunction)py_encode_basestring_ascii, - METH_O, pydoc_encode_basestring_ascii}, - {"scanstring", (PyCFunction)py_scanstring, METH_VARARGS, - pydoc_scanstring}, +static int +encoder_listencode_obj(PyEncoderObject *s, PyObject *rval, PyObject *obj, Py_ssize_t indent_level) +{ + /* Encode Python object obj to a JSON term, rval is a PyList */ + PyObject *newobj; + int rv; + + if (obj == Py_None || obj == Py_True || obj == Py_False) { + PyObject *cstr = _encoded_const(obj); + if (cstr == NULL) + return -1; + return _steal_list_append(rval, cstr); + } + else if (PyUnicode_Check(obj)) + { + PyObject *encoded = encoder_encode_string(s, obj); + if (encoded == NULL) + return -1; + return _steal_list_append(rval, encoded); + } + else if (PyLong_Check(obj)) { + PyObject *encoded = PyObject_Str(obj); + if (encoded == NULL) + return -1; + return _steal_list_append(rval, encoded); + } + else if (PyFloat_Check(obj)) { + PyObject *encoded = encoder_encode_float(s, obj); + if (encoded == NULL) + return -1; + return _steal_list_append(rval, encoded); + } + else if (PyList_Check(obj) || PyTuple_Check(obj)) { + return encoder_listencode_list(s, rval, obj, indent_level); + } + else if (PyDict_Check(obj)) { + return encoder_listencode_dict(s, rval, obj, indent_level); + } + else { + PyObject *ident = NULL; + if (s->markers != Py_None) { + int has_key; + ident = PyLong_FromVoidPtr(obj); + if (ident == NULL) + return -1; + has_key = PyDict_Contains(s->markers, ident); + if (has_key) { + if (has_key != -1) + PyErr_SetString(PyExc_ValueError, "Circular reference detected"); + Py_DECREF(ident); + return -1; + } + if (PyDict_SetItem(s->markers, ident, obj)) { + Py_DECREF(ident); + return -1; + } + } + newobj = PyObject_CallFunctionObjArgs(s->defaultfn, obj, NULL); + if (newobj == NULL) { + Py_XDECREF(ident); + return -1; + } + rv = encoder_listencode_obj(s, rval, newobj, indent_level); + Py_DECREF(newobj); + if (rv) { + Py_XDECREF(ident); + return -1; + } + if (ident != NULL) { + if (PyDict_DelItem(s->markers, ident)) { + Py_XDECREF(ident); + return -1; + } + Py_XDECREF(ident); + } + return rv; + } +} + +static int +encoder_listencode_dict(PyEncoderObject *s, PyObject *rval, PyObject *dct, Py_ssize_t indent_level) +{ + /* Encode Python dict dct a JSON term, rval is a PyList */ + static PyObject *open_dict = NULL; + static PyObject *close_dict = NULL; + static PyObject *empty_dict = NULL; + PyObject *kstr = NULL; + PyObject *ident = NULL; + PyObject *key, *value; + Py_ssize_t pos; + int skipkeys; + Py_ssize_t idx; + + if (open_dict == NULL || close_dict == NULL || empty_dict == NULL) { + open_dict = PyUnicode_InternFromString("{"); + close_dict = PyUnicode_InternFromString("}"); + empty_dict = PyUnicode_InternFromString("{}"); + if (open_dict == NULL || close_dict == NULL || empty_dict == NULL) + return -1; + } + if (PyDict_Size(dct) == 0) + return PyList_Append(rval, empty_dict); + + if (s->markers != Py_None) { + int has_key; + ident = PyLong_FromVoidPtr(dct); + if (ident == NULL) + goto bail; + has_key = PyDict_Contains(s->markers, ident); + if (has_key) { + if (has_key != -1) + PyErr_SetString(PyExc_ValueError, "Circular reference detected"); + goto bail; + } + if (PyDict_SetItem(s->markers, ident, dct)) { + goto bail; + } + } + + if (PyList_Append(rval, open_dict)) + goto bail; + + if (s->indent != Py_None) { + /* TODO: DOES NOT RUN */ + indent_level += 1; + /* + newline_indent = '\n' + (' ' * (_indent * _current_indent_level)) + separator = _item_separator + newline_indent + buf += newline_indent + */ + } + + /* TODO: C speedup not implemented for sort_keys */ + + pos = 0; + skipkeys = PyObject_IsTrue(s->skipkeys); + idx = 0; + while (PyDict_Next(dct, &pos, &key, &value)) { + PyObject *encoded; + + if (PyUnicode_Check(key)) { + Py_INCREF(key); + kstr = key; + } + else if (PyFloat_Check(key)) { + kstr = encoder_encode_float(s, key); + if (kstr == NULL) + goto bail; + } + else if (PyLong_Check(key)) { + kstr = PyObject_Str(key); + if (kstr == NULL) + goto bail; + } + else if (key == Py_True || key == Py_False || key == Py_None) { + kstr = _encoded_const(key); + if (kstr == NULL) + goto bail; + } + else if (skipkeys) { + continue; + } + else { + /* TODO: include repr of key */ + PyErr_SetString(PyExc_ValueError, "keys must be a string"); + goto bail; + } + + if (idx) { + if (PyList_Append(rval, s->item_separator)) + goto bail; + } + + encoded = encoder_encode_string(s, kstr); + Py_CLEAR(kstr); + if (encoded == NULL) + goto bail; + if (PyList_Append(rval, encoded)) { + Py_DECREF(encoded); + goto bail; + } + Py_DECREF(encoded); + if (PyList_Append(rval, s->key_separator)) + goto bail; + if (encoder_listencode_obj(s, rval, value, indent_level)) + goto bail; + idx += 1; + } + if (ident != NULL) { + if (PyDict_DelItem(s->markers, ident)) + goto bail; + Py_CLEAR(ident); + } + if (s->indent != Py_None) { + /* TODO: DOES NOT RUN */ + indent_level -= 1; + /* + yield '\n' + (' ' * (_indent * _current_indent_level)) + */ + } + if (PyList_Append(rval, close_dict)) + goto bail; + return 0; + +bail: + Py_XDECREF(kstr); + Py_XDECREF(ident); + return -1; +} + + +static int +encoder_listencode_list(PyEncoderObject *s, PyObject *rval, PyObject *seq, Py_ssize_t indent_level) +{ + /* Encode Python list seq to a JSON term, rval is a PyList */ + static PyObject *open_array = NULL; + static PyObject *close_array = NULL; + static PyObject *empty_array = NULL; + PyObject *ident = NULL; + PyObject *s_fast = NULL; + Py_ssize_t num_items; + PyObject **seq_items; + Py_ssize_t i; + + if (open_array == NULL || close_array == NULL || empty_array == NULL) { + open_array = PyUnicode_InternFromString("["); + close_array = PyUnicode_InternFromString("]"); + empty_array = PyUnicode_InternFromString("[]"); + if (open_array == NULL || close_array == NULL || empty_array == NULL) + return -1; + } + ident = NULL; + s_fast = PySequence_Fast(seq, "_iterencode_list needs a sequence"); + if (s_fast == NULL) + return -1; + num_items = PySequence_Fast_GET_SIZE(s_fast); + if (num_items == 0) { + Py_DECREF(s_fast); + return PyList_Append(rval, empty_array); + } + + if (s->markers != Py_None) { + int has_key; + ident = PyLong_FromVoidPtr(seq); + if (ident == NULL) + goto bail; + has_key = PyDict_Contains(s->markers, ident); + if (has_key) { + if (has_key != -1) + PyErr_SetString(PyExc_ValueError, "Circular reference detected"); + goto bail; + } + if (PyDict_SetItem(s->markers, ident, seq)) { + goto bail; + } + } + + seq_items = PySequence_Fast_ITEMS(s_fast); + if (PyList_Append(rval, open_array)) + goto bail; + if (s->indent != Py_None) { + /* TODO: DOES NOT RUN */ + indent_level += 1; + /* + newline_indent = '\n' + (' ' * (_indent * _current_indent_level)) + separator = _item_separator + newline_indent + buf += newline_indent + */ + } + for (i = 0; i < num_items; i++) { + PyObject *obj = seq_items[i]; + if (i) { + if (PyList_Append(rval, s->item_separator)) + goto bail; + } + if (encoder_listencode_obj(s, rval, obj, indent_level)) + goto bail; + } + if (ident != NULL) { + if (PyDict_DelItem(s->markers, ident)) + goto bail; + Py_CLEAR(ident); + } + if (s->indent != Py_None) { + /* TODO: DOES NOT RUN */ + indent_level -= 1; + /* + yield '\n' + (' ' * (_indent * _current_indent_level)) + */ + } + if (PyList_Append(rval, close_array)) + goto bail; + Py_DECREF(s_fast); + return 0; + +bail: + Py_XDECREF(ident); + Py_DECREF(s_fast); + return -1; +} + +static void +encoder_dealloc(PyObject *self) +{ + /* Deallocate Encoder */ + encoder_clear(self); + Py_TYPE(self)->tp_free(self); +} + +static int +encoder_traverse(PyObject *self, visitproc visit, void *arg) +{ + PyEncoderObject *s; + assert(PyEncoder_Check(self)); + s = (PyEncoderObject *)self; + Py_VISIT(s->markers); + Py_VISIT(s->defaultfn); + Py_VISIT(s->encoder); + Py_VISIT(s->indent); + Py_VISIT(s->key_separator); + Py_VISIT(s->item_separator); + Py_VISIT(s->sort_keys); + Py_VISIT(s->skipkeys); + return 0; +} + +static int +encoder_clear(PyObject *self) +{ + /* Deallocate Encoder */ + PyEncoderObject *s; + assert(PyEncoder_Check(self)); + s = (PyEncoderObject *)self; + Py_CLEAR(s->markers); + Py_CLEAR(s->defaultfn); + Py_CLEAR(s->encoder); + Py_CLEAR(s->indent); + Py_CLEAR(s->key_separator); + Py_CLEAR(s->item_separator); + Py_CLEAR(s->sort_keys); + Py_CLEAR(s->skipkeys); + return 0; +} + +PyDoc_STRVAR(encoder_doc, "_iterencode(obj, _current_indent_level) -> iterable"); + +static +PyTypeObject PyEncoderType = { + PyVarObject_HEAD_INIT(NULL, 0) + "_json.Encoder", /* tp_name */ + sizeof(PyEncoderObject), /* tp_basicsize */ + 0, /* tp_itemsize */ + encoder_dealloc, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + encoder_call, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags */ + encoder_doc, /* tp_doc */ + encoder_traverse, /* tp_traverse */ + encoder_clear, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + encoder_members, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + encoder_init, /* tp_init */ + 0, /* tp_alloc */ + encoder_new, /* tp_new */ + 0, /* tp_free */ +}; + +static PyMethodDef speedups_methods[] = { + {"encode_basestring_ascii", + (PyCFunction)py_encode_basestring_ascii, + METH_O, + pydoc_encode_basestring_ascii}, + {"scanstring", + (PyCFunction)py_scanstring, + METH_VARARGS, + pydoc_scanstring}, {NULL, NULL, 0, NULL} }; @@ -630,7 +1655,7 @@ "_json", module_doc, -1, - json_methods, + speedups_methods, NULL, NULL, NULL, @@ -640,5 +1665,27 @@ PyObject* PyInit__json(void) { - return PyModule_Create(&jsonmodule); + PyObject *m = PyModule_Create(&jsonmodule); + if (!m) + return NULL; + PyScannerType.tp_new = PyType_GenericNew; + if (PyType_Ready(&PyScannerType) < 0) + goto fail; + PyEncoderType.tp_new = PyType_GenericNew; + if (PyType_Ready(&PyEncoderType) < 0) + goto fail; + Py_INCREF((PyObject*)&PyScannerType); + if (PyModule_AddObject(m, "make_scanner", (PyObject*)&PyScannerType) < 0) { + Py_DECREF((PyObject*)&PyScannerType); + goto fail; + } + Py_INCREF((PyObject*)&PyEncoderType); + if (PyModule_AddObject(m, "make_encoder", (PyObject*)&PyEncoderType) < 0) { + Py_DECREF((PyObject*)&PyEncoderType); + goto fail; + } + return m; + fail: + Py_DECREF(m); + return NULL; } Modified: python/branches/pep-0383/Modules/ld_so_aix ============================================================================== --- python/branches/pep-0383/Modules/ld_so_aix (original) +++ python/branches/pep-0383/Modules/ld_so_aix Sat May 2 21:20:57 2009 @@ -181,7 +181,10 @@ # Perform the link. #echo $CC $CCOPT $CCARGS $CC $CCOPT $CCARGS +retval=$? # Delete the module's export list file. # Comment this line if you need it. rm -f $expfile + +exit $retval Modified: python/branches/pep-0383/Objects/longobject.c ============================================================================== --- python/branches/pep-0383/Objects/longobject.c (original) +++ python/branches/pep-0383/Objects/longobject.c Sat May 2 21:20:57 2009 @@ -3832,8 +3832,13 @@ } static PyObject * -long_getN(PyLongObject *v, void *context) { - return PyLong_FromLong((Py_intptr_t)context); +long_get0(PyLongObject *v, void *context) { + return PyLong_FromLong(0L); +} + +static PyObject * +long_get1(PyLongObject *v, void *context) { + return PyLong_FromLong(1L); } static PyObject * @@ -4091,22 +4096,22 @@ }; static PyGetSetDef long_getset[] = { - {"real", + {"real", (getter)long_long, (setter)NULL, "the real part of a complex number", NULL}, - {"imag", - (getter)long_getN, (setter)NULL, + {"imag", + (getter)long_get0, (setter)NULL, "the imaginary part of a complex number", - (void*)0}, - {"numerator", + NULL}, + {"numerator", (getter)long_long, (setter)NULL, "the numerator of a rational number in lowest terms", NULL}, - {"denominator", - (getter)long_getN, (setter)NULL, + {"denominator", + (getter)long_get1, (setter)NULL, "the denominator of a rational number in lowest terms", - (void*)1}, + NULL}, {NULL} /* Sentinel */ }; Modified: python/branches/pep-0383/Objects/stringlib/formatter.h ============================================================================== --- python/branches/pep-0383/Objects/stringlib/formatter.h (original) +++ python/branches/pep-0383/Objects/stringlib/formatter.h Sat May 2 21:20:57 2009 @@ -934,8 +934,12 @@ if (precision < 0) precision = 6; + +#if PY_VERSION_HEX < 0x03010000 + /* 3.1 no longer converts large 'f' to 'g'. */ if ((type == 'f' || type == 'F') && fabs(val) >= 1e50) type = 'g'; +#endif /* Cast "type", because if we're in unicode we need to pass a 8-bit char. This is safe, because we've restricted what "type" Modified: python/branches/pep-0383/Objects/stringlib/string_format.h ============================================================================== --- python/branches/pep-0383/Objects/stringlib/string_format.h (original) +++ python/branches/pep-0383/Objects/stringlib/string_format.h Sat May 2 21:20:57 2009 @@ -34,7 +34,7 @@ typedef enum { ANS_INIT, ANS_AUTO, - ANS_MANUAL, + ANS_MANUAL } AutoNumberState; /* Keep track if we're auto-numbering fields */ /* Keeps track of our auto-numbering state, and which number field we're on */ Modified: python/branches/pep-0383/Objects/unicodeobject.c ============================================================================== --- python/branches/pep-0383/Objects/unicodeobject.c (original) +++ python/branches/pep-0383/Objects/unicodeobject.c Sat May 2 21:20:57 2009 @@ -8900,73 +8900,27 @@ return NULL; } -static void -strtounicode(Py_UNICODE *buffer, const char *charbuffer, Py_ssize_t len) -{ - register Py_ssize_t i; - for (i = len - 1; i >= 0; i--) - buffer[i] = (Py_UNICODE) charbuffer[i]; -} +/* Returns a new reference to a PyUnicode object, or NULL on failure. */ -static int -formatfloat(Py_UNICODE *buf, - size_t buflen, - int flags, - int prec, - int type, - PyObject *v) -{ - /* eric.smith: To minimize disturbances in PyUnicode_Format (the - only caller of this routine), I'm going to keep the existing - API to this function. That means that we'll allocate memory and - then copy back into the supplied buffer. But that's better than - all of the changes that would be required in PyUnicode_Format - because it does lots of memory management tricks. */ - - char* p = NULL; - int result = -1; +static PyObject * +formatfloat(PyObject *v, int flags, int prec, int type) +{ + char *p; + PyObject *result; double x; - Py_ssize_t len; x = PyFloat_AsDouble(v); if (x == -1.0 && PyErr_Occurred()) - goto done; + return NULL; + if (prec < 0) prec = 6; - /* make sure that the decimal representation of precision really does - need at most 10 digits: platforms with sizeof(int) == 8 exist! */ - if (prec > 0x7fffffffL) { - PyErr_SetString(PyExc_OverflowError, - "outrageously large precision " - "for formatted float"); - goto done; - } - - if (type == 'f' && fabs(x) >= 1e50) - type = 'g'; - - if (((type == 'g' || type == 'G') && - buflen <= (size_t)10 + (size_t)prec) || - ((type == 'f' || type == 'F') && - buflen <= (size_t)53 + (size_t)prec)) { - PyErr_SetString(PyExc_OverflowError, - "formatted float is too long (precision too large?)"); - goto done; - } - p = PyOS_double_to_string(x, type, prec, (flags & F_ALT) ? Py_DTSF_ALT : 0, NULL); - len = strlen(p); - if (len+1 >= buflen) { - /* Caller supplied buffer is not large enough. */ - PyErr_NoMemory(); - goto done; - } - strtounicode(buf, p, len); - result = Py_SAFE_DOWNCAST(len, Py_ssize_t, int); - -done: + if (p == NULL) + return NULL; + result = PyUnicode_FromStringAndSize(p, strlen(p)); PyMem_Free(p); return result; } @@ -9048,14 +9002,9 @@ } /* fmt%(v1,v2,...) is roughly equivalent to sprintf(fmt, v1, v2, ...) - - FORMATBUFLEN is the length of the buffer in which the floats, ints, & - chars are formatted. XXX This is a magic number. Each formatting - routine does bounds checking to ensure no overflow, but a better - solution may be to malloc a buffer of appropriate size for each - format. For now, the current solution is sufficient. + FORMATBUFLEN is the length of the buffer in which chars are formatted. */ -#define FORMATBUFLEN (size_t)120 +#define FORMATBUFLEN (size_t)10 PyObject *PyUnicode_Format(PyObject *format, PyObject *args) @@ -9120,7 +9069,7 @@ Py_UNICODE *pbuf; Py_UNICODE sign; Py_ssize_t len; - Py_UNICODE formatbuf[FORMATBUFLEN]; /* For format{float,int,char}() */ + Py_UNICODE formatbuf[FORMATBUFLEN]; /* For formatchar() */ fmt++; if (*fmt == '(') { @@ -9365,11 +9314,11 @@ case 'F': case 'g': case 'G': - pbuf = formatbuf; - len = formatfloat(pbuf, sizeof(formatbuf)/sizeof(Py_UNICODE), - flags, prec, c, v); - if (len < 0) + temp = formatfloat(v, flags, prec, c); + if (!temp) goto onError; + pbuf = PyUnicode_AS_UNICODE(temp); + len = PyUnicode_GET_SIZE(temp); sign = 1; if (flags & F_ZERO) fill = '0'; Modified: python/branches/pep-0383/PC/msvcrtmodule.c ============================================================================== --- python/branches/pep-0383/PC/msvcrtmodule.c (original) +++ python/branches/pep-0383/PC/msvcrtmodule.c Sat May 2 21:20:57 2009 @@ -220,18 +220,12 @@ static PyObject * msvcrt_putwch(PyObject *self, PyObject *args) { - Py_UNICODE *ch; - int size; + int ch; - if (!PyArg_ParseTuple(args, "u#:putwch", &ch, &size)) + if (!PyArg_ParseTuple(args, "C:putwch", &ch)) return NULL; - if (size == 0) { - PyErr_SetString(PyExc_ValueError, - "Expected unicode string of length 1"); - return NULL; - } - _putwch(*ch); + _putwch(ch); Py_RETURN_NONE; } @@ -255,12 +249,12 @@ static PyObject * msvcrt_ungetwch(PyObject *self, PyObject *args) { - Py_UNICODE ch; + int ch; - if (!PyArg_ParseTuple(args, "u:ungetwch", &ch)) + if (!PyArg_ParseTuple(args, "C:ungetwch", &ch)) return NULL; - if (_ungetch(ch) == EOF) + if (_ungetwch(ch) == WEOF) return PyErr_SetFromErrno(PyExc_IOError); Py_INCREF(Py_None); return Py_None; Modified: python/branches/pep-0383/Python/pystrtod.c ============================================================================== --- python/branches/pep-0383/Python/pystrtod.c (original) +++ python/branches/pep-0383/Python/pystrtod.c Sat May 2 21:20:57 2009 @@ -620,12 +620,10 @@ int flags, int *type) { - char buf[128]; char format[32]; - Py_ssize_t len; - char *result; - char *p; - int t; + Py_ssize_t bufsize; + char *buf; + int t, exp; int upper = 0; /* Validate format_code, and map upper and lower case */ @@ -669,6 +667,61 @@ return NULL; } + /* Here's a quick-and-dirty calculation to figure out how big a buffer + we need. In general, for a finite float we need: + + 1 byte for each digit of the decimal significand, and + + 1 for a possible sign + 1 for a possible decimal point + 2 for a possible [eE][+-] + 1 for each digit of the exponent; if we allow 19 digits + total then we're safe up to exponents of 2**63. + 1 for the trailing nul byte + + This gives a total of 24 + the number of digits in the significand, + and the number of digits in the significand is: + + for 'g' format: at most precision, except possibly + when precision == 0, when it's 1. + for 'e' format: precision+1 + for 'f' format: precision digits after the point, at least 1 + before. To figure out how many digits appear before the point + we have to examine the size of the number. If fabs(val) < 1.0 + then there will be only one digit before the point. If + fabs(val) >= 1.0, then there are at most + + 1+floor(log10(ceiling(fabs(val)))) + + digits before the point (where the 'ceiling' allows for the + possibility that the rounding rounds the integer part of val + up). A safe upper bound for the above quantity is + 1+floor(exp/3), where exp is the unique integer such that 0.5 + <= fabs(val)/2**exp < 1.0. This exp can be obtained from + frexp. + + So we allow room for precision+1 digits for all formats, plus an + extra floor(exp/3) digits for 'f' format. + + */ + + if (Py_IS_NAN(val) || Py_IS_INFINITY(val)) + /* 3 for 'inf'/'nan', 1 for sign, 1 for '\0' */ + bufsize = 5; + else { + bufsize = 25 + precision; + if (format_code == 'f' && fabs(val) >= 1.0) { + frexp(val, &exp); + bufsize += exp/3; + } + } + + buf = PyMem_Malloc(bufsize); + if (buf == NULL) { + PyErr_NoMemory(); + return NULL; + } + /* Handle nan and inf. */ if (Py_IS_NAN(val)) { strcpy(buf, "nan"); @@ -687,38 +740,29 @@ PyOS_snprintf(format, sizeof(format), "%%%s.%i%c", (flags & Py_DTSF_ALT ? "#" : ""), precision, format_code); - _PyOS_ascii_formatd(buf, sizeof(buf), format, val, precision); + _PyOS_ascii_formatd(buf, bufsize, format, val, precision); } - len = strlen(buf); - - /* Add 1 for the trailing 0 byte. - Add 1 because we might need to make room for the sign. - */ - result = PyMem_Malloc(len + 2); - if (result == NULL) { - PyErr_NoMemory(); - return NULL; - } - p = result; - /* Add sign when requested. It's convenient (esp. when formatting complex numbers) to include a sign even for inf and nan. */ - if (flags & Py_DTSF_SIGN && buf[0] != '-') - *p++ = '+'; - - strcpy(p, buf); - + if (flags & Py_DTSF_SIGN && buf[0] != '-') { + size_t len = strlen(buf); + /* the bufsize calculations above should ensure that we've got + space to add a sign */ + assert((size_t)bufsize >= len+2); + memmove(buf+1, buf, len+1); + buf[0] = '+'; + } if (upper) { /* Convert to upper case. */ char *p1; - for (p1 = p; *p1; p1++) + for (p1 = buf; *p1; p1++) *p1 = Py_TOUPPER(*p1); } if (type) *type = t; - return result; + return buf; } #else From python-checkins at python.org Sat May 2 21:22:34 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 2 May 2009 21:22:34 +0200 (CEST) Subject: [Python-checkins] r72215 - in python/branches/pep-0383: Misc/NEWS Message-ID: <20090502192234.BF1191E4025@bag.python.org> Author: martin.v.loewis Date: Sat May 2 21:22:34 2009 New Revision: 72215 Log: Merged revisions 72208 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r72208 | martin.v.loewis | 2009-05-02 20:52:14 +0200 (Sa, 02 Mai 2009) | 3 lines Issue #3672: Reject surrogates in utf-8 codec; add surrogates error handler. ........ Modified: python/branches/pep-0383/ (props changed) python/branches/pep-0383/Misc/NEWS Modified: python/branches/pep-0383/Misc/NEWS ============================================================================== --- python/branches/pep-0383/Misc/NEWS (original) +++ python/branches/pep-0383/Misc/NEWS Sat May 2 21:22:34 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #3672: Reject surrogates in utf-8 codec; add surrogates error handler. + - Issue #5883: In the io module, the BufferedIOBase and TextIOBase ABCs have received a new method, detach(). detach() disconnects the underlying stream from the buffer or text IO and returns it. From python-checkins at python.org Sat May 2 21:23:55 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 2 May 2009 21:23:55 +0200 (CEST) Subject: [Python-checkins] r72216 - in python/branches/pep-0383: Lib/test/test_ipaddr.py Message-ID: <20090502192355.DFC351E4025@bag.python.org> Author: martin.v.loewis Date: Sat May 2 21:23:55 2009 New Revision: 72216 Log: Merged revisions 72211-72212 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72211 | gregory.p.smith | 2009-05-02 21:01:54 +0200 (Sa, 02 Mai 2009) | 9 lines Merged revisions 72210 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72210 | gregory.p.smith | 2009-05-02 11:58:21 -0700 (Sat, 02 May 2009) | 2 lines Convert test method names to PEP8 style. ........ ................ r72212 | benjamin.peterson | 2009-05-02 21:15:23 +0200 (Sa, 02 Mai 2009) | 22 lines Blocked revisions 71780,71961,72117,72155 via svnmerge ........ r71780 | senthil.kumaran | 2009-04-20 22:24:19 -0500 (Mon, 20 Apr 2009) | 3 lines Fix for the Issue918368 - urllib doesn't correct server returned urls ........ r71961 | georg.brandl | 2009-04-26 04:57:29 -0500 (Sun, 26 Apr 2009) | 2 lines Update pydoc topics. ........ r72117 | benjamin.peterson | 2009-04-29 15:36:25 -0500 (Wed, 29 Apr 2009) | 1 line run autoconf ........ r72155 | senthil.kumaran | 2009-05-01 00:59:52 -0500 (Fri, 01 May 2009) | 4 lines Fix for Issue1648102, based on the MSDN spec: If this parameter specifies the "" macro as the only entry, this function bypasses any host name that does not contain a period. ........ ................ Modified: python/branches/pep-0383/ (props changed) python/branches/pep-0383/Lib/test/test_ipaddr.py Modified: python/branches/pep-0383/Lib/test/test_ipaddr.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_ipaddr.py (original) +++ python/branches/pep-0383/Lib/test/test_ipaddr.py Sat May 2 21:23:55 2009 @@ -22,6 +22,7 @@ import ipaddr + class IpaddrUnitTest(unittest.TestCase): def setUp(self): @@ -29,11 +30,11 @@ self.ipv4_hostmask = ipaddr.IPv4('10.0.0.1/0.255.255.255') self.ipv6 = ipaddr.IPv6('2001:658:22a:cafe:200:0:0:1/64') - def testRepr(self): + def test_repr(self): self.assertEqual("IPv4('1.2.3.4/32')", repr(ipaddr.IPv4('1.2.3.4'))) self.assertEqual("IPv6('::1/128')", repr(ipaddr.IPv6('::1'))) - def testInvalidStrings(self): + def test_invalid_strings(self): self.assertRaises(ValueError, ipaddr.IP, '') self.assertRaises(ValueError, ipaddr.IP, 'www.google.com') self.assertRaises(ValueError, ipaddr.IP, '1.2.3') @@ -64,7 +65,7 @@ self.assertRaises(ipaddr.IPv6IpValidationError, ipaddr.IPv6, '1.2.3.4') - def testGetNetwork(self): + def test_get_network(self): self.assertEqual(self.ipv4.network, 16909056) self.assertEqual(self.ipv4.network_ext, '1.2.3.0') self.assertEqual(self.ipv4_hostmask.network_ext, '10.0.0.0') @@ -76,7 +77,7 @@ self.assertEqual(self.ipv6.hostmask_ext, '::ffff:ffff:ffff:ffff') - def testIpFromInt(self): + def test_ip_from_int(self): self.assertEqual(self.ipv4.ip, ipaddr.IPv4(16909060).ip) self.assertRaises(ipaddr.IPv4IpValidationError, ipaddr.IPv4, 2**32) @@ -93,7 +94,7 @@ self.assertEqual(ipaddr.IP(self.ipv4.ip).version, 4) self.assertEqual(ipaddr.IP(self.ipv6.ip).version, 6) - def testIpFromPacked(self): + def test_ip_from_packed(self): ip = ipaddr.IP self.assertEqual(self.ipv4.ip, @@ -113,7 +114,7 @@ self.assertRaises(ValueError, ip, b'\x00' * 15) self.assertRaises(ValueError, ip, b'\x00' * 17) - def testGetIp(self): + def test_get_ip(self): self.assertEqual(self.ipv4.ip, 16909060) self.assertEqual(self.ipv4.ip_ext, '1.2.3.4') self.assertEqual(self.ipv4.ip_ext_full, '1.2.3.4') @@ -125,7 +126,7 @@ self.assertEqual(self.ipv6.ip_ext_full, '2001:0658:022a:cafe:0200:0000:0000:0001') - def testGetNetmask(self): + def test_get_netmask(self): self.assertEqual(self.ipv4.netmask, 4294967040) self.assertEqual(self.ipv4.netmask_ext, '255.255.255.0') self.assertEqual(self.ipv4_hostmask.netmask_ext, '255.0.0.0') @@ -133,7 +134,7 @@ 340282366920938463444927863358058659840) self.assertEqual(self.ipv6.netmask_ext, 64) - def testZeroNetmask(self): + def test_zero_netmask(self): ipv4_zero_netmask = ipaddr.IPv4('1.2.3.4/0') self.assertEqual(ipv4_zero_netmask.netmask, 0) self.assert_(ipv4_zero_netmask._is_valid_netmask(str(0))) @@ -142,7 +143,7 @@ self.assertEqual(ipv6_zero_netmask.netmask, 0) self.assert_(ipv6_zero_netmask._is_valid_netmask(str(0))) - def testGetBroadcast(self): + def test_get_broadcast(self): self.assertEqual(self.ipv4.broadcast, 16909311) self.assertEqual(self.ipv4.broadcast_ext, '1.2.3.255') @@ -151,12 +152,12 @@ self.assertEqual(self.ipv6.broadcast_ext, '2001:658:22a:cafe:ffff:ffff:ffff:ffff') - def testGetPrefixlen(self): + def test_get_prefixlen(self): self.assertEqual(self.ipv4.prefixlen, 24) self.assertEqual(self.ipv6.prefixlen, 64) - def testGetSupernet(self): + def test_get_supernet(self): self.assertEqual(self.ipv4.supernet().prefixlen, 23) self.assertEqual(self.ipv4.supernet().network_ext, '1.2.2.0') self.assertEqual(ipaddr.IPv4('0.0.0.0/0').supernet(), @@ -167,7 +168,7 @@ '2001:658:22a:cafe::') self.assertEqual(ipaddr.IPv6('::0/0').supernet(), ipaddr.IPv6('::0/0')) - def testGetSupernet3(self): + def test_get_supernet3(self): self.assertEqual(self.ipv4.supernet(3).prefixlen, 21) self.assertEqual(self.ipv4.supernet(3).network_ext, '1.2.0.0') @@ -175,28 +176,28 @@ self.assertEqual(self.ipv6.supernet(3).network_ext, '2001:658:22a:caf8::') - def testGetSubnet(self): + def test_get_subnet(self): self.assertEqual(self.ipv4.subnet()[0].prefixlen, 25) self.assertEqual(self.ipv4.subnet()[0].network_ext, '1.2.3.0') self.assertEqual(self.ipv4.subnet()[1].network_ext, '1.2.3.128') self.assertEqual(self.ipv6.subnet()[0].prefixlen, 65) - def testGetSubnetForSingle32(self): + def test_get_subnet_for_single32(self): ip = ipaddr.IPv4('1.2.3.4/32') subnets1 = [str(x) for x in ip.subnet()] subnets2 = [str(x) for x in ip.subnet(2)] self.assertEqual(subnets1, ['1.2.3.4/32']) self.assertEqual(subnets1, subnets2) - def testGetSubnetForSingle128(self): + def test_get_subnet_for_single128(self): ip = ipaddr.IPv6('::1/128') subnets1 = [str(x) for x in ip.subnet()] subnets2 = [str(x) for x in ip.subnet(2)] self.assertEqual(subnets1, ['::1/128']) self.assertEqual(subnets1, subnets2) - def testSubnet2(self): + def test_subnet2(self): ips = [str(x) for x in self.ipv4.subnet(2)] self.assertEqual( ips, @@ -210,24 +211,24 @@ '2001:658:22a:cafe:8000::/66', '2001:658:22a:cafe:c000::/66']) - def testSubnetFailsForLargeCidrDiff(self): + def test_subnet_fails_for_large_cidr_diff(self): self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv4.subnet, 9) self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv6.subnet, 65) - def testSupernetFailsForLargeCidrDiff(self): + def test_supernet_fails_for_large_cidr_diff(self): self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv4.supernet, 25) self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv6.supernet, 65) - def testSubnetFailsForNegativeCidrDiff(self): + def test_subnet_fails_for_negative_cidr_diff(self): self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv4.subnet, -1) self.assertRaises(ipaddr.PrefixlenDiffInvalidError, self.ipv6.subnet, -1) - def testGetNumHosts(self): + def test_get_num_hosts(self): self.assertEqual(self.ipv4.numhosts, 256) self.assertEqual(self.ipv4.subnet()[0].numhosts, 128) self.assertEqual(self.ipv4.supernet().numhosts, 512) @@ -236,7 +237,7 @@ self.assertEqual(self.ipv6.subnet()[0].numhosts, 9223372036854775808) self.assertEqual(self.ipv6.supernet().numhosts, 36893488147419103232) - def testContains(self): + def test_contains(self): self.assertTrue(ipaddr.IPv4('1.2.3.128/25') in self.ipv4) self.assertFalse(ipaddr.IPv4('1.2.4.1/24') in self.ipv4) self.assertFalse(self.ipv4 in self.ipv6) @@ -244,7 +245,7 @@ self.assertTrue(self.ipv4 in self.ipv4) self.assertTrue(self.ipv6 in self.ipv6) - def testBadAddress(self): + def test_bad_address(self): self.assertRaises(ipaddr.IPv4IpValidationError, ipaddr.IPv4, 'poop') self.assertRaises(ipaddr.IPv4IpValidationError, ipaddr.IPv4, '1.2.3.256') @@ -253,7 +254,7 @@ self.assertRaises(ipaddr.IPv4IpValidationError, ipaddr.IPv4, '1.2.3.4/32/24') - def testBadNetMask(self): + def test_bad_net_mask(self): self.assertRaises(ipaddr.IPv4NetmaskValidationError, ipaddr.IPv4, '1.2.3.4/') self.assertRaises(ipaddr.IPv4NetmaskValidationError, @@ -266,14 +267,14 @@ self.assertRaises(ipaddr.IPv6NetmaskValidationError, ipaddr.IPv6, '::1/129') - def testNth(self): + def test_nth(self): self.assertEqual(self.ipv4[5], '1.2.3.5') self.assertRaises(IndexError, self.ipv4.__getitem__, 256) self.assertEqual(self.ipv6[5], '2001:658:22a:cafe::5') - def testEquals(self): + def test_equals(self): self.assertTrue(self.ipv4 == ipaddr.IPv4('1.2.3.4/24')) self.assertFalse(self.ipv4 == ipaddr.IPv4('1.2.3.4/23')) self.assertFalse(self.ipv4 == ipaddr.IPv4('1.2.3.5/24')) @@ -293,7 +294,7 @@ self.assertFalse(self.ipv6 == []) self.assertFalse(self.ipv6 == 2) - def testNotEquals(self): + def test_not_equals(self): self.assertFalse(self.ipv4 != ipaddr.IPv4('1.2.3.4/24')) self.assertTrue(self.ipv4 != ipaddr.IPv4('1.2.3.4/23')) self.assertTrue(self.ipv4 != ipaddr.IPv4('1.2.3.5/24')) @@ -313,18 +314,18 @@ self.assertTrue(self.ipv6 != []) self.assertTrue(self.ipv6 != 2) - def testSlash32Constructor(self): + def test_slash32_constructor(self): self.assertEquals(str(ipaddr.IPv4('1.2.3.4/255.255.255.255')), '1.2.3.4/32') - def testSlash128Constructor(self): + def test_slash128_constructor(self): self.assertEquals(str(ipaddr.IPv6('::1/128')), '::1/128') - def testSlash0Constructor(self): + def test_slash0_constructor(self): self.assertEquals(str(ipaddr.IPv4('1.2.3.4/0.0.0.0')), '1.2.3.4/0') - def testCollapsing(self): + def test_collapsing(self): ip1 = ipaddr.IPv4('1.1.0.0/24') ip2 = ipaddr.IPv4('1.1.1.0/24') ip3 = ipaddr.IPv4('1.1.2.0/24') @@ -350,7 +351,7 @@ collapsed = ipaddr.collapse_address_list([ip1, ip2, ip3]) self.assertEqual(collapsed, [ip3]) - def testNetworkComparison(self): + def test_network_comparison(self): # ip1 and ip2 have the same network address ip1 = ipaddr.IPv4('1.1.1.0/24') ip2 = ipaddr.IPv4('1.1.1.1/24') @@ -381,7 +382,7 @@ self.assertTrue(ipv6 > ipv4) self.assertTrue(ipv4 < ipv6) - def testEmbeddedIpv4(self): + def test_embedded_ipv4(self): ipv4_string = '192.168.0.1' ipv4 = ipaddr.IPv4(ipv4_string) v4compat_ipv6 = ipaddr.IPv6('::%s' % ipv4_string) @@ -391,11 +392,11 @@ self.assertRaises(ipaddr.IPv6IpValidationError, ipaddr.IPv6, '2001:1.1.1.1:1.1.1.1') - def testIPVersion(self): + def test_ip_version(self): self.assertEqual(self.ipv4.version, 4) self.assertEqual(self.ipv6.version, 6) - def testPacked(self): + def test_packed(self): self.assertEqual(self.ipv4.packed, b'\x01\x02\x03\x04') self.assertEqual(ipaddr.IPv4('255.254.253.252').packed, @@ -409,18 +410,18 @@ self.assertEqual(ipaddr.IPv6('::1:0:0:0:0').packed, b'\x00' * 6 + b'\x00\x01' + b'\x00' * 8) - def testIpStrFromPrefixlen(self): + def test_ip_str_from_prefixlen(self): ipv4 = ipaddr.IPv4('1.2.3.4/24') self.assertEquals(ipv4._ip_string_from_prefix(), '255.255.255.0') self.assertEquals(ipv4._ip_string_from_prefix(28), '255.255.255.240') - def testIpType(self): + def test_ip_type(self): ipv4 = ipaddr.IP('1.2.3.4') ipv6 = ipaddr.IP('::1.2.3.4') self.assertEquals(ipaddr.IPv4, type(ipv4)) self.assertEquals(ipaddr.IPv6, type(ipv6)) - def testReservedIpv4(self): + def test_reserved_ipv4(self): self.assertEquals(True, ipaddr.IP('224.1.1.1/31').is_multicast) self.assertEquals(False, ipaddr.IP('240.0.0.0').is_multicast) @@ -438,7 +439,7 @@ self.assertEquals(True, ipaddr.IP('127.42.0.0/16').is_loopback) self.assertEquals(False, ipaddr.IP('128.0.0.0').is_loopback) - def testReservedIpv6(self): + def test_reserved_ipv6(self): ip = ipaddr.IP self.assertEquals(True, ip('ffff::').is_multicast) @@ -470,7 +471,7 @@ self.assertEquals(False, ip('::1').is_unspecified) self.assertEquals(False, ip('::/127').is_unspecified) - def testAddrExclude(self): + def test_addr_exclude(self): addr1 = ipaddr.IP('10.1.1.0/24') addr2 = ipaddr.IP('10.1.1.0/26') addr3 = ipaddr.IP('10.2.1.0/24') @@ -479,7 +480,7 @@ ipaddr.IP('10.1.1.128/25')]) self.assertRaises(ValueError, addr1.address_exclude, addr3) - def testHash(self): + def test_hash(self): self.assertEquals(hash(ipaddr.IP('10.1.1.0/24')), hash(ipaddr.IP('10.1.1.0/24'))) dummy = {} @@ -487,7 +488,7 @@ dummy[self.ipv6] = None self.assertTrue(self.ipv4 in dummy) - def testIPv4PrefixFromInt(self): + def test_ipv4_prefix_from_int(self): addr1 = ipaddr.IP('10.1.1.0/24') addr2 = ipaddr.IPv4(addr1.ip) # clone prefix addr2.prefixlen = addr1.prefixlen @@ -499,7 +500,7 @@ self.assertEqual(addr1, addr2) self.assertEqual(str(addr1), str(addr2)) - def testIPv6PrefixFromInt(self): + def test_ipv6_prefix_from_int(self): addr1 = ipaddr.IP('2001:0658:022a:cafe:0200::1/64') addr2 = ipaddr.IPv6(addr1.ip) # clone prefix addr2.prefixlen = addr1.prefixlen @@ -511,7 +512,7 @@ self.assertEqual(addr1, addr2) self.assertEqual(str(addr1), str(addr2)) - def testCopyConstructor(self): + def test_copy_constructor(self): addr1 = ipaddr.IP('10.1.1.0/24') addr2 = ipaddr.IP(addr1) addr3 = ipaddr.IP('2001:658:22a:cafe:200::1/64') @@ -520,7 +521,7 @@ self.assertEqual(addr1, addr2) self.assertEqual(addr3, addr4) - def testCompressIPv6Address(self): + def test_compress_ipv6_address(self): test_addresses = { '1:2:3:4:5:6:7:8': '1:2:3:4:5:6:7:8/128', '2001:0:0:4:0:0:0:8': '2001:0:0:4::8/128', @@ -540,16 +541,16 @@ for uncompressed, compressed in test_addresses.items(): self.assertEquals(compressed, str(ipaddr.IPv6(uncompressed))) - def testExplodeShortHandIpStr(self): + def test_explode_short_hand_ip_str(self): addr1 = ipaddr.IPv6('2001::1') self.assertEqual('2001:0000:0000:0000:0000:0000:0000:0001', addr1._explode_shorthand_ip_string(addr1.ip_ext)) - def testIntRepresentation(self): + def test_int_representation(self): self.assertEqual(16909060, int(self.ipv4)) self.assertEqual(42540616829182469433547762482097946625, int(self.ipv6)) - def testHexRepresentation(self): + def test_hex_representation(self): self.assertEqual(hex(0x1020304), hex(self.ipv4)) self.assertEqual(hex(0x20010658022ACAFE0200000000000001), From python-checkins at python.org Sat May 2 21:27:30 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 2 May 2009 21:27:30 +0200 (CEST) Subject: [Python-checkins] r72217 - python/branches/py3k/Python/codecs.c Message-ID: <20090502192730.2B0881E4025@bag.python.org> Author: martin.v.loewis Date: Sat May 2 21:27:30 2009 New Revision: 72217 Log: Make PyCodec_SurrogateErrors static. Modified: python/branches/py3k/Python/codecs.c Modified: python/branches/py3k/Python/codecs.c ============================================================================== --- python/branches/py3k/Python/codecs.c (original) +++ python/branches/py3k/Python/codecs.c Sat May 2 21:27:30 2009 @@ -748,7 +748,10 @@ } } -PyObject *PyCodec_SurrogateErrors(PyObject *exc) +/* This handler is declared static until someone demonstrates + a need to call it directly. */ +static PyObject * +PyCodec_SurrogateErrors(PyObject *exc) { PyObject *restuple; PyObject *object; From buildbot at python.org Sat May 2 21:41:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 May 2009 19:41:53 +0000 Subject: [Python-checkins] buildbot failure in x86 osx.5 2.6 Message-ID: <20090502194153.31DD41E4025@bag.python.org> The Buildbot has detected a new failure of x86 osx.5 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20osx.5%202.6/builds/314 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: heller-x86-osx5 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_asynchat make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat May 2 22:14:56 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 2 May 2009 22:14:56 +0200 (CEST) Subject: [Python-checkins] r72218 - python/branches/py3k Message-ID: <20090502201456.59AA01E4025@bag.python.org> Author: benjamin.peterson Date: Sat May 2 22:14:55 2009 New Revision: 72218 Log: revert merge properties to something sane Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat May 2 22:15:07 2009 From: python-checkins at python.org (michael.foord) Date: Sat, 2 May 2009 22:15:07 +0200 (CEST) Subject: [Python-checkins] r72219 - in python/trunk: Doc/library/unittest.rst Doc/whatsnew/2.7.rst Lib/test/test_unittest.py Lib/unittest.py Message-ID: <20090502201507.92BCF1E4025@bag.python.org> Author: michael.foord Date: Sat May 2 22:15:05 2009 New Revision: 72219 Log: Add addCleanup and doCleanups to unittest.TestCase. Closes issue 5679. Michael Foord Modified: python/trunk/Doc/library/unittest.rst python/trunk/Doc/whatsnew/2.7.rst python/trunk/Lib/test/test_unittest.py python/trunk/Lib/unittest.py Modified: python/trunk/Doc/library/unittest.rst ============================================================================== --- python/trunk/Doc/library/unittest.rst (original) +++ python/trunk/Doc/library/unittest.rst Sat May 2 22:15:05 2009 @@ -978,6 +978,36 @@ .. versionadded:: 2.7 + .. method:: addCleanup(function[, *args[, **kwargs]]) + + Add a function to be called after :meth:`tearDown` to cleanup resources + used during the test. Functions will be called in reverse order to the + order they are added (LIFO). They are called with any arguments and + keyword arguments passed into :meth:`addCleanup` when they are + added. + + If :meth:`setUp` fails, meaning that :meth:`tearDown` is not called, + then any cleanup functions added will still be called. + + .. versionadded:: 2.7 + + + .. method:: doCleanups() + + This method is called uncoditionally after :meth:`tearDown`, or + after :meth:`setUp` if :meth:`setUp` raises an exception. + + It is responsible for calling all the cleanup functions added by + :meth:`addCleanup`. If you need cleanup functions to be called + *prior* to :meth:`tearDown` then you can call :meth:`doCleanups` + yourself. + + :meth:`doCleanups` pops methods off the stack of cleanup + functions one at a time, so it can be called at any time. + + .. versionadded:: 2.7 + + .. class:: FunctionTestCase(testFunc[, setUp[, tearDown[, description]]]) This class implements the portion of the :class:`TestCase` interface which Modified: python/trunk/Doc/whatsnew/2.7.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.7.rst (original) +++ python/trunk/Doc/whatsnew/2.7.rst Sat May 2 22:15:05 2009 @@ -452,6 +452,13 @@ (Implemented by Antoine Pitrou; :issue:`4444`.) + The methods :meth:`addCleanup` and :meth:`doCleanups` were added. + :meth:`addCleanup` allows you to add cleanup functions that + will be called unconditionally (after :meth:`setUp` if + :meth:`setUp` fails, otherwise after :meth:`tearDown`). This allows + for much simpler resource allocation and deallocation during tests. + :issue:`5679` + A number of new methods were added that provide more specialized tests. Many of these methods were written by Google engineers for use in their test suites; Gregory P. Smith, Michael Foord, and Modified: python/trunk/Lib/test/test_unittest.py ============================================================================== --- python/trunk/Lib/test/test_unittest.py (original) +++ python/trunk/Lib/test/test_unittest.py Sat May 2 22:15:05 2009 @@ -3041,6 +3041,111 @@ "^unexpectedly identical: None : oops$"]) +class TestCleanUp(TestCase): + + def testCleanUp(self): + class TestableTest(TestCase): + def testNothing(self): + pass + + test = TestableTest('testNothing') + self.assertEqual(test._cleanups, []) + + cleanups = [] + + def cleanup1(*args, **kwargs): + cleanups.append((1, args, kwargs)) + + def cleanup2(*args, **kwargs): + cleanups.append((2, args, kwargs)) + + test.addCleanup(cleanup1, 1, 2, 3, four='hello', five='goodbye') + test.addCleanup(cleanup2) + + self.assertEqual(test._cleanups, + [(cleanup1, (1, 2, 3), dict(four='hello', five='goodbye')), + (cleanup2, (), {})]) + + result = test.doCleanups() + self.assertTrue(result) + + self.assertEqual(cleanups, [(2, (), {}), (1, (1, 2, 3), dict(four='hello', five='goodbye'))]) + + def testCleanUpWithErrors(self): + class TestableTest(TestCase): + def testNothing(self): + pass + + class MockResult(object): + errors = [] + def addError(self, test, exc_info): + self.errors.append((test, exc_info)) + + result = MockResult() + test = TestableTest('testNothing') + test._result = result + + exc1 = Exception('foo') + exc2 = Exception('bar') + def cleanup1(): + raise exc1 + + def cleanup2(): + raise exc2 + + test.addCleanup(cleanup1) + test.addCleanup(cleanup2) + + self.assertFalse(test.doCleanups()) + + (test1, (Type1, instance1, _)), (test2, (Type2, instance2, _)) = reversed(MockResult.errors) + self.assertEqual((test1, Type1, instance1), (test, Exception, exc1)) + self.assertEqual((test2, Type2, instance2), (test, Exception, exc2)) + + def testCleanupInRun(self): + blowUp = False + ordering = [] + + class TestableTest(TestCase): + def setUp(self): + ordering.append('setUp') + if blowUp: + raise Exception('foo') + + def testNothing(self): + ordering.append('test') + + def tearDown(self): + ordering.append('tearDown') + + test = TestableTest('testNothing') + + def cleanup1(): + ordering.append('cleanup1') + def cleanup2(): + ordering.append('cleanup2') + test.addCleanup(cleanup1) + test.addCleanup(cleanup2) + + def success(some_test): + self.assertEqual(some_test, test) + ordering.append('success') + + result = unittest.TestResult() + result.addSuccess = success + + test.run(result) + self.assertEqual(ordering, ['setUp', 'test', 'tearDown', + 'cleanup2', 'cleanup1', 'success']) + + blowUp = True + ordering = [] + test = TestableTest('testNothing') + test.addCleanup(cleanup1) + test.run(result) + self.assertEqual(ordering, ['setUp', 'cleanup1']) + + class Test_TestProgram(TestCase): # Horrible white box test @@ -3110,7 +3215,6 @@ testLoader=self.FooBarLoader()) - ###################################################################### ## Main ###################################################################### @@ -3119,7 +3223,7 @@ test_support.run_unittest(Test_TestCase, Test_TestLoader, Test_TestSuite, Test_TestResult, Test_FunctionTestCase, Test_TestSkipping, Test_Assertions, TestLongMessage, - Test_TestProgram) + Test_TestProgram, TestCleanUp) if __name__ == "__main__": test_main() Modified: python/trunk/Lib/unittest.py ============================================================================== --- python/trunk/Lib/unittest.py (original) +++ python/trunk/Lib/unittest.py Sat May 2 22:15:05 2009 @@ -340,12 +340,14 @@ not have a method with the specified name. """ self._testMethodName = methodName + self._result = None try: testMethod = getattr(self, methodName) except AttributeError: raise ValueError("no such test method in %s: %s" % \ (self.__class__, methodName)) self._testMethodDoc = testMethod.__doc__ + self._cleanups = [] # Map types to custom assertEqual functions that will compare # instances of said type in more detail to generate a more useful @@ -372,6 +374,14 @@ """ self._type_equality_funcs[typeobj] = _AssertWrapper(function) + def addCleanup(self, function, *args, **kwargs): + """Add a function, with arguments, to be called when the test is + completed. Functions added are called on a LIFO basis and are + called after tearDown on test failure or success. + + Cleanup items are called even if setUp fails (unlike tearDown).""" + self._cleanups.append((function, args, kwargs)) + def setUp(self): "Hook method for setting up the test fixture before exercising it." pass @@ -429,44 +439,60 @@ def run(self, result=None): if result is None: result = self.defaultTestResult() + self._result = result result.startTest(self) testMethod = getattr(self, self._testMethodName) try: - try: - self.setUp() - except SkipTest as e: - result.addSkip(self, str(e)) - return - except Exception: - result.addError(self, sys.exc_info()) - return - success = False try: - testMethod() - except self.failureException: - result.addFailure(self, sys.exc_info()) - except _ExpectedFailure as e: - result.addExpectedFailure(self, e.exc_info) - except _UnexpectedSuccess: - result.addUnexpectedSuccess(self) + self.setUp() except SkipTest as e: result.addSkip(self, str(e)) except Exception: result.addError(self, sys.exc_info()) else: - success = True + try: + testMethod() + except self.failureException: + result.addFailure(self, sys.exc_info()) + except _ExpectedFailure as e: + result.addExpectedFailure(self, e.exc_info) + except _UnexpectedSuccess: + result.addUnexpectedSuccess(self) + except SkipTest as e: + result.addSkip(self, str(e)) + except Exception: + result.addError(self, sys.exc_info()) + else: + success = True - try: - self.tearDown() - except Exception: - result.addError(self, sys.exc_info()) - success = False + try: + self.tearDown() + except Exception: + result.addError(self, sys.exc_info()) + success = False + + cleanUpSuccess = self.doCleanups() + success = success and cleanUpSuccess if success: result.addSuccess(self) finally: result.stopTest(self) + def doCleanups(self): + """Execute all cleanup functions. Normally called for you after + tearDown.""" + result = self._result + ok = True + while self._cleanups: + function, args, kwargs = self._cleanups.pop(-1) + try: + function(*args, **kwargs) + except Exception: + ok = False + result.addError(self, sys.exc_info()) + return ok + def __call__(self, *args, **kwds): return self.run(*args, **kwds) @@ -1538,5 +1564,9 @@ main = TestProgram +############################################################################## +# Executing this module from the command line +############################################################################## + if __name__ == "__main__": main(module=None) From python-checkins at python.org Sat May 2 22:25:05 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 2 May 2009 22:25:05 +0200 (CEST) Subject: [Python-checkins] r72220 - python/branches/py3k Message-ID: <20090502202505.6EBE31E4025@bag.python.org> Author: benjamin.peterson Date: Sat May 2 22:25:05 2009 New Revision: 72220 Log: try to get merge props correct Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat May 2 22:26:53 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 2 May 2009 22:26:53 +0200 (CEST) Subject: [Python-checkins] r72221 - python/trunk/Doc/library/2to3.rst Message-ID: <20090502202653.E0B611E4025@bag.python.org> Author: benjamin.peterson Date: Sat May 2 22:26:53 2009 New Revision: 72221 Log: add myself Modified: python/trunk/Doc/library/2to3.rst Modified: python/trunk/Doc/library/2to3.rst ============================================================================== --- python/trunk/Doc/library/2to3.rst (original) +++ python/trunk/Doc/library/2to3.rst Sat May 2 22:26:53 2009 @@ -352,6 +352,7 @@ :synopsis: the 2to3 library .. moduleauthor:: Guido van Rossum .. moduleauthor:: Collin Winter +.. moduleauthor:: Benjamin Peterson .. note:: From python-checkins at python.org Sat May 2 22:31:20 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 2 May 2009 22:31:20 +0200 (CEST) Subject: [Python-checkins] r72222 - python/branches/py3k Message-ID: <20090502203120.D63A61E4025@bag.python.org> Author: benjamin.peterson Date: Sat May 2 22:31:20 2009 New Revision: 72222 Log: Blocked revisions 71662,72052,72117 via svnmerge ........ r71662 | vinay.sajip | 2009-04-16 14:15:49 -0500 (Thu, 16 Apr 2009) | 1 line Issue #5768: Change to Unicode output logic and test case for same. ........ r72052 | raymond.hettinger | 2009-04-27 16:12:27 -0500 (Mon, 27 Apr 2009) | 1 line Update spec version number. ........ r72117 | benjamin.peterson | 2009-04-29 15:36:25 -0500 (Wed, 29 Apr 2009) | 1 line run autoconf ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Sat May 2 22:36:12 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 May 2009 20:36:12 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 2.6 Message-ID: <20090502203612.56C641E438E@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%202.6/builds/238 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_hotshot ====================================================================== FAIL: test_logreader_eof_error (test.test_hotshot.HotShotTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/2.6.loewis-sun/build/Lib/test/test_hotshot.py", line 130, in test_logreader_eof_error self.assertRaises((IOError, EOFError), _hotshot.logreader, ".") AssertionError: (, ) not raised sincerely, -The Buildbot From buildbot at python.org Sat May 2 23:01:58 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 May 2009 21:01:58 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090502210158.37B431E4032@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/866 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_time ====================================================================== FAIL: test_tzset (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_time.py", line 166, in test_tzset self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) AssertionError: time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) == time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat May 2 23:13:24 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 2 May 2009 23:13:24 +0200 (CEST) Subject: [Python-checkins] r72223 - in python/trunk: Lib/pickle.py Lib/test/pickletester.py Misc/NEWS Modules/cPickle.c Message-ID: <20090502211324.3E59B1E4025@bag.python.org> Author: antoine.pitrou Date: Sat May 2 23:13:23 2009 New Revision: 72223 Log: Isue #5084: unpickling now interns the attribute names of pickled objects, saving memory and avoiding growth in size of subsequent pickles. Proposal and original patch by Jake McGuire. Modified: python/trunk/Lib/pickle.py python/trunk/Lib/test/pickletester.py python/trunk/Misc/NEWS python/trunk/Modules/cPickle.c Modified: python/trunk/Lib/pickle.py ============================================================================== --- python/trunk/Lib/pickle.py (original) +++ python/trunk/Lib/pickle.py Sat May 2 23:13:23 2009 @@ -1221,7 +1221,15 @@ state, slotstate = state if state: try: - inst.__dict__.update(state) + d = inst.__dict__ + try: + for k, v in state.iteritems(): + d[intern(k)] = v + # keys in state don't have to be strings + # don't blow up, but don't go out of our way + except TypeError: + d.update(state) + except RuntimeError: # XXX In restricted execution, the instance's __dict__ # is not accessible. Use the old way of unpickling Modified: python/trunk/Lib/test/pickletester.py ============================================================================== --- python/trunk/Lib/test/pickletester.py (original) +++ python/trunk/Lib/test/pickletester.py Sat May 2 23:13:23 2009 @@ -938,6 +938,20 @@ "Failed protocol %d: %r != %r" % (proto, obj, loaded)) + def test_attribute_name_interning(self): + # Test that attribute names of pickled objects are interned when + # unpickling. + for proto in protocols: + x = C() + x.foo = 42 + x.bar = "hello" + s = self.dumps(x, proto) + y = self.loads(s) + x_keys = sorted(x.__dict__) + y_keys = sorted(y.__dict__) + for x_key, y_key in zip(x_keys, y_keys): + self.assertIs(x_key, y_key) + # Test classes for reduce_ex Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat May 2 23:13:23 2009 @@ -261,6 +261,10 @@ Library ------- +- Issue #5084: unpickling now interns the attribute names of pickled objects, + saving memory and avoiding growth in size of subsequent pickles. Proposal + and original patch by Jake McGuire. + - Issue #3002: ``shutil.copyfile()`` and ``shutil.copytree()`` now raise an error when a named pipe is encountered, rather than blocking infinitely. Modified: python/trunk/Modules/cPickle.c ============================================================================== --- python/trunk/Modules/cPickle.c (original) +++ python/trunk/Modules/cPickle.c Sat May 2 23:13:23 2009 @@ -4473,8 +4473,16 @@ i = 0; while (PyDict_Next(state, &i, &d_key, &d_value)) { - if (PyObject_SetItem(dict, d_key, d_value) < 0) + /* normally the keys for instance attributes are + interned. we should try to do that here. */ + Py_INCREF(d_key); + if (PyString_CheckExact(d_key)) + PyString_InternInPlace(&d_key); + if (PyObject_SetItem(dict, d_key, d_value) < 0) { + Py_DECREF(d_key); goto finally; + } + Py_DECREF(d_key); } Py_DECREF(dict); } From buildbot at python.org Sat May 2 23:36:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 May 2009 21:36:40 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090502213640.DCEDD1E4025@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1231 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: antoine.pitrou,benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_time make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat May 2 23:41:14 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 2 May 2009 23:41:14 +0200 (CEST) Subject: [Python-checkins] r72224 - in python/branches/py3k: Lib/pickle.py Lib/test/pickletester.py Misc/NEWS Modules/_pickle.c Message-ID: <20090502214114.77A011E4025@bag.python.org> Author: antoine.pitrou Date: Sat May 2 23:41:14 2009 New Revision: 72224 Log: Merged revisions 72223 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72223 | antoine.pitrou | 2009-05-02 23:13:23 +0200 (sam., 02 mai 2009) | 5 lines Isue #5084: unpickling now interns the attribute names of pickled objects, saving memory and avoiding growth in size of subsequent pickles. Proposal and original patch by Jake McGuire. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/pickle.py python/branches/py3k/Lib/test/pickletester.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_pickle.c Modified: python/branches/py3k/Lib/pickle.py ============================================================================== --- python/branches/py3k/Lib/pickle.py (original) +++ python/branches/py3k/Lib/pickle.py Sat May 2 23:41:14 2009 @@ -1195,7 +1195,15 @@ if isinstance(state, tuple) and len(state) == 2: state, slotstate = state if state: - inst.__dict__.update(state) + d = inst.__dict__ + intern = sys.intern + try: + for k, v in state.items(): + d[intern(k)] = v + # keys in state don't have to be strings + # don't blow up, but don't go out of our way + except TypeError: + d.update(state) if slotstate: for k, v in slotstate.items(): setattr(inst, k, v) Modified: python/branches/py3k/Lib/test/pickletester.py ============================================================================== --- python/branches/py3k/Lib/test/pickletester.py (original) +++ python/branches/py3k/Lib/test/pickletester.py Sat May 2 23:41:14 2009 @@ -932,6 +932,20 @@ "Failed protocol %d: %r != %r" % (proto, obj, loaded)) + def test_attribute_name_interning(self): + # Test that attribute names of pickled objects are interned when + # unpickling. + for proto in protocols: + x = C() + x.foo = 42 + x.bar = "hello" + s = self.dumps(x, proto) + y = self.loads(s) + x_keys = sorted(x.__dict__) + y_keys = sorted(y.__dict__) + for x_key, y_key in zip(x_keys, y_keys): + self.assertIs(x_key, y_key) + # Test classes for reduce_ex class REX_one(object): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 2 23:41:14 2009 @@ -109,6 +109,10 @@ Library ------- +- Issue #5084: unpickling now interns the attribute names of pickled objects, + saving memory and avoiding growth in size of subsequent pickles. Proposal + and original patch by Jake McGuire. + - The json module now works exclusively with str and not bytes. - Issue #3959: The ipaddr module has been added to the standard library. Modified: python/branches/py3k/Modules/_pickle.c ============================================================================== --- python/branches/py3k/Modules/_pickle.c (original) +++ python/branches/py3k/Modules/_pickle.c Sat May 2 23:41:14 2009 @@ -4020,6 +4020,8 @@ /* Set inst.__dict__ from the state dict (if any). */ if (state != Py_None) { PyObject *dict; + PyObject *d_key, *d_value; + Py_ssize_t i; if (!PyDict_Check(state)) { PyErr_SetString(UnpicklingError, "state is not a dictionary"); @@ -4029,7 +4031,19 @@ if (dict == NULL) goto error; - PyDict_Update(dict, state); + i = 0; + while (PyDict_Next(state, &i, &d_key, &d_value)) { + /* normally the keys for instance attributes are + interned. we should try to do that here. */ + Py_INCREF(d_key); + if (PyUnicode_CheckExact(d_key)) + PyUnicode_InternInPlace(&d_key); + if (PyObject_SetItem(dict, d_key, d_value) < 0) { + Py_DECREF(d_key); + goto error; + } + Py_DECREF(d_key); + } Py_DECREF(dict); } From buildbot at python.org Sat May 2 23:45:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 May 2009 21:45:14 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090502214514.B868D1E44D8@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/323 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 45, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/Include ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From buildbot at python.org Sun May 3 00:07:33 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 May 2009 22:07:33 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090502220733.CE2241E4025@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/448 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling,gregory.p.smith BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_time ====================================================================== FAIL: test_update2 (test.test_os.EnvironTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_os.py", line 348, in test_update2 self.assertEquals(value, "World") AssertionError: '' != 'World' ====================================================================== FAIL: test_tzset (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_time.py", line 161, in test_tzset self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) AssertionError: time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) == time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun May 3 00:14:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 02 May 2009 22:14:56 +0000 Subject: [Python-checkins] buildbot failure in x86 FreeBSD 2.6 Message-ID: <20090502221456.C73901E4025@bag.python.org> The Buildbot has detected a new failure of x86 FreeBSD 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20FreeBSD%202.6/builds/1 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-freebsd Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sun May 3 00:43:35 2009 From: python-checkins at python.org (michael.foord) Date: Sun, 3 May 2009 00:43:35 +0200 (CEST) Subject: [Python-checkins] r72225 - in python/trunk: Doc/library/unittest.rst Doc/whatsnew/2.7.rst Lib/test/test_unittest.py Lib/unittest.py Misc/NEWS Message-ID: <20090502224335.319F71E4028@bag.python.org> Author: michael.foord Date: Sun May 3 00:43:34 2009 New Revision: 72225 Log: Modified: python/trunk/Doc/library/unittest.rst python/trunk/Doc/whatsnew/2.7.rst python/trunk/Lib/test/test_unittest.py python/trunk/Lib/unittest.py python/trunk/Misc/NEWS Modified: python/trunk/Doc/library/unittest.rst ============================================================================== --- python/trunk/Doc/library/unittest.rst (original) +++ python/trunk/Doc/library/unittest.rst Sun May 3 00:43:34 2009 @@ -1318,6 +1318,20 @@ The default implementation does nothing. + .. method:: startTestRun(test) + + Called once before any tests are executed. + + .. versionadded:: 2.7 + + + .. method:: stopTestRun(test) + + Called once before any tests are executed. + + .. versionadded:: 2.7 + + .. method:: addError(test, err) Called when the test case *test* raises an unexpected exception *err* is a Modified: python/trunk/Doc/whatsnew/2.7.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.7.rst (original) +++ python/trunk/Doc/whatsnew/2.7.rst Sun May 3 00:43:34 2009 @@ -517,6 +517,10 @@ If False ``main`` doesn't call :func:`sys.exit` allowing it to be used from the interactive interpreter. :issue:`3379`. + :class:`TestResult` has new :meth:`startTestRun` and + :meth:`stopTestRun` methods; called immediately before + and after a test run. :issue:`5728` by Robert Collins. + * The :func:`is_zipfile` function in the :mod:`zipfile` module will now accept a file object, in addition to the path names accepted in earlier versions. (Contributed by Gabriel Genellina; :issue:`4756`.) Modified: python/trunk/Lib/test/test_unittest.py ============================================================================== --- python/trunk/Lib/test/test_unittest.py (original) +++ python/trunk/Lib/test/test_unittest.py Sun May 3 00:43:34 2009 @@ -6,6 +6,7 @@ TestCase.{assert,fail}* methods (some are tested implicitly) """ +from StringIO import StringIO import re from test import test_support import unittest @@ -26,10 +27,18 @@ self._events.append('startTest') super(LoggingResult, self).startTest(test) + def startTestRun(self): + self._events.append('startTestRun') + super(LoggingResult, self).startTestRun() + def stopTest(self, test): self._events.append('stopTest') super(LoggingResult, self).stopTest(test) + def stopTestRun(self): + self._events.append('stopTestRun') + super(LoggingResult, self).stopTestRun() + def addFailure(self, *args): self._events.append('addFailure') super(LoggingResult, self).addFailure(*args) @@ -1817,6 +1826,12 @@ self.assertEqual(result.testsRun, 1) self.assertEqual(result.shouldStop, False) + # "Called before and after tests are run. The default implementation does nothing." + def test_startTestRun_stopTestRun(self): + result = unittest.TestResult() + result.startTestRun() + result.stopTestRun() + # "addSuccess(test)" # ... # "Called when the test case test succeeds" @@ -1964,6 +1979,53 @@ class Bar(Foo): def test2(self): pass +class LoggingTestCase(unittest.TestCase): + """A test case which logs its calls.""" + + def __init__(self, events): + super(LoggingTestCase, self).__init__('test') + self.events = events + + def setUp(self): + self.events.append('setUp') + + def test(self): + self.events.append('test') + + def tearDown(self): + self.events.append('tearDown') + +class ResultWithNoStartTestRunStopTestRun(object): + """An object honouring TestResult before startTestRun/stopTestRun.""" + + def __init__(self): + self.failures = [] + self.errors = [] + self.testsRun = 0 + self.skipped = [] + self.expectedFailures = [] + self.unexpectedSuccesses = [] + self.shouldStop = False + + def startTest(self, test): + pass + + def stopTest(self, test): + pass + + def addError(self, test): + pass + + def addFailure(self, test): + pass + + def addSuccess(self, test): + pass + + def wasSuccessful(self): + return True + + ################################################################ ### /Support code for Test_TestCase @@ -2058,19 +2120,30 @@ events = [] result = LoggingResult(events) - class Foo(unittest.TestCase): + class Foo(LoggingTestCase): def setUp(self): - events.append('setUp') + super(Foo, self).setUp() raise RuntimeError('raised by Foo.setUp') - def test(self): - events.append('test') + Foo(events).run(result) + expected = ['startTest', 'setUp', 'addError', 'stopTest'] + self.assertEqual(events, expected) - def tearDown(self): - events.append('tearDown') + # "With a temporary result stopTestRun is called when setUp errors. + def test_run_call_order__error_in_setUp_default_result(self): + events = [] - Foo('test').run(result) - expected = ['startTest', 'setUp', 'addError', 'stopTest'] + class Foo(LoggingTestCase): + def defaultTestResult(self): + return LoggingResult(self.events) + + def setUp(self): + super(Foo, self).setUp() + raise RuntimeError('raised by Foo.setUp') + + Foo(events).run() + expected = ['startTestRun', 'startTest', 'setUp', 'addError', + 'stopTest', 'stopTestRun'] self.assertEqual(events, expected) # "When a setUp() method is defined, the test runner will run that method @@ -2084,20 +2157,32 @@ events = [] result = LoggingResult(events) - class Foo(unittest.TestCase): - def setUp(self): - events.append('setUp') - + class Foo(LoggingTestCase): def test(self): - events.append('test') + super(Foo, self).test() raise RuntimeError('raised by Foo.test') - def tearDown(self): - events.append('tearDown') - expected = ['startTest', 'setUp', 'test', 'addError', 'tearDown', 'stopTest'] - Foo('test').run(result) + Foo(events).run(result) + self.assertEqual(events, expected) + + # "With a default result, an error in the test still results in stopTestRun + # being called." + def test_run_call_order__error_in_test_default_result(self): + events = [] + + class Foo(LoggingTestCase): + def defaultTestResult(self): + return LoggingResult(self.events) + + def test(self): + super(Foo, self).test() + raise RuntimeError('raised by Foo.test') + + expected = ['startTestRun', 'startTest', 'setUp', 'test', 'addError', + 'tearDown', 'stopTest', 'stopTestRun'] + Foo(events).run() self.assertEqual(events, expected) # "When a setUp() method is defined, the test runner will run that method @@ -2111,20 +2196,30 @@ events = [] result = LoggingResult(events) - class Foo(unittest.TestCase): - def setUp(self): - events.append('setUp') - + class Foo(LoggingTestCase): def test(self): - events.append('test') + super(Foo, self).test() self.fail('raised by Foo.test') - def tearDown(self): - events.append('tearDown') - expected = ['startTest', 'setUp', 'test', 'addFailure', 'tearDown', 'stopTest'] - Foo('test').run(result) + Foo(events).run(result) + self.assertEqual(events, expected) + + # "When a test fails with a default result stopTestRun is still called." + def test_run_call_order__failure_in_test_default_result(self): + + class Foo(LoggingTestCase): + def defaultTestResult(self): + return LoggingResult(self.events) + def test(self): + super(Foo, self).test() + self.fail('raised by Foo.test') + + expected = ['startTestRun', 'startTest', 'setUp', 'test', 'addFailure', + 'tearDown', 'stopTest', 'stopTestRun'] + events = [] + Foo(events).run() self.assertEqual(events, expected) # "When a setUp() method is defined, the test runner will run that method @@ -2138,22 +2233,44 @@ events = [] result = LoggingResult(events) - class Foo(unittest.TestCase): - def setUp(self): - events.append('setUp') - - def test(self): - events.append('test') - + class Foo(LoggingTestCase): def tearDown(self): - events.append('tearDown') + super(Foo, self).tearDown() raise RuntimeError('raised by Foo.tearDown') - Foo('test').run(result) + Foo(events).run(result) expected = ['startTest', 'setUp', 'test', 'tearDown', 'addError', 'stopTest'] self.assertEqual(events, expected) + # "When tearDown errors with a default result stopTestRun is still called." + def test_run_call_order__error_in_tearDown_default_result(self): + + class Foo(LoggingTestCase): + def defaultTestResult(self): + return LoggingResult(self.events) + def tearDown(self): + super(Foo, self).tearDown() + raise RuntimeError('raised by Foo.tearDown') + + events = [] + Foo(events).run() + expected = ['startTestRun', 'startTest', 'setUp', 'test', 'tearDown', + 'addError', 'stopTest', 'stopTestRun'] + self.assertEqual(events, expected) + + # "TestCase.run() still works when the defaultTestResult is a TestResult + # that does not support startTestRun and stopTestRun. + def test_run_call_order_default_result(self): + + class Foo(unittest.TestCase): + def defaultTestResult(self): + return ResultWithNoStartTestRunStopTestRun() + def test(self): + pass + + Foo('test').run() + # "This class attribute gives the exception raised by the test() method. # If a test framework needs to use a specialized exception, possibly to # carry additional information, it must subclass this exception in @@ -2244,7 +2361,9 @@ self.failUnless(isinstance(Foo().id(), basestring)) # "If result is omitted or None, a temporary result object is created - # and used, but is not made available to the caller" + # and used, but is not made available to the caller. As TestCase owns the + # temporary result startTestRun and stopTestRun are called. + def test_run__uses_defaultTestResult(self): events = [] @@ -2258,7 +2377,8 @@ # Make run() find a result object on its own Foo('test').run() - expected = ['startTest', 'test', 'addSuccess', 'stopTest'] + expected = ['startTestRun', 'startTest', 'test', 'addSuccess', + 'stopTest', 'stopTestRun'] self.assertEqual(events, expected) def testShortDescriptionWithoutDocstring(self): @@ -3215,6 +3335,46 @@ testLoader=self.FooBarLoader()) +class Test_TextTestRunner(TestCase): + """Tests for TextTestRunner.""" + + def test_works_with_result_without_startTestRun_stopTestRun(self): + class OldTextResult(ResultWithNoStartTestRunStopTestRun): + separator2 = '' + def printErrors(self): + pass + + class Runner(unittest.TextTestRunner): + def __init__(self): + super(Runner, self).__init__(StringIO()) + + def _makeResult(self): + return OldTextResult() + + runner = Runner() + runner.run(unittest.TestSuite()) + + def test_startTestRun_stopTestRun_called(self): + class LoggingTextResult(LoggingResult): + separator2 = '' + def printErrors(self): + pass + + class LoggingRunner(unittest.TextTestRunner): + def __init__(self, events): + super(LoggingRunner, self).__init__(StringIO()) + self._events = events + + def _makeResult(self): + return LoggingTextResult(self._events) + + events = [] + runner = LoggingRunner(events) + runner.run(unittest.TestSuite()) + expected = ['startTestRun', 'stopTestRun'] + self.assertEqual(events, expected) + + ###################################################################### ## Main ###################################################################### Modified: python/trunk/Lib/unittest.py ============================================================================== --- python/trunk/Lib/unittest.py (original) +++ python/trunk/Lib/unittest.py Sun May 3 00:43:34 2009 @@ -186,10 +186,22 @@ "Called when the given test is about to be run" self.testsRun = self.testsRun + 1 + def startTestRun(self): + """Called once before any tests are executed. + + See startTest for a method called before each test. + """ + def stopTest(self, test): "Called when the given test has been run" pass + def stopTestRun(self): + """Called once after all tests are executed. + + See stopTest for a method called after each test. + """ + def addError(self, test, err): """Called when an error has occurred. 'err' is a tuple of values as returned by sys.exc_info(). @@ -437,8 +449,13 @@ (_strclass(self.__class__), self._testMethodName) def run(self, result=None): + orig_result = result if result is None: result = self.defaultTestResult() + startTestRun = getattr(result, 'startTestRun', None) + if startTestRun is not None: + startTestRun() + self._result = result result.startTest(self) testMethod = getattr(self, self._testMethodName) @@ -478,6 +495,10 @@ result.addSuccess(self) finally: result.stopTest(self) + if orig_result is None: + stopTestRun = getattr(result, 'stopTestRun', None) + if stopTestRun is not None: + stopTestRun() def doCleanups(self): """Execute all cleanup functions. Normally called for you after @@ -1433,7 +1454,15 @@ "Run the given test case or test suite." result = self._makeResult() startTime = time.time() - test(result) + startTestRun = getattr(result, 'startTestRun', None) + if startTestRun is not None: + startTestRun() + try: + test(result) + finally: + stopTestRun = getattr(result, 'stopTestRun', None) + if stopTestRun is not None: + stopTestRun() stopTime = time.time() timeTaken = stopTime - startTime result.printErrors() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun May 3 00:43:34 2009 @@ -359,6 +359,17 @@ - unittest.assertNotEqual() now uses the inequality operator (!=) instead of the equality operator. +- Issue #5679: The methods unittest.TestCase.addCleanup and doCleanups were added. + addCleanup allows you to add cleanup functions that will be called + unconditionally (after setUp if setUp fails, otherwise after tearDown). This + allows for much simpler resource allocation and deallocation during tests. + +- Issue #3379: unittest.main now takes an optional exit argument. If False main + doesn't call sys.exit allowing it to be used from the interactive interpreter. + +- Issue #5728: unittest.TestResult has new startTestRun and stopTestRun methods; + called immediately before and after a test run. + - Issue #5663: better failure messages for unittest asserts. Default assertTrue and assertFalse messages are now useful. TestCase has a longMessage attribute. This defaults to False, but if set to True useful error messages are shown in From buildbot at python.org Sun May 3 02:44:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 03 May 2009 00:44:17 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090503004418.0A1BF1E4025@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/730 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_time make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun May 3 03:00:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 03 May 2009 01:00:17 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090503010024.0FFE11E402A@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/618 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou,benjamin.peterson,gregory.p.smith,martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 4 tests failed: test_importlib test_os test_posix test_time Traceback (most recent call last): File "./Lib/test/regrtest.py", line 620, in runtest_inner File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_importlib.py", line 6, in test_main run_unittest(importlib.test.test_suite('importlib.test')) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/__init__.py", line 22, in test_suite package_tests = getattr(sys.modules[package_name], 'test_suite')() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/source/__init__.py", line 8, in test_suite return importlib.test.test_suite('importlib.test.source', directory) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/__init__.py", line 16, in test_suite __import__(module_name, level=0) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/source/test_case_sensitivity.py", line 12, in class CaseSensitivityTest(unittest.TestCase): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/util.py", line 13, in case_insensitive_tests original_name = os.listdir('.')[0] IndexError: list index out of range ====================================================================== FAIL: test_update2 (test.test_os.EnvironTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_os.py", line 382, in test_update2 self.assertEquals(value, "World") AssertionError: '' != 'World' ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_tzset (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_time.py", line 157, in test_tzset time.gmtime(xmas2002), time.localtime(xmas2002) AssertionError: time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) != time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=1, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) sincerely, -The Buildbot From python-checkins at python.org Sun May 3 03:03:45 2009 From: python-checkins at python.org (kurt.kaiser) Date: Sun, 3 May 2009 03:03:45 +0200 (CEST) Subject: [Python-checkins] r72226 - in python/trunk/Lib/idlelib: NEWS.txt idle.py Message-ID: <20090503010345.7EA5B1E402A@bag.python.org> Author: kurt.kaiser Date: Sun May 3 03:03:44 2009 New Revision: 72226 Log: idle.py modified and simplified to better support developing experimental versions of IDLE which are not installed in the standard location. Modified: python/trunk/Lib/idlelib/NEWS.txt python/trunk/Lib/idlelib/idle.py Modified: python/trunk/Lib/idlelib/NEWS.txt ============================================================================== --- python/trunk/Lib/idlelib/NEWS.txt (original) +++ python/trunk/Lib/idlelib/NEWS.txt Sun May 3 03:03:44 2009 @@ -3,6 +3,9 @@ *Release date: XX-XXX-2009* +- idle.py modified and simplified to better support developing experimental + versions of IDLE which are not installed in the standard location. + - OutputWindow/PyShell right click menu "Go to file/line" wasn't working with file paths containing spaces. Bug 5559. Modified: python/trunk/Lib/idlelib/idle.py ============================================================================== --- python/trunk/Lib/idlelib/idle.py (original) +++ python/trunk/Lib/idlelib/idle.py Sun May 3 03:03:44 2009 @@ -1,21 +1,11 @@ -try: - import idlelib.PyShell -except ImportError: - # IDLE is not installed, but maybe PyShell is on sys.path: - try: - import PyShell - except ImportError: - raise - else: - import os - idledir = os.path.dirname(os.path.abspath(PyShell.__file__)) - if idledir != os.getcwd(): - # We're not in the IDLE directory, help the subprocess find run.py - pypath = os.environ.get('PYTHONPATH', '') - if pypath: - os.environ['PYTHONPATH'] = pypath + ':' + idledir - else: - os.environ['PYTHONPATH'] = idledir - PyShell.main() -else: - idlelib.PyShell.main() +import os.path +import sys + +# If we are working on a development version of IDLE, we need to prepend the +# parent of this idlelib dir to sys.path. Otherwise, importing idlelib gets +# the version installed with the Python used to call this module: +idlelib_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +sys.path.insert(0, idlelib_dir) + +import idlelib.PyShell +idlelib.PyShell.main() From buildbot at python.org Sun May 3 03:18:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 03 May 2009 01:18:29 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090503011830.2DA7B1E402A@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%202.6/builds/238 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 ====================================================================== ERROR: test01_badpointer (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 21, in test01_badpointer dbs = dbshelve.open(self.filename) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\dbshelve.py", line 106, in open d.open(filename, dbname, filetype, flags, mode) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\dbshelve.py", line 171, in open self.db.open(*args, **kwargs) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test03_repr_closed_db (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 37, in test03_repr_closed_db db = hashopen(self.filename) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test04_repr_db (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 43, in test04_repr_db db = hashopen(self.filename) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test05_double_free_make_key_dbt (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 65, in test05_double_free_make_key_dbt db.DB_CREATE | db.DB_THREAD) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test06_key_with_null_bytes (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 77, in test06_key_with_null_bytes db1.open(self.filename, None, db.DB_HASH, db.DB_CREATE) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test07_DB_set_flags_persists (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 101, in test07_DB_set_flags_persists db1.open(self.filename, db.DB_HASH, db.DB_CREATE) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test01_basic_replication (bsddb.test.test_replication.DBReplicationManager) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_replication.py", line 170, in test01_basic_replication mode=0666, txn=txn) DBNoSuchFileError: (2, 'No such file or directory -- connection closed: Successful return: 0') ====================================================================== ERROR: test01_basic_replication (bsddb.test.test_replication.DBReplicationManager) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_replication.py", line 58, in tearDown if self.dbClient : DBError: (0, 'DB object has been closed') ====================================================================== FAIL: test01_basic_replication (bsddb.test.test_replication.DBBaseReplication) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_replication.py", line 315, in test01_basic_replication self.assertTrue(time.time() Author: kurt.kaiser Date: Sun May 3 04:05:22 2009 New Revision: 72227 Log: Further development of issue5559, handle Windows files which not only have embedded spaces, but leading spaces. Modified: python/trunk/Lib/idlelib/OutputWindow.py Modified: python/trunk/Lib/idlelib/OutputWindow.py ============================================================================== --- python/trunk/Lib/idlelib/OutputWindow.py (original) +++ python/trunk/Lib/idlelib/OutputWindow.py Sun May 3 04:05:22 2009 @@ -60,10 +60,12 @@ ] file_line_pats = [ + # order of patterns matters r'file "([^"]*)", line (\d+)', r'([^\s]+)\((\d+)\)', - r'([^\s]+):\s*(\d+):', - r'^\s*(\S+.*?):\s*(\d+):', # Win path with spaces, trim leading spaces + r'^(\s*\S.*?):\s*(\d+):', # Win filename, maybe starting with spaces + r'([^\s]+):\s*(\d+):', # filename or path, ltrim + r'^\s*(\S.*?):\s*(\d+):', # Win abs path with embedded spaces, ltrim ] file_line_progs = None From buildbot at python.org Sun May 3 04:30:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 03 May 2009 02:30:29 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090503023029.D3E391E4168@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/4920 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: kurt.kaiser BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_time make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun May 3 04:52:21 2009 From: python-checkins at python.org (andrew.kuchling) Date: Sun, 3 May 2009 04:52:21 +0200 (CEST) Subject: [Python-checkins] r72228 - in python/branches/py3k: Lib/mailbox.py Lib/test/test_mailbox.py Message-ID: <20090503025221.3417C1E4011@bag.python.org> Author: andrew.kuchling Date: Sun May 3 04:52:20 2009 New Revision: 72228 Log: Merged revisions 72213 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72213 | andrew.kuchling | 2009-05-02 15:17:28 -0400 (Sat, 02 May 2009) | 3 lines #1607951: Make mailbox.Maildir re-read the directories less frequently. This is done by recording the current time -1sec, and not re-reading unless the directory mod. times are >= the recorded time. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/mailbox.py python/branches/py3k/Lib/test/test_mailbox.py Modified: python/branches/py3k/Lib/mailbox.py ============================================================================== --- python/branches/py3k/Lib/mailbox.py (original) +++ python/branches/py3k/Lib/mailbox.py Sun May 3 04:52:20 2009 @@ -233,6 +233,7 @@ else: raise NoSuchMailboxError(self._path) self._toc = {} + self._last_read = None # Records last time we read cur/new def add(self, message): """Add message and return assigned key.""" @@ -457,16 +458,35 @@ def _refresh(self): """Update table of contents mapping.""" + new_mtime = os.path.getmtime(os.path.join(self._path, 'new')) + cur_mtime = os.path.getmtime(os.path.join(self._path, 'cur')) + + if (self._last_read is not None and + new_mtime <= self._last_read and cur_mtime <= self._last_read): + return + self._toc = {} - for subdir in ('new', 'cur'): - subdir_path = os.path.join(self._path, subdir) - for entry in os.listdir(subdir_path): - p = os.path.join(subdir_path, entry) + def update_dir (subdir): + path = os.path.join(self._path, subdir) + for entry in os.listdir(path): + p = os.path.join(path, entry) if os.path.isdir(p): continue uniq = entry.split(self.colon)[0] self._toc[uniq] = os.path.join(subdir, entry) + update_dir('new') + update_dir('cur') + + # We record the current time - 1sec so that, if _refresh() is called + # again in the same second, we will always re-read the mailbox + # just in case it's been modified. (os.path.mtime() only has + # 1sec resolution.) This results in a few unnecessary re-reads + # when _refresh() is called multiple times in the same second, + # but once the clock ticks over, we will only re-read as needed. + now = int(time.time() - 1) + self._last_read = time.time() - 1 + def _lookup(self, key): """Use TOC to return subpath for given key, or raise a KeyError.""" try: Modified: python/branches/py3k/Lib/test/test_mailbox.py ============================================================================== --- python/branches/py3k/Lib/test/test_mailbox.py (original) +++ python/branches/py3k/Lib/test/test_mailbox.py Sun May 3 04:52:20 2009 @@ -740,6 +740,37 @@ perms = st.st_mode self.assertFalse((perms & 0o111)) # Execute bits should all be off. + def test_reread(self): + # Wait for 2 seconds + time.sleep(2) + + # Initially, the mailbox has not been read and the time is null. + assert getattr(self._box, '_last_read', None) is None + + # Refresh mailbox; the times should now be set to something. + self._box._refresh() + assert getattr(self._box, '_last_read', None) is not None + + # Try calling _refresh() again; the modification times shouldn't have + # changed, so the mailbox should not be re-reading. Re-reading causes + # the ._toc attribute to be assigned a new dictionary object, so + # we'll check that the ._toc attribute isn't a different object. + orig_toc = self._box._toc + def refreshed(): + return self._box._toc is not orig_toc + + time.sleep(1) # Wait 1sec to ensure time.time()'s value changes + self._box._refresh() + assert not refreshed() + + # Now, write something into cur and remove it. This changes + # the mtime and should cause a re-read. + filename = os.path.join(self._path, 'cur', 'stray-file') + f = open(filename, 'w') + f.close() + os.unlink(filename) + self._box._refresh() + assert refreshed() class _TestMboxMMDF(TestMailbox): From buildbot at python.org Sun May 3 05:18:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 03 May 2009 03:18:14 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090503031814.8B8341E4011@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/452 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: kurt.kaiser BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/multiprocessing/process.py", line 231, in _bootstrap self.run() File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/multiprocessing/process.py", line 88, in run self._target(*self._args, **self._kwargs) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/multiprocessing/managers.py", line 524, in _run_server server = cls._Server(registry, address, authkey, serializer) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/multiprocessing/managers.py", line 136, in __init__ self.listener = Listener(address=address, backlog=5) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/multiprocessing/connection.py", line 97, in __init__ self._listener = SocketListener(address, family, backlog) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/multiprocessing/connection.py", line 218, in __init__ self._socket.bind(address) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/socket.py", line 219, in meth return getattr(self._sock,name)(*args) error: [Errno 98] Address already in use 2 tests failed: test_multiprocessing test_time make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun May 3 08:53:18 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sun, 3 May 2009 08:53:18 +0200 (CEST) Subject: [Python-checkins] r72229 - python/branches/py3k/Doc/whatsnew/3.1.rst Message-ID: <20090503065318.ECD7C1E4016@bag.python.org> Author: gregory.p.smith Date: Sun May 3 08:53:18 2009 New Revision: 72229 Log: Mention ipaddr in whatsnew for 3.1. Modified: python/branches/py3k/Doc/whatsnew/3.1.rst Modified: python/branches/py3k/Doc/whatsnew/3.1.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/3.1.rst (original) +++ python/branches/py3k/Doc/whatsnew/3.1.rst Sun May 3 08:53:18 2009 @@ -354,6 +354,12 @@ (Contributed by Brett Cannon.) +* A new module, :mod:`ipaddr` has been added to the standard library. + It provides classes to represent, verify and manipulate IPv4 and IPv6 + host and network addresses. + + (Contributed by Google, :issue:`3959`.) + Optimizations ============= From python-checkins at python.org Sun May 3 10:01:50 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 3 May 2009 10:01:50 +0200 (CEST) Subject: [Python-checkins] r72230 - python/branches/pep-0383/Modules/posixmodule.c Message-ID: <20090503080150.78F9A1E4011@bag.python.org> Author: martin.v.loewis Date: Sun May 3 10:01:49 2009 New Revision: 72230 Log: Convert environment variables. Modified: python/branches/pep-0383/Modules/posixmodule.c Modified: python/branches/pep-0383/Modules/posixmodule.c ============================================================================== --- python/branches/pep-0383/Modules/posixmodule.c (original) +++ python/branches/pep-0383/Modules/posixmodule.c Sun May 3 10:01:49 2009 @@ -493,12 +493,14 @@ char *p = strchr(*e, '='); if (p == NULL) continue; - k = PyUnicode_FromStringAndSize(*e, (int)(p-*e)); + k = PyUnicode_Decode(*e, (int)(p-*e), + Py_FileSystemDefaultEncoding, "utf8b"); if (k == NULL) { PyErr_Clear(); continue; } - v = PyUnicode_FromString(p+1); + v = PyUnicode_Decode(p+1, strlen(p+1), + Py_FileSystemDefaultEncoding, "utf8b"); if (v == NULL) { PyErr_Clear(); Py_DECREF(k); From python-checkins at python.org Sun May 3 10:09:53 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 3 May 2009 10:09:53 +0200 (CEST) Subject: [Python-checkins] r72231 - python/branches/pep-0383/Python/pythonrun.c Message-ID: <20090503080953.75E521E4011@bag.python.org> Author: martin.v.loewis Date: Sun May 3 10:09:51 2009 New Revision: 72231 Log: Move setting of Py_FileSystemDefaultEncoding before import of posix. Modified: python/branches/pep-0383/Python/pythonrun.c Modified: python/branches/pep-0383/Python/pythonrun.c ============================================================================== --- python/branches/pep-0383/Python/pythonrun.c (original) +++ python/branches/pep-0383/Python/pythonrun.c Sun May 3 10:09:51 2009 @@ -262,6 +262,22 @@ _PyImportHooks_Init(); +#if defined(HAVE_LANGINFO_H) && defined(CODESET) + /* On Unix, set the file system encoding according to the + user's preference, if the CODESET names a well-known + Python codec, and Py_FileSystemDefaultEncoding isn't + initialized by other means. Also set the encoding of + stdin and stdout if these are terminals. */ + + codeset = get_codeset(); + if (codeset) { + if (!Py_FileSystemDefaultEncoding) + Py_FileSystemDefaultEncoding = codeset; + else + free(codeset); + } +#endif + if (install_sigs) initsigs(); /* Signal handling stuff, including initintr() */ @@ -285,22 +301,6 @@ #ifdef WITH_THREAD _PyGILState_Init(interp, tstate); #endif /* WITH_THREAD */ - -#if defined(HAVE_LANGINFO_H) && defined(CODESET) - /* On Unix, set the file system encoding according to the - user's preference, if the CODESET names a well-known - Python codec, and Py_FileSystemDefaultEncoding isn't - initialized by other means. Also set the encoding of - stdin and stdout if these are terminals. */ - - codeset = get_codeset(); - if (codeset) { - if (!Py_FileSystemDefaultEncoding) - Py_FileSystemDefaultEncoding = codeset; - else - free(codeset); - } -#endif } void From python-checkins at python.org Sun May 3 10:11:28 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 3 May 2009 10:11:28 +0200 (CEST) Subject: [Python-checkins] r72232 - python/branches/pep-0383/Python/codecs.c Message-ID: <20090503081128.84FA11E401D@bag.python.org> Author: martin.v.loewis Date: Sun May 3 10:11:23 2009 New Revision: 72232 Log: Fix minor errors. Modified: python/branches/pep-0383/Python/codecs.c Modified: python/branches/pep-0383/Python/codecs.c ============================================================================== --- python/branches/pep-0383/Python/codecs.c (original) +++ python/branches/pep-0383/Python/codecs.c Sun May 3 10:11:23 2009 @@ -826,7 +826,8 @@ } } -PyObject *PyCodec_UTF8bErrors(PyObject *exc) +static PyObject * +PyCodec_UTF8bErrors(PyObject *exc) { PyObject *restuple; PyObject *object; @@ -883,10 +884,6 @@ consumed++; } Py_DECREF(object); - if (ch == 0) { - PyErr_SetObject(PyExceptionInstance_Class(exc), exc); - return NULL; - } return Py_BuildValue("(u#n)", ch, consumed, start+consumed); } else { From python-checkins at python.org Sun May 3 10:16:59 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 3 May 2009 10:16:59 +0200 (CEST) Subject: [Python-checkins] r72233 - peps/trunk/pep-0383.txt Message-ID: <20090503081659.72F0E1E4011@bag.python.org> Author: martin.v.loewis Date: Sun May 3 10:16:57 2009 New Revision: 72233 Log: Remove utf-8b codec. Rename error handler to utf8b. Modified: peps/trunk/pep-0383.txt Modified: peps/trunk/pep-0383.txt ============================================================================== --- peps/trunk/pep-0383.txt (original) +++ peps/trunk/pep-0383.txt Sun May 3 10:16:57 2009 @@ -72,27 +72,17 @@ represented as lone half surrogate codes U+DC80..U+DCFF. Bytes below 128 will produce exceptions; see the discussion below. -To convert non-decodable bytes, a new error handler ([2]) -"python-escape" is introduced, which produces these half -surrogates. On encoding, the error handler converts the half surrogate -back to the corresponding byte. This error handler will be used in any -API that receives or produces file names, command line arguments, or -environment variables. +To convert non-decodable bytes, a new error handler ([2]) "utf8b" is +introduced, which produces these half surrogates. On encoding, the +error handler converts the half surrogate back to the corresponding +byte. This error handler will be used in any API that receives or +produces file names, command line arguments, or environment variables. The error handler interface is extended to allow the encode error handler to return byte strings immediately, in addition to returning Unicode strings which then get encoded again (also see the discussion below). -If the locale's encoding is UTF-8, the file system encoding is set to -a new encoding "utf-8b", as the regular UTF-8 codec would not -re-encode half surrogates as single bytes. The UTF-8b codec decodes -invalid bytes (which must be >= 0x80) into half surrogate codes -U+DC80..U+DCFF. Unlike the utf-8 codec, the utf-8b codec follows the -strict definition of UTF-8 to determine what an invalid byte is -(which, among other restrictions, disallows to encode surrogate codes -in UTF-8). - Byte-orientied interfaces that already exist in Python 3.0 are not affected by this specification. They are neither enhanced nor deprecated. From python-checkins at python.org Sun May 3 19:32:28 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 3 May 2009 19:32:28 +0200 (CEST) Subject: [Python-checkins] r72234 - peps/trunk/pep-0383.txt Message-ID: <20090503173228.0F1231E4073@bag.python.org> Author: martin.v.loewis Date: Sun May 3 19:32:27 2009 New Revision: 72234 Log: Fix typo. Modified: peps/trunk/pep-0383.txt Modified: peps/trunk/pep-0383.txt ============================================================================== --- peps/trunk/pep-0383.txt (original) +++ peps/trunk/pep-0383.txt Sun May 3 19:32:27 2009 @@ -68,7 +68,7 @@ On POSIX systems, Python currently applies the locale's encoding to convert the byte data to Unicode, failing for characters that cannot -be decoded. With this PEP, non-decodable bytes >128 will be +be decoded. With this PEP, non-decodable bytes >= 128 will be represented as lone half surrogate codes U+DC80..U+DCFF. Bytes below 128 will produce exceptions; see the discussion below. From python-checkins at python.org Sun May 3 20:19:26 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 3 May 2009 20:19:26 +0200 (CEST) Subject: [Python-checkins] r72235 - in python/branches/pep-0383: Modules/python.c configure configure.in pyconfig.h.in Message-ID: <20090503181926.EA22C1E4048@bag.python.org> Author: martin.v.loewis Date: Sun May 3 20:19:21 2009 New Revision: 72235 Log: Convert command line arguments. Modified: python/branches/pep-0383/Modules/python.c python/branches/pep-0383/configure python/branches/pep-0383/configure.in python/branches/pep-0383/pyconfig.h.in Modified: python/branches/pep-0383/Modules/python.c ============================================================================== --- python/branches/pep-0383/Modules/python.c (original) +++ python/branches/pep-0383/Modules/python.c Sun May 3 20:19:21 2009 @@ -14,6 +14,93 @@ return Py_Main(argc, argv); } #else +static wchar_t* +char2wchar(char* arg) +{ + wchar_t *res; +#ifdef HAVE_BROKEN_MBSTOWCS + /* Some platforms have a broken implementation of + * mbstowcs which does not count the characters that + * would result from conversion. Use an upper bound. + */ + size_t argsize = strlen(arg); +#else + size_t argsize = mbstowcs(NULL, arg, 0); +#endif + size_t count; + unsigned char *in; + wchar_t *out; +#ifdef HAVE_MBRTOWC + mbstate_t mbs; +#endif + if (argsize != (size_t)-1) { + res = (wchar_t *)PyMem_Malloc((argsize+1)*sizeof(wchar_t)); + if (!res) + goto oom; + count = mbstowcs(res, arg, argsize+1); + if (count != (size_t)-1) + return res; + PyMem_Free(res); + } + /* Conversion failed. Fall back to escaping with utf8b. */ +#ifdef HAVE_MBRTOWC + /* Try conversion with mbsrtwocs (C99), and escape non-decodable bytes. */ + + /* Overallocate; as multi-byte characters are in the argument, the + actual output could use less memory. */ + argsize = strlen(arg) + 1; + res = PyMem_Malloc(argsize*sizeof(wchar_t)); + if (!res) goto oom; + in = (unsigned char*)arg; + out = res; + memset(&mbs, 0, sizeof mbs); + while (argsize) { + size_t converted = mbrtowc(out, (char*)in, argsize, &mbs); + if (converted == 0) + /* Reached end of string; null char stored. */ + break; + if (converted == (size_t)-2) { + /* Incomplete character. This should never happen, + since we provide everything that we have - + unless there is a bug in the C library, or I + misunderstood how mbrtowc works. */ + fprintf(stderr, "unexpected mbrtowc result -2\n"); + return NULL; + } + if (converted == (size_t)-1) { + /* Conversion error. Escape as UTF-8b, and start over + in the initial shift state. */ + *out++ = 0xdc00 + *in++; + argsize--; + memset(&mbs, 0, sizeof mbs); + continue; + } + /* successfully converted some bytes */ + in += converted; + argsize -= converted; + out++; + } +#else + /* Cannot use C locale for escaping; manually escape as if charset + is ASCII (i.e. escape all bytes > 128. This will still roundtrip + correctly in the locale's charset, which must be an ASCII superset. */ + res = PyMem_Malloc((strlen(arg)+1)*sizeof(wchar_t)); + if (!res) goto oom; + in = (unsigned char*)arg; + out = res; + while(*in) + if(*in < 128) + *out++ = *in++; + else + *out++ = 0xdc00 + *in++; + *out = 0; +#endif + return res; +oom: + fprintf(stderr, "out of memory\n"); + return NULL; +} + int main(int argc, char **argv) { @@ -40,31 +127,9 @@ oldloc = strdup(setlocale(LC_ALL, NULL)); setlocale(LC_ALL, ""); for (i = 0; i < argc; i++) { -#ifdef HAVE_BROKEN_MBSTOWCS - /* Some platforms have a broken implementation of - * mbstowcs which does not count the characters that - * would result from conversion. Use an upper bound. - */ - size_t argsize = strlen(argv[i]); -#else - size_t argsize = mbstowcs(NULL, argv[i], 0); -#endif - size_t count; - if (argsize == (size_t)-1) { - fprintf(stderr, "Could not convert argument %d to string\n", i); + argv_copy2[i] = argv_copy[i] = char2wchar(argv[i]); + if (!argv_copy[i]) return 1; - } - argv_copy[i] = (wchar_t *)PyMem_Malloc((argsize+1)*sizeof(wchar_t)); - argv_copy2[i] = argv_copy[i]; - if (!argv_copy[i]) { - fprintf(stderr, "out of memory\n"); - return 1; - } - count = mbstowcs(argv_copy[i], argv[i], argsize+1); - if (count == (size_t)-1) { - fprintf(stderr, "Could not convert argument %d to string\n", i); - return 1; - } } setlocale(LC_ALL, oldloc); free(oldloc); Modified: python/branches/pep-0383/configure ============================================================================== --- python/branches/pep-0383/configure (original) +++ python/branches/pep-0383/configure Sun May 3 20:19:21 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 71731 . +# From configure.in Revision: 72144 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 3.1. # @@ -16299,11 +16299,12 @@ + for ac_func in alarm setitimer getitimer bind_textdomain_codeset chown \ clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \ getpriority getpwent getspnam getspent getsid getwd \ - kill killpg lchmod lchown lstat mkfifo mknod mktime \ + kill killpg lchmod lchown lstat mbrtowc mkfifo mknod mktime \ mremap nice pathconf pause plock poll pthread_init \ putenv readlink realpath \ select sem_open sem_timedwait sem_getvalue sem_unlink setegid seteuid \ Modified: python/branches/pep-0383/configure.in ============================================================================== --- python/branches/pep-0383/configure.in (original) +++ python/branches/pep-0383/configure.in Sun May 3 20:19:21 2009 @@ -2403,7 +2403,7 @@ clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \ getpriority getpwent getspnam getspent getsid getwd \ - kill killpg lchmod lchown lstat mkfifo mknod mktime \ + kill killpg lchmod lchown lstat mbrtowc mkfifo mknod mktime \ mremap nice pathconf pause plock poll pthread_init \ putenv readlink realpath \ select sem_open sem_timedwait sem_getvalue sem_unlink setegid seteuid \ Modified: python/branches/pep-0383/pyconfig.h.in ============================================================================== --- python/branches/pep-0383/pyconfig.h.in (original) +++ python/branches/pep-0383/pyconfig.h.in Sun May 3 20:19:21 2009 @@ -419,6 +419,9 @@ /* Define this if you have the makedev macro. */ #undef HAVE_MAKEDEV +/* Define to 1 if you have the `mbrtowc' function. */ +#undef HAVE_MBRTOWC + /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE From python-checkins at python.org Sun May 3 20:30:40 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 3 May 2009 20:30:40 +0200 (CEST) Subject: [Python-checkins] r72236 - python/branches/pep-0383/Python/codecs.c Message-ID: <20090503183040.A39E91E4048@bag.python.org> Author: martin.v.loewis Date: Sun May 3 20:30:39 2009 New Revision: 72236 Log: Refuse to escape ASCII bytes. Modified: python/branches/pep-0383/Python/codecs.c Modified: python/branches/pep-0383/Python/codecs.c ============================================================================== --- python/branches/pep-0383/Python/codecs.c (original) +++ python/branches/pep-0383/Python/codecs.c Sun May 3 20:30:39 2009 @@ -880,9 +880,17 @@ return NULL; } while (consumed < 4 && consumed < end-start) { + /* Refuse to escape ASCII bytes. */ + if (p[start+consumed] < 128) + break; ch[consumed] = 0xdc00 + p[start+consumed]; consumed++; } + if (!consumed) { + /* codec complained about ASCII byte. */ + PyErr_SetObject(PyExceptionInstance_Class(exc), exc); + return NULL; + } Py_DECREF(object); return Py_BuildValue("(u#n)", ch, consumed, start+consumed); } From python-checkins at python.org Sun May 3 20:42:16 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sun, 3 May 2009 20:42:16 +0200 (CEST) Subject: [Python-checkins] r72237 - in python/trunk/Demo/sockets: README mcast.py Message-ID: <20090503184216.7745B1E4048@bag.python.org> Author: gregory.p.smith Date: Sun May 3 20:42:15 2009 New Revision: 72237 Log: Issue 5379 - applies patch supplied by philipp hagemeister to fix many problems with the ancient mcast.py demo code. Modified: python/trunk/Demo/sockets/README python/trunk/Demo/sockets/mcast.py Modified: python/trunk/Demo/sockets/README ============================================================================== --- python/trunk/Demo/sockets/README (original) +++ python/trunk/Demo/sockets/README Sun May 3 20:42:15 2009 @@ -5,17 +5,10 @@ finger.py Client for the 'finger' protocol. ftp.py A very simple ftp client. gopher.py A simple gopher client. +mcast.py IPv4/v6 multicast example radio.py Receive time broadcasts from broadcast.py. telnet.py Client for the 'telnet' protocol. throughput.py Client and server to measure TCP throughput. unixclient.py Unix socket example, client side unixserver.py Unix socket example, server side udpecho.py Client and server for the UDP echo protocol. - -The following file is only relevant on SGI machines (or other systems -that support multicast): - -mcast.py A Python translation of - /usr/people/4Dgifts/examples/network/mcast.c - (Note that IN.py is in ../../lib/sgi.) - Modified: python/trunk/Demo/sockets/mcast.py ============================================================================== --- python/trunk/Demo/sockets/mcast.py (original) +++ python/trunk/Demo/sockets/mcast.py Sun May 3 20:42:15 2009 @@ -1,93 +1,87 @@ +#!/usr/bin/env python +# # Send/receive UDP multicast packets. # Requires that your OS kernel supports IP multicast. -# This is built-in on SGI, still optional for most other vendors. # # Usage: -# mcast -s (sender) -# mcast -b (sender, using broadcast instead multicast) -# mcast (receivers) +# mcast -s (sender, IPv4) +# mcast -s -6 (sender, IPv6) +# mcast (receivers, IPv4) +# mcast -6 (receivers, IPv6) MYPORT = 8123 -MYGROUP = '225.0.0.250' +MYGROUP_4 = '225.0.0.250' +MYGROUP_6 = 'ff15:7079:7468:6f6e:6465:6d6f:6d63:6173' +MYTTL = 1 # Increase to reach other networks -import sys +import ipaddr import time import struct -from socket import * - +import socket +import sys -# Main program def main(): - flags = sys.argv[1:] - # - if flags: - sender(flags[0]) + group = MYGROUP_6 if "-6" in sys.argv[1:] else MYGROUP_4 + + if "-s" in sys.argv[1:]: + sender(group) else: - receiver() + receiver(group) +def _sockfam(ip): + """Returns the family argument of socket.socket""" + if ip.version == 4: + return socket.AF_INET + elif ip.version == 6: + return socket.AF_INET6 + else: + raise ValueError('IPv' + ip.version + ' is not supported') -# Sender subroutine (only one per local area network) -def sender(flag): - s = socket(AF_INET, SOCK_DGRAM) - if flag == '-b': - s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1) - mygroup = '' +def sender(group): + group_ip = ipaddr.IP(group) + + s = socket.socket(_sockfam(group_ip), socket.SOCK_DGRAM) + + # Set Time-to-live (optional) + ttl_bin = struct.pack('@i', MYTTL) + if group_ip.version == 4: + s.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, ttl_bin) else: - mygroup = MYGROUP - ttl = struct.pack('b', 1) # Time-to-live - s.setsockopt(IPPROTO_IP, IP_MULTICAST_TTL, ttl) - while 1: + s.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_MULTICAST_HOPS, ttl_bin) + + while True: data = repr(time.time()) -## data = data + (1400 - len(data)) * '\0' - s.sendto(data, (mygroup, MYPORT)) + s.sendto(data + '\0', (group_ip.ip_ext_full, MYPORT)) time.sleep(1) -# Receiver subroutine (as many as you like) -def receiver(): - # Open and initialize the socket - s = openmcastsock(MYGROUP, MYPORT) - # - # Loop, printing any data we receive - while 1: - data, sender = s.recvfrom(1500) - while data[-1:] == '\0': data = data[:-1] # Strip trailing \0's - print sender, ':', repr(data) - +def receiver(group): + group_ip = ipaddr.IP(group) -# Open a UDP socket, bind it to a port and select a multicast group -def openmcastsock(group, port): - # Import modules used only here - import string - import struct - # # Create a socket - s = socket(AF_INET, SOCK_DGRAM) - # + s = socket.socket(_sockfam(group_ip), socket.SOCK_DGRAM) + # Allow multiple copies of this program on one machine # (not strictly needed) - s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) - # + s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + # Bind it to the port - s.bind(('', port)) - # - # Look up multicast group address in name server - # (doesn't hurt if it is already in ddd.ddd.ddd.ddd format) - group = gethostbyname(group) - # - # Construct binary group address - bytes = map(int, string.split(group, ".")) - grpaddr = 0 - for byte in bytes: grpaddr = (grpaddr << 8) | byte - # - # Construct struct mreq from grpaddr and ifaddr - ifaddr = INADDR_ANY - mreq = struct.pack('ll', htonl(grpaddr), htonl(ifaddr)) - # - # Add group membership - s.setsockopt(IPPROTO_IP, IP_ADD_MEMBERSHIP, mreq) - # - return s + s.bind(('', MYPORT)) + + # Join group + if group_ip.version == 4: # IPv4 + mreq = group_ip.packed + struct.pack('=I', socket.INADDR_ANY) + s.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq) + else: + mreq = group_ip.packed + struct.pack('@I', 0) + s.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_JOIN_GROUP, mreq) + + # Loop, printing any data we receive + while True: + data, sender = s.recvfrom(1500) + while data[-1:] == '\0': data = data[:-1] # Strip trailing \0's + print (str(sender) + ' ' + repr(data)) -main() +if __name__ == '__main__': + main() From python-checkins at python.org Sun May 3 21:10:01 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sun, 3 May 2009 21:10:01 +0200 (CEST) Subject: [Python-checkins] r72238 - in python/branches/py3k/Demo/sockets: README mcast.py Message-ID: <20090503191001.411181E4048@bag.python.org> Author: gregory.p.smith Date: Sun May 3 21:09:56 2009 New Revision: 72238 Log: Merged revisions 72237 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72237 | gregory.p.smith | 2009-05-03 11:42:15 -0700 (Sun, 03 May 2009) | 3 lines Issue 5379 - applies patch supplied by philipp hagemeister to fix many problems with the ancient mcast.py demo code. ........ Modified: python/branches/py3k/Demo/sockets/README python/branches/py3k/Demo/sockets/mcast.py Modified: python/branches/py3k/Demo/sockets/README ============================================================================== --- python/branches/py3k/Demo/sockets/README (original) +++ python/branches/py3k/Demo/sockets/README Sun May 3 21:09:56 2009 @@ -5,17 +5,10 @@ finger.py Client for the 'finger' protocol. ftp.py A very simple ftp client. gopher.py A simple gopher client. +mcast.py IPv4/v6 multicast example radio.py Receive time broadcasts from broadcast.py. telnet.py Client for the 'telnet' protocol. throughput.py Client and server to measure TCP throughput. unixclient.py Unix socket example, client side unixserver.py Unix socket example, server side udpecho.py Client and server for the UDP echo protocol. - -The following file is only relevant on SGI machines (or other systems -that support multicast): - -mcast.py A Python translation of - /usr/people/4Dgifts/examples/network/mcast.c - (Note that IN.py is in ../../lib/sgi.) - Modified: python/branches/py3k/Demo/sockets/mcast.py ============================================================================== --- python/branches/py3k/Demo/sockets/mcast.py (original) +++ python/branches/py3k/Demo/sockets/mcast.py Sun May 3 21:09:56 2009 @@ -1,93 +1,87 @@ +#!/usr/bin/env python +# # Send/receive UDP multicast packets. # Requires that your OS kernel supports IP multicast. -# This is built-in on SGI, still optional for most other vendors. # # Usage: -# mcast -s (sender) -# mcast -b (sender, using broadcast instead multicast) -# mcast (receivers) +# mcast -s (sender, IPv4) +# mcast -s -6 (sender, IPv6) +# mcast (receivers, IPv4) +# mcast -6 (receivers, IPv6) MYPORT = 8123 -MYGROUP = '225.0.0.250' +MYGROUP_4 = '225.0.0.250' +MYGROUP_6 = 'ff15:7079:7468:6f6e:6465:6d6f:6d63:6173' +MYTTL = 1 # Increase to reach other networks -import sys +import ipaddr import time import struct -from socket import * - +import socket +import sys -# Main program def main(): - flags = sys.argv[1:] - # - if flags: - sender(flags[0]) + group = MYGROUP_6 if "-6" in sys.argv[1:] else MYGROUP_4 + + if "-s" in sys.argv[1:]: + sender(group) else: - receiver() + receiver(group) +def _sockfam(ip): + """Returns the family argument of socket.socket""" + if ip.version == 4: + return socket.AF_INET + elif ip.version == 6: + return socket.AF_INET6 + else: + raise ValueError('IPv' + ip.version + ' is not supported') -# Sender subroutine (only one per local area network) -def sender(flag): - s = socket(AF_INET, SOCK_DGRAM) - if flag == '-b': - s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1) - mygroup = '' +def sender(group): + group_ip = ipaddr.IP(group) + + s = socket.socket(_sockfam(group_ip), socket.SOCK_DGRAM) + + # Set Time-to-live (optional) + ttl_bin = struct.pack('@i', MYTTL) + if group_ip.version == 4: + s.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_TTL, ttl_bin) else: - mygroup = MYGROUP - ttl = struct.pack('b', 1) # Time-to-live - s.setsockopt(IPPROTO_IP, IP_MULTICAST_TTL, ttl) - while 1: - data = repr(time.time()) -## data = data + (1400 - len(data)) * '\0' - s.sendto(data, (mygroup, MYPORT)) + s.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_MULTICAST_HOPS, ttl_bin) + + while True: + data = repr(time.time()).encode('utf-8') + b'\0' + s.sendto(data, (group_ip.ip_ext_full, MYPORT)) time.sleep(1) -# Receiver subroutine (as many as you like) -def receiver(): - # Open and initialize the socket - s = openmcastsock(MYGROUP, MYPORT) - # - # Loop, printing any data we receive - while 1: - data, sender = s.recvfrom(1500) - while data[-1:] == '\0': data = data[:-1] # Strip trailing \0's - print(sender, ':', repr(data)) - +def receiver(group): + group_ip = ipaddr.IP(group) -# Open a UDP socket, bind it to a port and select a multicast group -def openmcastsock(group, port): - # Import modules used only here - import string - import struct - # # Create a socket - s = socket(AF_INET, SOCK_DGRAM) - # + s = socket.socket(_sockfam(group_ip), socket.SOCK_DGRAM) + # Allow multiple copies of this program on one machine # (not strictly needed) - s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) - # + s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) + # Bind it to the port - s.bind(('', port)) - # - # Look up multicast group address in name server - # (doesn't hurt if it is already in ddd.ddd.ddd.ddd format) - group = gethostbyname(group) - # - # Construct binary group address - bytes = list(map(int, string.split(group, "."))) - grpaddr = 0 - for byte in bytes: grpaddr = (grpaddr << 8) | byte - # - # Construct struct mreq from grpaddr and ifaddr - ifaddr = INADDR_ANY - mreq = struct.pack('ll', htonl(grpaddr), htonl(ifaddr)) - # - # Add group membership - s.setsockopt(IPPROTO_IP, IP_ADD_MEMBERSHIP, mreq) - # - return s + s.bind(('', MYPORT)) + + # Join group + if group_ip.version == 4: # IPv4 + mreq = group_ip.packed + struct.pack('=I', socket.INADDR_ANY) + s.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq) + else: + mreq = group_ip.packed + struct.pack('@I', 0) + s.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_JOIN_GROUP, mreq) + + # Loop, printing any data we receive + while True: + data, sender = s.recvfrom(1500) + while data[-1:] == '\0': data = data[:-1] # Strip trailing \0's + print(str(sender) + ' ' + repr(data)) -main() +if __name__ == '__main__': + main() From python-checkins at python.org Sun May 3 21:11:25 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sun, 3 May 2009 21:11:25 +0200 (CEST) Subject: [Python-checkins] r72239 - python/branches/py3k Message-ID: <20090503191125.79A5D1E4048@bag.python.org> Author: gregory.p.smith Date: Sun May 3 21:11:25 2009 New Revision: 72239 Log: missing commit of . for last checkin. Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sun May 3 21:14:40 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 3 May 2009 21:14:40 +0200 (CEST) Subject: [Python-checkins] r72240 - python/branches/pep-0383/Objects/unicodeobject.c Message-ID: <20090503191440.EC35E1E420D@bag.python.org> Author: martin.v.loewis Date: Sun May 3 21:14:40 2009 New Revision: 72240 Log: Support byte results from error handlers in ucs1 and charmap encoders. Modified: python/branches/pep-0383/Objects/unicodeobject.c Modified: python/branches/pep-0383/Objects/unicodeobject.c ============================================================================== --- python/branches/pep-0383/Objects/unicodeobject.c (original) +++ python/branches/pep-0383/Objects/unicodeobject.c Sun May 3 21:14:40 2009 @@ -4154,11 +4154,22 @@ collstart-startp, collend-startp, &newpos); if (repunicode == NULL) goto onError; - if (!PyUnicode_Check(repunicode)) { - /* Implementation limitation: byte results not supported yet. */ - PyErr_SetString(PyExc_TypeError, "error handler should return unicode"); + if (PyBytes_Check(repunicode)) { + /* Directly copy bytes result to output. */ + repsize = PyBytes_Size(repunicode); + if (repsize > 1) { + /* Make room for all additional bytes. */ + if (_PyBytes_Resize(&res, ressize+repsize-1)) { + Py_DECREF(repunicode); + goto onError; + } + ressize += repsize-1; + } + memcpy(str, PyBytes_AsString(repunicode), repsize); + str += repsize; + p = startp + newpos; Py_DECREF(repunicode); - goto onError; + break; } /* need more space? (at least enough for what we have+the replacement+the rest of the string, so @@ -5123,11 +5134,24 @@ collstartpos, collendpos, &newpos); if (repunicode == NULL) return -1; - if (!PyUnicode_Check(repunicode)) { - /* Implementation limitation: byte results not supported yet. */ - PyErr_SetString(PyExc_TypeError, "error handler should return unicode"); + if (PyBytes_Check(repunicode)) { + /* Directly copy bytes result to output. */ + Py_ssize_t outsize = PyBytes_Size(*res); + Py_ssize_t requiredsize; + repsize = PyBytes_Size(repunicode); + requiredsize = *respos + repsize; + if (requiredsize > outsize) + /* Make room for all additional bytes. */ + if (charmapencode_resize(res, respos, requiredsize)) { + Py_DECREF(repunicode); + return -1; + } + memcpy(PyBytes_AsString(*res) + *respos, + PyBytes_AsString(repunicode), repsize); + *respos += repsize; + *inpos = newpos; Py_DECREF(repunicode); - return -1; + break; } /* generate replacement */ repsize = PyUnicode_GET_SIZE(repunicode); @@ -5691,7 +5715,7 @@ if (repunicode == NULL) goto onError; if (!PyUnicode_Check(repunicode)) { - /* Implementation limitation: byte results not supported yet. */ + /* Byte results not supported, since they have no decimal property. */ PyErr_SetString(PyExc_TypeError, "error handler should return unicode"); Py_DECREF(repunicode); goto onError; From buildbot at python.org Sun May 3 21:28:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 03 May 2009 19:28:07 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090503192808.18B981E4048@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/870 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: gregory.p.smith BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_os make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun May 3 21:37:06 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sun, 3 May 2009 21:37:06 +0200 (CEST) Subject: [Python-checkins] r72241 - python/trunk/Lib/ipaddr.py Message-ID: <20090503193706.45F6B1E4048@bag.python.org> Author: gregory.p.smith Date: Sun May 3 21:37:05 2009 New Revision: 72241 Log: Optimization: move RFC defined network constant construction out of the is_*() methods and into module private instances. Modified: python/trunk/Lib/ipaddr.py Modified: python/trunk/Lib/ipaddr.py ============================================================================== --- python/trunk/Lib/ipaddr.py (original) +++ python/trunk/Lib/ipaddr.py Sun May 3 21:37:05 2009 @@ -26,6 +26,7 @@ import struct + class Error(Exception): """Base class for exceptions.""" @@ -540,6 +541,7 @@ # Equivalent to 255.255.255.255 or 32 bits of 1's. _ALL_ONES = 0xffffffff + _version = 4 def __init__(self, ipaddr): """Instantiate a new IPv4 object. @@ -569,7 +571,6 @@ """ BaseIP.__init__(self) - self._version = 4 # Efficient constructor from integer. if isinstance(ipaddr, int) or isinstance(ipaddr, long): @@ -711,9 +712,10 @@ A boolean, True if the address is reserved per RFC 1918. """ - return (self in IPv4('10.0.0.0/8') or - self in IPv4('172.16.0.0/12') or - self in IPv4('192.168.0.0/16')) + for network in _IPV4_RFC1918_NETWORKS: + if self in network: + return True + return False @property def is_multicast(self): @@ -724,7 +726,7 @@ See RFC 3171 for details. """ - return self in IPv4('224.0.0.0/4') + return self in _IPV4_RFC3171_MULTICAST @property def is_loopback(self): @@ -734,7 +736,7 @@ A boolean, True if the address is a loopback per RFC 3330. """ - return self in IPv4('127.0.0.0/8') + return self in _IPV4_RFC3330_LOOPBACK @property def is_link_local(self): @@ -744,7 +746,7 @@ A boolean, True if the address is link-local per RFC 3927. """ - return self in IPv4('169.254.0.0/16') + return self in _IPV4_RFC3927_LINK_LOCAL @property def version(self): @@ -873,6 +875,7 @@ """ _ALL_ONES = (2**128) - 1 + _version = 6 def __init__(self, ipaddr): """Instantiate a new IPv6 object. @@ -900,7 +903,6 @@ """ BaseIP.__init__(self) - self._version = 6 # Efficient constructor from integer. if isinstance(ipaddr, long) or isinstance(ipaddr, int): @@ -1032,7 +1034,7 @@ See RFC 2373 2.7 for details. """ - return self in IPv6('ff00::/8') + return self in _IPV6_RFC2373_MULTICAST @property def is_unspecified(self): @@ -1043,7 +1045,7 @@ RFC 2373 2.5.2. """ - return self == IPv6('::') + return self == _IPV6_RFC2373_UNSPECIFIED @property def is_loopback(self): @@ -1054,7 +1056,7 @@ RFC 2373 2.5.3. """ - return self == IPv6('::1') + return self == _IPV6_RFC2373_LOOPBACK @property def is_link_local(self): @@ -1064,7 +1066,7 @@ A boolean, True if the address is reserved per RFC 4291. """ - return self in IPv6('fe80::/10') + return self in _IPV6_RFC4291_LINK_LOCAL @property def is_site_local(self): @@ -1078,7 +1080,7 @@ A boolean, True if the address is reserved per RFC 3513 2.5.6. """ - return self in IPv6('fec0::/10') + return self in _IPV6_RFC3513_SITE_LOCAL @property def is_private(self): @@ -1088,7 +1090,7 @@ A boolean, True if the address is reserved per RFC 4193. """ - return self in IPv6('fc00::/7') + return self in _IPV6_RFC4193_PRIVATE @property def version(self): @@ -1335,3 +1337,20 @@ """ return self.prefixlen + + +# IPv4 constants. +_IPV4_RFC1918_NETWORKS = (IPv4('10.0.0.0/8'), + IPv4('172.16.0.0/12'), + IPv4('192.168.0.0/16')) +_IPV4_RFC3171_MULTICAST = IPv4('224.0.0.0/4') +_IPV4_RFC3330_LOOPBACK = IPv4('127.0.0.0/8') +_IPV4_RFC3927_LINK_LOCAL = IPv4('169.254.0.0/16') + +# IPv6 constants. +_IPV6_RFC2373_MULTICAST = IPv6('ff00::/8') +_IPV6_RFC2373_UNSPECIFIED = IPv6('::') +_IPV6_RFC2373_LOOPBACK = IPv6('::1') +_IPV6_RFC4291_LINK_LOCAL = IPv6('fe80::/10') +_IPV6_RFC3513_SITE_LOCAL = IPv6('fec0::/10') # Deprecated by RFC3879. +_IPV6_RFC4193_PRIVATE = IPv6('fc00::/7') From python-checkins at python.org Sun May 3 21:38:30 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sun, 3 May 2009 21:38:30 +0200 (CEST) Subject: [Python-checkins] r72242 - in python/branches/py3k: Lib/ipaddr.py Message-ID: <20090503193830.124931E4048@bag.python.org> Author: gregory.p.smith Date: Sun May 3 21:38:29 2009 New Revision: 72242 Log: Merged revisions 72241 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72241 | gregory.p.smith | 2009-05-03 12:37:05 -0700 (Sun, 03 May 2009) | 3 lines Optimization: move RFC defined network constant construction out of the is_*() methods and into module private instances. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/ipaddr.py Modified: python/branches/py3k/Lib/ipaddr.py ============================================================================== --- python/branches/py3k/Lib/ipaddr.py (original) +++ python/branches/py3k/Lib/ipaddr.py Sun May 3 21:38:29 2009 @@ -26,6 +26,7 @@ import struct + class Error(Exception): """Base class for exceptions.""" @@ -537,6 +538,7 @@ # Equivalent to 255.255.255.255 or 32 bits of 1's. _ALL_ONES = 0xffffffff + _version = 4 def __init__(self, ipaddr): """Instantiate a new IPv4 object. @@ -566,7 +568,6 @@ """ BaseIP.__init__(self) - self._version = 4 # Efficient constructor from integer. if isinstance(ipaddr, int): @@ -715,9 +716,10 @@ A boolean, True if the address is reserved per RFC 1918. """ - return (self in IPv4('10.0.0.0/8') or - self in IPv4('172.16.0.0/12') or - self in IPv4('192.168.0.0/16')) + for network in _IPV4_RFC1918_NETWORKS: + if self in network: + return True + return False @property def is_multicast(self): @@ -728,7 +730,7 @@ See RFC 3171 for details. """ - return self in IPv4('224.0.0.0/4') + return self in _IPV4_RFC3171_MULTICAST @property def is_loopback(self): @@ -738,7 +740,7 @@ A boolean, True if the address is a loopback per RFC 3330. """ - return self in IPv4('127.0.0.0/8') + return self in _IPV4_RFC3330_LOOPBACK @property def is_link_local(self): @@ -748,7 +750,7 @@ A boolean, True if the address is link-local per RFC 3927. """ - return self in IPv4('169.254.0.0/16') + return self in _IPV4_RFC3927_LINK_LOCAL @property def version(self): @@ -877,6 +879,7 @@ """ _ALL_ONES = (2**128) - 1 + _version = 6 def __init__(self, ipaddr): """Instantiate a new IPv6 object. @@ -904,7 +907,6 @@ """ BaseIP.__init__(self) - self._version = 6 # Efficient constructor from integer. if isinstance(ipaddr, int): @@ -1044,7 +1046,7 @@ See RFC 2373 2.7 for details. """ - return self in IPv6('ff00::/8') + return self in _IPV6_RFC2373_MULTICAST @property def is_unspecified(self): @@ -1055,7 +1057,7 @@ RFC 2373 2.5.2. """ - return self == IPv6('::') + return self == _IPV6_RFC2373_UNSPECIFIED @property def is_loopback(self): @@ -1066,7 +1068,7 @@ RFC 2373 2.5.3. """ - return self == IPv6('::1') + return self == _IPV6_RFC2373_LOOPBACK @property def is_link_local(self): @@ -1076,7 +1078,7 @@ A boolean, True if the address is reserved per RFC 4291. """ - return self in IPv6('fe80::/10') + return self in _IPV6_RFC4291_LINK_LOCAL @property def is_site_local(self): @@ -1090,7 +1092,7 @@ A boolean, True if the address is reserved per RFC 3513 2.5.6. """ - return self in IPv6('fec0::/10') + return self in _IPV6_RFC3513_SITE_LOCAL @property def is_private(self): @@ -1100,7 +1102,7 @@ A boolean, True if the address is reserved per RFC 4193. """ - return self in IPv6('fc00::/7') + return self in _IPV6_RFC4193_PRIVATE @property def version(self): @@ -1347,3 +1349,20 @@ """ return self.prefixlen + + +# IPv4 constants. +_IPV4_RFC1918_NETWORKS = (IPv4('10.0.0.0/8'), + IPv4('172.16.0.0/12'), + IPv4('192.168.0.0/16')) +_IPV4_RFC3171_MULTICAST = IPv4('224.0.0.0/4') +_IPV4_RFC3330_LOOPBACK = IPv4('127.0.0.0/8') +_IPV4_RFC3927_LINK_LOCAL = IPv4('169.254.0.0/16') + +# IPv6 constants. +_IPV6_RFC2373_MULTICAST = IPv6('ff00::/8') +_IPV6_RFC2373_UNSPECIFIED = IPv6('::') +_IPV6_RFC2373_LOOPBACK = IPv6('::1') +_IPV6_RFC4291_LINK_LOCAL = IPv6('fe80::/10') +_IPV6_RFC3513_SITE_LOCAL = IPv6('fec0::/10') # Deprecated by RFC3879. +_IPV6_RFC4193_PRIVATE = IPv6('fc00::/7') From python-checkins at python.org Sun May 3 21:51:08 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 3 May 2009 21:51:08 +0200 (CEST) Subject: [Python-checkins] r72243 - python/branches/pep-0383/Lib/test/test_pep383.py Message-ID: <20090503195108.23A5B1E404E@bag.python.org> Author: martin.v.loewis Date: Sun May 3 21:51:07 2009 New Revision: 72243 Log: Add tests. Added: python/branches/pep-0383/Lib/test/test_pep383.py (contents, props changed) Added: python/branches/pep-0383/Lib/test/test_pep383.py ============================================================================== --- (empty file) +++ python/branches/pep-0383/Lib/test/test_pep383.py Sun May 3 21:51:07 2009 @@ -0,0 +1,76 @@ +from test import support +import unittest, shutil, os, sys + +class Utf8bTest(unittest.TestCase): + + def test_utf8(self): + # Bad byte + self.assertEqual(b"foo\x80bar".decode("utf-8", "utf8b"), + "foo\udc80bar") + self.assertEqual("foo\udc80bar".encode("utf-8", "utf8b"), + b"foo\x80bar") + # bad-utf-8 encoded surrogate + self.assertEqual(b"\xed\xb0\x80".decode("utf-8", "utf8b"), + "\udced\udcb0\udc80") + self.assertEqual("\udced\udcb0\udc80".encode("utf-8", "utf8b"), + b"\xed\xb0\x80") + + def test_ascii(self): + # bad byte + self.assertEqual(b"foo\x80bar".decode("ascii", "utf8b"), + "foo\udc80bar") + self.assertEqual("foo\udc80bar".encode("ascii", "utf8b"), + b"foo\x80bar") + + def test_charmap(self): + # bad byte: \xa5 is unmapped in iso-8859-3 + self.assertEqual(b"foo\xa5bar".decode("iso-8859-3", "utf8b"), + "foo\udca5bar") + self.assertEqual("foo\udca5bar".encode("iso-8859-4", "utf8b"), + b"foo\xa5bar") + +class FileTests(unittest.TestCase): + if os.name != 'win32': + filenames = [b'foo\xf6bar', b'foo\xf6bar'] + else: + # PEP 383 has no effect on file name handling on Windows + filenames = [] + + def setUp(self): + self.fsencoding = sys.getfilesystemencoding() + sys.setfilesystemencoding("utf-8") + self.dir = support.TESTFN + self.bdir = self.dir.encode("utf-8", "utf8b") + os.mkdir(self.dir) + self.unicodefn = [] + for fn in self.filenames: + f = open(self.bdir + b"/" + fn, "w") + f.close() + self.unicodefn.append(fn.decode("utf-8", "utf8b")) + + def tearDown(self): + shutil.rmtree(self.dir) + sys.setfilesystemencoding(self.fsencoding) + + def test_listdir(self): + expected = set(self.unicodefn) + found = set(os.listdir(support.TESTFN)) + self.assertEquals(found, expected) + + def test_open(self): + for fn in self.unicodefn: + f = open(os.path.join(self.dir, fn)) + f.close() + + def test_stat(self): + for fn in self.unicodefn: + os.stat(os.path.join(self.dir, fn)) + +def test_main(): + support.run_unittest( + Utf8bTest, + FileTests) + + +if __name__ == "__main__": + test_main() From buildbot at python.org Sun May 3 21:53:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 03 May 2009 19:53:35 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090503195335.BF0F01E4048@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/685 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: gregory.p.smith BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_cgi test_os test_time make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun May 3 21:59:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 03 May 2009 19:59:22 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090503195922.734471E4048@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/620 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: gregory.p.smith BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sun May 3 22:21:07 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 3 May 2009 22:21:07 +0200 (CEST) Subject: [Python-checkins] r72244 - python/branches/pep-0383/Modules/posixmodule.c Message-ID: <20090503202107.2984E1E4022@bag.python.org> Author: martin.v.loewis Date: Sun May 3 22:21:06 2009 New Revision: 72244 Log: Have listdir raise an exception on undecodable ASCII bytes. Modified: python/branches/pep-0383/Modules/posixmodule.c Modified: python/branches/pep-0383/Modules/posixmodule.c ============================================================================== --- python/branches/pep-0383/Modules/posixmodule.c (original) +++ python/branches/pep-0383/Modules/posixmodule.c Sun May 3 22:21:06 2009 @@ -2511,17 +2511,15 @@ w = PyUnicode_FromEncodedObject(v, Py_FileSystemDefaultEncoding, "utf8b"); - if (w != NULL) { - Py_DECREF(v); + Py_DECREF(v); + if (w != NULL) v = w; - } else { - /* Ignore undecodable filenames, as discussed - * in issue 3187. To include these, - * use getcwdb(). */ - PyErr_Clear(); - Py_DECREF(v); - continue; + /* Encoding failed to decode ASCII bytes. + Raise exception. */ + Py_DECREF(d); + d = NULL; + break; } } if (PyList_Append(d, v) != 0) { From python-checkins at python.org Sun May 3 22:21:26 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sun, 3 May 2009 22:21:26 +0200 (CEST) Subject: [Python-checkins] r72245 - in python/branches/release30-maint: Lib/test/test_os.py Modules/posixmodule.c Message-ID: <20090503202126.C26E31E4022@bag.python.org> Author: gregory.p.smith Date: Sun May 3 22:21:26 2009 New Revision: 72245 Log: backport r71299 from trunk: Fixes issue5705: os.setuid() and friends did not accept the same range of values that pwd.getpwnam() returns. Modified: python/branches/release30-maint/Lib/test/test_os.py python/branches/release30-maint/Modules/posixmodule.c Modified: python/branches/release30-maint/Lib/test/test_os.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_os.py (original) +++ python/branches/release30-maint/Lib/test/test_os.py Sun May 3 22:21:26 2009 @@ -656,6 +656,48 @@ class Win32ErrorTests(unittest.TestCase): pass + class PosixUidGidTests(unittest.TestCase): + if hasattr(os, 'setuid'): + def test_setuid(self): + if os.getuid() != 0: + self.assertRaises(os.error, os.setuid, 0) + self.assertRaises(OverflowError, os.setuid, 1<<32) + + if hasattr(os, 'setgid'): + def test_setgid(self): + if os.getuid() != 0: + self.assertRaises(os.error, os.setgid, 0) + self.assertRaises(OverflowError, os.setgid, 1<<32) + + if hasattr(os, 'seteuid'): + def test_seteuid(self): + if os.getuid() != 0: + self.assertRaises(os.error, os.seteuid, 0) + self.assertRaises(OverflowError, os.seteuid, 1<<32) + + if hasattr(os, 'setegid'): + def test_setegid(self): + if os.getuid() != 0: + self.assertRaises(os.error, os.setegid, 0) + self.assertRaises(OverflowError, os.setegid, 1<<32) + + if hasattr(os, 'setreuid'): + def test_setreuid(self): + if os.getuid() != 0: + self.assertRaises(os.error, os.setreuid, 0, 0) + self.assertRaises(OverflowError, os.setreuid, 1<<32, 0) + self.assertRaises(OverflowError, os.setreuid, 0, 1<<32) + + if hasattr(os, 'setregid'): + def test_setregid(self): + if os.getuid() != 0: + self.assertRaises(os.error, os.setregid, 0, 0) + self.assertRaises(OverflowError, os.setregid, 1<<32, 0) + self.assertRaises(OverflowError, os.setregid, 0, 1<<32) +else: + class PosixUidGidTests(unittest.TestCase): + pass + def test_main(): support.run_unittest( FileTests, @@ -666,7 +708,8 @@ DevNullTests, URandomTests, ExecTests, - Win32ErrorTests + Win32ErrorTests, + PosixUidGidTests ) if __name__ == "__main__": Modified: python/branches/release30-maint/Modules/posixmodule.c ============================================================================== --- python/branches/release30-maint/Modules/posixmodule.c (original) +++ python/branches/release30-maint/Modules/posixmodule.c Sun May 3 22:21:26 2009 @@ -4057,9 +4057,15 @@ static PyObject * posix_setuid(PyObject *self, PyObject *args) { - int uid; - if (!PyArg_ParseTuple(args, "i:setuid", &uid)) + long uid_arg; + uid_t uid; + if (!PyArg_ParseTuple(args, "l:setuid", &uid_arg)) + return NULL; + uid = uid_arg; + if (uid != uid_arg) { + PyErr_SetString(PyExc_OverflowError, "user id too big"); return NULL; + } if (setuid(uid) < 0) return posix_error(); Py_INCREF(Py_None); @@ -4076,10 +4082,16 @@ static PyObject * posix_seteuid (PyObject *self, PyObject *args) { - int euid; - if (!PyArg_ParseTuple(args, "i", &euid)) { + long euid_arg; + uid_t euid; + if (!PyArg_ParseTuple(args, "l", &euid_arg)) + return NULL; + euid = euid_arg; + if (euid != euid_arg) { + PyErr_SetString(PyExc_OverflowError, "user id too big"); return NULL; - } else if (seteuid(euid) < 0) { + } + if (seteuid(euid) < 0) { return posix_error(); } else { Py_INCREF(Py_None); @@ -4096,10 +4108,16 @@ static PyObject * posix_setegid (PyObject *self, PyObject *args) { - int egid; - if (!PyArg_ParseTuple(args, "i", &egid)) { + long egid_arg; + gid_t egid; + if (!PyArg_ParseTuple(args, "l", &egid_arg)) return NULL; - } else if (setegid(egid) < 0) { + egid = egid_arg; + if (egid != egid_arg) { + PyErr_SetString(PyExc_OverflowError, "group id too big"); + return NULL; + } + if (setegid(egid) < 0) { return posix_error(); } else { Py_INCREF(Py_None); @@ -4116,10 +4134,17 @@ static PyObject * posix_setreuid (PyObject *self, PyObject *args) { - int ruid, euid; - if (!PyArg_ParseTuple(args, "ii", &ruid, &euid)) { + long ruid_arg, euid_arg; + uid_t ruid, euid; + if (!PyArg_ParseTuple(args, "ll", &ruid_arg, &euid_arg)) return NULL; - } else if (setreuid(ruid, euid) < 0) { + ruid = ruid_arg; + euid = euid_arg; + if (euid != euid_arg || ruid != ruid_arg) { + PyErr_SetString(PyExc_OverflowError, "user id too big"); + return NULL; + } + if (setreuid(ruid, euid) < 0) { return posix_error(); } else { Py_INCREF(Py_None); @@ -4136,10 +4161,17 @@ static PyObject * posix_setregid (PyObject *self, PyObject *args) { - int rgid, egid; - if (!PyArg_ParseTuple(args, "ii", &rgid, &egid)) { + long rgid_arg, egid_arg; + gid_t rgid, egid; + if (!PyArg_ParseTuple(args, "ll", &rgid_arg, &egid_arg)) + return NULL; + rgid = rgid_arg; + egid = egid_arg; + if (egid != egid_arg || rgid != rgid_arg) { + PyErr_SetString(PyExc_OverflowError, "group id too big"); return NULL; - } else if (setregid(rgid, egid) < 0) { + } + if (setregid(rgid, egid) < 0) { return posix_error(); } else { Py_INCREF(Py_None); @@ -4156,9 +4188,15 @@ static PyObject * posix_setgid(PyObject *self, PyObject *args) { - int gid; - if (!PyArg_ParseTuple(args, "i:setgid", &gid)) + long gid_arg; + gid_t gid; + if (!PyArg_ParseTuple(args, "l:setgid", &gid_arg)) + return NULL; + gid = gid_arg; + if (gid != gid_arg) { + PyErr_SetString(PyExc_OverflowError, "group id too big"); return NULL; + } if (setgid(gid) < 0) return posix_error(); Py_INCREF(Py_None); @@ -4205,7 +4243,7 @@ return NULL; } grouplist[i] = x; - /* read back the value to see if it fitted in gid_t */ + /* read back to see if it fits in gid_t */ if (grouplist[i] != x) { PyErr_SetString(PyExc_TypeError, "group id too big"); From python-checkins at python.org Sun May 3 22:27:26 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sun, 3 May 2009 22:27:26 +0200 (CEST) Subject: [Python-checkins] r72246 - python/trunk/Lib/CGIHTTPServer.py Message-ID: <20090503202726.7A9861E4022@bag.python.org> Author: gregory.p.smith Date: Sun May 3 22:27:25 2009 New Revision: 72246 Log: docstring update. Modified: python/trunk/Lib/CGIHTTPServer.py Modified: python/trunk/Lib/CGIHTTPServer.py ============================================================================== --- python/trunk/Lib/CGIHTTPServer.py (original) +++ python/trunk/Lib/CGIHTTPServer.py Sun May 3 22:27:25 2009 @@ -76,6 +76,9 @@ (dir, rest) if self.path requires running a CGI script. Returns False otherwise. + If any exception is raised, the caller should assume that + self.path was rejected as invalid and act accordingly. + The default implementation tests whether the normalized url path begins with one of the strings in self.cgi_directories (and the next character is a '/' or the end of the string). From python-checkins at python.org Sun May 3 22:29:02 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 3 May 2009 22:29:02 +0200 (CEST) Subject: [Python-checkins] r72247 - in python/branches/pep-0383/Doc/library: codecs.rst os.rst Message-ID: <20090503202902.7D8CA1E4022@bag.python.org> Author: martin.v.loewis Date: Sun May 3 22:29:02 2009 New Revision: 72247 Log: Document PEP 383. Modified: python/branches/pep-0383/Doc/library/codecs.rst python/branches/pep-0383/Doc/library/os.rst Modified: python/branches/pep-0383/Doc/library/codecs.rst ============================================================================== --- python/branches/pep-0383/Doc/library/codecs.rst (original) +++ python/branches/pep-0383/Doc/library/codecs.rst Sun May 3 22:29:02 2009 @@ -322,6 +322,8 @@ | ``'backslashreplace'`` | Replace with backslashed escape sequences | | | (only for encoding). | +-------------------------+-----------------------------------------------+ +| ``'utf8b'`` | Replace byte with surrogate U+DCxx. | ++-------------------------+-----------------------------------------------+ In addition, the following error handlers are specific to a single codec: Modified: python/branches/pep-0383/Doc/library/os.rst ============================================================================== --- python/branches/pep-0383/Doc/library/os.rst (original) +++ python/branches/pep-0383/Doc/library/os.rst Sun May 3 22:29:02 2009 @@ -50,6 +50,26 @@ have currently been registered: ``'posix'``, ``'nt'``, ``'mac'``, ``'os2'``, ``'ce'``, ``'java'``. +.. _os-filenames: + +File Names, Command Line Arguments, and Environment Variables +------------------------------------------------------------- + +In Python, file names, command line arguments, and environment +variables are represented using the string type. On some systems, +decoding these strings to and from bytes is necessary before passing +them to the operating system. Python uses the file system encoding to +perform this conversion (see :func:`sys.getfilesystemencoding`). + +.. versionchanged:: 3.1 + On some systems, conversion using the file system encoding may + fail. In this case, Python uses the ``utf8b`` encoding error + handler. + + +The file system encoding must guarantee to successfully decode all +bytes below 128. If the file system encoding fails to provide this +guarantee, API functions may raise UnicodeErrors. .. _os-procinfo: @@ -688,12 +708,7 @@ .. function:: getcwd() - Return a string representing the current working directory. On Unix - platforms, this function may raise :exc:`UnicodeDecodeError` if the name of - the current directory is not decodable in the file system encoding. Use - :func:`getcwdb` if you need the call to never fail. Availability: Unix, - Windows. - + Return a string representing the current working directory. .. function:: getcwdb() @@ -800,10 +815,8 @@ entries ``'.'`` and ``'..'`` even if they are present in the directory. Availability: Unix, Windows. - This function can be called with a bytes or string argument. In the bytes - case, all filenames will be listed as returned by the underlying API. In the - string case, filenames will be decoded using the file system encoding, and - skipped if a decoding error occurs. + This function can be called with a bytes or string argument, and return + filenames of the same datatype. .. function:: lstat(path) From python-checkins at python.org Sun May 3 22:33:41 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 3 May 2009 22:33:41 +0200 (CEST) Subject: [Python-checkins] r72248 - in python/branches/py3k: Doc/c-api/conversion.rst Include/pystrtod.h Modules/_pickle.c Modules/_testcapimodule.c Objects/complexobject.c Objects/floatobject.c Python/ast.c Python/dtoa.c Python/marshal.c Python/pystrtod.c Message-ID: <20090503203341.03C011E4022@bag.python.org> Author: mark.dickinson Date: Sun May 3 22:33:40 2009 New Revision: 72248 Log: Issue #5914: Add new C-API function PyOS_string_to_double, to complement PyOS_double_to_string, and deprecate PyOS_ascii_strtod and PyOS_ascii_atof. Modified: python/branches/py3k/Doc/c-api/conversion.rst python/branches/py3k/Include/pystrtod.h python/branches/py3k/Modules/_pickle.c python/branches/py3k/Modules/_testcapimodule.c python/branches/py3k/Objects/complexobject.c python/branches/py3k/Objects/floatobject.c python/branches/py3k/Python/ast.c python/branches/py3k/Python/dtoa.c python/branches/py3k/Python/marshal.c python/branches/py3k/Python/pystrtod.c Modified: python/branches/py3k/Doc/c-api/conversion.rst ============================================================================== --- python/branches/py3k/Doc/c-api/conversion.rst (original) +++ python/branches/py3k/Doc/c-api/conversion.rst Sun May 3 22:33:40 2009 @@ -62,6 +62,43 @@ See the Unix man page :manpage:`strtod(2)` for details. + .. deprecated:: 3.1 + Use :cfunc:`PyOS_string_to_double` instead. + + +.. cfunction:: double PyOS_string_to_double(const char *s, char **endptr, PyObject *overflow_exception) + + Convert a string ``s`` to a :ctype:`double`, raising a Python + exception on failure. The set of accepted strings corresponds to + the set of strings accepted by Python's :func:`float` constructor, + except that ``s`` must not have leading or trailing whitespace. + The conversion is independent of the current locale. + + If ``endptr`` is ``NULL``, convert the whole string. Raise + ValueError and return ``-1.0`` if the string is not a valid + representation of a floating-point number. + + If endptr is not ``NULL``, convert as much of the string as + possible and set ``*endptr`` to point to the first unconverted + character. If no initial segment of the string is the valid + representation of a floating-point number, set ``*endptr`` to point + to the beginning of the string, raise ValueError, and return + ``-1.0``. + + If ``s`` represents a value that is too large to store in a float + (for example, ``"1e500"`` is such a string on many platforms) then + if ``overflow_exception`` is ``NULL`` return ``Py_HUGE_VAL`` (with + an appropriate sign) and don't set any exception. Otherwise, + ``overflow_exception`` must point to a Python exception object; + raise that exception and return ``-1.0``. In both cases, set + ``*endptr`` to point to the first character after the converted value. + + If any other error occurs during the conversion (for example an + out-of-memory error), set the appropriate Python exception and + return ``-1.0``. + + .. versionadded:: 3.1 + .. cfunction:: char* PyOS_ascii_formatd(char *buffer, size_t buf_len, const char *format, double d) @@ -117,6 +154,9 @@ See the Unix man page :manpage:`atof(2)` for details. + .. deprecated:: 3.1 + Use PyOS_string_to_double instead. + .. cfunction:: char* PyOS_stricmp(char *s1, char *s2) Modified: python/branches/py3k/Include/pystrtod.h ============================================================================== --- python/branches/py3k/Include/pystrtod.h (original) +++ python/branches/py3k/Include/pystrtod.h Sun May 3 22:33:40 2009 @@ -9,6 +9,9 @@ PyAPI_FUNC(double) PyOS_ascii_strtod(const char *str, char **ptr); PyAPI_FUNC(double) PyOS_ascii_atof(const char *str); PyAPI_FUNC(char *) PyOS_ascii_formatd(char *buffer, size_t buf_len, const char *format, double d); +PyAPI_FUNC(double) PyOS_string_to_double(const char *str, + char **endptr, + PyObject *overflow_exception); /* The caller is responsible for calling PyMem_Free to free the buffer that's is returned. */ Modified: python/branches/py3k/Modules/_pickle.c ============================================================================== --- python/branches/py3k/Modules/_pickle.c (original) +++ python/branches/py3k/Modules/_pickle.c Sun May 3 22:33:40 2009 @@ -2971,20 +2971,20 @@ return bad_readline(); errno = 0; - d = PyOS_ascii_strtod(s, &endptr); - - if ((errno == ERANGE && !(fabs(d) <= 1.0)) || - (endptr[0] != '\n') || (endptr[1] != '\0')) { + d = PyOS_string_to_double(s, &endptr, PyExc_OverflowError); + if (d == -1.0 && PyErr_Occurred()) + return -1; + if ((endptr[0] != '\n') || (endptr[1] != '\0')) { PyErr_SetString(PyExc_ValueError, "could not convert string to float"); return -1; } - - if ((value = PyFloat_FromDouble(d)) == NULL) + value = PyFloat_FromDouble(d); + if (value == NULL) return -1; PDATA_PUSH(self->stack, value, -1); return 0; -} + } static int load_binfloat(UnpicklerObject *self) Modified: python/branches/py3k/Modules/_testcapimodule.c ============================================================================== --- python/branches/py3k/Modules/_testcapimodule.c (original) +++ python/branches/py3k/Modules/_testcapimodule.c Sun May 3 22:33:40 2009 @@ -1045,6 +1045,54 @@ Py_RETURN_NONE; } +/* Test PyOS_string_to_double. */ +static PyObject * +test_string_to_double(PyObject *self) { + double result; + char *msg; + +#define CHECK_STRING(STR, expected) \ + result = PyOS_string_to_double(STR, NULL, NULL); \ + if (result == -1.0 && PyErr_Occurred()) \ + return NULL; \ + if (result != expected) { \ + msg = "conversion of " STR " to float failed"; \ + goto fail; \ + } + +#define CHECK_INVALID(STR) \ + result = PyOS_string_to_double(STR, NULL, NULL); \ + if (result == -1.0 && PyErr_Occurred()) { \ + if (PyErr_ExceptionMatches(PyExc_ValueError)) \ + PyErr_Clear(); \ + else \ + return NULL; \ + } \ + else { \ + msg = "conversion of " STR " didn't raise ValueError"; \ + goto fail; \ + } + + CHECK_STRING("0.1", 0.1); + CHECK_STRING("1.234", 1.234); + CHECK_STRING("-1.35", -1.35); + CHECK_STRING(".1e01", 1.0); + CHECK_STRING("2.e-2", 0.02); + + CHECK_INVALID(" 0.1"); + CHECK_INVALID("\t\n-3"); + CHECK_INVALID(".123 "); + CHECK_INVALID("3\n"); + CHECK_INVALID("123abc"); + + Py_RETURN_NONE; + fail: + return raiseTestError("test_string_to_double", msg); +#undef CHECK_STRING +#undef CHECK_INVALID +} + + #ifdef HAVE_GETTIMEOFDAY /* Profiling of integer performance */ static void print_delta(int test, struct timeval *s, struct timeval *e) @@ -1223,6 +1271,7 @@ {"test_empty_argparse", (PyCFunction)test_empty_argparse,METH_NOARGS}, {"test_null_strings", (PyCFunction)test_null_strings, METH_NOARGS}, {"test_string_from_format", (PyCFunction)test_string_from_format, METH_NOARGS}, + {"test_string_to_double", (PyCFunction)test_string_to_double, METH_NOARGS}, {"test_with_docstring", (PyCFunction)test_with_docstring, METH_NOARGS, PyDoc_STR("This is a pretty normal docstring.")}, Modified: python/branches/py3k/Objects/complexobject.c ============================================================================== --- python/branches/py3k/Objects/complexobject.c (original) +++ python/branches/py3k/Objects/complexobject.c Sun May 3 22:33:40 2009 @@ -799,25 +799,26 @@ */ /* first look for forms starting with */ - errno = 0; - z = PyOS_ascii_strtod(s, &end); - if (end == s && errno == ENOMEM) - return PyErr_NoMemory(); - if (errno == ERANGE && fabs(z) >= 1.0) - goto overflow; - + z = PyOS_string_to_double(s, &end, PyExc_OverflowError); + if (z == -1.0 && PyErr_Occurred()) { + if (PyErr_ExceptionMatches(PyExc_ValueError)) + PyErr_Clear(); + else + return NULL; + } if (end != s) { /* all 4 forms starting with land here */ s = end; if (*s == '+' || *s == '-') { /* j | j */ x = z; - errno = 0; - y = PyOS_ascii_strtod(s, &end); - if (end == s && errno == ENOMEM) - return PyErr_NoMemory(); - if (errno == ERANGE && fabs(y) >= 1.0) - goto overflow; + y = PyOS_string_to_double(s, &end, PyExc_OverflowError); + if (y == -1.0 && PyErr_Occurred()) { + if (PyErr_ExceptionMatches(PyExc_ValueError)) + PyErr_Clear(); + else + return NULL; + } if (end != s) /* j */ s = end; @@ -877,11 +878,6 @@ PyErr_SetString(PyExc_ValueError, "complex() arg is a malformed string"); return NULL; - - overflow: - PyErr_SetString(PyExc_OverflowError, - "complex() arg overflow"); - return NULL; } static PyObject * Modified: python/branches/py3k/Objects/floatobject.c ============================================================================== --- python/branches/py3k/Objects/floatobject.c (original) +++ python/branches/py3k/Objects/floatobject.c Sun May 3 22:33:40 2009 @@ -193,36 +193,20 @@ /* We don't care about overflow or underflow. If the platform * supports them, infinities and signed zeroes (on underflow) are * fine. */ - errno = 0; - PyFPE_START_PROTECT("strtod", goto error) - x = PyOS_ascii_strtod(s, (char **)&end); - PyFPE_END_PROTECT(x) - if (end == s) { - if (errno == ENOMEM) - PyErr_NoMemory(); - else { - PyOS_snprintf(buffer, sizeof(buffer), - "invalid literal for float(): %.200s", s); - PyErr_SetString(PyExc_ValueError, buffer); - } + x = PyOS_string_to_double(s, (char **)&end, NULL); + if (x == -1.0 && PyErr_Occurred()) goto error; - } - /* Since end != s, the platform made *some* kind of sense out - of the input. Trust it. */ while (*end && isspace(Py_CHARMASK(*end))) end++; - if (end != last) { - if (*end == '\0') - PyErr_SetString(PyExc_ValueError, - "null byte in argument for float()"); - else { - PyOS_snprintf(buffer, sizeof(buffer), - "invalid literal for float(): %.200s", s); - PyErr_SetString(PyExc_ValueError, buffer); - } - goto error; + if (end == last) + result = PyFloat_FromDouble(x); + else { + PyOS_snprintf(buffer, sizeof(buffer), + "invalid literal for float(): %.200s", s); + PyErr_SetString(PyExc_ValueError, buffer); + result = NULL; } - result = PyFloat_FromDouble(x); + error: if (s_buffer) PyMem_FREE(s_buffer); Modified: python/branches/py3k/Python/ast.c ============================================================================== --- python/branches/py3k/Python/ast.c (original) +++ python/branches/py3k/Python/ast.c Sun May 3 22:33:40 2009 @@ -3162,18 +3162,18 @@ #ifndef WITHOUT_COMPLEX if (imflag) { compl.real = 0.; - PyFPE_START_PROTECT("atof", return 0) - compl.imag = PyOS_ascii_atof(s); - PyFPE_END_PROTECT(c) - return PyComplex_FromCComplex(compl); + compl.imag = PyOS_string_to_double(s, (char **)&end, NULL); + if (compl.imag == -1.0 && PyErr_Occurred()) + return NULL; + return PyComplex_FromCComplex(compl); } else #endif { - PyFPE_START_PROTECT("atof", return 0) - dx = PyOS_ascii_atof(s); - PyFPE_END_PROTECT(dx) - return PyFloat_FromDouble(dx); + dx = PyOS_string_to_double(s, NULL, NULL); + if (dx == -1.0 && PyErr_Occurred()) + return NULL; + return PyFloat_FromDouble(dx); } } Modified: python/branches/py3k/Python/dtoa.c ============================================================================== --- python/branches/py3k/Python/dtoa.c (original) +++ python/branches/py3k/Python/dtoa.c Sun May 3 22:33:40 2009 @@ -61,6 +61,9 @@ * that hasn't been MALLOC'ed, private_mem should only be used when k <= * Kmax. * + * 7. _Py_dg_strtod has been modified so that it doesn't accept strings with + * leading whitespace. + * ***************************************************************/ /* Please send bug reports for the original dtoa.c code to David M. Gay (dmg @@ -1355,6 +1358,7 @@ /* no break */ case 0: goto ret0; + /* modify original dtoa.c so that it doesn't accept leading whitespace case '\t': case '\n': case '\v': @@ -1362,6 +1366,7 @@ case '\r': case ' ': continue; + */ default: goto break2; } Modified: python/branches/py3k/Python/marshal.c ============================================================================== --- python/branches/py3k/Python/marshal.c (original) +++ python/branches/py3k/Python/marshal.c Sun May 3 22:33:40 2009 @@ -670,18 +670,17 @@ { char buf[256]; double dx; + retval = NULL; n = r_byte(p); if (n == EOF || r_string(buf, (int)n, p) != n) { PyErr_SetString(PyExc_EOFError, "EOF read where object expected"); - retval = NULL; break; } buf[n] = '\0'; - retval = NULL; - PyFPE_START_PROTECT("atof", break) - dx = PyOS_ascii_atof(buf); - PyFPE_END_PROTECT(dx) + dx = PyOS_string_to_double(buf, NULL, NULL); + if (dx == -1.0 && PyErr_Occurred()) + break; retval = PyFloat_FromDouble(dx); break; } @@ -710,29 +709,27 @@ { char buf[256]; Py_complex c; + retval = NULL; n = r_byte(p); if (n == EOF || r_string(buf, (int)n, p) != n) { PyErr_SetString(PyExc_EOFError, "EOF read where object expected"); - retval = NULL; break; } buf[n] = '\0'; - retval = NULL; - PyFPE_START_PROTECT("atof", break;) - c.real = PyOS_ascii_atof(buf); - PyFPE_END_PROTECT(c) + c.real = PyOS_string_to_double(buf, NULL, NULL); + if (c.real == -1.0 && PyErr_Occurred()) + break; n = r_byte(p); if (n == EOF || r_string(buf, (int)n, p) != n) { PyErr_SetString(PyExc_EOFError, "EOF read where object expected"); - retval = NULL; break; } buf[n] = '\0'; - PyFPE_START_PROTECT("atof", break) - c.imag = PyOS_ascii_atof(buf); - PyFPE_END_PROTECT(c) + c.imag = PyOS_string_to_double(buf, NULL, NULL); + if (c.imag == -1.0 && PyErr_Occurred()) + break; retval = PyComplex_FromCComplex(c); break; } Modified: python/branches/py3k/Python/pystrtod.c ============================================================================== --- python/branches/py3k/Python/pystrtod.c (original) +++ python/branches/py3k/Python/pystrtod.c Sun May 3 22:33:40 2009 @@ -35,7 +35,7 @@ #ifndef PY_NO_SHORT_FLOAT_REPR double -PyOS_ascii_strtod(const char *nptr, char **endptr) +_PyOS_ascii_strtod(const char *nptr, char **endptr) { double result; _Py_SET_53BIT_PRECISION_HEADER; @@ -64,7 +64,7 @@ */ double -PyOS_ascii_strtod(const char *nptr, char **endptr) +_PyOS_ascii_strtod(const char *nptr, char **endptr) { char *fail_pos; double val = -1.0; @@ -92,15 +92,10 @@ and underflows */ errno = 0; - /* We process any leading whitespace and the optional sign manually, - then pass the remainder to the system strtod. This ensures that - the result of an underflow has the correct sign. (bug #1725) */ - + /* We process the optional sign manually, then pass the remainder to + the system strtod. This ensures that the result of an underflow + has the correct sign. (bug #1725) */ p = nptr; - /* Skip leading space */ - while (Py_ISSPACE(*p)) - p++; - /* Process leading sign, if present */ if (*p == '-') { negate = 1; @@ -185,8 +180,7 @@ copy = (char *)PyMem_MALLOC(end - digits_pos + 1 + decimal_point_len); if (copy == NULL) { - if (endptr) - *endptr = (char *)nptr; + *endptr = (char *)nptr; errno = ENOMEM; return val; } @@ -227,27 +221,116 @@ got_val: if (negate && fail_pos != nptr) val = -val; - - if (endptr) - *endptr = fail_pos; + *endptr = fail_pos; return val; invalid_string: - if (endptr) - *endptr = (char*)nptr; + *endptr = (char*)nptr; errno = EINVAL; return -1.0; } #endif +/* PyOS_ascii_strtod is DEPRECATED in Python 3.1 */ + +double +PyOS_ascii_strtod(const char *nptr, char **endptr) +{ + char *fail_pos; + const char *p; + double x; + + if (PyErr_WarnEx(PyExc_DeprecationWarning, + "PyOS_ascii_strtod and PyOS_ascii_atof are " + "deprecated. Use PyOS_string_to_double " + "instead.", 1) < 0) + return -1.0; + + /* _PyOS_ascii_strtod already does everything that we want, + except that it doesn't parse leading whitespace */ + p = nptr; + while (Py_ISSPACE(*p)) + p++; + x = _PyOS_ascii_strtod(p, &fail_pos); + if (fail_pos == p) + fail_pos = (char *)nptr; + if (endptr) + *endptr = (char *)fail_pos; + return x; +} + +/* PyOS_ascii_strtod is DEPRECATED in Python 3.1 */ + double PyOS_ascii_atof(const char *nptr) { return PyOS_ascii_strtod(nptr, NULL); } +/* PyOS_string_to_double is the recommended replacement for the deprecated + PyOS_ascii_strtod and PyOS_ascii_atof functions. It converts a + null-terminated byte string s (interpreted as a string of ASCII characters) + to a float. The string should not have leading or trailing whitespace (in + contrast, PyOS_ascii_strtod allows leading whitespace but not trailing + whitespace). The conversion is independent of the current locale. + + If endptr is NULL, try to convert the whole string. Raise ValueError and + return -1.0 if the string is not a valid representation of a floating-point + number. + + If endptr is non-NULL, try to convert as much of the string as possible. + If no initial segment of the string is the valid representation of a + floating-point number then *endptr is set to point to the beginning of the + string, -1.0 is returned and again ValueError is raised. + + On overflow (e.g., when trying to convert '1e500' on an IEEE 754 machine), + if overflow_exception is NULL then +-Py_HUGE_VAL is returned, and no Python + exception is raised. Otherwise, overflow_exception should point to a + a Python exception, this exception will be raised, -1.0 will be returned, + and *endptr will point just past the end of the converted value. + + If any other failure occurs (for example lack of memory), -1.0 is returned + and the appropriate Python exception will have been set. +*/ + +double +PyOS_string_to_double(const char *s, + char **endptr, + PyObject *overflow_exception) +{ + double x, result=-1.0; + char *fail_pos; + + errno = 0; + PyFPE_START_PROTECT("PyOS_string_to_double", return -1.0) + x = _PyOS_ascii_strtod(s, &fail_pos); + PyFPE_END_PROTECT(x) + + if (errno == ENOMEM) { + PyErr_NoMemory(); + fail_pos = (char *)s; + } + else if (!endptr && (fail_pos == s || *fail_pos != '\0')) + PyErr_Format(PyExc_ValueError, + "could not convert string to float: " + "%.200s", s); + else if (fail_pos == s) + PyErr_Format(PyExc_ValueError, + "could not convert string to float: " + "%.200s", s); + else if (errno == ERANGE && fabs(x) >= 1.0 && overflow_exception) + PyErr_Format(overflow_exception, + "value too large to convert to float: " + "%.200s", s); + else + result = x; + + if (endptr != NULL) + *endptr = fail_pos; + return result; +} /* Given a string that may have a decimal point in the current locale, change it back to a dot. Since the string cannot get From python-checkins at python.org Sun May 3 22:34:39 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 3 May 2009 22:34:39 +0200 (CEST) Subject: [Python-checkins] r72249 - python/branches/release30-maint Message-ID: <20090503203439.74D121E4022@bag.python.org> Author: mark.dickinson Date: Sun May 3 22:34:39 2009 New Revision: 72249 Log: Blocked revisions 72248 via svnmerge ........ r72248 | mark.dickinson | 2009-05-03 21:33:40 +0100 (Sun, 03 May 2009) | 4 lines Issue #5914: Add new C-API function PyOS_string_to_double, to complement PyOS_double_to_string, and deprecate PyOS_ascii_strtod and PyOS_ascii_atof. ........ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun May 3 22:39:06 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 3 May 2009 22:39:06 +0200 (CEST) Subject: [Python-checkins] r72250 - python/trunk/Objects/intobject.c Message-ID: <20090503203906.9C58B1E4022@bag.python.org> Author: mark.dickinson Date: Sun May 3 22:39:06 2009 New Revision: 72250 Log: Remove unnecessary uses of context in PyGetSetDef. See issue #5880. Modified: python/trunk/Objects/intobject.c Modified: python/trunk/Objects/intobject.c ============================================================================== --- python/trunk/Objects/intobject.c (original) +++ python/trunk/Objects/intobject.c Sun May 3 22:39:06 2009 @@ -1104,8 +1104,13 @@ } static PyObject * -int_getN(PyIntObject *v, void *context) { - return PyInt_FromLong((Py_intptr_t)context); +int_get0(PyIntObject *v, void *context) { + return PyInt_FromLong(0L); +} + +static PyObject * +int_get1(PyIntObject *v, void *context) { + return PyInt_FromLong(1L); } /* Convert an integer to the given base. Returns a string. @@ -1254,22 +1259,22 @@ }; static PyGetSetDef int_getset[] = { - {"real", + {"real", (getter)int_int, (setter)NULL, "the real part of a complex number", NULL}, - {"imag", - (getter)int_getN, (setter)NULL, + {"imag", + (getter)int_get0, (setter)NULL, "the imaginary part of a complex number", - (void*)0}, - {"numerator", + NULL}, + {"numerator", (getter)int_int, (setter)NULL, "the numerator of a rational number in lowest terms", NULL}, - {"denominator", - (getter)int_getN, (setter)NULL, + {"denominator", + (getter)int_get1, (setter)NULL, "the denominator of a rational number in lowest terms", - (void*)1}, + NULL}, {NULL} /* Sentinel */ }; From python-checkins at python.org Sun May 3 22:39:47 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 3 May 2009 22:39:47 +0200 (CEST) Subject: [Python-checkins] r72251 - python/branches/release26-maint Message-ID: <20090503203947.3F7D41E4022@bag.python.org> Author: mark.dickinson Date: Sun May 3 22:39:47 2009 New Revision: 72251 Log: Blocked revisions 72250 via svnmerge ........ r72250 | mark.dickinson | 2009-05-03 21:39:06 +0100 (Sun, 03 May 2009) | 2 lines Remove unnecessary uses of context in PyGetSetDef. See issue #5880. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun May 3 22:40:46 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 3 May 2009 22:40:46 +0200 (CEST) Subject: [Python-checkins] r72252 - python/branches/py3k Message-ID: <20090503204046.A9CF91E4022@bag.python.org> Author: mark.dickinson Date: Sun May 3 22:40:46 2009 New Revision: 72252 Log: Blocked revisions 72250 via svnmerge ........ r72250 | mark.dickinson | 2009-05-03 21:39:06 +0100 (Sun, 03 May 2009) | 2 lines Remove unnecessary uses of context in PyGetSetDef. See issue #5880. ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Sun May 3 22:59:01 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 03 May 2009 20:59:01 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc trunk Message-ID: <20090503205901.B1B861E4048@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%20trunk/builds/364 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: gregory.p.smith BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_os ====================================================================== FAIL: test_update2 (test.test_os.EnvironTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/test/test_os.py", line 348, in test_update2 self.assertEquals(value, "World") AssertionError: '' != 'World' sincerely, -The Buildbot From python-checkins at python.org Sun May 3 22:59:49 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 3 May 2009 22:59:49 +0200 (CEST) Subject: [Python-checkins] r72253 - in python/trunk: Objects/complexobject.c Objects/floatobject.c Python/pystrtod.c Message-ID: <20090503205949.00CE61E4048@bag.python.org> Author: mark.dickinson Date: Sun May 3 22:59:48 2009 New Revision: 72253 Log: Eliminate some locale-dependent calls to isspace and tolower. Modified: python/trunk/Objects/complexobject.c python/trunk/Objects/floatobject.c python/trunk/Python/pystrtod.c Modified: python/trunk/Objects/complexobject.c ============================================================================== --- python/trunk/Objects/complexobject.c (original) +++ python/trunk/Objects/complexobject.c Sun May 3 22:59:48 2009 @@ -950,13 +950,13 @@ /* position on first nonblank */ start = s; - while (*s && isspace(Py_CHARMASK(*s))) + while (Py_ISSPACE(*s)) s++; if (*s == '(') { /* Skip over possible bracket from repr(). */ got_bracket = 1; s++; - while (*s && isspace(Py_CHARMASK(*s))) + while (Py_ISSPACE(*s)) s++; } @@ -1038,7 +1038,7 @@ } /* trailing whitespace and closing bracket */ - while (*s && isspace(Py_CHARMASK(*s))) + while (Py_ISSPACE(*s)) s++; if (got_bracket) { /* if there was an opening parenthesis, then the corresponding @@ -1046,7 +1046,7 @@ if (*s != ')') goto parse_error; s++; - while (*s && isspace(Py_CHARMASK(*s))) + while (Py_ISSPACE(*s)) s++; } Modified: python/trunk/Objects/floatobject.c ============================================================================== --- python/trunk/Objects/floatobject.c (original) +++ python/trunk/Objects/floatobject.c Sun May 3 22:59:48 2009 @@ -214,7 +214,7 @@ } last = s + len; - while (*s && isspace(Py_CHARMASK(*s))) + while (Py_ISSPACE(*s)) s++; /* We don't care about overflow or underflow. If the platform * supports them, infinities and signed zeroes (on underflow) are @@ -235,7 +235,7 @@ } /* Since end != s, the platform made *some* kind of sense out of the input. Trust it. */ - while (*end && isspace(Py_CHARMASK(*end))) + while (Py_ISSPACE(*end)) end++; if (end != last) { if (*end == '\0') @@ -1220,7 +1220,7 @@ ********************/ /* leading whitespace and optional sign */ - while (isspace(*s)) + while (Py_ISSPACE(*s)) s++; if (*s == '-') { s++; @@ -1244,7 +1244,7 @@ s_store = s; if (*s == '0') { s++; - if (tolower(*s) == (int)'x') + if (*s == 'x' || *s == 'X') s++; else s = s_store; @@ -1274,7 +1274,7 @@ goto insane_length_error; /* [p ] */ - if (tolower(*s) == (int)'p') { + if (*s == 'p' || *s == 'P') { s++; exp_start = s; if (*s == '-' || *s == '+') @@ -1290,7 +1290,7 @@ exp = 0; /* optional trailing whitespace leading to the end of the string */ - while (isspace(*s)) + while (Py_ISSPACE(*s)) s++; if (s != s_end) goto parse_error; Modified: python/trunk/Python/pystrtod.c ============================================================================== --- python/trunk/Python/pystrtod.c (original) +++ python/trunk/Python/pystrtod.c Sun May 3 22:59:48 2009 @@ -718,7 +718,7 @@ /* Convert to upper case. */ char *p; for (p = buf; *p; p++) - *p = toupper(*p); + *p = Py_TOUPPER(*p); } if (ptype) From python-checkins at python.org Sun May 3 23:00:26 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 3 May 2009 23:00:26 +0200 (CEST) Subject: [Python-checkins] r72254 - python/branches/release26-maint Message-ID: <20090503210026.765FA1E41D0@bag.python.org> Author: mark.dickinson Date: Sun May 3 23:00:26 2009 New Revision: 72254 Log: Blocked revisions 72253 via svnmerge ........ r72253 | mark.dickinson | 2009-05-03 21:59:48 +0100 (Sun, 03 May 2009) | 2 lines Eliminate some locale-dependent calls to isspace and tolower. ........ Modified: python/branches/release26-maint/ (props changed) From buildbot at python.org Sun May 3 23:01:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 03 May 2009 21:01:59 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090503210159.C90471E4048@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/733 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: gregory.p.smith BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_os ====================================================================== FAIL: test_update2 (test.test_os.EnvironTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_os.py", line 382, in test_update2 self.assertEquals(value, "World") AssertionError: '' != 'World' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun May 3 23:07:14 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 3 May 2009 23:07:14 +0200 (CEST) Subject: [Python-checkins] r72255 - in python/branches/py3k: Objects/complexobject.c Objects/floatobject.c Message-ID: <20090503210714.1FC301E4048@bag.python.org> Author: mark.dickinson Date: Sun May 3 23:07:13 2009 New Revision: 72255 Log: Merged revisions 72253 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72253 | mark.dickinson | 2009-05-03 21:59:48 +0100 (Sun, 03 May 2009) | 2 lines Eliminate some locale-dependent calls to isspace and tolower. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Objects/complexobject.c python/branches/py3k/Objects/floatobject.c Modified: python/branches/py3k/Objects/complexobject.c ============================================================================== --- python/branches/py3k/Objects/complexobject.c (original) +++ python/branches/py3k/Objects/complexobject.c Sun May 3 23:07:13 2009 @@ -767,13 +767,13 @@ /* position on first nonblank */ start = s; - while (*s && isspace(Py_CHARMASK(*s))) + while (Py_ISSPACE(*s)) s++; if (*s == '(') { /* Skip over possible bracket from repr(). */ got_bracket = 1; s++; - while (*s && isspace(Py_CHARMASK(*s))) + while (Py_ISSPACE(*s)) s++; } @@ -856,7 +856,7 @@ } /* trailing whitespace and closing bracket */ - while (*s && isspace(Py_CHARMASK(*s))) + while (Py_ISSPACE(*s)) s++; if (got_bracket) { /* if there was an opening parenthesis, then the corresponding @@ -864,7 +864,7 @@ if (*s != ')') goto parse_error; s++; - while (*s && isspace(Py_CHARMASK(*s))) + while (Py_ISSPACE(*s)) s++; } Modified: python/branches/py3k/Objects/floatobject.c ============================================================================== --- python/branches/py3k/Objects/floatobject.c (original) +++ python/branches/py3k/Objects/floatobject.c Sun May 3 23:07:13 2009 @@ -188,7 +188,7 @@ } last = s + len; - while (*s && isspace(Py_CHARMASK(*s))) + while (Py_ISSPACE(*s)) s++; /* We don't care about overflow or underflow. If the platform * supports them, infinities and signed zeroes (on underflow) are @@ -196,7 +196,7 @@ x = PyOS_string_to_double(s, (char **)&end, NULL); if (x == -1.0 && PyErr_Occurred()) goto error; - while (*end && isspace(Py_CHARMASK(*end))) + while (Py_ISSPACE(*end)) end++; if (end == last) result = PyFloat_FromDouble(x); @@ -1223,7 +1223,7 @@ ********************/ /* leading whitespace and optional sign */ - while (isspace(Py_CHARMASK(*s))) + while (Py_ISSPACE(*s)) s++; if (*s == '-') { s++; @@ -1247,7 +1247,7 @@ s_store = s; if (*s == '0') { s++; - if (tolower(*s) == (int)'x') + if (*s == 'x' || *s == 'X') s++; else s = s_store; @@ -1277,7 +1277,7 @@ goto insane_length_error; /* [p ] */ - if (tolower(*s) == (int)'p') { + if (*s == 'p' || *s == 'P') { s++; exp_start = s; if (*s == '-' || *s == '+') @@ -1293,7 +1293,7 @@ exp = 0; /* optional trailing whitespace leading to the end of the string */ - while (isspace(Py_CHARMASK(*s))) + while (Py_ISSPACE(*s)) s++; if (s != s_end) goto parse_error; From python-checkins at python.org Sun May 3 23:07:43 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 3 May 2009 23:07:43 +0200 (CEST) Subject: [Python-checkins] r72256 - python/branches/release30-maint Message-ID: <20090503210743.747461E4048@bag.python.org> Author: mark.dickinson Date: Sun May 3 23:07:43 2009 New Revision: 72256 Log: Blocked revisions 72255 via svnmerge ................ r72255 | mark.dickinson | 2009-05-03 22:07:13 +0100 (Sun, 03 May 2009) | 9 lines Merged revisions 72253 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72253 | mark.dickinson | 2009-05-03 21:59:48 +0100 (Sun, 03 May 2009) | 2 lines Eliminate some locale-dependent calls to isspace and tolower. ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Sun May 3 23:16:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 03 May 2009 21:16:31 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090503211631.319C11E403E@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/872 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_time ====================================================================== FAIL: test_update2 (test.test_os.EnvironTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_os.py", line 382, in test_update2 self.assertEquals(value, "World") AssertionError: '' != 'World' ====================================================================== FAIL: test_tzset (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_time.py", line 166, in test_tzset self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) AssertionError: time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) == time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon May 4 00:33:34 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 4 May 2009 00:33:34 +0200 (CEST) Subject: [Python-checkins] r72257 - python/trunk/Python/pystrtod.c Message-ID: <20090503223334.D33C91E401D@bag.python.org> Author: mark.dickinson Date: Mon May 4 00:33:34 2009 New Revision: 72257 Log: Don't use PyOS_strnicmp for NaN and Inf detection: it's locale-aware. Modified: python/trunk/Python/pystrtod.c Modified: python/trunk/Python/pystrtod.c ============================================================================== --- python/trunk/Python/pystrtod.c (original) +++ python/trunk/Python/pystrtod.c Mon May 4 00:33:34 2009 @@ -40,6 +40,19 @@ correctly rounded results. */ +/* Case-insensitive string match used for nan and inf detection; t should be + lower-case. Returns 1 for a successful match, 0 otherwise. */ + +static int +case_insensitive_match(const char *s, const char *t) +{ + while(*t && Py_TOLOWER(*s) == *t) { + s++; + t++; + } + return *t ? 0 : 1; +} + double PyOS_ascii_strtod(const char *nptr, char **endptr) { @@ -89,9 +102,9 @@ /* Parse infinities and nans */ if (*p == 'i' || *p == 'I') { - if (PyOS_strnicmp(p, "inf", 3) == 0) { + if (case_insensitive_match(p+1, "nf")) { val = Py_HUGE_VAL; - if (PyOS_strnicmp(p+3, "inity", 5) == 0) + if (case_insensitive_match(p+3, "inity")) fail_pos = (char *)p+8; else fail_pos = (char *)p+3; @@ -102,7 +115,7 @@ } #ifdef Py_NAN if (*p == 'n' || *p == 'N') { - if (PyOS_strnicmp(p, "nan", 3) == 0) { + if (case_insensitive_match(p+1, "an")) { val = Py_NAN; fail_pos = (char *)p+3; goto got_val; From buildbot at python.org Mon May 4 00:34:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 03 May 2009 22:34:04 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090503223404.451271E401D@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/325 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: gregory.p.smith BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Mon May 4 00:34:16 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 4 May 2009 00:34:16 +0200 (CEST) Subject: [Python-checkins] r72258 - python/branches/release26-maint Message-ID: <20090503223416.B57E61E401D@bag.python.org> Author: mark.dickinson Date: Mon May 4 00:34:16 2009 New Revision: 72258 Log: Blocked revisions 72257 via svnmerge ........ r72257 | mark.dickinson | 2009-05-03 23:33:34 +0100 (Sun, 03 May 2009) | 2 lines Don't use PyOS_strnicmp for NaN and Inf detection: it's locale-aware. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Mon May 4 00:36:01 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 4 May 2009 00:36:01 +0200 (CEST) Subject: [Python-checkins] r72259 - in python/branches/py3k: Python/pystrtod.c Message-ID: <20090503223602.03AF91E401D@bag.python.org> Author: mark.dickinson Date: Mon May 4 00:36:01 2009 New Revision: 72259 Log: Merged revisions 72257 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72257 | mark.dickinson | 2009-05-03 23:33:34 +0100 (Sun, 03 May 2009) | 2 lines Don't use PyOS_strnicmp for NaN and Inf detection: it's locale-aware. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Python/pystrtod.c Modified: python/branches/py3k/Python/pystrtod.c ============================================================================== --- python/branches/py3k/Python/pystrtod.c (original) +++ python/branches/py3k/Python/pystrtod.c Mon May 4 00:36:01 2009 @@ -63,6 +63,19 @@ correctly rounded results. */ +/* Case-insensitive string match used for nan and inf detection; t should be + lower-case. Returns 1 for a successful match, 0 otherwise. */ + +static int +case_insensitive_match(const char *s, const char *t) +{ + while(*t && Py_TOLOWER(*s) == *t) { + s++; + t++; + } + return *t ? 0 : 1; +} + double _PyOS_ascii_strtod(const char *nptr, char **endptr) { @@ -107,9 +120,9 @@ /* Parse infinities and nans */ if (*p == 'i' || *p == 'I') { - if (PyOS_strnicmp(p, "inf", 3) == 0) { + if (case_insensitive_match(p+1, "nf")) { val = Py_HUGE_VAL; - if (PyOS_strnicmp(p+3, "inity", 5) == 0) + if (case_insensitive_match(p+3, "inity")) fail_pos = (char *)p+8; else fail_pos = (char *)p+3; @@ -120,7 +133,7 @@ } #ifdef Py_NAN if (*p == 'n' || *p == 'N') { - if (PyOS_strnicmp(p, "nan", 3) == 0) { + if (case_insensitive_match(p+1, "an")) { val = Py_NAN; fail_pos = (char *)p+3; goto got_val; From python-checkins at python.org Mon May 4 00:36:33 2009 From: python-checkins at python.org (walter.doerwald) Date: Mon, 4 May 2009 00:36:33 +0200 (CEST) Subject: [Python-checkins] r72260 - in python/trunk: Misc/NEWS Objects/unicodeobject.c Message-ID: <20090503223633.DC3161E401D@bag.python.org> Author: walter.doerwald Date: Mon May 4 00:36:33 2009 New Revision: 72260 Log: Issue #5108: Handle %s like %S and %R in PyUnicode_FromFormatV(): Call PyUnicode_DecodeUTF8() once, remember the result and output it in a second step. This avoids problems with counting UTF-8 bytes that ignores the effect of using the replace error handler in PyUnicode_DecodeUTF8(). Modified: python/trunk/Misc/NEWS python/trunk/Objects/unicodeobject.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon May 4 00:36:33 2009 @@ -258,6 +258,11 @@ - Issue #5705: os.setuid() would not accept values > 2**31-1 but pwd.getpwnam() returned them on 64bit platforms. +- Issue #5108: Handle %s like %S and %R in PyUnicode_FromFormatV(): Call + PyUnicode_DecodeUTF8() once, remember the result and output it in a second + step. This avoids problems with counting UTF-8 bytes that ignores the effect + of using the replace error handler in PyUnicode_DecodeUTF8(). + Library ------- Modified: python/trunk/Objects/unicodeobject.c ============================================================================== --- python/trunk/Objects/unicodeobject.c (original) +++ python/trunk/Objects/unicodeobject.c Mon May 4 00:36:33 2009 @@ -674,15 +674,25 @@ count = vargs; #endif #endif - /* step 1: count the number of %S/%R format specifications - * (we call PyObject_Str()/PyObject_Repr() for these objects - * once during step 3 and put the result in an array) */ + /* step 1: count the number of %S/%R/%s format specifications + * (we call PyObject_Str()/PyObject_Repr()/PyUnicode_DecodeUTF8() for these + * objects once during step 3 and put the result in an array) */ for (f = format; *f; f++) { - if (*f == '%' && (*(f+1)=='S' || *(f+1)=='R')) - ++callcount; + if (*f == '%') { + if (*(f+1)=='%') + continue; + if (*(f+1)=='S' || *(f+1)=='R' || *(f+1)=='A') + ++callcount; + while (isdigit((unsigned)*f)) + width = (width*10) + *f++ - '0'; + while (*++f && *f != '%' && !isalpha((unsigned)*f)) + ; + if (*f == 's') + ++callcount; + } } /* step 2: allocate memory for the results of - * PyObject_Str()/PyObject_Repr() calls */ + * PyObject_Str()/PyObject_Repr()/PyUnicode_DecodeUTF8() calls */ if (callcount) { callresults = PyObject_Malloc(sizeof(PyObject *)*callcount); if (!callresults) { @@ -731,35 +741,13 @@ case 's': { /* UTF-8 */ - unsigned char*s; - s = va_arg(count, unsigned char*); - while (*s) { - if (*s < 128) { - n++; s++; - } else if (*s < 0xc0) { - /* invalid UTF-8 */ - n++; s++; - } else if (*s < 0xc0) { - n++; - s++; if(!*s)break; - s++; - } else if (*s < 0xe0) { - n++; - s++; if(!*s)break; - s++; if(!*s)break; - s++; - } else { -#ifdef Py_UNICODE_WIDE - n++; -#else - n+=2; -#endif - s++; if(!*s)break; - s++; if(!*s)break; - s++; if(!*s)break; - s++; - } - } + unsigned char *s = va_arg(count, unsigned char*); + PyObject *str = PyUnicode_DecodeUTF8(s, strlen(s), "replace"); + if (!str) + goto fail; + n += PyUnicode_GET_SIZE(str); + /* Remember the str and switch to the next slot */ + *callresult++ = str; break; } case 'U': @@ -915,19 +903,15 @@ break; case 's': { - /* Parameter must be UTF-8 encoded. - In case of encoding errors, use - the replacement character. */ - PyObject *u; - p = va_arg(vargs, char*); - u = PyUnicode_DecodeUTF8(p, strlen(p), - "replace"); - if (!u) - goto fail; - Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(u), - PyUnicode_GET_SIZE(u)); - s += PyUnicode_GET_SIZE(u); - Py_DECREF(u); + /* unused, since we already have the result */ + (void) va_arg(vargs, char *); + Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(*callresult), + PyUnicode_GET_SIZE(*callresult)); + s += PyUnicode_GET_SIZE(*callresult); + /* We're done with the unicode()/repr() => forget it */ + Py_DECREF(*callresult); + /* switch to next unicode()/repr() result */ + ++callresult; break; } case 'U': From python-checkins at python.org Mon May 4 00:36:37 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 4 May 2009 00:36:37 +0200 (CEST) Subject: [Python-checkins] r72261 - python/branches/release30-maint Message-ID: <20090503223637.3B2B51E40C7@bag.python.org> Author: mark.dickinson Date: Mon May 4 00:36:37 2009 New Revision: 72261 Log: Blocked revisions 72259 via svnmerge ................ r72259 | mark.dickinson | 2009-05-03 23:36:01 +0100 (Sun, 03 May 2009) | 9 lines Merged revisions 72257 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72257 | mark.dickinson | 2009-05-03 23:33:34 +0100 (Sun, 03 May 2009) | 2 lines Don't use PyOS_strnicmp for NaN and Inf detection: it's locale-aware. ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Mon May 4 00:38:54 2009 From: python-checkins at python.org (walter.doerwald) Date: Mon, 4 May 2009 00:38:54 +0200 (CEST) Subject: [Python-checkins] r72262 - in python/branches/release26-maint: Misc/NEWS Objects/unicodeobject.c Message-ID: <20090503223854.6CBCA1E401D@bag.python.org> Author: walter.doerwald Date: Mon May 4 00:38:54 2009 New Revision: 72262 Log: Merged revisions 72260 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72260 | walter.doerwald | 2009-05-04 00:36:33 +0200 (Mo, 04 Mai 2009) | 5 lines Issue #5108: Handle %s like %S and %R in PyUnicode_FromFormatV(): Call PyUnicode_DecodeUTF8() once, remember the result and output it in a second step. This avoids problems with counting UTF-8 bytes that ignores the effect of using the replace error handler in PyUnicode_DecodeUTF8(). ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Objects/unicodeobject.c Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Mon May 4 00:38:54 2009 @@ -24,6 +24,11 @@ - Issue #5759: float() didn't call __float__ on str subclasses. +- Issue #5108: Handle %s like %S and %R in PyUnicode_FromFormatV(): Call + PyUnicode_DecodeUTF8() once, remember the result and output it in a second + step. This avoids problems with counting UTF-8 bytes that ignores the effect + of using the replace error handler in PyUnicode_DecodeUTF8(). + Library ------- Modified: python/branches/release26-maint/Objects/unicodeobject.c ============================================================================== --- python/branches/release26-maint/Objects/unicodeobject.c (original) +++ python/branches/release26-maint/Objects/unicodeobject.c Mon May 4 00:38:54 2009 @@ -616,15 +616,25 @@ count = vargs; #endif #endif - /* step 1: count the number of %S/%R format specifications - * (we call PyObject_Str()/PyObject_Repr() for these objects - * once during step 3 and put the result in an array) */ + /* step 1: count the number of %S/%R/%s format specifications + * (we call PyObject_Str()/PyObject_Repr()/PyUnicode_DecodeUTF8() for these + * objects once during step 3 and put the result in an array) */ for (f = format; *f; f++) { - if (*f == '%' && (*(f+1)=='S' || *(f+1)=='R')) - ++callcount; + if (*f == '%') { + if (*(f+1)=='%') + continue; + if (*(f+1)=='S' || *(f+1)=='R' || *(f+1)=='A') + ++callcount; + while (isdigit((unsigned)*f)) + width = (width*10) + *f++ - '0'; + while (*++f && *f != '%' && !isalpha((unsigned)*f)) + ; + if (*f == 's') + ++callcount; + } } /* step 2: allocate memory for the results of - * PyObject_Str()/PyObject_Repr() calls */ + * PyObject_Str()/PyObject_Repr()/PyUnicode_DecodeUTF8() calls */ if (callcount) { callresults = PyObject_Malloc(sizeof(PyObject *)*callcount); if (!callresults) { @@ -673,35 +683,13 @@ case 's': { /* UTF-8 */ - unsigned char*s; - s = va_arg(count, unsigned char*); - while (*s) { - if (*s < 128) { - n++; s++; - } else if (*s < 0xc0) { - /* invalid UTF-8 */ - n++; s++; - } else if (*s < 0xc0) { - n++; - s++; if(!*s)break; - s++; - } else if (*s < 0xe0) { - n++; - s++; if(!*s)break; - s++; if(!*s)break; - s++; - } else { -#ifdef Py_UNICODE_WIDE - n++; -#else - n+=2; -#endif - s++; if(!*s)break; - s++; if(!*s)break; - s++; if(!*s)break; - s++; - } - } + unsigned char *s = va_arg(count, unsigned char*); + PyObject *str = PyUnicode_DecodeUTF8(s, strlen(s), "replace"); + if (!str) + goto fail; + n += PyUnicode_GET_SIZE(str); + /* Remember the str and switch to the next slot */ + *callresult++ = str; break; } case 'U': @@ -857,19 +845,15 @@ break; case 's': { - /* Parameter must be UTF-8 encoded. - In case of encoding errors, use - the replacement character. */ - PyObject *u; - p = va_arg(vargs, char*); - u = PyUnicode_DecodeUTF8(p, strlen(p), - "replace"); - if (!u) - goto fail; - Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(u), - PyUnicode_GET_SIZE(u)); - s += PyUnicode_GET_SIZE(u); - Py_DECREF(u); + /* unused, since we already have the result */ + (void) va_arg(vargs, char *); + Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(*callresult), + PyUnicode_GET_SIZE(*callresult)); + s += PyUnicode_GET_SIZE(*callresult); + /* We're done with the unicode()/repr() => forget it */ + Py_DECREF(*callresult); + /* switch to next unicode()/repr() result */ + ++callresult; break; } case 'U': From python-checkins at python.org Mon May 4 00:46:07 2009 From: python-checkins at python.org (walter.doerwald) Date: Mon, 4 May 2009 00:46:07 +0200 (CEST) Subject: [Python-checkins] r72263 - python/trunk/Objects/unicodeobject.c Message-ID: <20090503224607.6BAA41E4022@bag.python.org> Author: walter.doerwald Date: Mon May 4 00:46:07 2009 New Revision: 72263 Log: There's no %A in Python 2.x! Modified: python/trunk/Objects/unicodeobject.c Modified: python/trunk/Objects/unicodeobject.c ============================================================================== --- python/trunk/Objects/unicodeobject.c (original) +++ python/trunk/Objects/unicodeobject.c Mon May 4 00:46:07 2009 @@ -681,7 +681,7 @@ if (*f == '%') { if (*(f+1)=='%') continue; - if (*(f+1)=='S' || *(f+1)=='R' || *(f+1)=='A') + if (*(f+1)=='S' || *(f+1)=='R') ++callcount; while (isdigit((unsigned)*f)) width = (width*10) + *f++ - '0'; From python-checkins at python.org Mon May 4 00:46:50 2009 From: python-checkins at python.org (walter.doerwald) Date: Mon, 4 May 2009 00:46:50 +0200 (CEST) Subject: [Python-checkins] r72264 - in python/branches/release26-maint: Objects/unicodeobject.c Message-ID: <20090503224650.622231E4023@bag.python.org> Author: walter.doerwald Date: Mon May 4 00:46:50 2009 New Revision: 72264 Log: Merged revisions 72263 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72263 | walter.doerwald | 2009-05-04 00:46:07 +0200 (Mo, 04 Mai 2009) | 2 lines There's no %A in Python 2.x! ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Objects/unicodeobject.c Modified: python/branches/release26-maint/Objects/unicodeobject.c ============================================================================== --- python/branches/release26-maint/Objects/unicodeobject.c (original) +++ python/branches/release26-maint/Objects/unicodeobject.c Mon May 4 00:46:50 2009 @@ -623,7 +623,7 @@ if (*f == '%') { if (*(f+1)=='%') continue; - if (*(f+1)=='S' || *(f+1)=='R' || *(f+1)=='A') + if (*(f+1)=='S' || *(f+1)=='R') ++callcount; while (isdigit((unsigned)*f)) width = (width*10) + *f++ - '0'; From python-checkins at python.org Mon May 4 00:55:55 2009 From: python-checkins at python.org (walter.doerwald) Date: Mon, 4 May 2009 00:55:55 +0200 (CEST) Subject: [Python-checkins] r72265 - in python/branches/py3k: Misc/NEWS Objects/unicodeobject.c Message-ID: <20090503225555.34E871E4022@bag.python.org> Author: walter.doerwald Date: Mon May 4 00:55:55 2009 New Revision: 72265 Log: Merged revisions 72260 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72260 | walter.doerwald | 2009-05-04 00:36:33 +0200 (Mo, 04 Mai 2009) | 5 lines Issue #5108: Handle %s like %S and %R in PyUnicode_FromFormatV(): Call PyUnicode_DecodeUTF8() once, remember the result and output it in a second step. This avoids problems with counting UTF-8 bytes that ignores the effect of using the replace error handler in PyUnicode_DecodeUTF8(). ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/unicodeobject.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon May 4 00:55:55 2009 @@ -499,6 +499,11 @@ - The re.sub(), re.subn() and re.split() functions now accept a flags parameter. +- Issue #5108: Handle %s like %S, %R and %A in PyUnicode_FromFormatV(): Call + PyUnicode_DecodeUTF8() once, remember the result and output it in a second + step. This avoids problems with counting UTF-8 bytes that ignores the effect + of using the replace error handler in PyUnicode_DecodeUTF8(). + Library ------- Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Mon May 4 00:55:55 2009 @@ -723,16 +723,26 @@ count = vargs; #endif #endif - /* step 1: count the number of %S/%R/%A format specifications - * (we call PyObject_Str()/PyObject_Repr()/PyObject_ASCII() for - * these objects once during step 3 and put the result in - an array) */ + /* step 1: count the number of %S/%R/%A/%s format specifications + * (we call PyObject_Str()/PyObject_Repr()/PyObject_ASCII()/ + * PyUnicode_DecodeUTF8() for these objects once during step 3 and put the + * result in an array) */ for (f = format; *f; f++) { - if (*f == '%' && (*(f+1)=='S' || *(f+1)=='R' || *(f+1)=='A')) - ++callcount; + if (*f == '%') { + if (*(f+1)=='%') + continue; + if (*(f+1)=='S' || *(f+1)=='R' || *(f+1)=='A') + ++callcount; + while (ISDIGIT((unsigned)*f)) + width = (width*10) + *f++ - '0'; + while (*++f && *f != '%' && !ISALPHA((unsigned)*f)) + ; + if (*f == 's') + ++callcount; + } } /* step 2: allocate memory for the results of - * PyObject_Str()/PyObject_Repr() calls */ + * PyObject_Str()/PyObject_Repr()/PyUnicode_DecodeUTF8() calls */ if (callcount) { callresults = PyObject_Malloc(sizeof(PyObject *)*callcount); if (!callresults) { @@ -781,35 +791,13 @@ case 's': { /* UTF-8 */ - unsigned char*s; - s = va_arg(count, unsigned char*); - while (*s) { - if (*s < 128) { - n++; s++; - } else if (*s < 0xc0) { - /* invalid UTF-8 */ - n++; s++; - } else if (*s < 0xc0) { - n++; - s++; if(!*s)break; - s++; - } else if (*s < 0xe0) { - n++; - s++; if(!*s)break; - s++; if(!*s)break; - s++; - } else { -#ifdef Py_UNICODE_WIDE - n++; -#else - n+=2; -#endif - s++; if(!*s)break; - s++; if(!*s)break; - s++; if(!*s)break; - s++; - } - } + unsigned char *s = va_arg(count, unsigned char*); + PyObject *str = PyUnicode_DecodeUTF8(s, strlen(s), "replace"); + if (!str) + goto fail; + n += PyUnicode_GET_SIZE(str); + /* Remember the str and switch to the next slot */ + *callresult++ = str; break; } case 'U': @@ -978,19 +966,15 @@ break; case 's': { - /* Parameter must be UTF-8 encoded. - In case of encoding errors, use - the replacement character. */ - PyObject *u; - p = va_arg(vargs, char*); - u = PyUnicode_DecodeUTF8(p, strlen(p), - "replace"); - if (!u) - goto fail; - Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(u), - PyUnicode_GET_SIZE(u)); - s += PyUnicode_GET_SIZE(u); - Py_DECREF(u); + /* unused, since we already have the result */ + (void) va_arg(vargs, char *); + Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(*callresult), + PyUnicode_GET_SIZE(*callresult)); + s += PyUnicode_GET_SIZE(*callresult); + /* We're done with the unicode()/repr() => forget it */ + Py_DECREF(*callresult); + /* switch to next unicode()/repr() result */ + ++callresult; break; } case 'U': From python-checkins at python.org Mon May 4 00:57:39 2009 From: python-checkins at python.org (walter.doerwald) Date: Mon, 4 May 2009 00:57:39 +0200 (CEST) Subject: [Python-checkins] r72266 - in python/branches/release30-maint: Misc/NEWS Objects/unicodeobject.c Message-ID: <20090503225739.DBA9E1E4022@bag.python.org> Author: walter.doerwald Date: Mon May 4 00:57:39 2009 New Revision: 72266 Log: Merged revisions 72265 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72265 | walter.doerwald | 2009-05-04 00:55:55 +0200 (Mo, 04 Mai 2009) | 12 lines Merged revisions 72260 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72260 | walter.doerwald | 2009-05-04 00:36:33 +0200 (Mo, 04 Mai 2009) | 5 lines Issue #5108: Handle %s like %S and %R in PyUnicode_FromFormatV(): Call PyUnicode_DecodeUTF8() once, remember the result and output it in a second step. This avoids problems with counting UTF-8 bytes that ignores the effect of using the replace error handler in PyUnicode_DecodeUTF8(). ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Objects/unicodeobject.c Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Mon May 4 00:57:39 2009 @@ -39,6 +39,11 @@ - Issue #5249: time.strftime returned malformed string when format string contained non ascii character on windows. +- Issue #5108: Handle %s like %S, %R and %A in PyUnicode_FromFormatV(): Call + PyUnicode_DecodeUTF8() once, remember the result and output it in a second + step. This avoids problems with counting UTF-8 bytes that ignores the effect + of using the replace error handler in PyUnicode_DecodeUTF8(). + Library ------- Modified: python/branches/release30-maint/Objects/unicodeobject.c ============================================================================== --- python/branches/release30-maint/Objects/unicodeobject.c (original) +++ python/branches/release30-maint/Objects/unicodeobject.c Mon May 4 00:57:39 2009 @@ -654,16 +654,26 @@ count = vargs; #endif #endif - /* step 1: count the number of %S/%R/%A format specifications - * (we call PyObject_Str()/PyObject_Repr()/PyObject_ASCII() for - * these objects once during step 3 and put the result in - an array) */ + /* step 1: count the number of %S/%R/%A/%s format specifications + * (we call PyObject_Str()/PyObject_Repr()/PyObject_ASCII()/ + * PyUnicode_DecodeUTF8() for these objects once during step 3 and put the + * result in an array) */ for (f = format; *f; f++) { - if (*f == '%' && (*(f+1)=='S' || *(f+1)=='R' || *(f+1)=='A')) - ++callcount; + if (*f == '%') { + if (*(f+1)=='%') + continue; + if (*(f+1)=='S' || *(f+1)=='R' || *(f+1)=='A') + ++callcount; + while (ISDIGIT((unsigned)*f)) + width = (width*10) + *f++ - '0'; + while (*++f && *f != '%' && !ISALPHA((unsigned)*f)) + ; + if (*f == 's') + ++callcount; + } } /* step 2: allocate memory for the results of - * PyObject_Str()/PyObject_Repr() calls */ + * PyObject_Str()/PyObject_Repr()/PyUnicode_DecodeUTF8() calls */ if (callcount) { callresults = PyObject_Malloc(sizeof(PyObject *)*callcount); if (!callresults) { @@ -712,35 +722,13 @@ case 's': { /* UTF-8 */ - unsigned char*s; - s = va_arg(count, unsigned char*); - while (*s) { - if (*s < 128) { - n++; s++; - } else if (*s < 0xc0) { - /* invalid UTF-8 */ - n++; s++; - } else if (*s < 0xc0) { - n++; - s++; if(!*s)break; - s++; - } else if (*s < 0xe0) { - n++; - s++; if(!*s)break; - s++; if(!*s)break; - s++; - } else { -#ifdef Py_UNICODE_WIDE - n++; -#else - n+=2; -#endif - s++; if(!*s)break; - s++; if(!*s)break; - s++; if(!*s)break; - s++; - } - } + unsigned char *s = va_arg(count, unsigned char*); + PyObject *str = PyUnicode_DecodeUTF8(s, strlen(s), "replace"); + if (!str) + goto fail; + n += PyUnicode_GET_SIZE(str); + /* Remember the str and switch to the next slot */ + *callresult++ = str; break; } case 'U': @@ -909,19 +897,15 @@ break; case 's': { - /* Parameter must be UTF-8 encoded. - In case of encoding errors, use - the replacement character. */ - PyObject *u; - p = va_arg(vargs, char*); - u = PyUnicode_DecodeUTF8(p, strlen(p), - "replace"); - if (!u) - goto fail; - Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(u), - PyUnicode_GET_SIZE(u)); - s += PyUnicode_GET_SIZE(u); - Py_DECREF(u); + /* unused, since we already have the result */ + (void) va_arg(vargs, char *); + Py_UNICODE_COPY(s, PyUnicode_AS_UNICODE(*callresult), + PyUnicode_GET_SIZE(*callresult)); + s += PyUnicode_GET_SIZE(*callresult); + /* We're done with the unicode()/repr() => forget it */ + Py_DECREF(*callresult); + /* switch to next unicode()/repr() result */ + ++callresult; break; } case 'U': From buildbot at python.org Mon May 4 01:00:08 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 03 May 2009 23:00:08 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090503230008.63A3F1E4022@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1237 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_time make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon May 4 02:16:49 2009 From: python-checkins at python.org (gregory.p.smith) Date: Mon, 4 May 2009 02:16:49 +0200 (CEST) Subject: [Python-checkins] r72267 - in python/trunk: Doc/library/hashlib.rst Lib/test/test_hashlib.py Misc/NEWS Modules/_hashopenssl.c Message-ID: <20090504001649.96D6F1E4023@bag.python.org> Author: gregory.p.smith Date: Mon May 4 02:16:49 2009 New Revision: 72267 Log: Issue #4751: For hashlib algorithms provided by OpenSSL, the Python GIL is now released during computation on data lengths >= 2048 bytes. Modified: python/trunk/Doc/library/hashlib.rst python/trunk/Lib/test/test_hashlib.py python/trunk/Misc/NEWS python/trunk/Modules/_hashopenssl.c Modified: python/trunk/Doc/library/hashlib.rst ============================================================================== --- python/trunk/Doc/library/hashlib.rst (original) +++ python/trunk/Doc/library/hashlib.rst Mon May 4 02:16:49 2009 @@ -95,6 +95,12 @@ a single call with the concatenation of all the arguments: ``m.update(a); m.update(b)`` is equivalent to ``m.update(a+b)``. + .. versionchanged:: 2.7 + + The Python GIL is released to allow other threads to run while + hash updates on data larger than 2048 bytes is taking place when + using hash algorithms supplied by OpenSSL. + .. method:: hash.digest() Modified: python/trunk/Lib/test/test_hashlib.py ============================================================================== --- python/trunk/Lib/test/test_hashlib.py (original) +++ python/trunk/Lib/test/test_hashlib.py Mon May 4 02:16:49 2009 @@ -2,11 +2,16 @@ # # $Id$ # -# Copyright (C) 2005 Gregory P. Smith (greg at krypto.org) +# Copyright (C) 2005-2009 Gregory P. Smith (greg at krypto.org) # Licensed to PSF under a Contributor Agreement. # import hashlib +import StringIO +try: + import threading +except ImportError: + threading = None import unittest from test import test_support from test.test_support import _4G, precisionbigmemtest @@ -61,10 +66,10 @@ def check(self, name, data, digest): # test the direct constructors computed = getattr(hashlib, name)(data).hexdigest() - self.assert_(computed == digest) + self.assertEqual(computed, digest) # test the general new() interface computed = hashlib.new(name, data).hexdigest() - self.assert_(computed == digest) + self.assertEqual(computed, digest) def check_no_unicode(self, algorithm_name): # Unicode objects are not allowed as input. @@ -211,6 +216,44 @@ "e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973eb"+ "de0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b") + def test_threaded_hashing(self): + if not threading: + raise unittest.SkipTest('No threading module.') + + # Updating the same hash object from several threads at once + # using data chunk sizes containing the same byte sequences. + # + # If the internal locks are working to prevent multiple + # updates on the same object from running at once, the resulting + # hash will be the same as doing it single threaded upfront. + hasher = hashlib.sha1() + num_threads = 5 + smallest_data = 'swineflu' + data = smallest_data*200000 + expected_hash = hashlib.sha1(data*num_threads).hexdigest() + + def hash_in_chunks(chunk_size, event): + index = 0 + while index < len(data): + hasher.update(data[index:index+chunk_size]) + index += chunk_size + event.set() + + events = [] + for threadnum in xrange(num_threads): + chunk_size = len(data) // (10**threadnum) + assert chunk_size > 0 + assert chunk_size % len(smallest_data) == 0 + event = threading.Event() + events.append(event) + threading.Thread(target=hash_in_chunks, + args=(chunk_size, event)).start() + + for event in events: + event.wait() + + self.assertEqual(expected_hash, hasher.hexdigest()) + def test_main(): test_support.run_unittest(HashLibTestCase) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon May 4 02:16:49 2009 @@ -905,6 +905,9 @@ Extension Modules ----------------- +- Issue #4751: For hashlib algorithms provided by OpenSSL, the Python + GIL is now released during computation on data lengths >= 2048 bytes. + - Issue #3745: Fix hashlib to always reject unicode and non buffer-api supporting objects as input no matter how it was compiled (built in implementations or external openssl library). Modified: python/trunk/Modules/_hashopenssl.c ============================================================================== --- python/trunk/Modules/_hashopenssl.c (original) +++ python/trunk/Modules/_hashopenssl.c Mon May 4 02:16:49 2009 @@ -1,7 +1,7 @@ /* Module that wraps all OpenSSL hash algorithms */ /* - * Copyright (C) 2005-2007 Gregory P. Smith (greg at krypto.org) + * Copyright (C) 2005-2009 Gregory P. Smith (greg at krypto.org) * Licensed to PSF under a Contributor Agreement. * * Derived from a skeleton of shamodule.c containing work performed by: @@ -17,25 +17,49 @@ #include "structmember.h" #include "hashlib.h" +#ifdef WITH_THREAD +#include "pythread.h" + #define ENTER_HASHLIB(obj) \ + if ((obj)->lock) \ + { \ + if (!PyThread_acquire_lock((obj)->lock, 0)) \ + { \ + Py_BEGIN_ALLOW_THREADS \ + PyThread_acquire_lock((obj)->lock, 1); \ + Py_END_ALLOW_THREADS \ + } \ + } + #define LEAVE_HASHLIB(obj) \ + if ((obj)->lock) \ + { \ + PyThread_release_lock((obj)->lock); \ + } +#else + #define ENTER_HASHLIB(obj) + #define LEAVE_HASHLIB(obj) +#endif + /* EVP is the preferred interface to hashing in OpenSSL */ #include #define MUNCH_SIZE INT_MAX +/* TODO(gps): We should probably make this a module or EVPobject attribute + * to allow the user to optimize based on the platform they're using. */ +#define HASHLIB_GIL_MINSIZE 2048 #ifndef HASH_OBJ_CONSTRUCTOR #define HASH_OBJ_CONSTRUCTOR 0 #endif + typedef struct { PyObject_HEAD PyObject *name; /* name of this hash algorithm */ EVP_MD_CTX ctx; /* OpenSSL message digest context */ - /* - * TODO investigate performance impact of including a lock for this object - * here and releasing the Python GIL while hash updates are in progress. - * (perhaps only release GIL if input length will take long to process?) - */ +#ifdef WITH_THREAD + PyThread_type_lock lock; /* OpenSSL context lock */ +#endif } EVPobject; @@ -64,26 +88,57 @@ if (retval != NULL) { Py_INCREF(name); retval->name = name; +#ifdef WITH_THREAD + retval->lock = NULL; +#endif } return retval; } +static void +EVP_hash(EVPobject *self, const void *vp, Py_ssize_t len) +{ + unsigned int process; + const unsigned char *cp = (const unsigned char *)vp; + while (0 < len) + { + if (len > (Py_ssize_t)MUNCH_SIZE) + process = MUNCH_SIZE; + else + process = Py_SAFE_DOWNCAST(len, Py_ssize_t, unsigned int); + EVP_DigestUpdate(&self->ctx, (const void*)cp, process); + len -= process; + cp += process; + } +} + /* Internal methods for a hash object */ static void -EVP_dealloc(PyObject *ptr) +EVP_dealloc(EVPobject *self) { - EVP_MD_CTX_cleanup(&((EVPobject *)ptr)->ctx); - Py_XDECREF(((EVPobject *)ptr)->name); - PyObject_Del(ptr); +#ifdef WITH_THREAD + if (self->lock != NULL) + PyThread_free_lock(self->lock); +#endif + EVP_MD_CTX_cleanup(&self->ctx); + Py_XDECREF(self->name); + PyObject_Del(self); } +static void locked_EVP_MD_CTX_copy(EVP_MD_CTX *new_ctx_p, EVPobject *self) +{ + ENTER_HASHLIB(self); + EVP_MD_CTX_copy(new_ctx_p, &self->ctx); + LEAVE_HASHLIB(self); +} /* External methods for a hash object */ PyDoc_STRVAR(EVP_copy__doc__, "Return a copy of the hash object."); + static PyObject * EVP_copy(EVPobject *self, PyObject *unused) { @@ -92,7 +147,7 @@ if ( (newobj = newEVPobject(self->name))==NULL) return NULL; - EVP_MD_CTX_copy(&newobj->ctx, &self->ctx); + locked_EVP_MD_CTX_copy(&newobj->ctx, self); return (PyObject *)newobj; } @@ -107,7 +162,7 @@ PyObject *retval; unsigned int digest_size; - EVP_MD_CTX_copy(&temp_ctx, &self->ctx); + locked_EVP_MD_CTX_copy(&temp_ctx, self); digest_size = EVP_MD_CTX_size(&temp_ctx); EVP_DigestFinal(&temp_ctx, digest, NULL); @@ -129,7 +184,7 @@ unsigned int i, j, digest_size; /* Get the raw (binary) digest value */ - EVP_MD_CTX_copy(&temp_ctx, &self->ctx); + locked_EVP_MD_CTX_copy(&temp_ctx, self); digest_size = EVP_MD_CTX_size(&temp_ctx); EVP_DigestFinal(&temp_ctx, digest, NULL); @@ -174,19 +229,26 @@ GET_BUFFER_VIEW_OR_ERROUT(obj, &view, NULL); - if (view.len > 0 && view.len <= MUNCH_SIZE) { - EVP_DigestUpdate(&self->ctx, (unsigned char*)view.buf, - Py_SAFE_DOWNCAST(view.len, Py_ssize_t, unsigned int)); +#ifdef WITH_THREAD + if (self->lock == NULL && view.len >= HASHLIB_GIL_MINSIZE) + { + self->lock = PyThread_allocate_lock(); + /* fail? lock = NULL and we fail over to non-threaded code. */ + } + + if (self->lock != NULL) + { + Py_BEGIN_ALLOW_THREADS + PyThread_acquire_lock(self->lock, 1); + EVP_hash(self, view.buf, view.len); + PyThread_release_lock(self->lock); + Py_END_ALLOW_THREADS } else { - Py_ssize_t len = view.len; - unsigned char *cp = (unsigned char *)view.buf; - while (len > 0) { - unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len; - EVP_DigestUpdate(&self->ctx, cp, process); - len -= process; - cp += process; - } + EVP_hash(self, view.buf, view.len); } +#else + EVP_hash(self, view.buf, view.len); +#endif PyBuffer_Release(&view); @@ -205,13 +267,17 @@ static PyObject * EVP_get_block_size(EVPobject *self, void *closure) { - return PyInt_FromLong(EVP_MD_CTX_block_size(&((EVPobject *)self)->ctx)); + long block_size; + block_size = EVP_MD_CTX_block_size(&self->ctx); + return PyLong_FromLong(block_size); } static PyObject * EVP_get_digest_size(EVPobject *self, void *closure) { - return PyInt_FromLong(EVP_MD_CTX_size(&((EVPobject *)self)->ctx)); + long size; + size = EVP_MD_CTX_size(&self->ctx); + return PyLong_FromLong(size); } static PyMemberDef EVP_members[] = { @@ -286,19 +352,14 @@ Py_INCREF(self->name); if (data_obj) { - if (view.len > 0 && view.len <= MUNCH_SIZE) { - EVP_DigestUpdate(&self->ctx, (unsigned char*)view.buf, - Py_SAFE_DOWNCAST(view.len, Py_ssize_t, unsigned int)); + if (view.len >= HASHLIB_GIL_MINSIZE) + { + Py_BEGIN_ALLOW_THREADS + EVP_hash(self, view.buf, view.len); + Py_END_ALLOW_THREADS } else { - Py_ssize_t len = view.len; - unsigned char *cp = (unsigned char*)view.buf; - while (len > 0) { - unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len; - EVP_DigestUpdate(&self->ctx, cp, process); - len -= process; - cp += process; - } - } + EVP_hash(self, view.buf, view.len); + } PyBuffer_Release(&view); } @@ -329,7 +390,7 @@ sizeof(EVPobject), /*tp_basicsize*/ 0, /*tp_itemsize*/ /* methods */ - EVP_dealloc, /*tp_dealloc*/ + (destructor)EVP_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ 0, /*tp_getattr*/ 0, /*tp_setattr*/ @@ -389,17 +450,13 @@ } if (cp && len) { - if (len > 0 && len <= MUNCH_SIZE) { - EVP_DigestUpdate(&self->ctx, cp, Py_SAFE_DOWNCAST(len, Py_ssize_t, - unsigned int)); + if (len >= HASHLIB_GIL_MINSIZE) + { + Py_BEGIN_ALLOW_THREADS + EVP_hash(self, cp, len); + Py_END_ALLOW_THREADS } else { - Py_ssize_t offset = 0; - while (len > 0) { - unsigned int process = len > MUNCH_SIZE ? MUNCH_SIZE : len; - EVP_DigestUpdate(&self->ctx, cp + offset, process); - len -= process; - offset += process; - } + EVP_hash(self, cp, len); } } From python-checkins at python.org Mon May 4 02:45:34 2009 From: python-checkins at python.org (gregory.p.smith) Date: Mon, 4 May 2009 02:45:34 +0200 (CEST) Subject: [Python-checkins] r72268 - in python/branches/py3k: Doc/library/hashlib.rst Lib/test/test_hashlib.py Modules/_hashopenssl.c Message-ID: <20090504004534.3DDEC1E4023@bag.python.org> Author: gregory.p.smith Date: Mon May 4 02:45:33 2009 New Revision: 72268 Log: Merge refactoring I did when committing r72267 to trunk into the already committed issue4751 support in py3k r68411. Modified: python/branches/py3k/Doc/library/hashlib.rst python/branches/py3k/Lib/test/test_hashlib.py python/branches/py3k/Modules/_hashopenssl.c Modified: python/branches/py3k/Doc/library/hashlib.rst ============================================================================== --- python/branches/py3k/Doc/library/hashlib.rst (original) +++ python/branches/py3k/Doc/library/hashlib.rst Mon May 4 02:45:33 2009 @@ -105,6 +105,12 @@ concatenation of all the arguments: ``m.update(a); m.update(b)`` is equivalent to ``m.update(a+b)``. + .. versionchanged:: 2.7 + + The Python GIL is released to allow other threads to run while + hash updates on data larger than 2048 bytes is taking place when + using hash algorithms supplied by OpenSSL. + .. method:: hash.digest() Modified: python/branches/py3k/Lib/test/test_hashlib.py ============================================================================== --- python/branches/py3k/Lib/test/test_hashlib.py (original) +++ python/branches/py3k/Lib/test/test_hashlib.py Mon May 4 02:45:33 2009 @@ -2,11 +2,16 @@ # # $Id$ # -# Copyright (C) 2005 Gregory P. Smith (greg at krypto.org) +# Copyright (C) 2005-2009 Gregory P. Smith (greg at krypto.org) # Licensed to PSF under a Contributor Agreement. # import hashlib +from io import StringIO +try: + import threading +except ImportError: + threading = None import unittest from test import support from test.support import _4G, precisionbigmemtest @@ -224,6 +229,45 @@ m = hashlib.md5(b'x' * gil_minsize) self.assertEquals(m.hexdigest(), 'cfb767f225d58469c5de3632a8803958') + def test_threaded_hashing(self): + if not threading: + raise unittest.SkipTest('No threading module.') + + # Updating the same hash object from several threads at once + # using data chunk sizes containing the same byte sequences. + # + # If the internal locks are working to prevent multiple + # updates on the same object from running at once, the resulting + # hash will be the same as doing it single threaded upfront. + hasher = hashlib.sha1() + num_threads = 5 + smallest_data = b'swineflu' + data = smallest_data*200000 + expected_hash = hashlib.sha1(data*num_threads).hexdigest() + + def hash_in_chunks(chunk_size, event): + index = 0 + while index < len(data): + hasher.update(data[index:index+chunk_size]) + index += chunk_size + event.set() + + events = [] + for threadnum in range(num_threads): + chunk_size = len(data) // (10**threadnum) + assert chunk_size > 0 + assert chunk_size % len(smallest_data) == 0 + event = threading.Event() + events.append(event) + threading.Thread(target=hash_in_chunks, + args=(chunk_size, event)).start() + + for event in events: + event.wait() + + self.assertEqual(expected_hash, hasher.hexdigest()) + + def test_main(): support.run_unittest(HashLibTestCase) Modified: python/branches/py3k/Modules/_hashopenssl.c ============================================================================== --- python/branches/py3k/Modules/_hashopenssl.c (original) +++ python/branches/py3k/Modules/_hashopenssl.c Mon May 4 02:45:33 2009 @@ -1,7 +1,7 @@ /* Module that wraps all OpenSSL hash algorithms */ /* - * Copyright (C) 2005-2007 Gregory P. Smith (greg at krypto.org) + * Copyright (C) 2005-2009 Gregory P. Smith (greg at krypto.org) * Licensed to PSF under a Contributor Agreement. * * Derived from a skeleton of shamodule.c containing work performed by: @@ -17,21 +17,8 @@ #include "structmember.h" #include "hashlib.h" -/* EVP is the preferred interface to hashing in OpenSSL */ -#include - -#define MUNCH_SIZE INT_MAX - - -#ifndef HASH_OBJ_CONSTRUCTOR -#define HASH_OBJ_CONSTRUCTOR 0 -#endif - -#define HASHLIB_GIL_MINSIZE 2048 - #ifdef WITH_THREAD - #include "pythread.h" - +#include "pythread.h" #define ENTER_HASHLIB(obj) \ if ((obj)->lock) { \ if (!PyThread_acquire_lock((obj)->lock, 0)) { \ @@ -49,6 +36,20 @@ #define LEAVE_HASHLIB(obj) #endif +/* EVP is the preferred interface to hashing in OpenSSL */ +#include + +#define MUNCH_SIZE INT_MAX + +/* TODO(gps): We should probably make this a module or EVPobject attribute + * to allow the user to optimize based on the platform they're using. */ +#define HASHLIB_GIL_MINSIZE 2048 + +#ifndef HASH_OBJ_CONSTRUCTOR +#define HASH_OBJ_CONSTRUCTOR 0 +#endif + + typedef struct { PyObject_HEAD PyObject *name; /* name of this hash algorithm */ @@ -122,11 +123,18 @@ PyObject_Del(self); } +static void locked_EVP_MD_CTX_copy(EVP_MD_CTX *new_ctx_p, EVPobject *self) +{ + ENTER_HASHLIB(self); + EVP_MD_CTX_copy(new_ctx_p, &self->ctx); + LEAVE_HASHLIB(self); +} /* External methods for a hash object */ PyDoc_STRVAR(EVP_copy__doc__, "Return a copy of the hash object."); + static PyObject * EVP_copy(EVPobject *self, PyObject *unused) { @@ -135,9 +143,7 @@ if ( (newobj = newEVPobject(self->name))==NULL) return NULL; - ENTER_HASHLIB(self); - EVP_MD_CTX_copy(&newobj->ctx, &self->ctx); - LEAVE_HASHLIB(self); + locked_EVP_MD_CTX_copy(&newobj->ctx, self); return (PyObject *)newobj; } @@ -152,9 +158,7 @@ PyObject *retval; unsigned int digest_size; - ENTER_HASHLIB(self); - EVP_MD_CTX_copy(&temp_ctx, &self->ctx); - LEAVE_HASHLIB(self); + locked_EVP_MD_CTX_copy(&temp_ctx, self); digest_size = EVP_MD_CTX_size(&temp_ctx); EVP_DigestFinal(&temp_ctx, digest, NULL); @@ -176,9 +180,7 @@ unsigned int i, j, digest_size; /* Get the raw (binary) digest value */ - ENTER_HASHLIB(self); - EVP_MD_CTX_copy(&temp_ctx, &self->ctx); - LEAVE_HASHLIB(self); + locked_EVP_MD_CTX_copy(&temp_ctx, self); digest_size = EVP_MD_CTX_size(&temp_ctx); EVP_DigestFinal(&temp_ctx, digest, NULL); @@ -221,11 +223,7 @@ #ifdef WITH_THREAD if (self->lock == NULL && view.len >= HASHLIB_GIL_MINSIZE) { self->lock = PyThread_allocate_lock(); - if (self->lock == NULL) { - PyBuffer_Release(&view); - PyErr_SetString(PyExc_MemoryError, "unable to allocate lock"); - return NULL; - } + /* fail? lock = NULL and we fail over to non-threaded code. */ } if (self->lock != NULL) { @@ -257,9 +255,7 @@ EVP_get_block_size(EVPobject *self, void *closure) { long block_size; - ENTER_HASHLIB(self); block_size = EVP_MD_CTX_block_size(&self->ctx); - LEAVE_HASHLIB(self); return PyLong_FromLong(block_size); } @@ -267,9 +263,7 @@ EVP_get_digest_size(EVPobject *self, void *closure) { long size; - ENTER_HASHLIB(self); size = EVP_MD_CTX_size(&self->ctx); - LEAVE_HASHLIB(self); return PyLong_FromLong(size); } From python-checkins at python.org Mon May 4 02:48:41 2009 From: python-checkins at python.org (gregory.p.smith) Date: Mon, 4 May 2009 02:48:41 +0200 (CEST) Subject: [Python-checkins] r72269 - python/trunk/Modules/_hashopenssl.c Message-ID: <20090504004841.4F24B1E4023@bag.python.org> Author: gregory.p.smith Date: Mon May 4 02:48:41 2009 New Revision: 72269 Log: cleanup applied patch to match style that is already in py3k branch. Modified: python/trunk/Modules/_hashopenssl.c Modified: python/trunk/Modules/_hashopenssl.c ============================================================================== --- python/trunk/Modules/_hashopenssl.c (original) +++ python/trunk/Modules/_hashopenssl.c Mon May 4 02:48:41 2009 @@ -20,18 +20,15 @@ #ifdef WITH_THREAD #include "pythread.h" #define ENTER_HASHLIB(obj) \ - if ((obj)->lock) \ - { \ - if (!PyThread_acquire_lock((obj)->lock, 0)) \ - { \ + if ((obj)->lock) { \ + if (!PyThread_acquire_lock((obj)->lock, 0)) { \ Py_BEGIN_ALLOW_THREADS \ PyThread_acquire_lock((obj)->lock, 1); \ Py_END_ALLOW_THREADS \ } \ } #define LEAVE_HASHLIB(obj) \ - if ((obj)->lock) \ - { \ + if ((obj)->lock) { \ PyThread_release_lock((obj)->lock); \ } #else @@ -230,14 +227,12 @@ GET_BUFFER_VIEW_OR_ERROUT(obj, &view, NULL); #ifdef WITH_THREAD - if (self->lock == NULL && view.len >= HASHLIB_GIL_MINSIZE) - { + if (self->lock == NULL && view.len >= HASHLIB_GIL_MINSIZE) { self->lock = PyThread_allocate_lock(); /* fail? lock = NULL and we fail over to non-threaded code. */ } - if (self->lock != NULL) - { + if (self->lock != NULL) { Py_BEGIN_ALLOW_THREADS PyThread_acquire_lock(self->lock, 1); EVP_hash(self, view.buf, view.len); @@ -352,14 +347,13 @@ Py_INCREF(self->name); if (data_obj) { - if (view.len >= HASHLIB_GIL_MINSIZE) - { + if (view.len >= HASHLIB_GIL_MINSIZE) { Py_BEGIN_ALLOW_THREADS EVP_hash(self, view.buf, view.len); Py_END_ALLOW_THREADS } else { EVP_hash(self, view.buf, view.len); - } + } PyBuffer_Release(&view); } @@ -450,8 +444,7 @@ } if (cp && len) { - if (len >= HASHLIB_GIL_MINSIZE) - { + if (len >= HASHLIB_GIL_MINSIZE) { Py_BEGIN_ALLOW_THREADS EVP_hash(self, cp, len); Py_END_ALLOW_THREADS From python-checkins at python.org Mon May 4 02:51:15 2009 From: python-checkins at python.org (gregory.p.smith) Date: Mon, 4 May 2009 02:51:15 +0200 (CEST) Subject: [Python-checkins] r72270 - python/branches/py3k Message-ID: <20090504005115.876AE1E4023@bag.python.org> Author: gregory.p.smith Date: Mon May 4 02:51:15 2009 New Revision: 72270 Log: block 72267 and 72269. already effectively merged. Modified: python/branches/py3k/ (props changed) From buildbot at python.org Mon May 4 03:07:10 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 01:07:10 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090504010711.0F99D1E4023@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/622 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Mon May 4 03:12:51 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 01:12:51 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090504011252.AE1D11E4023@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/455 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon May 4 03:13:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 01:13:00 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090504011300.509821E4023@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/687 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_time ====================================================================== FAIL: test_update2 (test.test_os.EnvironTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_os.py", line 382, in test_update2 self.assertEquals(value, "World") AssertionError: '' != 'World' ====================================================================== FAIL: test_tzset (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_time.py", line 166, in test_tzset self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) AssertionError: time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) == time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon May 4 04:05:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 02:05:31 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090504020531.E0A861E4023@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/874 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.dickinson,walter.doerwald BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_time ====================================================================== FAIL: test_update2 (test.test_os.EnvironTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_os.py", line 382, in test_update2 self.assertEquals(value, "World") AssertionError: '' != 'World' ====================================================================== FAIL: test_tzset (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_time.py", line 166, in test_tzset self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) AssertionError: time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) == time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon May 4 06:45:51 2009 From: python-checkins at python.org (martin.v.loewis) Date: Mon, 4 May 2009 06:45:51 +0200 (CEST) Subject: [Python-checkins] r72271 - python/branches/pep-0383/Modules/posixmodule.c Message-ID: <20090504044551.E5EC81E4018@bag.python.org> Author: martin.v.loewis Date: Mon May 4 06:45:51 2009 New Revision: 72271 Log: Implement PEP 383 for putenv. Modified: python/branches/pep-0383/Modules/posixmodule.c Modified: python/branches/pep-0383/Modules/posixmodule.c ============================================================================== --- python/branches/pep-0383/Modules/posixmodule.c (original) +++ python/branches/pep-0383/Modules/posixmodule.c Mon May 4 06:45:51 2009 @@ -5382,20 +5382,27 @@ wchar_t *s1, *s2; wchar_t *newenv; #else + PyObject *os1, *os2; char *s1, *s2; char *newenv; #endif PyObject *newstr; size_t len; - if (!PyArg_ParseTuple(args, #ifdef MS_WINDOWS + if (!PyArg_ParseTuple(args, "uu:putenv", -#else - "ss:putenv", -#endif &s1, &s2)) return NULL; +#else + if (!PyArg_ParseTuple(args, + "O&O&:putenv", + PyUnicode_FSConverter, &os1, + PyUnicode_FSConverter, &os2)) + return NULL; + s1 = bytes2str(os1, 1); + s2 = bytes2str(os2, 1); +#endif #if defined(PYOS_OS2) if (stricmp(s1, "BEGINLIBPATH") == 0) { @@ -5438,6 +5445,8 @@ PyOS_snprintf(newenv, len, "%s=%s", s1, s2); if (putenv(newenv)) { Py_DECREF(newstr); + release_bytes(os1); + release_bytes(os2); posix_error(); return NULL; } @@ -5458,6 +5467,10 @@ #if defined(PYOS_OS2) } #endif +#ifndef MS_WINDOWS + release_bytes(os1); + release_bytes(os2); +#endif Py_INCREF(Py_None); return Py_None; } From python-checkins at python.org Mon May 4 06:59:36 2009 From: python-checkins at python.org (martin.v.loewis) Date: Mon, 4 May 2009 06:59:36 +0200 (CEST) Subject: [Python-checkins] r72272 - in python/branches/pep-0383: Lib/test/test_codecs.py Lib/test/test_os.py Lib/test/test_pep383.py Modules/posixmodule.c Python/codecs.c Message-ID: <20090504045936.767711E4018@bag.python.org> Author: martin.v.loewis Date: Mon May 4 06:59:36 2009 New Revision: 72272 Log: Address comments of Rietveld issue 52095 patchset 1. Removed: python/branches/pep-0383/Lib/test/test_pep383.py Modified: python/branches/pep-0383/Lib/test/test_codecs.py python/branches/pep-0383/Lib/test/test_os.py python/branches/pep-0383/Modules/posixmodule.c python/branches/pep-0383/Python/codecs.c Modified: python/branches/pep-0383/Lib/test/test_codecs.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_codecs.py (original) +++ python/branches/pep-0383/Lib/test/test_codecs.py Mon May 4 06:59:36 2009 @@ -1516,6 +1516,34 @@ self.assertEquals(codecs.raw_unicode_escape_decode(r"\u1234"), ("\u1234", 6)) self.assertEquals(codecs.raw_unicode_escape_decode(br"\u1234"), ("\u1234", 6)) +class Utf8bTest(unittest.TestCase): + + def test_utf8(self): + # Bad byte + self.assertEqual(b"foo\x80bar".decode("utf-8", "utf8b"), + "foo\udc80bar") + self.assertEqual("foo\udc80bar".encode("utf-8", "utf8b"), + b"foo\x80bar") + # bad-utf-8 encoded surrogate + self.assertEqual(b"\xed\xb0\x80".decode("utf-8", "utf8b"), + "\udced\udcb0\udc80") + self.assertEqual("\udced\udcb0\udc80".encode("utf-8", "utf8b"), + b"\xed\xb0\x80") + + def test_ascii(self): + # bad byte + self.assertEqual(b"foo\x80bar".decode("ascii", "utf8b"), + "foo\udc80bar") + self.assertEqual("foo\udc80bar".encode("ascii", "utf8b"), + b"foo\x80bar") + + def test_charmap(self): + # bad byte: \xa5 is unmapped in iso-8859-3 + self.assertEqual(b"foo\xa5bar".decode("iso-8859-3", "utf8b"), + "foo\udca5bar") + self.assertEqual("foo\udca5bar".encode("iso-8859-4", "utf8b"), + b"foo\xa5bar") + def test_main(): support.run_unittest( @@ -1543,6 +1571,7 @@ CharmapTest, WithStmtTest, TypesTest, + Utf8bTest, ) Modified: python/branches/pep-0383/Lib/test/test_os.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_os.py (original) +++ python/branches/pep-0383/Lib/test/test_os.py Mon May 4 06:59:36 2009 @@ -7,6 +7,7 @@ import unittest import warnings import sys +import shutil from test import support # Tests creating TESTFN @@ -698,9 +699,44 @@ self.assertRaises(os.error, os.setregid, 0, 0) self.assertRaises(OverflowError, os.setregid, 1<<32, 0) self.assertRaises(OverflowError, os.setregid, 0, 1<<32) + + class Pep383Tests(unittest.TestCase): + filenames = [b'foo\xf6bar', b'foo\xf6bar'] + + def setUp(self): + self.fsencoding = sys.getfilesystemencoding() + sys.setfilesystemencoding("utf-8") + self.dir = support.TESTFN + self.bdir = self.dir.encode("utf-8", "utf8b") + os.mkdir(self.dir) + self.unicodefn = [] + for fn in self.filenames: + f = open(os.path.join(self.bdir, fn), "w") + f.close() + self.unicodefn.append(fn.decode("utf-8", "utf8b")) + + def tearDown(self): + shutil.rmtree(self.dir) + sys.setfilesystemencoding(self.fsencoding) + + def test_listdir(self): + expected = set(self.unicodefn) + found = set(os.listdir(support.TESTFN)) + self.assertEquals(found, expected) + + def test_open(self): + for fn in self.unicodefn: + f = open(os.path.join(self.dir, fn)) + f.close() + + def test_stat(self): + for fn in self.unicodefn: + os.stat(os.path.join(self.dir, fn)) else: class PosixUidGidTests(unittest.TestCase): pass + class Pep383Tests(unittest.TestCase): + pass def test_main(): support.run_unittest( @@ -714,7 +750,8 @@ ExecTests, Win32ErrorTests, TestInvalidFD, - PosixUidGidTests + PosixUidGidTests, + Pep383Tests ) if __name__ == "__main__": Deleted: python/branches/pep-0383/Lib/test/test_pep383.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_pep383.py Mon May 4 06:59:36 2009 +++ (empty file) @@ -1,76 +0,0 @@ -from test import support -import unittest, shutil, os, sys - -class Utf8bTest(unittest.TestCase): - - def test_utf8(self): - # Bad byte - self.assertEqual(b"foo\x80bar".decode("utf-8", "utf8b"), - "foo\udc80bar") - self.assertEqual("foo\udc80bar".encode("utf-8", "utf8b"), - b"foo\x80bar") - # bad-utf-8 encoded surrogate - self.assertEqual(b"\xed\xb0\x80".decode("utf-8", "utf8b"), - "\udced\udcb0\udc80") - self.assertEqual("\udced\udcb0\udc80".encode("utf-8", "utf8b"), - b"\xed\xb0\x80") - - def test_ascii(self): - # bad byte - self.assertEqual(b"foo\x80bar".decode("ascii", "utf8b"), - "foo\udc80bar") - self.assertEqual("foo\udc80bar".encode("ascii", "utf8b"), - b"foo\x80bar") - - def test_charmap(self): - # bad byte: \xa5 is unmapped in iso-8859-3 - self.assertEqual(b"foo\xa5bar".decode("iso-8859-3", "utf8b"), - "foo\udca5bar") - self.assertEqual("foo\udca5bar".encode("iso-8859-4", "utf8b"), - b"foo\xa5bar") - -class FileTests(unittest.TestCase): - if os.name != 'win32': - filenames = [b'foo\xf6bar', b'foo\xf6bar'] - else: - # PEP 383 has no effect on file name handling on Windows - filenames = [] - - def setUp(self): - self.fsencoding = sys.getfilesystemencoding() - sys.setfilesystemencoding("utf-8") - self.dir = support.TESTFN - self.bdir = self.dir.encode("utf-8", "utf8b") - os.mkdir(self.dir) - self.unicodefn = [] - for fn in self.filenames: - f = open(self.bdir + b"/" + fn, "w") - f.close() - self.unicodefn.append(fn.decode("utf-8", "utf8b")) - - def tearDown(self): - shutil.rmtree(self.dir) - sys.setfilesystemencoding(self.fsencoding) - - def test_listdir(self): - expected = set(self.unicodefn) - found = set(os.listdir(support.TESTFN)) - self.assertEquals(found, expected) - - def test_open(self): - for fn in self.unicodefn: - f = open(os.path.join(self.dir, fn)) - f.close() - - def test_stat(self): - for fn in self.unicodefn: - os.stat(os.path.join(self.dir, fn)) - -def test_main(): - support.run_unittest( - Utf8bTest, - FileTests) - - -if __name__ == "__main__": - test_main() Modified: python/branches/pep-0383/Modules/posixmodule.c ============================================================================== --- python/branches/pep-0383/Modules/posixmodule.c (original) +++ python/branches/pep-0383/Modules/posixmodule.c Mon May 4 06:59:36 2009 @@ -545,15 +545,16 @@ if(PyBytes_Check(o)) return PyBytes_AsString(o); else if(PyByteArray_Check(o)) { - if (lock && o->ob_type->tp_as_buffer->bf_getbuffer(o, NULL, 0) < 0) + if (lock && PyObject_GetBuffer(o, NULL, 0) < 0) /* On a bytearray, this should not fail. */ PyErr_BadInternalCall(); return PyByteArray_AsString(o); } else { /* The FS converter should have verified that this is either bytes or bytearray. */ - PyErr_BadInternalCall(); - return NULL; + Py_FatalError("bad object passed to bytes2str"); + /* not reached. */ + return ""; } } Modified: python/branches/pep-0383/Python/codecs.c ============================================================================== --- python/branches/pep-0383/Python/codecs.c (original) +++ python/branches/pep-0383/Python/codecs.c Mon May 4 06:59:36 2009 @@ -846,8 +846,10 @@ return NULL; startp = PyUnicode_AS_UNICODE(object); res = PyBytes_FromStringAndSize(NULL, end-start); - if (!res) + if (!res) { + Py_DECREF(object); return NULL; + } outp = PyBytes_AsString(res); for (p = startp+start; p < startp+end; p++) { Py_UNICODE ch = *p; @@ -886,12 +888,12 @@ ch[consumed] = 0xdc00 + p[start+consumed]; consumed++; } + Py_DECREF(object); if (!consumed) { /* codec complained about ASCII byte. */ PyErr_SetObject(PyExceptionInstance_Class(exc), exc); return NULL; } - Py_DECREF(object); return Py_BuildValue("(u#n)", ch, consumed, start+consumed); } else { From python-checkins at python.org Mon May 4 07:28:40 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Mon, 4 May 2009 07:28:40 +0200 (CEST) Subject: [Python-checkins] r72273 - in python/trunk: Misc/NEWS Modules/posixmodule.c Message-ID: <20090504052840.4382A1E4018@bag.python.org> Author: hirokazu.yamamoto Date: Mon May 4 07:28:39 2009 New Revision: 72273 Log: Issue #5913: os.listdir() should fail for empty path on windows. Modified: python/trunk/Misc/NEWS python/trunk/Modules/posixmodule.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon May 4 07:28:39 2009 @@ -266,6 +266,8 @@ Library ------- +- Issue #5913: os.listdir() should fail for empty path on windows. + - Issue #5084: unpickling now interns the attribute names of pickled objects, saving memory and avoiding growth in size of subsequent pickles. Proposal and original patch by Jake McGuire. Modified: python/trunk/Modules/posixmodule.c ============================================================================== --- python/trunk/Modules/posixmodule.c (original) +++ python/trunk/Modules/posixmodule.c Mon May 4 07:28:39 2009 @@ -2183,7 +2183,6 @@ if (PyArg_ParseTuple(args, "U:listdir", &po)) { WIN32_FIND_DATAW wFileData; Py_UNICODE *wnamebuf; - Py_UNICODE wch; /* Overallocate for \\*.*\0 */ len = PyUnicode_GET_SIZE(po); wnamebuf = malloc((len + 5) * sizeof(wchar_t)); @@ -2192,10 +2191,12 @@ return NULL; } wcscpy(wnamebuf, PyUnicode_AS_UNICODE(po)); - wch = len > 0 ? wnamebuf[len-1] : '\0'; - if (wch != L'/' && wch != L'\\' && wch != L':') - wnamebuf[len++] = L'\\'; - wcscpy(wnamebuf + len, L"*.*"); + if (len > 0) { + Py_UNICODE wch = wnamebuf[len-1]; + if (wch != L'/' && wch != L'\\' && wch != L':') + wnamebuf[len++] = L'\\'; + wcscpy(wnamebuf + len, L"*.*"); + } if ((d = PyList_New(0)) == NULL) { free(wnamebuf); return NULL; @@ -2266,8 +2267,8 @@ char ch = namebuf[len-1]; if (ch != SEP && ch != ALTSEP && ch != ':') namebuf[len++] = '/'; + strcpy(namebuf + len, "*.*"); } - strcpy(namebuf + len, "*.*"); if ((d = PyList_New(0)) == NULL) return NULL; From buildbot at python.org Mon May 4 07:40:43 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 05:40:43 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090504054043.C8F061E4018@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/327 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson,walter.doerwald BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_posix test_subprocess ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Mon May 4 07:56:46 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Mon, 4 May 2009 07:56:46 +0200 (CEST) Subject: [Python-checkins] r72274 - in python/branches/py3k: Misc/NEWS Modules/posixmodule.c Message-ID: <20090504055646.3A9F41E4018@bag.python.org> Author: hirokazu.yamamoto Date: Mon May 4 07:56:46 2009 New Revision: 72274 Log: Merged revisions 72273 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72273 | hirokazu.yamamoto | 2009-05-04 14:28:39 +0900 | 1 line Issue #5913: os.listdir() should fail for empty path on windows. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/posixmodule.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon May 4 07:56:46 2009 @@ -109,6 +109,8 @@ Library ------- +- Issue #5913: os.listdir() should fail for empty path on windows. + - Issue #5084: unpickling now interns the attribute names of pickled objects, saving memory and avoiding growth in size of subsequent pickles. Proposal and original patch by Jake McGuire. Modified: python/branches/py3k/Modules/posixmodule.c ============================================================================== --- python/branches/py3k/Modules/posixmodule.c (original) +++ python/branches/py3k/Modules/posixmodule.c Mon May 4 07:56:46 2009 @@ -2183,7 +2183,6 @@ if (PyArg_ParseTuple(args, "U:listdir", &po)) { WIN32_FIND_DATAW wFileData; Py_UNICODE *wnamebuf; - Py_UNICODE wch; /* Overallocate for \\*.*\0 */ len = PyUnicode_GET_SIZE(po); wnamebuf = malloc((len + 5) * sizeof(wchar_t)); @@ -2192,10 +2191,12 @@ return NULL; } wcscpy(wnamebuf, PyUnicode_AS_UNICODE(po)); - wch = len > 0 ? wnamebuf[len-1] : '\0'; - if (wch != L'/' && wch != L'\\' && wch != L':') - wnamebuf[len++] = L'\\'; - wcscpy(wnamebuf + len, L"*.*"); + if (len > 0) { + Py_UNICODE wch = wnamebuf[len-1]; + if (wch != L'/' && wch != L'\\' && wch != L':') + wnamebuf[len++] = L'\\'; + wcscpy(wnamebuf + len, L"*.*"); + } if ((d = PyList_New(0)) == NULL) { free(wnamebuf); return NULL; @@ -2266,8 +2267,8 @@ char ch = namebuf[len-1]; if (ch != SEP && ch != ALTSEP && ch != ':') namebuf[len++] = '/'; + strcpy(namebuf + len, "*.*"); } - strcpy(namebuf + len, "*.*"); if ((d = PyList_New(0)) == NULL) return NULL; From buildbot at python.org Mon May 4 08:00:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 06:00:46 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090504060046.5BE511E4018@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1240 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_os ====================================================================== FAIL: test_update2 (test.test_os.EnvironTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_os.py", line 348, in test_update2 self.assertEquals(value, "World") AssertionError: '' != 'World' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon May 4 08:14:12 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 06:14:12 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090504061412.591E01E401A@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/876 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_time ====================================================================== FAIL: test_tzset (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_time.py", line 166, in test_tzset self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) AssertionError: time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) == time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon May 4 09:23:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 07:23:13 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090504072313.8EC3F1E4028@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/737 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_time make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon May 4 15:30:44 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 4 May 2009 15:30:44 +0200 (CEST) Subject: [Python-checkins] r72275 - in python/branches/release26-maint: Include/pymath.h Misc/NEWS PC/pyconfig.h Python/pymath.c configure configure.in pyconfig.h.in Message-ID: <20090504133044.1CFCE1E40C1@bag.python.org> Author: mark.dickinson Date: Mon May 4 15:30:43 2009 New Revision: 72275 Log: Issue #5724: Fix cmath failures on Solaris 10. Modified: python/branches/release26-maint/Include/pymath.h python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/PC/pyconfig.h python/branches/release26-maint/Python/pymath.c python/branches/release26-maint/configure python/branches/release26-maint/configure.in python/branches/release26-maint/pyconfig.h.in Modified: python/branches/release26-maint/Include/pymath.h ============================================================================== --- python/branches/release26-maint/Include/pymath.h (original) +++ python/branches/release26-maint/Include/pymath.h Mon May 4 15:30:43 2009 @@ -77,6 +77,21 @@ #define Py_MATH_E 2.7182818284590452354 #endif +/* On x86, Py_FORCE_DOUBLE forces a floating-point number out of an x87 FPU + register and into a 64-bit memory location, rounding from extended + precision to double precision in the process. On other platforms it does + nothing. */ + +/* we take double rounding as evidence of x87 usage */ +#ifndef Py_FORCE_DOUBLE +# ifdef X87_DOUBLE_ROUNDING +PyAPI_FUNC(double) _Py_force_double(double); +# define Py_FORCE_DOUBLE(X) (_Py_force_double(X)) +# else +# define Py_FORCE_DOUBLE(X) (X) +# endif +#endif + /* Py_IS_NAN(X) * Return 1 if float or double arg is a NaN, else 0. * Caution: @@ -87,7 +102,7 @@ * Note: PC/pyconfig.h defines Py_IS_NAN as _isnan */ #ifndef Py_IS_NAN -#ifdef HAVE_ISNAN +#if defined HAVE_DECL_ISNAN && HAVE_DECL_ISNAN == 1 #define Py_IS_NAN(X) isnan(X) #else #define Py_IS_NAN(X) ((X) != (X)) @@ -101,14 +116,18 @@ * This implementation may set the underflow flag if |X| is very small; * it really can't be implemented correctly (& easily) before C99. * Override in pyconfig.h if you have a better spelling on your platform. + * Py_FORCE_DOUBLE is used to avoid getting false negatives from a + * non-infinite value v sitting in an 80-bit x87 register such that + * v becomes infinite when spilled from the register to 64-bit memory. * Note: PC/pyconfig.h defines Py_IS_INFINITY as _isinf */ #ifndef Py_IS_INFINITY -#ifdef HAVE_ISINF -#define Py_IS_INFINITY(X) isinf(X) -#else -#define Py_IS_INFINITY(X) ((X) && (X)*0.5 == (X)) -#endif +# if defined HAVE_DECL_ISINF && HAVE_DECL_ISINF == 1 +# define Py_IS_INFINITY(X) isinf(X) +# else +# define Py_IS_INFINITY(X) ((X) && \ + (Py_FORCE_DOUBLE(X)*0.5 == Py_FORCE_DOUBLE(X))) +# endif #endif /* Py_IS_FINITE(X) @@ -118,7 +137,9 @@ * Note: PC/pyconfig.h defines Py_IS_FINITE as _finite */ #ifndef Py_IS_FINITE -#ifdef HAVE_FINITE +#if defined HAVE_DECL_ISFINITE && HAVE_DECL_ISFINITE == 1 +#define Py_IS_FINITE(X) isfinite(X) +#elif defined HAVE_FINITE #define Py_IS_FINITE(X) finite(X) #else #define Py_IS_FINITE(X) (!Py_IS_INFINITY(X) && !Py_IS_NAN(X)) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Mon May 4 15:30:43 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #5724: (See also issue #4575.) Fix Py_IS_INFINITY macro to + work correctly on x87 FPUs: it now forces its argument to double + before testing for infinity. + - Issue #4971: Fix titlecase for characters that are their own titlecase, but not their own uppercase. Modified: python/branches/release26-maint/PC/pyconfig.h ============================================================================== --- python/branches/release26-maint/PC/pyconfig.h (original) +++ python/branches/release26-maint/PC/pyconfig.h Mon May 4 15:30:43 2009 @@ -405,11 +405,11 @@ /* Define to 1 if you have the `copysign' function. */ #define HAVE_COPYSIGN 1 -/* Define to 1 if you have the `isinf' function. */ -#define HAVE_ISINF 1 +/* Define to 1 if you have the `isinf' macro. */ +#define HAVE_DECL_ISINF 1 /* Define to 1 if you have the `isnan' function. */ -#define HAVE_ISNAN 1 +#define HAVE_DECL_ISNAN 1 /* Define if on AIX 3. System headers sometimes define this. Modified: python/branches/release26-maint/Python/pymath.c ============================================================================== --- python/branches/release26-maint/Python/pymath.c (original) +++ python/branches/release26-maint/Python/pymath.c Mon May 4 15:30:43 2009 @@ -1,5 +1,18 @@ #include "Python.h" +#ifdef X87_DOUBLE_ROUNDING +/* On x86 platforms using an x87 FPU, this function is called from the + Py_FORCE_DOUBLE macro (defined in pymath.h) to force a floating-point + number out of an 80-bit x87 FPU register and into a 64-bit memory location, + thus rounding from extended precision to double precision. */ +double _Py_force_double(double x) +{ + volatile double y; + y = x; + return y; +} +#endif + #ifndef HAVE_HYPOT double hypot(double x, double y) { Modified: python/branches/release26-maint/configure ============================================================================== --- python/branches/release26-maint/configure (original) +++ python/branches/release26-maint/configure Mon May 4 15:30:43 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 68599 . +# From configure.in Revision: 70731 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.6. # @@ -21525,6 +21525,94 @@ LIBS_SAVE=$LIBS LIBS="$LIBS $LIBM" +# Detect whether system arithmetic is subject to x87-style double +# rounding issues. The result of this test has little meaning on non +# IEEE 754 platforms. On IEEE 754, test should return 1 if rounding +# mode is round-to-nearest and double rounding issues are present, and +# 0 otherwise. See http://bugs.python.org/issue2937 for more info. +{ echo "$as_me:$LINENO: checking for x87-style double rounding" >&5 +echo $ECHO_N "checking for x87-style double rounding... $ECHO_C" >&6; } +if test "${ac_cv_x87_double_rounding+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +if test "$cross_compiling" = yes; then + ac_cv_x87_double_rounding=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +int main() { + volatile double x, y, z; + /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */ + x = 0.99999999999999989; /* 1-2**-53 */ + y = 1./x; + if (y != 1.) + exit(0); + /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */ + x = 1e16; + y = 2.99999; + z = x + y; + if (z != 1e16+4.) + exit(0); + /* both tests show evidence of double rounding */ + exit(1); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_x87_double_rounding=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_x87_double_rounding=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi + +{ echo "$as_me:$LINENO: result: $ac_cv_x87_double_rounding" >&5 +echo "${ECHO_T}$ac_cv_x87_double_rounding" >&6; } +if test "$ac_cv_x87_double_rounding" = yes +then + +cat >>confdefs.h <<\_ACEOF +#define X87_DOUBLE_ROUNDING 1 +_ACEOF + +fi + + # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of # -0. on some architectures. { echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5 @@ -21609,9 +21697,7 @@ - - -for ac_func in acosh asinh atanh copysign expm1 finite hypot isinf isnan log1p +for ac_func in acosh asinh atanh copysign expm1 finite hypot log1p do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -21704,6 +21790,209 @@ fi done +{ echo "$as_me:$LINENO: checking whether isinf is declared" >&5 +echo $ECHO_N "checking whether isinf is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_isinf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef isinf + (void) isinf; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_isinf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_isinf=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isinf" >&6; } +if test $ac_cv_have_decl_isinf = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISINF 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISINF 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether isnan is declared" >&5 +echo $ECHO_N "checking whether isnan is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_isnan+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef isnan + (void) isnan; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_isnan=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_isnan=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isnan" >&6; } +if test $ac_cv_have_decl_isnan = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISNAN 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISNAN 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether isfinite is declared" >&5 +echo $ECHO_N "checking whether isfinite is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_isfinite+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef isfinite + (void) isfinite; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_isfinite=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_isfinite=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isfinite" >&6; } +if test $ac_cv_have_decl_isfinite = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISFINITE 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISFINITE 0 +_ACEOF + + +fi + + LIBS=$LIBS_SAVE Modified: python/branches/release26-maint/configure.in ============================================================================== --- python/branches/release26-maint/configure.in (original) +++ python/branches/release26-maint/configure.in Mon May 4 15:30:43 2009 @@ -3145,6 +3145,44 @@ LIBS_SAVE=$LIBS LIBS="$LIBS $LIBM" +# Detect whether system arithmetic is subject to x87-style double +# rounding issues. The result of this test has little meaning on non +# IEEE 754 platforms. On IEEE 754, test should return 1 if rounding +# mode is round-to-nearest and double rounding issues are present, and +# 0 otherwise. See http://bugs.python.org/issue2937 for more info. +AC_MSG_CHECKING(for x87-style double rounding) +AC_CACHE_VAL(ac_cv_x87_double_rounding, [ +AC_TRY_RUN([ +#include +#include +int main() { + volatile double x, y, z; + /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */ + x = 0.99999999999999989; /* 1-2**-53 */ + y = 1./x; + if (y != 1.) + exit(0); + /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */ + x = 1e16; + y = 2.99999; + z = x + y; + if (z != 1e16+4.) + exit(0); + /* both tests show evidence of double rounding */ + exit(1); +} +], +ac_cv_x87_double_rounding=no, +ac_cv_x87_double_rounding=yes, +ac_cv_x87_double_rounding=no)]) +AC_MSG_RESULT($ac_cv_x87_double_rounding) +if test "$ac_cv_x87_double_rounding" = yes +then + AC_DEFINE(X87_DOUBLE_ROUNDING, 1, + [Define if arithmetic is subject to x87-style double rounding issue]) +fi + + # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of # -0. on some architectures. AC_MSG_CHECKING(whether tanh preserves the sign of zero) @@ -3171,7 +3209,8 @@ [Define if tanh(-0.) is -0., or if platform doesn't have signed zeros]) fi -AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite hypot isinf isnan log1p]) +AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite hypot log1p]) +AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include ]]) LIBS=$LIBS_SAVE Modified: python/branches/release26-maint/pyconfig.h.in ============================================================================== --- python/branches/release26-maint/pyconfig.h.in (original) +++ python/branches/release26-maint/pyconfig.h.in Mon May 4 15:30:43 2009 @@ -115,6 +115,18 @@ /* Define if you have the 'resize_term' function. */ #undef HAVE_CURSES_RESIZE_TERM +/* Define to 1 if you have the declaration of `isfinite', and to 0 if you + don't. */ +#undef HAVE_DECL_ISFINITE + +/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't. + */ +#undef HAVE_DECL_ISINF + +/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't. + */ +#undef HAVE_DECL_ISNAN + /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. */ #undef HAVE_DECL_TZNAME @@ -315,12 +327,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_IO_H -/* Define to 1 if you have the `isinf' function. */ -#undef HAVE_ISINF - -/* Define to 1 if you have the `isnan' function. */ -#undef HAVE_ISNAN - /* Define to 1 if you have the `kill' function. */ #undef HAVE_KILL @@ -360,7 +366,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H -/* Define to 1 if you have the `readline' library (-lreadline). */ +/* Define if you have the readline library (-lreadline). */ #undef HAVE_LIBREADLINE /* Define to 1 if you have the `resolv' library (-lresolv). */ @@ -983,6 +989,9 @@ first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN +/* Define if arithmetic is subject to x87-style double rounding issue */ +#undef X87_DOUBLE_ROUNDING + /* Define to 1 if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ From python-checkins at python.org Mon May 4 15:49:31 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 4 May 2009 15:49:31 +0200 (CEST) Subject: [Python-checkins] r72276 - in python/branches/release30-maint: configure pyconfig.h.in Message-ID: <20090504134931.415BD1E400C@bag.python.org> Author: mark.dickinson Date: Mon May 4 15:49:30 2009 New Revision: 72276 Log: Regenerate configure and pyconfig.h.in Modified: python/branches/release30-maint/configure python/branches/release30-maint/pyconfig.h.in Modified: python/branches/release30-maint/configure ============================================================================== --- python/branches/release30-maint/configure (original) +++ python/branches/release30-maint/configure Mon May 4 15:49:30 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 68280 . +# From configure.in Revision: 68442 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 3.0. # @@ -2228,7 +2228,7 @@ if test "${with_gcc+set}" = set; then withval=$with_gcc; case $withval in - no) CC=cc + no) CC=${CC:-cc} without_gcc=yes;; yes) CC=gcc without_gcc=no;; Modified: python/branches/release30-maint/pyconfig.h.in ============================================================================== --- python/branches/release30-maint/pyconfig.h.in (original) +++ python/branches/release30-maint/pyconfig.h.in Mon May 4 15:49:30 2009 @@ -58,6 +58,10 @@ /* Define to 1 if you have the header file. */ #undef HAVE_BLUETOOTH_H +/* Define if mbstowcs(NULL, "text", 0) does not return the number of wide + chars that would be converted. */ +#undef HAVE_BROKEN_MBSTOWCS + /* Define if nice() returns success/failure instead of the new priority. */ #undef HAVE_BROKEN_NICE @@ -357,7 +361,7 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBINTL_H -/* Define to 1 if you have the `readline' library (-lreadline). */ +/* Define if you have the readline library (-lreadline). */ #undef HAVE_LIBREADLINE /* Define to 1 if you have the `resolv' library (-lresolv). */ @@ -800,10 +804,6 @@ /* Define to 1 if you have the `wcsxfrm' function. */ #undef HAVE_WCSXFRM -/* Define if mbstowcs(NULL, "text", 0) does not return the number of - wide chars that would be converted */ -#undef HAVE_BROKEN_MBSTOWCS - /* Define if tzset() actually switches the local timezone in a meaningful way. */ #undef HAVE_WORKING_TZSET From python-checkins at python.org Mon May 4 15:59:05 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 4 May 2009 15:59:05 +0200 (CEST) Subject: [Python-checkins] r72277 - in python/branches/release30-maint: Include/pymath.h Misc/NEWS PC/pyconfig.h Python/pymath.c configure configure.in pyconfig.h.in Message-ID: <20090504135905.BAE2A1E400C@bag.python.org> Author: mark.dickinson Date: Mon May 4 15:59:04 2009 New Revision: 72277 Log: Issue #5724: Fix test_cmath failures on Solaris 10. Modified: python/branches/release30-maint/Include/pymath.h python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/PC/pyconfig.h python/branches/release30-maint/Python/pymath.c python/branches/release30-maint/configure python/branches/release30-maint/configure.in python/branches/release30-maint/pyconfig.h.in Modified: python/branches/release30-maint/Include/pymath.h ============================================================================== --- python/branches/release30-maint/Include/pymath.h (original) +++ python/branches/release30-maint/Include/pymath.h Mon May 4 15:59:04 2009 @@ -77,6 +77,21 @@ #define Py_MATH_E 2.7182818284590452354 #endif +/* On x86, Py_FORCE_DOUBLE forces a floating-point number out of an x87 FPU + register and into a 64-bit memory location, rounding from extended + precision to double precision in the process. On other platforms it does + nothing. */ + +/* we take double rounding as evidence of x87 usage */ +#ifndef Py_FORCE_DOUBLE +# ifdef X87_DOUBLE_ROUNDING +PyAPI_FUNC(double) _Py_force_double(double); +# define Py_FORCE_DOUBLE(X) (_Py_force_double(X)) +# else +# define Py_FORCE_DOUBLE(X) (X) +# endif +#endif + /* Py_IS_NAN(X) * Return 1 if float or double arg is a NaN, else 0. * Caution: @@ -87,7 +102,7 @@ * Note: PC/pyconfig.h defines Py_IS_NAN as _isnan */ #ifndef Py_IS_NAN -#ifdef HAVE_ISNAN +#if defined HAVE_DECL_ISNAN && HAVE_DECL_ISNAN == 1 #define Py_IS_NAN(X) isnan(X) #else #define Py_IS_NAN(X) ((X) != (X)) @@ -101,14 +116,18 @@ * This implementation may set the underflow flag if |X| is very small; * it really can't be implemented correctly (& easily) before C99. * Override in pyconfig.h if you have a better spelling on your platform. + * Py_FORCE_DOUBLE is used to avoid getting false negatives from a + * non-infinite value v sitting in an 80-bit x87 register such that + * v becomes infinite when spilled from the register to 64-bit memory. * Note: PC/pyconfig.h defines Py_IS_INFINITY as _isinf */ #ifndef Py_IS_INFINITY -#ifdef HAVE_ISINF -#define Py_IS_INFINITY(X) isinf(X) -#else -#define Py_IS_INFINITY(X) ((X) && (X)*0.5 == (X)) -#endif +# if defined HAVE_DECL_ISINF && HAVE_DECL_ISINF == 1 +# define Py_IS_INFINITY(X) isinf(X) +# else +# define Py_IS_INFINITY(X) ((X) && \ + (Py_FORCE_DOUBLE(X)*0.5 == Py_FORCE_DOUBLE(X))) +# endif #endif /* Py_IS_FINITE(X) @@ -118,7 +137,9 @@ * Note: PC/pyconfig.h defines Py_IS_FINITE as _finite */ #ifndef Py_IS_FINITE -#ifdef HAVE_FINITE +#if defined HAVE_DECL_ISFINITE && HAVE_DECL_ISFINITE == 1 +#define Py_IS_FINITE(X) isfinite(X) +#elif defined HAVE_FINITE #define Py_IS_FINITE(X) finite(X) #else #define Py_IS_FINITE(X) (!Py_IS_INFINITY(X) && !Py_IS_NAN(X)) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Mon May 4 15:59:04 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #5724: (See also issue #4575.) Fix Py_IS_INFINITY macro to + work correctly on x87 FPUs: it now forces its argument to double + before testing for infinity. + - Issue #4971: Fix titlecase for characters that are their own titlecase, but not their own uppercase. Modified: python/branches/release30-maint/PC/pyconfig.h ============================================================================== --- python/branches/release30-maint/PC/pyconfig.h (original) +++ python/branches/release30-maint/PC/pyconfig.h Mon May 4 15:59:04 2009 @@ -395,11 +395,11 @@ /* Define to 1 if you have the `copysign' function. */ #define HAVE_COPYSIGN 1 -/* Define to 1 if you have the `isinf' function. */ -#define HAVE_ISINF 1 +/* Define to 1 if you have the `isinf' macro. */ +#define HAVE_DECL_ISINF 1 /* Define to 1 if you have the `isnan' function. */ -#define HAVE_ISNAN 1 +#define HAVE_DECL_ISNAN 1 /* Define if on AIX 3. System headers sometimes define this. Modified: python/branches/release30-maint/Python/pymath.c ============================================================================== --- python/branches/release30-maint/Python/pymath.c (original) +++ python/branches/release30-maint/Python/pymath.c Mon May 4 15:59:04 2009 @@ -1,5 +1,18 @@ #include "Python.h" +#ifdef X87_DOUBLE_ROUNDING +/* On x86 platforms using an x87 FPU, this function is called from the + Py_FORCE_DOUBLE macro (defined in pymath.h) to force a floating-point + number out of an 80-bit x87 FPU register and into a 64-bit memory location, + thus rounding from extended precision to double precision. */ +double _Py_force_double(double x) +{ + volatile double y; + y = x; + return y; +} +#endif + #ifndef HAVE_HYPOT double hypot(double x, double y) { Modified: python/branches/release30-maint/configure ============================================================================== --- python/branches/release30-maint/configure (original) +++ python/branches/release30-maint/configure Mon May 4 15:59:04 2009 @@ -21214,6 +21214,94 @@ LIBS_SAVE=$LIBS LIBS="$LIBS $LIBM" +# Detect whether system arithmetic is subject to x87-style double +# rounding issues. The result of this test has little meaning on non +# IEEE 754 platforms. On IEEE 754, test should return 1 if rounding +# mode is round-to-nearest and double rounding issues are present, and +# 0 otherwise. See http://bugs.python.org/issue2937 for more info. +{ echo "$as_me:$LINENO: checking for x87-style double rounding" >&5 +echo $ECHO_N "checking for x87-style double rounding... $ECHO_C" >&6; } +if test "${ac_cv_x87_double_rounding+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +if test "$cross_compiling" = yes; then + ac_cv_x87_double_rounding=no +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#include +#include +int main() { + volatile double x, y, z; + /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */ + x = 0.99999999999999989; /* 1-2**-53 */ + y = 1./x; + if (y != 1.) + exit(0); + /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */ + x = 1e16; + y = 2.99999; + z = x + y; + if (z != 1e16+4.) + exit(0); + /* both tests show evidence of double rounding */ + exit(1); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_x87_double_rounding=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_x87_double_rounding=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi + +{ echo "$as_me:$LINENO: result: $ac_cv_x87_double_rounding" >&5 +echo "${ECHO_T}$ac_cv_x87_double_rounding" >&6; } +if test "$ac_cv_x87_double_rounding" = yes +then + +cat >>confdefs.h <<\_ACEOF +#define X87_DOUBLE_ROUNDING 1 +_ACEOF + +fi + + # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of # -0. on some architectures. { echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5 @@ -21298,9 +21386,7 @@ - - -for ac_func in acosh asinh atanh copysign expm1 finite hypot isinf isnan log1p +for ac_func in acosh asinh atanh copysign expm1 finite hypot log1p do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -21393,6 +21479,209 @@ fi done +{ echo "$as_me:$LINENO: checking whether isinf is declared" >&5 +echo $ECHO_N "checking whether isinf is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_isinf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef isinf + (void) isinf; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_isinf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_isinf=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isinf" >&6; } +if test $ac_cv_have_decl_isinf = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISINF 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISINF 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether isnan is declared" >&5 +echo $ECHO_N "checking whether isnan is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_isnan+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef isnan + (void) isnan; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_isnan=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_isnan=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isnan" >&6; } +if test $ac_cv_have_decl_isnan = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISNAN 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISNAN 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether isfinite is declared" >&5 +echo $ECHO_N "checking whether isfinite is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_isfinite+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef isfinite + (void) isfinite; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_isfinite=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_isfinite=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isfinite" >&6; } +if test $ac_cv_have_decl_isfinite = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISFINITE 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_ISFINITE 0 +_ACEOF + + +fi + + LIBS=$LIBS_SAVE Modified: python/branches/release30-maint/configure.in ============================================================================== --- python/branches/release30-maint/configure.in (original) +++ python/branches/release30-maint/configure.in Mon May 4 15:59:04 2009 @@ -3056,6 +3056,44 @@ LIBS_SAVE=$LIBS LIBS="$LIBS $LIBM" +# Detect whether system arithmetic is subject to x87-style double +# rounding issues. The result of this test has little meaning on non +# IEEE 754 platforms. On IEEE 754, test should return 1 if rounding +# mode is round-to-nearest and double rounding issues are present, and +# 0 otherwise. See http://bugs.python.org/issue2937 for more info. +AC_MSG_CHECKING(for x87-style double rounding) +AC_CACHE_VAL(ac_cv_x87_double_rounding, [ +AC_TRY_RUN([ +#include +#include +int main() { + volatile double x, y, z; + /* 1./(1-2**-53) -> 1+2**-52 (correct), 1.0 (double rounding) */ + x = 0.99999999999999989; /* 1-2**-53 */ + y = 1./x; + if (y != 1.) + exit(0); + /* 1e16+2.99999 -> 1e16+2. (correct), 1e16+4. (double rounding) */ + x = 1e16; + y = 2.99999; + z = x + y; + if (z != 1e16+4.) + exit(0); + /* both tests show evidence of double rounding */ + exit(1); +} +], +ac_cv_x87_double_rounding=no, +ac_cv_x87_double_rounding=yes, +ac_cv_x87_double_rounding=no)]) +AC_MSG_RESULT($ac_cv_x87_double_rounding) +if test "$ac_cv_x87_double_rounding" = yes +then + AC_DEFINE(X87_DOUBLE_ROUNDING, 1, + [Define if arithmetic is subject to x87-style double rounding issue]) +fi + + # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of # -0. on some architectures. AC_MSG_CHECKING(whether tanh preserves the sign of zero) @@ -3082,7 +3120,8 @@ [Define if tanh(-0.) is -0., or if platform doesn't have signed zeros]) fi -AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite hypot isinf isnan log1p]) +AC_CHECK_FUNCS([acosh asinh atanh copysign expm1 finite hypot log1p]) +AC_CHECK_DECLS([isinf, isnan, isfinite], [], [], [[#include ]]) LIBS=$LIBS_SAVE Modified: python/branches/release30-maint/pyconfig.h.in ============================================================================== --- python/branches/release30-maint/pyconfig.h.in (original) +++ python/branches/release30-maint/pyconfig.h.in Mon May 4 15:59:04 2009 @@ -116,6 +116,18 @@ /* Define if you have the 'resize_term' function. */ #undef HAVE_CURSES_RESIZE_TERM +/* Define to 1 if you have the declaration of `isfinite', and to 0 if you + don't. */ +#undef HAVE_DECL_ISFINITE + +/* Define to 1 if you have the declaration of `isinf', and to 0 if you don't. + */ +#undef HAVE_DECL_ISINF + +/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't. + */ +#undef HAVE_DECL_ISNAN + /* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. */ #undef HAVE_DECL_TZNAME @@ -316,12 +328,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_IO_H -/* Define to 1 if you have the `isinf' function. */ -#undef HAVE_ISINF - -/* Define to 1 if you have the `isnan' function. */ -#undef HAVE_ISNAN - /* Define to 1 if you have the `kill' function. */ #undef HAVE_KILL @@ -984,6 +990,9 @@ first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN +/* Define if arithmetic is subject to x87-style double rounding issue */ +#undef X87_DOUBLE_ROUNDING + /* Define to 1 if on AIX 3. System headers sometimes define this. We just want to avoid a redefinition error message. */ From buildbot at python.org Mon May 4 16:59:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 14:59:47 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.0 Message-ID: <20090504145947.5FCD51E4027@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.0/builds/336 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Mon May 4 18:03:03 2009 From: python-checkins at python.org (walter.doerwald) Date: Mon, 4 May 2009 18:03:03 +0200 (CEST) Subject: [Python-checkins] r72278 - in python/trunk/Lib: abc.py lib-tk/Tix.py lib-tk/ttk.py Message-ID: <20090504160303.8580E1E402E@bag.python.org> Author: walter.doerwald Date: Mon May 4 18:03:03 2009 New Revision: 72278 Log: Fix typos. Modified: python/trunk/Lib/abc.py python/trunk/Lib/lib-tk/Tix.py python/trunk/Lib/lib-tk/ttk.py Modified: python/trunk/Lib/abc.py ============================================================================== --- python/trunk/Lib/abc.py (original) +++ python/trunk/Lib/abc.py Mon May 4 18:03:03 2009 @@ -10,7 +10,7 @@ Requires that the metaclass is ABCMeta or derived from it. A class that has a metaclass derived from ABCMeta cannot be instantiated unless all of its abstract methods are overridden. - The abstract methods can be called using any of the the normal + The abstract methods can be called using any of the normal 'super' call mechanisms. Usage: @@ -31,7 +31,7 @@ Requires that the metaclass is ABCMeta or derived from it. A class that has a metaclass derived from ABCMeta cannot be instantiated unless all of its abstract properties are overridden. - The abstract properties can be called using any of the the normal + The abstract properties can be called using any of the normal 'super' call mechanisms. Usage: Modified: python/trunk/Lib/lib-tk/Tix.py ============================================================================== --- python/trunk/Lib/lib-tk/Tix.py (original) +++ python/trunk/Lib/lib-tk/Tix.py Mon May 4 18:03:03 2009 @@ -1544,8 +1544,8 @@ '''This command is used to indicate whether the entry given by entryPath has children entries and whether the children are visible. mode must be one of open, close or none. If mode is set to open, a (+) - indicator is drawn next the the entry. If mode is set to close, a (-) - indicator is drawn next the the entry. If mode is set to none, no + indicator is drawn next to the entry. If mode is set to close, a (-) + indicator is drawn next to the entry. If mode is set to none, no indicators will be drawn for this entry. The default mode is none. The open mode indicates the entry has hidden children and this entry can be opened by the user. The close mode indicates that all the children of the Modified: python/trunk/Lib/lib-tk/ttk.py ============================================================================== --- python/trunk/Lib/lib-tk/ttk.py (original) +++ python/trunk/Lib/lib-tk/ttk.py Mon May 4 18:03:03 2009 @@ -37,7 +37,7 @@ import os tilelib = os.environ.get('TILE_LIBRARY') if tilelib: - # append custom tile path to the the list of directories that + # append custom tile path to the list of directories that # Tcl uses when attempting to resolve packages with the package # command master.tk.eval( From buildbot at python.org Mon May 4 18:03:43 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 16:03:43 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090504160345.736161E4038@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/329 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Mon May 4 18:06:12 2009 From: python-checkins at python.org (walter.doerwald) Date: Mon, 4 May 2009 18:06:12 +0200 (CEST) Subject: [Python-checkins] r72279 - in python/branches/release26-maint: Lib/abc.py Lib/lib-tk/Tix.py Message-ID: <20090504160612.D08521E40E3@bag.python.org> Author: walter.doerwald Date: Mon May 4 18:06:12 2009 New Revision: 72279 Log: Merged revisions 72278 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72278 | walter.doerwald | 2009-05-04 18:03:03 +0200 (Mo, 04 Mai 2009) | 2 lines Fix typos. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/abc.py python/branches/release26-maint/Lib/lib-tk/Tix.py Modified: python/branches/release26-maint/Lib/abc.py ============================================================================== --- python/branches/release26-maint/Lib/abc.py (original) +++ python/branches/release26-maint/Lib/abc.py Mon May 4 18:06:12 2009 @@ -10,7 +10,7 @@ Requires that the metaclass is ABCMeta or derived from it. A class that has a metaclass derived from ABCMeta cannot be instantiated unless all of its abstract methods are overridden. - The abstract methods can be called using any of the the normal + The abstract methods can be called using any of the normal 'super' call mechanisms. Usage: @@ -31,7 +31,7 @@ Requires that the metaclass is ABCMeta or derived from it. A class that has a metaclass derived from ABCMeta cannot be instantiated unless all of its abstract properties are overridden. - The abstract properties can be called using any of the the normal + The abstract properties can be called using any of the normal 'super' call mechanisms. Usage: Modified: python/branches/release26-maint/Lib/lib-tk/Tix.py ============================================================================== --- python/branches/release26-maint/Lib/lib-tk/Tix.py (original) +++ python/branches/release26-maint/Lib/lib-tk/Tix.py Mon May 4 18:06:12 2009 @@ -1544,8 +1544,8 @@ '''This command is used to indicate whether the entry given by entryPath has children entries and whether the children are visible. mode must be one of open, close or none. If mode is set to open, a (+) - indicator is drawn next the the entry. If mode is set to close, a (-) - indicator is drawn next the the entry. If mode is set to none, no + indicator is drawn next to the entry. If mode is set to close, a (-) + indicator is drawn next to the entry. If mode is set to none, no indicators will be drawn for this entry. The default mode is none. The open mode indicates the entry has hidden children and this entry can be opened by the user. The close mode indicates that all the children of the From python-checkins at python.org Mon May 4 18:10:10 2009 From: python-checkins at python.org (walter.doerwald) Date: Mon, 4 May 2009 18:10:10 +0200 (CEST) Subject: [Python-checkins] r72280 - in python/branches/py3k: Lib/abc.py Message-ID: <20090504161010.515E01E409A@bag.python.org> Author: walter.doerwald Date: Mon May 4 18:10:10 2009 New Revision: 72280 Log: Merged revisions 72278 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72278 | walter.doerwald | 2009-05-04 18:03:03 +0200 (Mo, 04 Mai 2009) | 2 lines Fix typos. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/abc.py Modified: python/branches/py3k/Lib/abc.py ============================================================================== --- python/branches/py3k/Lib/abc.py (original) +++ python/branches/py3k/Lib/abc.py Mon May 4 18:10:10 2009 @@ -11,7 +11,7 @@ Requires that the metaclass is ABCMeta or derived from it. A class that has a metaclass derived from ABCMeta cannot be instantiated unless all of its abstract methods are overridden. - The abstract methods can be called using any of the the normal + The abstract methods can be called using any of the normal 'super' call mechanisms. Usage: @@ -31,7 +31,7 @@ Requires that the metaclass is ABCMeta or derived from it. A class that has a metaclass derived from ABCMeta cannot be instantiated unless all of its abstract properties are overridden. - The abstract properties can be called using any of the the normal + The abstract properties can be called using any of the normal 'super' call mechanisms. Usage: From python-checkins at python.org Mon May 4 18:13:11 2009 From: python-checkins at python.org (walter.doerwald) Date: Mon, 4 May 2009 18:13:11 +0200 (CEST) Subject: [Python-checkins] r72281 - in python/branches/release30-maint: Lib/abc.py Message-ID: <20090504161311.72DFE1E4027@bag.python.org> Author: walter.doerwald Date: Mon May 4 18:13:11 2009 New Revision: 72281 Log: Merged revisions 72280 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72280 | walter.doerwald | 2009-05-04 18:10:10 +0200 (Mo, 04 Mai 2009) | 9 lines Merged revisions 72278 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72278 | walter.doerwald | 2009-05-04 18:03:03 +0200 (Mo, 04 Mai 2009) | 2 lines Fix typos. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/abc.py Modified: python/branches/release30-maint/Lib/abc.py ============================================================================== --- python/branches/release30-maint/Lib/abc.py (original) +++ python/branches/release30-maint/Lib/abc.py Mon May 4 18:13:11 2009 @@ -11,7 +11,7 @@ Requires that the metaclass is ABCMeta or derived from it. A class that has a metaclass derived from ABCMeta cannot be instantiated unless all of its abstract methods are overridden. - The abstract methods can be called using any of the the normal + The abstract methods can be called using any of the normal 'super' call mechanisms. Usage: @@ -31,7 +31,7 @@ Requires that the metaclass is ABCMeta or derived from it. A class that has a metaclass derived from ABCMeta cannot be instantiated unless all of its abstract properties are overridden. - The abstract properties can be called using any of the the normal + The abstract properties can be called using any of the normal 'super' call mechanisms. Usage: From python-checkins at python.org Mon May 4 18:39:25 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 4 May 2009 18:39:25 +0200 (CEST) Subject: [Python-checkins] r72282 - python/branches/py3k Message-ID: <20090504163925.D60581E42D9@bag.python.org> Author: georg.brandl Date: Mon May 4 18:39:25 2009 New Revision: 72282 Log: Blocked revisions 72263 via svnmerge ........ r72263 | walter.doerwald | 2009-05-04 00:46:07 +0200 (Mo, 04 Mai 2009) | 2 lines There's no %A in Python 2.x! ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Mon May 4 18:42:10 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 16:42:10 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090504164211.2B2CD1E400C@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/4928 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: walter.doerwald BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Mon May 4 20:32:32 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 4 May 2009 20:32:32 +0200 (CEST) Subject: [Python-checkins] r72283 - in python/trunk: Include/unicodeobject.h Lib/test/test_unicode.py Misc/NEWS Objects/unicodeobject.c Message-ID: <20090504183232.617451E400C@bag.python.org> Author: antoine.pitrou Date: Mon May 4 20:32:32 2009 New Revision: 72283 Log: Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal sequences. Patch by Nick Barnes and Victor Stinner. Modified: python/trunk/Include/unicodeobject.h python/trunk/Lib/test/test_unicode.py python/trunk/Misc/NEWS python/trunk/Objects/unicodeobject.c Modified: python/trunk/Include/unicodeobject.h ============================================================================== --- python/trunk/Include/unicodeobject.h (original) +++ python/trunk/Include/unicodeobject.h Mon May 4 20:32:32 2009 @@ -740,10 +740,8 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF7( const Py_UNICODE *data, /* Unicode char buffer */ Py_ssize_t length, /* number of Py_UNICODE chars to encode */ - int encodeSetO, /* force the encoder to encode characters in - Set O, as described in RFC2152 */ - int encodeWhiteSpace, /* force the encoder to encode space, tab, - carriage return and linefeed characters */ + int base64SetO, /* Encode RFC2152 Set O characters in base64 */ + int base64WhiteSpace, /* Encode whitespace (sp, ht, nl, cr) in base64 */ const char *errors /* error handling */ ); Modified: python/trunk/Lib/test/test_unicode.py ============================================================================== --- python/trunk/Lib/test/test_unicode.py (original) +++ python/trunk/Lib/test/test_unicode.py Mon May 4 20:32:32 2009 @@ -521,19 +521,28 @@ (u'+?', '+-?'), (ur'\\?', '+AFwAXA?'), (ur'\\\?', '+AFwAXABc?'), - (ur'++--', '+-+---') + (ur'++--', '+-+---'), + (u'\U000abcde', '+2m/c3g-'), # surrogate pairs + (u'/', '/'), ] for (x, y) in utfTests: self.assertEqual(x.encode('utf-7'), y) - # surrogates not supported + # Unpaired surrogates not supported self.assertRaises(UnicodeError, unicode, '+3ADYAA-', 'utf-7') - self.assertEqual(unicode('+3ADYAA-', 'utf-7', 'replace'), u'\ufffd') + self.assertEqual(unicode('+3ADYAA-', 'utf-7', 'replace'), u'\ufffd\ufffd') - # Issue #2242: crash on some Windows/MSVC versions - self.assertRaises(UnicodeDecodeError, '+\xc1'.decode, 'utf-7') + # Direct encoded characters + set_d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'(),-./:?" + # Optional direct characters + set_o = '!"#$%&*;<=>@[]^_`{|}' + for c in set_d: + self.assertEqual(c.encode('utf7'), c.encode('ascii')) + self.assertEqual(c.encode('ascii').decode('utf7'), c) + for c in set_o: + self.assertEqual(c.encode('ascii').decode('utf7'), c) def test_codecs_utf8(self): self.assertEqual(u''.encode('utf-8'), '') Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon May 4 20:32:32 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal + sequences. Patch by Nick Barnes and Victor Stinner. + - Issue #1588: Add complex.__format__. For example, format(complex(1, 2./3), '.5') now produces a sensible result. Modified: python/trunk/Objects/unicodeobject.c ============================================================================== --- python/trunk/Objects/unicodeobject.c (original) +++ python/trunk/Objects/unicodeobject.c Mon May 4 20:32:32 2009 @@ -1468,69 +1468,81 @@ /* --- UTF-7 Codec -------------------------------------------------------- */ -/* see RFC2152 for details */ +/* See RFC2152 for details. We encode conservatively and decode liberally. */ -static -char utf7_special[128] = { - /* indicate whether a UTF-7 character is special i.e. cannot be directly - encoded: - 0 - not special - 1 - special - 2 - whitespace (optional) - 3 - RFC2152 Set O (optional) */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 3, 3, 3, 3, 3, 3, 0, 0, 0, 3, 1, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 0, - 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 3, 3, 3, - 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 1, 1, +/* Three simple macros defining base-64. */ -}; +/* Is c a base-64 character? */ + +#define IS_BASE64(c) \ + (isalnum(c) || (c) == '+' || (c) == '/') + +/* given that c is a base-64 character, what is its base-64 value? */ + +#define FROM_BASE64(c) \ + (((c) >= 'A' && (c) <= 'Z') ? (c) - 'A' : \ + ((c) >= 'a' && (c) <= 'z') ? (c) - 'a' + 26 : \ + ((c) >= '0' && (c) <= '9') ? (c) - '0' + 52 : \ + (c) == '+' ? 62 : 63) -/* Note: The comparison (c) <= 0 is a trick to work-around gcc - warnings about the comparison always being false; since - utf7_special[0] is 1, we can safely make that one comparison - true */ - -#define SPECIAL(c, encodeO, encodeWS) \ - ((c) > 127 || (c) <= 0 || utf7_special[(c)] == 1 || \ - (encodeWS && (utf7_special[(c)] == 2)) || \ - (encodeO && (utf7_special[(c)] == 3))) +/* What is the base-64 character of the bottom 6 bits of n? */ -#define B64(n) \ +#define TO_BASE64(n) \ ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(n) & 0x3f]) -#define B64CHAR(c) \ - (isalnum(c) || (c) == '+' || (c) == '/') -#define UB64(c) \ - ((c) == '+' ? 62 : (c) == '/' ? 63 : (c) >= 'a' ? \ - (c) - 71 : (c) >= 'A' ? (c) - 65 : (c) + 4 ) - -#define ENCODE(out, ch, bits) \ - while (bits >= 6) { \ - *out++ = B64(ch >> (bits-6)); \ - bits -= 6; \ - } - -#define DECODE(out, ch, bits, surrogate) \ - while (bits >= 16) { \ - Py_UNICODE outCh = (Py_UNICODE) ((ch >> (bits-16)) & 0xffff); \ - bits -= 16; \ - if (surrogate) { \ - /* We have already generated an error for the high surrogate \ - so let's not bother seeing if the low surrogate is correct or not */ \ - surrogate = 0; \ - } else if (0xDC00 <= outCh && outCh <= 0xDFFF) { \ - /* This is a surrogate pair. Unfortunately we can't represent \ - it in a 16-bit character */ \ - surrogate = 1; \ - errmsg = "code pairs are not supported"; \ - goto utf7Error; \ - } else { \ - *out++ = outCh; \ - } \ - } + +/* DECODE_DIRECT: this byte encountered in a UTF-7 string should be + * decoded as itself. We are permissive on decoding; the only ASCII + * byte not decoding to itself is the + which begins a base64 + * string. */ + +#define DECODE_DIRECT(c) \ + ((c) <= 127 && (c) != '+') + +/* The UTF-7 encoder treats ASCII characters differently according to + * whether they are Set D, Set O, Whitespace, or special (i.e. none of + * the above). See RFC2152. This array identifies these different + * sets: + * 0 : "Set D" + * alphanumeric and '(),-./:? + * 1 : "Set O" + * !"#$%&*;<=>@[]^_`{|} + * 2 : "whitespace" + * ht nl cr sp + * 3 : special (must be base64 encoded) + * everything else (i.e. +\~ and non-printing codes 0-8 11-12 14-31 127) + */ + +static +char utf7_category[128] = { +/* nul soh stx etx eot enq ack bel bs ht nl vt np cr so si */ + 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 3, 3, 2, 3, 3, +/* dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us */ + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, +/* sp ! " # $ % & ' ( ) * + , - . / */ + 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 3, 0, 0, 0, 0, +/* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, +/* @ A B C D E F G H I J K L M N O */ + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* P Q R S T U V W X Y Z [ \ ] ^ _ */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 1, 1, 1, +/* ` a b c d e f g h i j k l m n o */ + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* p q r s t u v w x y z { | } ~ del */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 3, 3, +}; + +/* ENCODE_DIRECT: this character should be encoded as itself. The + * answer depends on whether we are encoding set O as itself, and also + * on whether we are encoding whitespace as itself. RFC2152 makes it + * clear that the answers to these questions vary between + * applications, so this code needs to be flexible. */ + +#define ENCODE_DIRECT(c, directO, directWS) \ + ((c) < 128 && (c) > 0 && \ + ((utf7_category[(c)] == 0) || \ + (directWS && (utf7_category[(c)] == 2)) || \ + (directO && (utf7_category[(c)] == 1)))) PyObject *PyUnicode_DecodeUTF7(const char *s, Py_ssize_t size, @@ -1539,6 +1551,13 @@ return PyUnicode_DecodeUTF7Stateful(s, size, errors, NULL); } +/* The decoder. The only state we preserve is our read position, + * i.e. how many characters we have consumed. So if we end in the + * middle of a shift sequence we have to back off the read position + * and the output to the beginning of the sequence, otherwise we lose + * all the shift state (seen bits, number of bits seen, high + * surrogate). */ + PyObject *PyUnicode_DecodeUTF7Stateful(const char *s, Py_ssize_t size, const char *errors, @@ -1553,9 +1572,10 @@ Py_UNICODE *p; const char *errmsg = ""; int inShift = 0; - unsigned int bitsleft = 0; - unsigned long charsleft = 0; - int surrogate = 0; + Py_UNICODE *shiftOutStart; + unsigned int base64bits = 0; + unsigned long base64buffer = 0; + Py_UNICODE surrogate = 0; PyObject *errorHandler = NULL; PyObject *exc = NULL; @@ -1569,79 +1589,107 @@ } p = unicode->str; + shiftOutStart = p; e = s + size; while (s < e) { - Py_UNICODE ch; - restart: - ch = (unsigned char) *s; + Py_UNICODE ch = (unsigned char) *s; - if (inShift) { - if ((ch == '-') || !B64CHAR(ch)) { - inShift = 0; + if (inShift) { /* in a base-64 section */ + if (IS_BASE64(ch)) { /* consume a base-64 character */ + base64buffer = (base64buffer << 6) | FROM_BASE64(ch); + base64bits += 6; s++; - - /* p, charsleft, bitsleft, surrogate = */ DECODE(p, charsleft, bitsleft, surrogate); - if (bitsleft >= 6) { - /* The shift sequence has a partial character in it. If - bitsleft < 6 then we could just classify it as padding - but that is not the case here */ - - errmsg = "partial character in shift sequence"; - goto utf7Error; + if (base64bits >= 16) { + /* we have enough bits for a UTF-16 value */ + Py_UNICODE outCh = (Py_UNICODE) + (base64buffer >> (base64bits-16)); + base64bits -= 16; + base64buffer &= (1 << base64bits) - 1; /* clear high bits */ + if (surrogate) { + /* expecting a second surrogate */ + if (outCh >= 0xDC00 && outCh <= 0xDFFF) { +#ifdef Py_UNICODE_WIDE + *p++ = (((surrogate & 0x3FF)<<10) + | (outCh & 0x3FF)) + 0x10000; +#else + *p++ = surrogate; + *p++ = outCh; +#endif + surrogate = 0; + } + else { + surrogate = 0; + errmsg = "second surrogate missing"; + goto utf7Error; + } + } + else if (outCh >= 0xD800 && outCh <= 0xDBFF) { + /* first surrogate */ + surrogate = outCh; + } + else if (outCh >= 0xDC00 && outCh <= 0xDFFF) { + errmsg = "unexpected second surrogate"; + goto utf7Error; + } + else { + *p++ = outCh; + } } - /* According to RFC2152 the remaining bits should be zero. We - choose to signal an error/insert a replacement character - here so indicate the potential of a misencoded character. */ - - /* On x86, a << b == a << (b%32) so make sure that bitsleft != 0 */ - if (bitsleft && charsleft << (sizeof(charsleft) * 8 - bitsleft)) { - errmsg = "non-zero padding bits in shift sequence"; + } + else { /* now leaving a base-64 section */ + inShift = 0; + s++; + if (surrogate) { + errmsg = "second surrogate missing at end of shift sequence"; goto utf7Error; } - - if (ch == '-') { - if ((s < e) && (*(s) == '-')) { - *p++ = '-'; - inShift = 1; + if (base64bits > 0) { /* left-over bits */ + if (base64bits >= 6) { + /* We've seen at least one base-64 character */ + errmsg = "partial character in shift sequence"; + goto utf7Error; } - } else if (SPECIAL(ch,0,0)) { - errmsg = "unexpected special character"; - goto utf7Error; - } else { + else { + /* Some bits remain; they should be zero */ + if (base64buffer != 0) { + errmsg = "non-zero padding bits in shift sequence"; + goto utf7Error; + } + } + } + if (ch != '-') { + /* '-' is absorbed; other terminating + characters are preserved */ *p++ = ch; } - } else { - charsleft = (charsleft << 6) | UB64(ch); - bitsleft += 6; - s++; - /* p, charsleft, bitsleft, surrogate = */ DECODE(p, charsleft, bitsleft, surrogate); } } else if ( ch == '+' ) { startinpos = s-starts; - s++; - if (s < e && *s == '-') { + s++; /* consume '+' */ + if (s < e && *s == '-') { /* '+-' encodes '+' */ s++; *p++ = '+'; - } else - { + } + else { /* begin base64-encoded section */ inShift = 1; - bitsleft = 0; + shiftOutStart = p; + base64bits = 0; } } - else if (SPECIAL(ch,0,0)) { - startinpos = s-starts; - errmsg = "unexpected special character"; + else if (DECODE_DIRECT(ch)) { /* character decodes as itself */ + *p++ = ch; s++; - goto utf7Error; } else { - *p++ = ch; + startinpos = s-starts; s++; + errmsg = "unexpected special character"; + goto utf7Error; } continue; - utf7Error: +utf7Error: outpos = p-PyUnicode_AS_UNICODE(unicode); endinpos = s-starts; if (unicode_decode_call_errorhandler( @@ -1652,23 +1700,33 @@ goto onError; } - if (inShift && !consumed) { - outpos = p-PyUnicode_AS_UNICODE(unicode); - endinpos = size; - if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "utf7", "unterminated shift sequence", - starts, size, &startinpos, &endinpos, &exc, &s, - &unicode, &outpos, &p)) - goto onError; - if (s < e) - goto restart; + /* end of string */ + + if (inShift && !consumed) { /* in shift sequence, no more to follow */ + /* if we're in an inconsistent state, that's an error */ + if (surrogate || + (base64bits >= 6) || + (base64bits > 0 && base64buffer != 0)) { + outpos = p-PyUnicode_AS_UNICODE(unicode); + endinpos = size; + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "utf7", "unterminated shift sequence", + starts, size, &startinpos, &endinpos, &exc, &s, + &unicode, &outpos, &p)) + goto onError; + } } + + /* return state */ if (consumed) { - if(inShift) + if (inShift) { + p = shiftOutStart; /* back off output */ *consumed = startinpos; - else + } + else { *consumed = s-starts; + } } if (_PyUnicode_Resize(&unicode, p - PyUnicode_AS_UNICODE(unicode)) < 0) @@ -1688,27 +1746,27 @@ PyObject *PyUnicode_EncodeUTF7(const Py_UNICODE *s, Py_ssize_t size, - int encodeSetO, - int encodeWhiteSpace, + int base64SetO, + int base64WhiteSpace, const char *errors) { PyObject *v; /* It might be possible to tighten this worst case */ - Py_ssize_t cbAllocated = 5 * size; + Py_ssize_t allocated = 5 * size; int inShift = 0; Py_ssize_t i = 0; - unsigned int bitsleft = 0; - unsigned long charsleft = 0; + unsigned int base64bits = 0; + unsigned long base64buffer = 0; char * out; char * start; - if (cbAllocated / 5 != size) + if (allocated / 5 != size) return PyErr_NoMemory(); if (size == 0) return PyString_FromStringAndSize(NULL, 0); - v = PyString_FromStringAndSize(NULL, cbAllocated); + v = PyString_FromStringAndSize(NULL, allocated); if (v == NULL) return NULL; @@ -1716,78 +1774,76 @@ for (;i < size; ++i) { Py_UNICODE ch = s[i]; - if (!inShift) { - if (ch == '+') { - *out++ = '+'; - *out++ = '-'; - } else if (SPECIAL(ch, encodeSetO, encodeWhiteSpace)) { - charsleft = ch; - bitsleft = 16; - *out++ = '+'; - /* out, charsleft, bitsleft = */ ENCODE(out, charsleft, bitsleft); - inShift = bitsleft > 0; - } else { - *out++ = (char) ch; - } - } else { - if (!SPECIAL(ch, encodeSetO, encodeWhiteSpace)) { - *out++ = B64(charsleft << (6-bitsleft)); - charsleft = 0; - bitsleft = 0; + if (inShift) { + if (ENCODE_DIRECT(ch, !base64SetO, !base64WhiteSpace)) { + /* shifting out */ + if (base64bits) { /* output remaining bits */ + *out++ = TO_BASE64(base64buffer << (6-base64bits)); + base64buffer = 0; + base64bits = 0; + } + inShift = 0; /* Characters not in the BASE64 set implicitly unshift the sequence so no '-' is required, except if the character is itself a '-' */ - if (B64CHAR(ch) || ch == '-') { + if (IS_BASE64(ch) || ch == '-') { *out++ = '-'; } - inShift = 0; *out++ = (char) ch; - } else { - bitsleft += 16; - charsleft = (charsleft << 16) | ch; - /* out, charsleft, bitsleft = */ ENCODE(out, charsleft, bitsleft); - - /* If the next character is special then we don't need to terminate - the shift sequence. If the next character is not a BASE64 character - or '-' then the shift sequence will be terminated implicitly and we - don't have to insert a '-'. */ - - if (bitsleft == 0) { - if (i + 1 < size) { - Py_UNICODE ch2 = s[i+1]; - - if (SPECIAL(ch2, encodeSetO, encodeWhiteSpace)) { - - } else if (B64CHAR(ch2) || ch2 == '-') { - *out++ = '-'; - inShift = 0; - } else { - inShift = 0; - } - - } - else { + } + else { + goto encode_char; + } + } + else { /* not in a shift sequence */ + if (ch == '+') { + *out++ = '+'; *out++ = '-'; - inShift = 0; - } - } + } + else if (ENCODE_DIRECT(ch, !base64SetO, !base64WhiteSpace)) { + *out++ = (char) ch; + } + else { + *out++ = '+'; + inShift = 1; + goto encode_char; } } - } - if (bitsleft) { - *out++= B64(charsleft << (6-bitsleft) ); + continue; +encode_char: +#ifdef Py_UNICODE_WIDE + if (ch >= 0x10000) { + /* code first surrogate */ + base64bits += 16; + base64buffer = (base64buffer << 16) | 0xd800 | ((ch-0x10000) >> 10); + while (base64bits >= 6) { + *out++ = TO_BASE64(base64buffer >> (base64bits-6)); + base64bits -= 6; + } + /* prepare second surrogate */ + ch = 0xDC00 | ((ch-0x10000) & 0x3FF); + } +#endif + base64bits += 16; + base64buffer = (base64buffer << 16) | ch; + while (base64bits >= 6) { + *out++ = TO_BASE64(base64buffer >> (base64bits-6)); + base64bits -= 6; + } + } + if (base64bits) + *out++= TO_BASE64(base64buffer << (6-base64bits) ); + if (inShift) *out++ = '-'; - } _PyString_Resize(&v, out - start); return v; } -#undef SPECIAL -#undef B64 -#undef B64CHAR -#undef UB64 -#undef ENCODE -#undef DECODE +#undef IS_BASE64 +#undef FROM_BASE64 +#undef TO_BASE64 +#undef DECODE_DIRECT +#undef ENCODE_DIRECT /* --- UTF-8 Codec -------------------------------------------------------- */ From python-checkins at python.org Mon May 4 20:32:50 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 4 May 2009 20:32:50 +0200 (CEST) Subject: [Python-checkins] r72284 - python/trunk/Misc/ACKS Message-ID: <20090504183250.7E5D11E4027@bag.python.org> Author: antoine.pitrou Date: Mon May 4 20:32:50 2009 New Revision: 72284 Log: Add Nick Barnes to ACKS. Modified: python/trunk/Misc/ACKS Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Mon May 4 20:32:50 2009 @@ -36,6 +36,7 @@ Jeff Balogh Michael J. Barber Chris Barker +Nick Barnes Quentin Barnes Richard Barran Cesar Eduardo Barros From python-checkins at python.org Mon May 4 20:56:14 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 4 May 2009 20:56:14 +0200 (CEST) Subject: [Python-checkins] r72285 - in python/branches/py3k: Include/unicodeobject.h Lib/test/test_unicode.py Misc/ACKS Misc/NEWS Objects/unicodeobject.c Message-ID: <20090504185614.468221E4038@bag.python.org> Author: antoine.pitrou Date: Mon May 4 20:56:13 2009 New Revision: 72285 Log: Merged revisions 72283-72284 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72283 | antoine.pitrou | 2009-05-04 20:32:32 +0200 (lun., 04 mai 2009) | 4 lines Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal sequences. Patch by Nick Barnes and Victor Stinner. ........ r72284 | antoine.pitrou | 2009-05-04 20:32:50 +0200 (lun., 04 mai 2009) | 3 lines Add Nick Barnes to ACKS. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Include/unicodeobject.h python/branches/py3k/Lib/test/test_unicode.py python/branches/py3k/Misc/ACKS python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/unicodeobject.c Modified: python/branches/py3k/Include/unicodeobject.h ============================================================================== --- python/branches/py3k/Include/unicodeobject.h (original) +++ python/branches/py3k/Include/unicodeobject.h Mon May 4 20:56:13 2009 @@ -858,10 +858,8 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF7( const Py_UNICODE *data, /* Unicode char buffer */ Py_ssize_t length, /* number of Py_UNICODE chars to encode */ - int encodeSetO, /* force the encoder to encode characters in - Set O, as described in RFC2152 */ - int encodeWhiteSpace, /* force the encoder to encode space, tab, - carriage return and linefeed characters */ + int base64SetO, /* Encode RFC2152 Set O characters in base64 */ + int base64WhiteSpace, /* Encode whitespace (sp, ht, nl, cr) in base64 */ const char *errors /* error handling */ ); Modified: python/branches/py3k/Lib/test/test_unicode.py ============================================================================== --- python/branches/py3k/Lib/test/test_unicode.py (original) +++ python/branches/py3k/Lib/test/test_unicode.py Mon May 4 20:56:13 2009 @@ -867,19 +867,31 @@ ('+?', b'+-?'), (r'\\?', b'+AFwAXA?'), (r'\\\?', b'+AFwAXABc?'), - (r'++--', b'+-+---') + (r'++--', b'+-+---'), + ('\U000abcde', b'+2m/c3g-'), # surrogate pairs + ('/', b'/'), ] for (x, y) in utfTests: self.assertEqual(x.encode('utf-7'), y) - # surrogates not supported + # Unpaired surrogates not supported self.assertRaises(UnicodeError, str, b'+3ADYAA-', 'utf-7') - self.assertEqual(str(b'+3ADYAA-', 'utf-7', 'replace'), '\ufffd') + self.assertEqual(str(b'+3ADYAA-', 'utf-7', 'replace'), '\ufffd\ufffd') # Issue #2242: crash on some Windows/MSVC versions - self.assertRaises(UnicodeDecodeError, b'+\xc1'.decode, 'utf-7') + self.assertEqual(b'+\xc1'.decode('utf-7'), '\xc1') + + # Direct encoded characters + set_d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'(),-./:?" + # Optional direct characters + set_o = '!"#$%&*;<=>@[]^_`{|}' + for c in set_d: + self.assertEqual(c.encode('utf7'), c.encode('ascii')) + self.assertEqual(c.encode('ascii').decode('utf7'), c) + for c in set_o: + self.assertEqual(c.encode('ascii').decode('utf7'), c) def test_codecs_utf8(self): self.assertEqual(''.encode('utf-8'), b'') Modified: python/branches/py3k/Misc/ACKS ============================================================================== --- python/branches/py3k/Misc/ACKS (original) +++ python/branches/py3k/Misc/ACKS Mon May 4 20:56:13 2009 @@ -35,6 +35,7 @@ Jeff Balogh Michael J. Barber Chris Barker +Nick Barnes Quentin Barnes Richard Barran Cesar Eduardo Barros Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon May 4 20:56:13 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal + sequences. Patch by Nick Barnes and Victor Stinner. + - Issue #3672: Reject surrogates in utf-8 codec; add surrogates error handler. - Issue #5883: In the io module, the BufferedIOBase and TextIOBase ABCs have Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Mon May 4 20:56:13 2009 @@ -1702,69 +1702,84 @@ /* --- UTF-7 Codec -------------------------------------------------------- */ -/* see RFC2152 for details */ +/* See RFC2152 for details. We encode conservatively and decode liberally. */ -static -char utf7_special[128] = { - /* indicate whether a UTF-7 character is special i.e. cannot be directly - encoded: - 0 - not special - 1 - special - 2 - whitespace (optional) - 3 - RFC2152 Set O (optional) */ - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 3, 3, 3, 3, 3, 3, 0, 0, 0, 3, 1, 0, 0, 0, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 3, 0, - 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 1, 3, 3, 3, - 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 1, 1, +/* Three simple macros defining base-64. */ -}; +/* Is c a base-64 character? */ + +#define IS_BASE64(c) \ + (((c) >= 'A' && (c) <= 'Z') || \ + ((c) >= 'a' && (c) <= 'z') || \ + ((c) >= '0' && (c) <= '9') || \ + (c) == '+' || (c) == '/') -/* Note: The comparison (c) <= 0 is a trick to work-around gcc - warnings about the comparison always being false; since - utf7_special[0] is 1, we can safely make that one comparison - true */ - -#define SPECIAL(c, encodeO, encodeWS) \ - ((c) > 127 || (c) <= 0 || utf7_special[(c)] == 1 || \ - (encodeWS && (utf7_special[(c)] == 2)) || \ - (encodeO && (utf7_special[(c)] == 3))) +/* given that c is a base-64 character, what is its base-64 value? */ -#define B64(n) \ +#define FROM_BASE64(c) \ + (((c) >= 'A' && (c) <= 'Z') ? (c) - 'A' : \ + ((c) >= 'a' && (c) <= 'z') ? (c) - 'a' + 26 : \ + ((c) >= '0' && (c) <= '9') ? (c) - '0' + 52 : \ + (c) == '+' ? 62 : 63) + +/* What is the base-64 character of the bottom 6 bits of n? */ + +#define TO_BASE64(n) \ ("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(n) & 0x3f]) -#define B64CHAR(c) \ - (ISALNUM(c) || (c) == '+' || (c) == '/') -#define UB64(c) \ - ((c) == '+' ? 62 : (c) == '/' ? 63 : (c) >= 'a' ? \ - (c) - 71 : (c) >= 'A' ? (c) - 65 : (c) + 4 ) - -#define ENCODE(out, ch, bits) \ - while (bits >= 6) { \ - *out++ = B64(ch >> (bits-6)); \ - bits -= 6; \ - } - -#define DECODE(out, ch, bits, surrogate) \ - while (bits >= 16) { \ - Py_UNICODE outCh = (Py_UNICODE) ((ch >> (bits-16)) & 0xffff); \ - bits -= 16; \ - if (surrogate) { \ - /* We have already generated an error for the high surrogate \ - so let's not bother seeing if the low surrogate is correct or not */ \ - surrogate = 0; \ - } else if (0xDC00 <= outCh && outCh <= 0xDFFF) { \ - /* This is a surrogate pair. Unfortunately we can't represent \ - it in a 16-bit character */ \ - surrogate = 1; \ - errmsg = "code pairs are not supported"; \ - goto utf7Error; \ - } else { \ - *out++ = outCh; \ - } \ - } + +/* DECODE_DIRECT: this byte encountered in a UTF-7 string should be + * decoded as itself. We are permissive on decoding; the only ASCII + * byte not decoding to itself is the + which begins a base64 + * string. */ + +#define DECODE_DIRECT(c) \ + ((c) <= 127 && (c) != '+') + +/* The UTF-7 encoder treats ASCII characters differently according to + * whether they are Set D, Set O, Whitespace, or special (i.e. none of + * the above). See RFC2152. This array identifies these different + * sets: + * 0 : "Set D" + * alphanumeric and '(),-./:? + * 1 : "Set O" + * !"#$%&*;<=>@[]^_`{|} + * 2 : "whitespace" + * ht nl cr sp + * 3 : special (must be base64 encoded) + * everything else (i.e. +\~ and non-printing codes 0-8 11-12 14-31 127) + */ + +static +char utf7_category[128] = { +/* nul soh stx etx eot enq ack bel bs ht nl vt np cr so si */ + 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 3, 3, 2, 3, 3, +/* dle dc1 dc2 dc3 dc4 nak syn etb can em sub esc fs gs rs us */ + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, +/* sp ! " # $ % & ' ( ) * + , - . / */ + 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 3, 0, 0, 0, 0, +/* 0 1 2 3 4 5 6 7 8 9 : ; < = > ? */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, +/* @ A B C D E F G H I J K L M N O */ + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* P Q R S T U V W X Y Z [ \ ] ^ _ */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 1, 1, 1, +/* ` a b c d e f g h i j k l m n o */ + 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/* p q r s t u v w x y z { | } ~ del */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 3, 3, +}; + +/* ENCODE_DIRECT: this character should be encoded as itself. The + * answer depends on whether we are encoding set O as itself, and also + * on whether we are encoding whitespace as itself. RFC2152 makes it + * clear that the answers to these questions vary between + * applications, so this code needs to be flexible. */ + +#define ENCODE_DIRECT(c, directO, directWS) \ + ((c) < 128 && (c) > 0 && \ + ((utf7_category[(c)] == 0) || \ + (directWS && (utf7_category[(c)] == 2)) || \ + (directO && (utf7_category[(c)] == 1)))) PyObject *PyUnicode_DecodeUTF7(const char *s, Py_ssize_t size, @@ -1773,6 +1788,13 @@ return PyUnicode_DecodeUTF7Stateful(s, size, errors, NULL); } +/* The decoder. The only state we preserve is our read position, + * i.e. how many characters we have consumed. So if we end in the + * middle of a shift sequence we have to back off the read position + * and the output to the beginning of the sequence, otherwise we lose + * all the shift state (seen bits, number of bits seen, high + * surrogate). */ + PyObject *PyUnicode_DecodeUTF7Stateful(const char *s, Py_ssize_t size, const char *errors, @@ -1787,9 +1809,10 @@ Py_UNICODE *p; const char *errmsg = ""; int inShift = 0; - unsigned int bitsleft = 0; - unsigned long charsleft = 0; - int surrogate = 0; + Py_UNICODE *shiftOutStart; + unsigned int base64bits = 0; + unsigned long base64buffer = 0; + Py_UNICODE surrogate = 0; PyObject *errorHandler = NULL; PyObject *exc = NULL; @@ -1803,6 +1826,7 @@ } p = unicode->str; + shiftOutStart = p; e = s + size; while (s < e) { @@ -1810,72 +1834,101 @@ restart: ch = (unsigned char) *s; - if (inShift) { - if ((ch == '-') || !B64CHAR(ch)) { - inShift = 0; + if (inShift) { /* in a base-64 section */ + if (IS_BASE64(ch)) { /* consume a base-64 character */ + base64buffer = (base64buffer << 6) | FROM_BASE64(ch); + base64bits += 6; s++; - - /* p, charsleft, bitsleft, surrogate = */ DECODE(p, charsleft, bitsleft, surrogate); - if (bitsleft >= 6) { - /* The shift sequence has a partial character in it. If - bitsleft < 6 then we could just classify it as padding - but that is not the case here */ - - errmsg = "partial character in shift sequence"; - goto utf7Error; + if (base64bits >= 16) { + /* we have enough bits for a UTF-16 value */ + Py_UNICODE outCh = (Py_UNICODE) + (base64buffer >> (base64bits-16)); + base64bits -= 16; + base64buffer &= (1 << base64bits) - 1; /* clear high bits */ + if (surrogate) { + /* expecting a second surrogate */ + if (outCh >= 0xDC00 && outCh <= 0xDFFF) { +#ifdef Py_UNICODE_WIDE + *p++ = (((surrogate & 0x3FF)<<10) + | (outCh & 0x3FF)) + 0x10000; +#else + *p++ = surrogate; + *p++ = outCh; +#endif + surrogate = 0; + } + else { + surrogate = 0; + errmsg = "second surrogate missing"; + goto utf7Error; + } + } + else if (outCh >= 0xD800 && outCh <= 0xDBFF) { + /* first surrogate */ + surrogate = outCh; + } + else if (outCh >= 0xDC00 && outCh <= 0xDFFF) { + errmsg = "unexpected second surrogate"; + goto utf7Error; + } + else { + *p++ = outCh; + } } - /* According to RFC2152 the remaining bits should be zero. We - choose to signal an error/insert a replacement character - here so indicate the potential of a misencoded character. */ - - /* On x86, a << b == a << (b%32) so make sure that bitsleft != 0 */ - if (bitsleft && charsleft << (sizeof(charsleft) * 8 - bitsleft)) { - errmsg = "non-zero padding bits in shift sequence"; + } + else { /* now leaving a base-64 section */ + inShift = 0; + s++; + if (surrogate) { + errmsg = "second surrogate missing at end of shift sequence"; goto utf7Error; } - - if (ch == '-') { - if ((s < e) && (*(s) == '-')) { - *p++ = '-'; - inShift = 1; + if (base64bits > 0) { /* left-over bits */ + if (base64bits >= 6) { + /* We've seen at least one base-64 character */ + errmsg = "partial character in shift sequence"; + goto utf7Error; } - } else if (SPECIAL(ch,0,0)) { - errmsg = "unexpected special character"; - goto utf7Error; - } else { + else { + /* Some bits remain; they should be zero */ + if (base64buffer != 0) { + errmsg = "non-zero padding bits in shift sequence"; + goto utf7Error; + } + } + } + if (ch != '-') { + /* '-' is absorbed; other terminating + characters are preserved */ *p++ = ch; } - } else { - charsleft = (charsleft << 6) | UB64(ch); - bitsleft += 6; - s++; - /* p, charsleft, bitsleft, surrogate = */ DECODE(p, charsleft, bitsleft, surrogate); } } else if ( ch == '+' ) { startinpos = s-starts; - s++; - if (s < e && *s == '-') { + s++; /* consume '+' */ + if (s < e && *s == '-') { /* '+-' encodes '+' */ s++; *p++ = '+'; - } else - { + } + else { /* begin base64-encoded section */ inShift = 1; - bitsleft = 0; + shiftOutStart = p; + base64bits = 0; } } - else if (SPECIAL(ch,0,0)) { - startinpos = s-starts; - errmsg = "unexpected special character"; + else if (DECODE_DIRECT(ch)) { /* character decodes as itself */ + *p++ = ch; s++; - goto utf7Error; } else { - *p++ = ch; + startinpos = s-starts; s++; + errmsg = "unexpected special character"; + goto utf7Error; } continue; - utf7Error: +utf7Error: outpos = p-PyUnicode_AS_UNICODE(unicode); endinpos = s-starts; if (unicode_decode_call_errorhandler( @@ -1886,23 +1939,35 @@ goto onError; } - if (inShift && !consumed) { - outpos = p-PyUnicode_AS_UNICODE(unicode); - endinpos = size; - if (unicode_decode_call_errorhandler( - errors, &errorHandler, - "utf7", "unterminated shift sequence", - &starts, &e, &startinpos, &endinpos, &exc, &s, - &unicode, &outpos, &p)) - goto onError; - if (s < e) - goto restart; + /* end of string */ + + if (inShift && !consumed) { /* in shift sequence, no more to follow */ + /* if we're in an inconsistent state, that's an error */ + if (surrogate || + (base64bits >= 6) || + (base64bits > 0 && base64buffer != 0)) { + outpos = p-PyUnicode_AS_UNICODE(unicode); + endinpos = size; + if (unicode_decode_call_errorhandler( + errors, &errorHandler, + "utf7", "unterminated shift sequence", + &starts, &e, &startinpos, &endinpos, &exc, &s, + &unicode, &outpos, &p)) + goto onError; + if (s < e) + goto restart; + } } + + /* return state */ if (consumed) { - if(inShift) + if (inShift) { + p = shiftOutStart; /* back off output */ *consumed = startinpos; - else + } + else { *consumed = s-starts; + } } if (_PyUnicode_Resize(&unicode, p - PyUnicode_AS_UNICODE(unicode)) < 0) @@ -1922,27 +1987,27 @@ PyObject *PyUnicode_EncodeUTF7(const Py_UNICODE *s, Py_ssize_t size, - int encodeSetO, - int encodeWhiteSpace, + int base64SetO, + int base64WhiteSpace, const char *errors) { PyObject *v; /* It might be possible to tighten this worst case */ - Py_ssize_t cbAllocated = 5 * size; + Py_ssize_t allocated = 5 * size; int inShift = 0; Py_ssize_t i = 0; - unsigned int bitsleft = 0; - unsigned long charsleft = 0; + unsigned int base64bits = 0; + unsigned long base64buffer = 0; char * out; char * start; if (size == 0) return PyBytes_FromStringAndSize(NULL, 0); - if (cbAllocated / 5 != size) + if (allocated / 5 != size) return PyErr_NoMemory(); - v = PyBytes_FromStringAndSize(NULL, cbAllocated); + v = PyBytes_FromStringAndSize(NULL, allocated); if (v == NULL) return NULL; @@ -1950,78 +2015,76 @@ for (;i < size; ++i) { Py_UNICODE ch = s[i]; - if (!inShift) { - if (ch == '+') { - *out++ = '+'; - *out++ = '-'; - } else if (SPECIAL(ch, encodeSetO, encodeWhiteSpace)) { - charsleft = ch; - bitsleft = 16; - *out++ = '+'; - /* out, charsleft, bitsleft = */ ENCODE(out, charsleft, bitsleft); - inShift = bitsleft > 0; - } else { - *out++ = (char) ch; - } - } else { - if (!SPECIAL(ch, encodeSetO, encodeWhiteSpace)) { - *out++ = B64(charsleft << (6-bitsleft)); - charsleft = 0; - bitsleft = 0; + if (inShift) { + if (ENCODE_DIRECT(ch, !base64SetO, !base64WhiteSpace)) { + /* shifting out */ + if (base64bits) { /* output remaining bits */ + *out++ = TO_BASE64(base64buffer << (6-base64bits)); + base64buffer = 0; + base64bits = 0; + } + inShift = 0; /* Characters not in the BASE64 set implicitly unshift the sequence so no '-' is required, except if the character is itself a '-' */ - if (B64CHAR(ch) || ch == '-') { + if (IS_BASE64(ch) || ch == '-') { *out++ = '-'; } - inShift = 0; *out++ = (char) ch; - } else { - bitsleft += 16; - charsleft = (charsleft << 16) | ch; - /* out, charsleft, bitsleft = */ ENCODE(out, charsleft, bitsleft); - - /* If the next character is special then we don't need to terminate - the shift sequence. If the next character is not a BASE64 character - or '-' then the shift sequence will be terminated implicitly and we - don't have to insert a '-'. */ - - if (bitsleft == 0) { - if (i + 1 < size) { - Py_UNICODE ch2 = s[i+1]; - - if (SPECIAL(ch2, encodeSetO, encodeWhiteSpace)) { - - } else if (B64CHAR(ch2) || ch2 == '-') { - *out++ = '-'; - inShift = 0; - } else { - inShift = 0; - } - - } - else { + } + else { + goto encode_char; + } + } + else { /* not in a shift sequence */ + if (ch == '+') { + *out++ = '+'; *out++ = '-'; - inShift = 0; - } - } + } + else if (ENCODE_DIRECT(ch, !base64SetO, !base64WhiteSpace)) { + *out++ = (char) ch; + } + else { + *out++ = '+'; + inShift = 1; + goto encode_char; } } - } - if (bitsleft) { - *out++= B64(charsleft << (6-bitsleft) ); + continue; +encode_char: +#ifdef Py_UNICODE_WIDE + if (ch >= 0x10000) { + /* code first surrogate */ + base64bits += 16; + base64buffer = (base64buffer << 16) | 0xd800 | ((ch-0x10000) >> 10); + while (base64bits >= 6) { + *out++ = TO_BASE64(base64buffer >> (base64bits-6)); + base64bits -= 6; + } + /* prepare second surrogate */ + ch = 0xDC00 | ((ch-0x10000) & 0x3FF); + } +#endif + base64bits += 16; + base64buffer = (base64buffer << 16) | ch; + while (base64bits >= 6) { + *out++ = TO_BASE64(base64buffer >> (base64bits-6)); + base64bits -= 6; + } + } + if (base64bits) + *out++= TO_BASE64(base64buffer << (6-base64bits) ); + if (inShift) *out++ = '-'; - } if (_PyBytes_Resize(&v, out - start) < 0) return NULL; return v; } -#undef SPECIAL -#undef B64 -#undef B64CHAR -#undef UB64 -#undef ENCODE -#undef DECODE +#undef IS_BASE64 +#undef FROM_BASE64 +#undef TO_BASE64 +#undef DECODE_DIRECT +#undef ENCODE_DIRECT /* --- UTF-8 Codec -------------------------------------------------------- */ From buildbot at python.org Mon May 4 20:57:21 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 18:57:21 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090504185721.33A141E400C@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/690 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: walter.doerwald BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Mon May 4 21:34:45 2009 From: python-checkins at python.org (gregory.p.smith) Date: Mon, 4 May 2009 21:34:45 +0200 (CEST) Subject: [Python-checkins] r72286 - python/branches/py3k/Doc/library/ipaddr.rst Message-ID: <20090504193445.DAB741E400C@bag.python.org> Author: gregory.p.smith Date: Mon May 4 21:34:45 2009 New Revision: 72286 Log: documentation clarification. mention bytes. Modified: python/branches/py3k/Doc/library/ipaddr.rst Modified: python/branches/py3k/Doc/library/ipaddr.rst ============================================================================== --- python/branches/py3k/Doc/library/ipaddr.rst (original) +++ python/branches/py3k/Doc/library/ipaddr.rst Mon May 4 21:34:45 2009 @@ -21,9 +21,10 @@ Take an IP string or int and return an object of the correct type. Returns an :class:`IPv4` or :class:`IPv6` object. - The *ipaddr* parameter must be a string or integer representing the IP - address. Either IPv4 or IPv6 addresses may be supplied. Integers less than - 2**32 will be considered to be IPv4. + The *ipaddr* parameter must be a string, bytes or integer representing the + IP address in ascii, network byte order or as a number respectively. Either + IPv4 or IPv6 addresses may be supplied. Integers less than 2**32 will be + considered to be IPv4. Raises :exc:`ValueError` if the *ipaddr* passed is not either an IPv4 or an IPv6 address. From python-checkins at python.org Mon May 4 21:35:17 2009 From: python-checkins at python.org (gregory.p.smith) Date: Mon, 4 May 2009 21:35:17 +0200 (CEST) Subject: [Python-checkins] r72287 - python/branches/py3k/Doc/library/ipaddr.rst Message-ID: <20090504193517.0FBE71E400C@bag.python.org> Author: gregory.p.smith Date: Mon May 4 21:35:16 2009 New Revision: 72287 Log: version added 3.1 Modified: python/branches/py3k/Doc/library/ipaddr.rst Modified: python/branches/py3k/Doc/library/ipaddr.rst ============================================================================== --- python/branches/py3k/Doc/library/ipaddr.rst (original) +++ python/branches/py3k/Doc/library/ipaddr.rst Mon May 4 21:35:16 2009 @@ -7,7 +7,7 @@ .. sectionauthor:: Gregory P. Smith -.. versionadded:: 2.7 +.. versionadded:: 3.1 .. index:: single: IP address, IPv4, IPv6, netmask From buildbot at python.org Mon May 4 22:26:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 20:26:40 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090504202640.EB16B1E434C@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/740 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_time ====================================================================== FAIL: test_tzset (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_time.py", line 166, in test_tzset self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) AssertionError: time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) == time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon May 4 22:30:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 20:30:13 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc trunk Message-ID: <20090504203015.93DFE1E43B4@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%20trunk/builds/370 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_time sincerely, -The Buildbot From python-checkins at python.org Mon May 4 22:42:09 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 4 May 2009 22:42:09 +0200 (CEST) Subject: [Python-checkins] r72288 - python/trunk/Doc/reference/lexical_analysis.rst Message-ID: <20090504204209.A31361E4035@bag.python.org> Author: georg.brandl Date: Mon May 4 22:42:08 2009 New Revision: 72288 Log: #5925: fix highlighting of keyword table. Modified: python/trunk/Doc/reference/lexical_analysis.rst Modified: python/trunk/Doc/reference/lexical_analysis.rst ============================================================================== --- python/trunk/Doc/reference/lexical_analysis.rst (original) +++ python/trunk/Doc/reference/lexical_analysis.rst Mon May 4 22:42:08 2009 @@ -339,7 +339,9 @@ The following identifiers are used as reserved words, or *keywords* of the language, and cannot be used as ordinary identifiers. They must be spelled -exactly as written here:: +exactly as written here: + +.. sourcecode:: text and del from not while as elif global or with From python-checkins at python.org Mon May 4 22:43:45 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 4 May 2009 22:43:45 +0200 (CEST) Subject: [Python-checkins] r72289 - in python/branches/py3k: Doc/reference/lexical_analysis.rst Message-ID: <20090504204345.12A9F1E43DB@bag.python.org> Author: georg.brandl Date: Mon May 4 22:43:44 2009 New Revision: 72289 Log: Merged revisions 72288 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72288 | georg.brandl | 2009-05-04 22:42:08 +0200 (Mo, 04 Mai 2009) | 1 line #5925: fix highlighting of keyword table. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/reference/lexical_analysis.rst Modified: python/branches/py3k/Doc/reference/lexical_analysis.rst ============================================================================== --- python/branches/py3k/Doc/reference/lexical_analysis.rst (original) +++ python/branches/py3k/Doc/reference/lexical_analysis.rst Mon May 4 22:43:44 2009 @@ -328,7 +328,9 @@ The following identifiers are used as reserved words, or *keywords* of the language, and cannot be used as ordinary identifiers. They must be spelled -exactly as written here:: +exactly as written here: + +.. sourcecode:: text False class finally is return None continue for lambda try From python-checkins at python.org Mon May 4 22:45:13 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 4 May 2009 22:45:13 +0200 (CEST) Subject: [Python-checkins] r72290 - python/trunk/Doc/library/xmlrpclib.rst Message-ID: <20090504204513.7FF8B1E4035@bag.python.org> Author: georg.brandl Date: Mon May 4 22:45:13 2009 New Revision: 72290 Log: #5927, 5928: typos. Modified: python/trunk/Doc/library/xmlrpclib.rst Modified: python/trunk/Doc/library/xmlrpclib.rst ============================================================================== --- python/trunk/Doc/library/xmlrpclib.rst (original) +++ python/trunk/Doc/library/xmlrpclib.rst Mon May 4 22:45:13 2009 @@ -160,7 +160,7 @@ .. method:: ServerProxy.system.methodSignature(name) This method takes one parameter, the name of a method implemented by the XML-RPC - server.It returns an array of possible signatures for this method. A signature + server. It returns an array of possible signatures for this method. A signature is an array of types. The first of these types is the return type of the method, the rest are parameters. @@ -174,7 +174,7 @@ If no signature is defined for the method, a non-array value is returned. In Python this means that the type of the returned value will be something other - that list. + than list. .. method:: ServerProxy.system.methodHelp(name) From python-checkins at python.org Mon May 4 22:46:44 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 4 May 2009 22:46:44 +0200 (CEST) Subject: [Python-checkins] r72291 - in python/branches/py3k: Doc/library/xmlrpc.client.rst Message-ID: <20090504204644.E0FE01E4069@bag.python.org> Author: georg.brandl Date: Mon May 4 22:46:44 2009 New Revision: 72291 Log: Merged revisions 72290 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72290 | georg.brandl | 2009-05-04 22:45:13 +0200 (Mo, 04 Mai 2009) | 1 line #5927, 5928: typos. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/xmlrpc.client.rst Modified: python/branches/py3k/Doc/library/xmlrpc.client.rst ============================================================================== --- python/branches/py3k/Doc/library/xmlrpc.client.rst (original) +++ python/branches/py3k/Doc/library/xmlrpc.client.rst Mon May 4 22:46:44 2009 @@ -144,7 +144,7 @@ .. method:: ServerProxy.system.methodSignature(name) This method takes one parameter, the name of a method implemented by the XML-RPC - server.It returns an array of possible signatures for this method. A signature + server. It returns an array of possible signatures for this method. A signature is an array of types. The first of these types is the return type of the method, the rest are parameters. @@ -158,7 +158,7 @@ If no signature is defined for the method, a non-array value is returned. In Python this means that the type of the returned value will be something other - that list. + than list. .. method:: ServerProxy.system.methodHelp(name) From python-checkins at python.org Mon May 4 22:49:17 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 4 May 2009 22:49:17 +0200 (CEST) Subject: [Python-checkins] r72292 - python/trunk/Doc/library/socket.rst Message-ID: <20090504204917.5B0ED1E4035@bag.python.org> Author: georg.brandl Date: Mon May 4 22:49:17 2009 New Revision: 72292 Log: #5916, 5917: small socket doc improvements. Modified: python/trunk/Doc/library/socket.rst Modified: python/trunk/Doc/library/socket.rst ============================================================================== --- python/trunk/Doc/library/socket.rst (original) +++ python/trunk/Doc/library/socket.rst Mon May 4 22:49:17 2009 @@ -405,7 +405,7 @@ :exc:`socket.error` will be raised. Note that exactly what is valid depends on the underlying C implementation of :cfunc:`inet_aton`. - :func:`inet_aton` does not support IPv6, and :func:`getnameinfo` should be used + :func:`inet_aton` does not support IPv6, and :func:`inet_pton` should be used instead for IPv4/v6 dual stack support. @@ -419,7 +419,7 @@ If the string passed to this function is not exactly 4 bytes in length, :exc:`socket.error` will be raised. :func:`inet_ntoa` does not support IPv6, and - :func:`getnameinfo` should be used instead for IPv4/v6 dual stack support. + :func:`inet_ntop` should be used instead for IPv4/v6 dual stack support. .. function:: inet_pton(address_family, ip_string) @@ -437,6 +437,11 @@ Availability: Unix (maybe not all platforms). + .. seealso:: + + :func:`ipaddr.BaseIP.packed` + Platform-independent conversion to a packed, binary format. + .. versionadded:: 2.3 From python-checkins at python.org Mon May 4 22:50:30 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 4 May 2009 22:50:30 +0200 (CEST) Subject: [Python-checkins] r72293 - in python/branches/py3k: Doc/library/socket.rst Message-ID: <20090504205030.D472B1E43C0@bag.python.org> Author: georg.brandl Date: Mon May 4 22:50:30 2009 New Revision: 72293 Log: Merged revisions 72292 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72292 | georg.brandl | 2009-05-04 22:49:17 +0200 (Mo, 04 Mai 2009) | 1 line #5916, 5917: small socket doc improvements. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/socket.rst Modified: python/branches/py3k/Doc/library/socket.rst ============================================================================== --- python/branches/py3k/Doc/library/socket.rst (original) +++ python/branches/py3k/Doc/library/socket.rst Mon May 4 22:50:30 2009 @@ -385,7 +385,7 @@ :exc:`socket.error` will be raised. Note that exactly what is valid depends on the underlying C implementation of :cfunc:`inet_aton`. - :func:`inet_aton` does not support IPv6, and :func:`getnameinfo` should be used + :func:`inet_aton` does not support IPv6, and :func:`inet_pton` should be used instead for IPv4/v6 dual stack support. @@ -400,7 +400,7 @@ If the byte sequence passed to this function is not exactly 4 bytes in length, :exc:`socket.error` will be raised. :func:`inet_ntoa` does not - support IPv6, and :func:`getnameinfo` should be used instead for IPv4/v6 dual + support IPv6, and :func:`inet_ntop` should be used instead for IPv4/v6 dual stack support. @@ -419,6 +419,11 @@ Availability: Unix (maybe not all platforms). + .. seealso:: + + :func:`ipaddr.BaseIP.packed` + Platform-independent conversion to a packed, binary format. + .. function:: inet_ntop(address_family, packed_ip) From python-checkins at python.org Mon May 4 23:01:20 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 4 May 2009 23:01:20 +0200 (CEST) Subject: [Python-checkins] r72294 - in python/branches/py3k/Doc: howto/unicode.rst library/stdtypes.rst Message-ID: <20090504210120.678AB1E40A4@bag.python.org> Author: georg.brandl Date: Mon May 4 23:01:20 2009 New Revision: 72294 Log: Add missing documentation for bytes.decode(). Modified: python/branches/py3k/Doc/howto/unicode.rst python/branches/py3k/Doc/library/stdtypes.rst Modified: python/branches/py3k/Doc/howto/unicode.rst ============================================================================== --- python/branches/py3k/Doc/howto/unicode.rst (original) +++ python/branches/py3k/Doc/howto/unicode.rst Mon May 4 23:01:20 2009 @@ -234,7 +234,7 @@ Since Python 3.0, the language features a ``str`` type that contain Unicode characters, meaning any string created using ``"unicode rocks!"``, ``'unicode -rocks!``, or the triple-quoted string syntax is stored as Unicode. +rocks!'``, or the triple-quoted string syntax is stored as Unicode. To insert a Unicode character that is not part ASCII, e.g., any letters with accents, one can use escape sequences in their string literals as such:: Modified: python/branches/py3k/Doc/library/stdtypes.rst ============================================================================== --- python/branches/py3k/Doc/library/stdtypes.rst (original) +++ python/branches/py3k/Doc/library/stdtypes.rst Mon May 4 23:01:20 2009 @@ -800,14 +800,14 @@ .. method:: str.encode([encoding[, errors]]) - Return an encoded version of the string. Default encoding is the current - default string encoding. *errors* may be given to set a different error - handling scheme. The default for *errors* is ``'strict'``, meaning that - encoding errors raise a :exc:`UnicodeError`. Other possible values are - ``'ignore'``, ``'replace'``, ``'xmlcharrefreplace'``, ``'backslashreplace'`` and - any other name registered via :func:`codecs.register_error`, see section - :ref:`codec-base-classes`. For a list of possible encodings, see section - :ref:`standard-encodings`. + Return an encoded version of the string as a bytes object. Default encoding + is the current default string encoding. *errors* may be given to set a + different error handling scheme. The default for *errors* is ``'strict'``, + meaning that encoding errors raise a :exc:`UnicodeError`. Other possible + values are ``'ignore'``, ``'replace'``, ``'xmlcharrefreplace'``, + ``'backslashreplace'`` and any other name registered via + :func:`codecs.register_error`, see section :ref:`codec-base-classes`. For a + list of possible encodings, see section :ref:`standard-encodings`. .. method:: str.endswith(suffix[, start[, end]]) @@ -1512,6 +1512,18 @@ b = a.replace(b"a", b"f") +.. method:: bytes.decode([encoding[, errors]]) + bytearray.decode([encoding[, errors]]) + + Return a string decoded from the given bytes. Default encoding is the + current default string encoding. *errors* may be given to set a different + error handling scheme. The default for *errors* is ``'strict'``, meaning + that encoding errors raise a :exc:`UnicodeError`. Other possible values are + ``'ignore'``, ``'replace'`` and any other name registered via + :func:`codecs.register_error`, see section :ref:`codec-base-classes`. For a + list of possible encodings, see section :ref:`standard-encodings`. + + The bytes and bytearray types have an additional class method: .. classmethod:: bytes.fromhex(string) From buildbot at python.org Mon May 4 23:12:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 21:12:06 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090504211207.361261E404C@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/626 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_importlib test_posix Traceback (most recent call last): File "./Lib/test/regrtest.py", line 620, in runtest_inner File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_importlib.py", line 6, in test_main run_unittest(importlib.test.test_suite('importlib.test')) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/__init__.py", line 22, in test_suite package_tests = getattr(sys.modules[package_name], 'test_suite')() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/source/__init__.py", line 8, in test_suite return importlib.test.test_suite('importlib.test.source', directory) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/__init__.py", line 16, in test_suite __import__(module_name, level=0) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/source/test_case_sensitivity.py", line 12, in class CaseSensitivityTest(unittest.TestCase): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/util.py", line 13, in case_insensitive_tests original_name = os.listdir('.')[0] IndexError: list index out of range ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Mon May 4 23:17:17 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 4 May 2009 23:17:17 +0200 (CEST) Subject: [Python-checkins] r72295 - in python/trunk: Lib/zipfile.py Misc/NEWS Message-ID: <20090504211717.AEFA51E400C@bag.python.org> Author: antoine.pitrou Date: Mon May 4 23:17:17 2009 New Revision: 72295 Log: Issue #5692: In :class:`zipfile.Zipfile`, fix wrong path calculation when extracting a file to the root directory. Modified: python/trunk/Lib/zipfile.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/zipfile.py ============================================================================== --- python/trunk/Lib/zipfile.py (original) +++ python/trunk/Lib/zipfile.py Mon May 4 23:17:17 2009 @@ -952,7 +952,9 @@ """ # build the destination pathname, replacing # forward slashes to platform specific separators. - if targetpath[-1:] in (os.path.sep, os.path.altsep): + # Strip trailing path separator, unless it represents the root. + if (targetpath[-1:] in (os.path.sep, os.path.altsep) + and len(os.path.splitdrive(targetpath)[1]) > 1): targetpath = targetpath[:-1] # don't include leading "/" from file name if present Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon May 4 23:17:17 2009 @@ -269,6 +269,9 @@ Library ------- +- Issue #5692: In :class:`zipfile.Zipfile`, fix wrong path calculation when + extracting a file to the root directory. + - Issue #5913: os.listdir() should fail for empty path on windows. - Issue #5084: unpickling now interns the attribute names of pickled objects, From python-checkins at python.org Mon May 4 23:21:36 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 4 May 2009 23:21:36 +0200 (CEST) Subject: [Python-checkins] r72296 - in python/branches/py3k: Lib/zipfile.py Misc/NEWS Message-ID: <20090504212136.8086D1E400C@bag.python.org> Author: antoine.pitrou Date: Mon May 4 23:21:36 2009 New Revision: 72296 Log: Merged revisions 72295 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72295 | antoine.pitrou | 2009-05-04 23:17:17 +0200 (lun., 04 mai 2009) | 3 lines Issue #5692: In :class:`zipfile.Zipfile`, fix wrong path calculation when extracting a file to the root directory. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/zipfile.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/zipfile.py ============================================================================== --- python/branches/py3k/Lib/zipfile.py (original) +++ python/branches/py3k/Lib/zipfile.py Mon May 4 23:21:36 2009 @@ -959,7 +959,9 @@ """ # build the destination pathname, replacing # forward slashes to platform specific separators. - if targetpath[-1:] in (os.path.sep, os.path.altsep): + # Strip trailing path separator, unless it represents the root. + if (targetpath[-1:] in (os.path.sep, os.path.altsep) + and len(os.path.splitdrive(targetpath)[1]) > 1): targetpath = targetpath[:-1] # don't include leading "/" from file name if present Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon May 4 23:21:36 2009 @@ -112,6 +112,9 @@ Library ------- +- Issue #5692: In :class:`zipfile.Zipfile`, fix wrong path calculation when + extracting a file to the root directory. + - Issue #5913: os.listdir() should fail for empty path on windows. - Issue #5084: unpickling now interns the attribute names of pickled objects, From python-checkins at python.org Mon May 4 23:24:37 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 4 May 2009 23:24:37 +0200 (CEST) Subject: [Python-checkins] r72297 - in python/branches/release26-maint: Lib/zipfile.py Misc/NEWS Message-ID: <20090504212437.95C091E400C@bag.python.org> Author: antoine.pitrou Date: Mon May 4 23:24:37 2009 New Revision: 72297 Log: Merged revisions 72295 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72295 | antoine.pitrou | 2009-05-04 23:17:17 +0200 (lun., 04 mai 2009) | 3 lines Issue #5692: In :class:`zipfile.Zipfile`, fix wrong path calculation when extracting a file to the root directory. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/zipfile.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/zipfile.py ============================================================================== --- python/branches/release26-maint/Lib/zipfile.py (original) +++ python/branches/release26-maint/Lib/zipfile.py Mon May 4 23:24:37 2009 @@ -940,7 +940,9 @@ """ # build the destination pathname, replacing # forward slashes to platform specific separators. - if targetpath[-1:] in (os.path.sep, os.path.altsep): + # Strip trailing path separator, unless it represents the root. + if (targetpath[-1:] in (os.path.sep, os.path.altsep) + and len(os.path.splitdrive(targetpath)[1]) > 1): targetpath = targetpath[:-1] # don't include leading "/" from file name if present Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Mon May 4 23:24:37 2009 @@ -36,6 +36,9 @@ Library ------- +- Issue #5692: In :class:`zipfile.Zipfile`, fix wrong path calculation when + extracting a file to the root directory. + - Issue #2245: aifc now skips chunk types it doesn't recognize, per spec. - Issue #4305: ctypes should now build again on mipsel-linux-gnu From python-checkins at python.org Mon May 4 23:28:12 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 4 May 2009 23:28:12 +0200 (CEST) Subject: [Python-checkins] r72298 - python/branches/py3k/Lib/test/test__locale.py Message-ID: <20090504212812.5EC551E400C@bag.python.org> Author: benjamin.peterson Date: Mon May 4 23:28:12 2009 New Revision: 72298 Log: see if we can get this to work on windows Modified: python/branches/py3k/Lib/test/test__locale.py Modified: python/branches/py3k/Lib/test/test__locale.py ============================================================================== --- python/branches/py3k/Lib/test/test__locale.py (original) +++ python/branches/py3k/Lib/test/test__locale.py Mon May 4 23:28:12 2009 @@ -1,6 +1,7 @@ from test.support import verbose, run_unittest -from _locale import (setlocale, LC_ALL, LC_CTYPE, LC_NUMERIC, RADIXCHAR, THOUSEP, nl_langinfo, - localeconv, Error) +import _locale +from _locale import (setlocale, LC_ALL, LC_CTYPE, LC_NUMERIC, nl_langinfo, + localeconv, Error) import unittest from platform import uname @@ -25,6 +26,10 @@ # value is not known, use '' . known_numerics = {'fr_FR' : (',', ''), 'en_US':('.', ',')} +def needs_radix_and_thousands(func): + return unittest.skipUnless(hasattr(_locale, "RADIXCHAR"), + "needs RADIXCHAR and THOUSEP")(func) + class _LocaleTests(unittest.TestCase): def setUp(self): @@ -53,6 +58,7 @@ calc_type, data_type, set_locale, used_locale)) + @needs_radix_and_thousands def test_lc_numeric_nl_langinfo(self): # Test nl_langinfo against known values for loc in candidate_locales: @@ -61,10 +67,11 @@ setlocale(LC_CTYPE, loc) except Error: continue - for li, lc in ((RADIXCHAR, "decimal_point"), - (THOUSEP, "thousands_sep")): + for li, lc in ((_locale.RADIXCHAR, "decimal_point"), + (_locale.THOUSEP, "thousands_sep")): self.numeric_tester('nl_langinfo', nl_langinfo(li), lc, loc) + @needs_radix_and_thousands def test_lc_numeric_localeconv(self): # Test localeconv against known values for loc in candidate_locales: @@ -73,10 +80,11 @@ setlocale(LC_CTYPE, loc) except Error: continue - for li, lc in ((RADIXCHAR, "decimal_point"), - (THOUSEP, "thousands_sep")): + for li, lc in ((_locale.RADIXCHAR, "decimal_point"), + (_locale.THOUSEP, "thousands_sep")): self.numeric_tester('localeconv', localeconv()[lc], lc, loc) + @needs_radix_and_thousands def test_lc_numeric_basic(self): # Test nl_langinfo against localeconv for loc in candidate_locales: @@ -85,8 +93,8 @@ setlocale(LC_CTYPE, loc) except Error: continue - for li, lc in ((RADIXCHAR, "decimal_point"), - (THOUSEP, "thousands_sep")): + for li, lc in ((_locale.RADIXCHAR, "decimal_point"), + (_locale.THOUSEP, "thousands_sep")): nl_radixchar = nl_langinfo(li) li_radixchar = localeconv()[lc] try: From nnorwitz at gmail.com Mon May 4 23:29:38 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 4 May 2009 17:29:38 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090504212938.GA30050@python.psfb.org> More important issues: ---------------------- test_ssl leaked [0, 0, -403] references, sum=-403 Less important issues: ---------------------- test_asynchat leaked [0, 0, 126] references, sum=126 test_cmd_line leaked [0, -25, 0] references, sum=-25 test_file leaked [0, 84, -84] references, sum=0 test_smtplib leaked [0, 0, 88] references, sum=88 test_socketserver leaked [0, 77, -77] references, sum=0 test_sys leaked [-42, 21, 0] references, sum=-21 test_threading leaked [48, 53, 43] references, sum=144 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 test_xmlrpc leaked [0, 83, -83] references, sum=0 From python-checkins at python.org Tue May 5 00:16:24 2009 From: python-checkins at python.org (r.david.murray) Date: Tue, 5 May 2009 00:16:24 +0200 (CEST) Subject: [Python-checkins] r72299 - in python/trunk: Lib/test/test_property.py Misc/NEWS Objects/descrobject.c Message-ID: <20090504221624.B92ED1E43BC@bag.python.org> Author: r.david.murray Date: Tue May 5 00:16:24 2009 New Revision: 72299 Log: Fix issue 5890: (property subclass shadows __doc__ string) by inserting the __doc__ into the subclass instance __dict__. The fix refactors property_copy to call property_init in such a way that the __doc__ logic is re-executed correctly when getter_doc is 1, thus simplifying property_copy. Modified: python/trunk/Lib/test/test_property.py python/trunk/Misc/NEWS python/trunk/Objects/descrobject.c Modified: python/trunk/Lib/test/test_property.py ============================================================================== --- python/trunk/Lib/test/test_property.py (original) +++ python/trunk/Lib/test/test_property.py Tue May 5 00:16:24 2009 @@ -60,6 +60,22 @@ """The decorator does not use this doc string""" return self._spam +class PropertySubNewGetter(BaseClass): + @BaseClass.spam.getter + def spam(self): + """new docstring""" + return 5 + +class PropertyNewGetter(object): + @property + def spam(self): + """original docstring""" + return 1 + @spam.getter + def spam(self): + """new docstring""" + return 8 + class PropertyTests(unittest.TestCase): def test_property_decorator_baseclass(self): # see #1620 @@ -91,8 +107,106 @@ self.assertEqual(base.__class__.spam.__doc__, "spam spam spam") self.assertEqual(sub.__class__.spam.__doc__, "spam spam spam") + def test_property_getter_doc_override(self): + newgettersub = PropertySubNewGetter() + self.assertEqual(newgettersub.spam, 5) + self.assertEqual(newgettersub.__class__.spam.__doc__, "new docstring") + newgetter = PropertyNewGetter() + self.assertEqual(newgetter.spam, 8) + self.assertEqual(newgetter.__class__.spam.__doc__, "new docstring") + + +# Issue 5890: subclasses of property do not preserve method __doc__ strings +class PropertySub(property): + """This is a subclass of property""" + +class PropertySubSlots(property): + """This is a subclass of property that defines __slots__""" + __slots__ = () + +class PropertySubclassTests(unittest.TestCase): + + def test_docstring_copy(self): + class Foo(object): + @PropertySub + def spam(self): + """spam wrapped in property subclass""" + return 1 + self.assertEqual( + Foo.spam.__doc__, + "spam wrapped in property subclass") + + def test_slots_docstring_copy_exception(self): + try: + class Foo(object): + @PropertySubSlots + def spam(self): + """Trying to copy this docstring will raise an exception""" + return 1 + except AttributeError: + pass + else: + raise Exception("AttributeError not raised") + + def test_property_setter_copies_getter_docstring(self): + class Foo(object): + def __init__(self): self._spam = 1 + @PropertySub + def spam(self): + """spam wrapped in property subclass""" + return self._spam + @spam.setter + def spam(self, value): + """this docstring is ignored""" + self._spam = value + foo = Foo() + self.assertEqual(foo.spam, 1) + foo.spam = 2 + self.assertEqual(foo.spam, 2) + self.assertEqual( + Foo.spam.__doc__, + "spam wrapped in property subclass") + class FooSub(Foo): + @Foo.spam.setter + def spam(self, value): + """another ignored docstring""" + self._spam = 'eggs' + foosub = FooSub() + self.assertEqual(foosub.spam, 1) + foosub.spam = 7 + self.assertEqual(foosub.spam, 'eggs') + self.assertEqual( + FooSub.spam.__doc__, + "spam wrapped in property subclass") + + def test_property_new_getter_new_docstring(self): + + class Foo(object): + @PropertySub + def spam(self): + """a docstring""" + return 1 + @spam.getter + def spam(self): + """a new docstring""" + return 2 + self.assertEqual(Foo.spam.__doc__, "a new docstring") + class FooBase(object): + @PropertySub + def spam(self): + """a docstring""" + return 1 + class Foo2(FooBase): + @FooBase.spam.getter + def spam(self): + """a new docstring""" + return 2 + self.assertEqual(Foo.spam.__doc__, "a new docstring") + + + def test_main(): - run_unittest(PropertyTests) + run_unittest(PropertyTests, PropertySubclassTests) if __name__ == '__main__': test_main() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue May 5 00:16:24 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #5890: in subclasses of 'property' the __doc__ attribute was + shadowed by classtype's, even if it was None. property now + inserts the __doc__ into the subclass instance __dict__. + - Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal sequences. Patch by Nick Barnes and Victor Stinner. Modified: python/trunk/Objects/descrobject.c ============================================================================== --- python/trunk/Objects/descrobject.c (original) +++ python/trunk/Objects/descrobject.c Tue May 5 00:16:24 2009 @@ -1233,25 +1233,19 @@ } if (doc == NULL || doc == Py_None) { Py_XDECREF(doc); - doc = pold->prop_doc ? pold->prop_doc : Py_None; + if (pold->getter_doc && get != Py_None) { + /* make _init use __doc__ from getter */ + doc = Py_None; + } + else { + doc = pold->prop_doc ? pold->prop_doc : Py_None; + } } - + new = PyObject_CallFunction(type, "OOOO", get, set, del, doc); Py_DECREF(type); if (new == NULL) return NULL; - pnew = (propertyobject *)new; - - if (pold->getter_doc && get != Py_None) { - PyObject *get_doc = PyObject_GetAttrString(get, "__doc__"); - if (get_doc != NULL) { - Py_XDECREF(pnew->prop_doc); - pnew->prop_doc = get_doc; /* get_doc already INCREF'd by GetAttr */ - pnew->getter_doc = 1; - } else { - PyErr_Clear(); - } - } return new; } @@ -1288,8 +1282,21 @@ if ((doc == NULL || doc == Py_None) && get != NULL) { PyObject *get_doc = PyObject_GetAttrString(get, "__doc__"); if (get_doc != NULL) { - Py_XDECREF(prop->prop_doc); - prop->prop_doc = get_doc; /* get_doc already INCREF'd by GetAttr */ + /* get_doc already INCREF'd by GetAttr */ + if (Py_TYPE(self)==&PyProperty_Type) { + Py_XDECREF(prop->prop_doc); + prop->prop_doc = get_doc; + } else { + /* Put __doc__ in dict of the subclass instance instead, + otherwise it gets shadowed by class's __doc__. */ + if (PyObject_SetAttrString(self, "__doc__", get_doc) != 0) + { + /* DECREF for props handled by _dealloc */ + Py_DECREF(get_doc); + return -1; + } + Py_DECREF(get_doc); + } prop->getter_doc = 1; } else { PyErr_Clear(); From buildbot at python.org Tue May 5 00:18:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 22:18:57 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090504221857.60F9B1E400C@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/881 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou,georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_os ====================================================================== FAIL: test_update2 (test.test_os.EnvironTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_os.py", line 382, in test_update2 self.assertEquals(value, "World") AssertionError: '' != 'World' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue May 5 00:25:22 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 5 May 2009 00:25:22 +0200 (CEST) Subject: [Python-checkins] r72300 - in python/branches/py3k: Misc/NEWS Modules/_hashopenssl.c Modules/pwdmodule.c Modules/sha256module.c Modules/sha512module.c Message-ID: <20090504222522.A7E681E43F4@bag.python.org> Author: benjamin.peterson Date: Tue May 5 00:25:21 2009 New Revision: 72300 Log: remove old undocumented compat interfaces in hashlib and pwd #5881 Modified: python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_hashopenssl.c python/branches/py3k/Modules/pwdmodule.c python/branches/py3k/Modules/sha256module.c python/branches/py3k/Modules/sha512module.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue May 5 00:25:21 2009 @@ -176,6 +176,9 @@ Extension Modules ----------------- +- Issue #5881: Remove old undocumented compatibility interfaces in hashlib and + pwd. + - Issue #5463: In struct module, remove deprecated float coercion for integer type codes: struct.pack('L', 0.3) should now raise an error. The _PY_STRUCT_FLOAT_COERCE constant has been removed. Modified: python/branches/py3k/Modules/_hashopenssl.c ============================================================================== --- python/branches/py3k/Modules/_hashopenssl.c (original) +++ python/branches/py3k/Modules/_hashopenssl.c Tue May 5 00:25:21 2009 @@ -281,12 +281,6 @@ (getter)EVP_get_block_size, NULL, NULL, NULL}, - /* the old md5 and sha modules support 'digest_size' as in PEP 247. - * the old sha module also supported 'digestsize'. ugh. */ - {"digestsize", - (getter)EVP_get_digest_size, NULL, - NULL, - NULL}, {NULL} /* Sentinel */ }; Modified: python/branches/py3k/Modules/pwdmodule.c ============================================================================== --- python/branches/py3k/Modules/pwdmodule.c (original) +++ python/branches/py3k/Modules/pwdmodule.c Tue May 5 00:25:21 2009 @@ -203,13 +203,12 @@ if (m == NULL) return NULL; - if (!initialized) + if (!initialized) { PyStructSequence_InitType(&StructPwdType, &struct_pwd_type_desc); + initialized = 1; + } Py_INCREF((PyObject *) &StructPwdType); PyModule_AddObject(m, "struct_passwd", (PyObject *) &StructPwdType); - /* And for b/w compatibility (this was defined by mistake): */ - PyModule_AddObject(m, "struct_pwent", (PyObject *) &StructPwdType); - initialized = 1; return m; } Modified: python/branches/py3k/Modules/sha256module.c ============================================================================== --- python/branches/py3k/Modules/sha256module.c (original) +++ python/branches/py3k/Modules/sha256module.c Tue May 5 00:25:21 2009 @@ -533,9 +533,6 @@ static PyMemberDef SHA_members[] = { {"digest_size", T_INT, offsetof(SHAobject, digestsize), READONLY, NULL}, - /* the old md5 and sha modules support 'digest_size' as in PEP 247. - * the old sha module also supported 'digestsize'. ugh. */ - {"digestsize", T_INT, offsetof(SHAobject, digestsize), READONLY, NULL}, {NULL} /* Sentinel */ }; Modified: python/branches/py3k/Modules/sha512module.c ============================================================================== --- python/branches/py3k/Modules/sha512module.c (original) +++ python/branches/py3k/Modules/sha512module.c Tue May 5 00:25:21 2009 @@ -599,9 +599,6 @@ static PyMemberDef SHA_members[] = { {"digest_size", T_INT, offsetof(SHAobject, digestsize), READONLY, NULL}, - /* the old md5 and sha modules support 'digest_size' as in PEP 247. - * the old sha module also supported 'digestsize'. ugh. */ - {"digestsize", T_INT, offsetof(SHAobject, digestsize), READONLY, NULL}, {NULL} /* Sentinel */ }; From buildbot at python.org Tue May 5 00:39:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 22:39:46 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090504223946.9446F1E408A@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/742 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou,georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_mailbox test_os test_time ====================================================================== FAIL: test_update2 (test.test_os.EnvironTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_os.py", line 382, in test_update2 self.assertEquals(value, "World") AssertionError: '' != 'World' ====================================================================== FAIL: test_tzset (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_time.py", line 166, in test_tzset self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) AssertionError: time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) == time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue May 5 00:59:07 2009 From: python-checkins at python.org (r.david.murray) Date: Tue, 5 May 2009 00:59:07 +0200 (CEST) Subject: [Python-checkins] r72301 - in python/branches/py3k: Lib/test/test_property.py Misc/NEWS Objects/descrobject.c Message-ID: <20090504225907.5C3A71E408A@bag.python.org> Author: r.david.murray Date: Tue May 5 00:59:07 2009 New Revision: 72301 Log: Merged revisions 72299 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72299 | r.david.murray | 2009-05-04 18:16:24 -0400 (Mon, 04 May 2009) | 7 lines Fix issue 5890: (property subclass shadows __doc__ string) by inserting the __doc__ into the subclass instance __dict__. The fix refactors property_copy to call property_init in such a way that the __doc__ logic is re-executed correctly when getter_doc is 1, thus simplifying property_copy. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_property.py python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/descrobject.c Modified: python/branches/py3k/Lib/test/test_property.py ============================================================================== --- python/branches/py3k/Lib/test/test_property.py (original) +++ python/branches/py3k/Lib/test/test_property.py Tue May 5 00:59:07 2009 @@ -60,6 +60,22 @@ """The decorator does not use this doc string""" return self._spam +class PropertySubNewGetter(BaseClass): + @BaseClass.spam.getter + def spam(self): + """new docstring""" + return 5 + +class PropertyNewGetter(object): + @property + def spam(self): + """original docstring""" + return 1 + @spam.getter + def spam(self): + """new docstring""" + return 8 + class PropertyTests(unittest.TestCase): def test_property_decorator_baseclass(self): # see #1620 @@ -91,8 +107,106 @@ self.assertEqual(base.__class__.spam.__doc__, "spam spam spam") self.assertEqual(sub.__class__.spam.__doc__, "spam spam spam") + def test_property_getter_doc_override(self): + newgettersub = PropertySubNewGetter() + self.assertEqual(newgettersub.spam, 5) + self.assertEqual(newgettersub.__class__.spam.__doc__, "new docstring") + newgetter = PropertyNewGetter() + self.assertEqual(newgetter.spam, 8) + self.assertEqual(newgetter.__class__.spam.__doc__, "new docstring") + + +# Issue 5890: subclasses of property do not preserve method __doc__ strings +class PropertySub(property): + """This is a subclass of property""" + +class PropertySubSlots(property): + """This is a subclass of property that defines __slots__""" + __slots__ = () + +class PropertySubclassTests(unittest.TestCase): + + def test_docstring_copy(self): + class Foo(object): + @PropertySub + def spam(self): + """spam wrapped in property subclass""" + return 1 + self.assertEqual( + Foo.spam.__doc__, + "spam wrapped in property subclass") + + def test_slots_docstring_copy_exception(self): + try: + class Foo(object): + @PropertySubSlots + def spam(self): + """Trying to copy this docstring will raise an exception""" + return 1 + except AttributeError: + pass + else: + raise Exception("AttributeError not raised") + + def test_property_setter_copies_getter_docstring(self): + class Foo(object): + def __init__(self): self._spam = 1 + @PropertySub + def spam(self): + """spam wrapped in property subclass""" + return self._spam + @spam.setter + def spam(self, value): + """this docstring is ignored""" + self._spam = value + foo = Foo() + self.assertEqual(foo.spam, 1) + foo.spam = 2 + self.assertEqual(foo.spam, 2) + self.assertEqual( + Foo.spam.__doc__, + "spam wrapped in property subclass") + class FooSub(Foo): + @Foo.spam.setter + def spam(self, value): + """another ignored docstring""" + self._spam = 'eggs' + foosub = FooSub() + self.assertEqual(foosub.spam, 1) + foosub.spam = 7 + self.assertEqual(foosub.spam, 'eggs') + self.assertEqual( + FooSub.spam.__doc__, + "spam wrapped in property subclass") + + def test_property_new_getter_new_docstring(self): + + class Foo(object): + @PropertySub + def spam(self): + """a docstring""" + return 1 + @spam.getter + def spam(self): + """a new docstring""" + return 2 + self.assertEqual(Foo.spam.__doc__, "a new docstring") + class FooBase(object): + @PropertySub + def spam(self): + """a docstring""" + return 1 + class Foo2(FooBase): + @FooBase.spam.getter + def spam(self): + """a new docstring""" + return 2 + self.assertEqual(Foo.spam.__doc__, "a new docstring") + + + def test_main(): - run_unittest(PropertyTests) + run_unittest(PropertyTests, PropertySubclassTests) if __name__ == '__main__': test_main() Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue May 5 00:59:07 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #5890: in subclasses of 'property' the __doc__ attribute was + shadowed by classtype's, even if it was None. property now + inserts the __doc__ into the subclass instance __dict__. + - Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal sequences. Patch by Nick Barnes and Victor Stinner. Modified: python/branches/py3k/Objects/descrobject.c ============================================================================== --- python/branches/py3k/Objects/descrobject.c (original) +++ python/branches/py3k/Objects/descrobject.c Tue May 5 00:59:07 2009 @@ -1246,25 +1246,19 @@ } if (doc == NULL || doc == Py_None) { Py_XDECREF(doc); - doc = pold->prop_doc ? pold->prop_doc : Py_None; + if (pold->getter_doc && get != Py_None) { + /* make _init use __doc__ from getter */ + doc = Py_None; + } + else { + doc = pold->prop_doc ? pold->prop_doc : Py_None; + } } - + new = PyObject_CallFunction(type, "OOOO", get, set, del, doc); Py_DECREF(type); if (new == NULL) return NULL; - pnew = (propertyobject *)new; - - if (pold->getter_doc && get != Py_None) { - PyObject *get_doc = PyObject_GetAttrString(get, "__doc__"); - if (get_doc != NULL) { - Py_XDECREF(pnew->prop_doc); - pnew->prop_doc = get_doc; /* get_doc already INCREF'd by GetAttr */ - pnew->getter_doc = 1; - } else { - PyErr_Clear(); - } - } return new; } @@ -1301,8 +1295,21 @@ if ((doc == NULL || doc == Py_None) && get != NULL) { PyObject *get_doc = PyObject_GetAttrString(get, "__doc__"); if (get_doc != NULL) { - Py_XDECREF(prop->prop_doc); - prop->prop_doc = get_doc; /* get_doc already INCREF'd by GetAttr */ + /* get_doc already INCREF'd by GetAttr */ + if (Py_TYPE(self)==&PyProperty_Type) { + Py_XDECREF(prop->prop_doc); + prop->prop_doc = get_doc; + } else { + /* Put __doc__ in dict of the subclass instance instead, + otherwise it gets shadowed by class's __doc__. */ + if (PyObject_SetAttrString(self, "__doc__", get_doc) != 0) + { + /* DECREF for props handled by _dealloc */ + Py_DECREF(get_doc); + return -1; + } + Py_DECREF(get_doc); + } prop->getter_doc = 1; } else { PyErr_Clear(); From buildbot at python.org Tue May 5 01:18:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 23:18:22 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090504231822.D82E11E4496@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1244 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_os make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue May 5 01:46:16 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 04 May 2009 23:46:16 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090504234616.BB0E51E406C@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/884 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_time ====================================================================== FAIL: test_update2 (test.test_os.EnvironTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_os.py", line 382, in test_update2 self.assertEquals(value, "World") AssertionError: '' != 'World' ====================================================================== FAIL: test_tzset (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_time.py", line 166, in test_tzset self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) AssertionError: time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) == time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue May 5 02:52:14 2009 From: python-checkins at python.org (r.david.murray) Date: Tue, 5 May 2009 02:52:14 +0200 (CEST) Subject: [Python-checkins] r72302 - in python/branches/release26-maint: Lib/test/test_property.py Misc/NEWS Objects/descrobject.c Message-ID: <20090505005214.DABB21E403C@bag.python.org> Author: r.david.murray Date: Tue May 5 02:52:14 2009 New Revision: 72302 Log: Merged revisions 72299 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72299 | r.david.murray | 2009-05-04 18:16:24 -0400 (Mon, 04 May 2009) | 7 lines Fix issue 5890: (property subclass shadows __doc__ string) by inserting the __doc__ into the subclass instance __dict__. The fix refactors property_copy to call property_init in such a way that the __doc__ logic is re-executed correctly when getter_doc is 1, thus simplifying property_copy. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_property.py python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Objects/descrobject.c Modified: python/branches/release26-maint/Lib/test/test_property.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_property.py (original) +++ python/branches/release26-maint/Lib/test/test_property.py Tue May 5 02:52:14 2009 @@ -60,6 +60,22 @@ """The decorator does not use this doc string""" return self._spam +class PropertySubNewGetter(BaseClass): + @BaseClass.spam.getter + def spam(self): + """new docstring""" + return 5 + +class PropertyNewGetter(object): + @property + def spam(self): + """original docstring""" + return 1 + @spam.getter + def spam(self): + """new docstring""" + return 8 + class PropertyTests(unittest.TestCase): def test_property_decorator_baseclass(self): # see #1620 @@ -91,8 +107,106 @@ self.assertEqual(base.__class__.spam.__doc__, "spam spam spam") self.assertEqual(sub.__class__.spam.__doc__, "spam spam spam") + def test_property_getter_doc_override(self): + newgettersub = PropertySubNewGetter() + self.assertEqual(newgettersub.spam, 5) + self.assertEqual(newgettersub.__class__.spam.__doc__, "new docstring") + newgetter = PropertyNewGetter() + self.assertEqual(newgetter.spam, 8) + self.assertEqual(newgetter.__class__.spam.__doc__, "new docstring") + + +# Issue 5890: subclasses of property do not preserve method __doc__ strings +class PropertySub(property): + """This is a subclass of property""" + +class PropertySubSlots(property): + """This is a subclass of property that defines __slots__""" + __slots__ = () + +class PropertySubclassTests(unittest.TestCase): + + def test_docstring_copy(self): + class Foo(object): + @PropertySub + def spam(self): + """spam wrapped in property subclass""" + return 1 + self.assertEqual( + Foo.spam.__doc__, + "spam wrapped in property subclass") + + def test_slots_docstring_copy_exception(self): + try: + class Foo(object): + @PropertySubSlots + def spam(self): + """Trying to copy this docstring will raise an exception""" + return 1 + except AttributeError: + pass + else: + raise Exception("AttributeError not raised") + + def test_property_setter_copies_getter_docstring(self): + class Foo(object): + def __init__(self): self._spam = 1 + @PropertySub + def spam(self): + """spam wrapped in property subclass""" + return self._spam + @spam.setter + def spam(self, value): + """this docstring is ignored""" + self._spam = value + foo = Foo() + self.assertEqual(foo.spam, 1) + foo.spam = 2 + self.assertEqual(foo.spam, 2) + self.assertEqual( + Foo.spam.__doc__, + "spam wrapped in property subclass") + class FooSub(Foo): + @Foo.spam.setter + def spam(self, value): + """another ignored docstring""" + self._spam = 'eggs' + foosub = FooSub() + self.assertEqual(foosub.spam, 1) + foosub.spam = 7 + self.assertEqual(foosub.spam, 'eggs') + self.assertEqual( + FooSub.spam.__doc__, + "spam wrapped in property subclass") + + def test_property_new_getter_new_docstring(self): + + class Foo(object): + @PropertySub + def spam(self): + """a docstring""" + return 1 + @spam.getter + def spam(self): + """a new docstring""" + return 2 + self.assertEqual(Foo.spam.__doc__, "a new docstring") + class FooBase(object): + @PropertySub + def spam(self): + """a docstring""" + return 1 + class Foo2(FooBase): + @FooBase.spam.getter + def spam(self): + """a new docstring""" + return 2 + self.assertEqual(Foo.spam.__doc__, "a new docstring") + + + def test_main(): - run_unittest(PropertyTests) + run_unittest(PropertyTests, PropertySubclassTests) if __name__ == '__main__': test_main() Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Tue May 5 02:52:14 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #5890: in subclasses of 'property' the __doc__ attribute was + shadowed by classtype's, even if it was None. property now + inserts the __doc__ into the subclass instance __dict__. + - Issue #5724: (See also issue #4575.) Fix Py_IS_INFINITY macro to work correctly on x87 FPUs: it now forces its argument to double before testing for infinity. Modified: python/branches/release26-maint/Objects/descrobject.c ============================================================================== --- python/branches/release26-maint/Objects/descrobject.c (original) +++ python/branches/release26-maint/Objects/descrobject.c Tue May 5 02:52:14 2009 @@ -1233,25 +1233,19 @@ } if (doc == NULL || doc == Py_None) { Py_XDECREF(doc); - doc = pold->prop_doc ? pold->prop_doc : Py_None; + if (pold->getter_doc && get != Py_None) { + /* make _init use __doc__ from getter */ + doc = Py_None; + } + else { + doc = pold->prop_doc ? pold->prop_doc : Py_None; + } } - + new = PyObject_CallFunction(type, "OOOO", get, set, del, doc); Py_DECREF(type); if (new == NULL) return NULL; - pnew = (propertyobject *)new; - - if (pold->getter_doc && get != Py_None) { - PyObject *get_doc = PyObject_GetAttrString(get, "__doc__"); - if (get_doc != NULL) { - Py_XDECREF(pnew->prop_doc); - pnew->prop_doc = get_doc; /* get_doc already INCREF'd by GetAttr */ - pnew->getter_doc = 1; - } else { - PyErr_Clear(); - } - } return new; } @@ -1288,8 +1282,21 @@ if ((doc == NULL || doc == Py_None) && get != NULL) { PyObject *get_doc = PyObject_GetAttrString(get, "__doc__"); if (get_doc != NULL) { - Py_XDECREF(prop->prop_doc); - prop->prop_doc = get_doc; /* get_doc already INCREF'd by GetAttr */ + /* get_doc already INCREF'd by GetAttr */ + if (Py_TYPE(self)==&PyProperty_Type) { + Py_XDECREF(prop->prop_doc); + prop->prop_doc = get_doc; + } else { + /* Put __doc__ in dict of the subclass instance instead, + otherwise it gets shadowed by class's __doc__. */ + if (PyObject_SetAttrString(self, "__doc__", get_doc) != 0) + { + /* DECREF for props handled by _dealloc */ + Py_DECREF(get_doc); + return -1; + } + Py_DECREF(get_doc); + } prop->getter_doc = 1; } else { PyErr_Clear(); From python-checkins at python.org Tue May 5 02:55:24 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 5 May 2009 02:55:24 +0200 (CEST) Subject: [Python-checkins] r72303 - python/trunk/Lib/collections.py Message-ID: <20090505005524.AE0A41E403C@bag.python.org> Author: benjamin.peterson Date: Tue May 5 02:55:24 2009 New Revision: 72303 Log: using sys._getframe(x), where x > 0 doesnt' work on IronPython Modified: python/trunk/Lib/collections.py Modified: python/trunk/Lib/collections.py ============================================================================== --- python/trunk/Lib/collections.py (original) +++ python/trunk/Lib/collections.py Tue May 5 02:55:24 2009 @@ -268,9 +268,12 @@ # For pickling to work, the __module__ variable needs to be set to the frame # where the named tuple is created. Bypass this step in enviroments where - # sys._getframe is not defined (Jython for example). - if hasattr(_sys, '_getframe'): + # sys._getframe is not defined (Jython for example) or sys._getframe is not + # defined for arguments greater than 0 (IronPython). + try: result.__module__ = _sys._getframe(1).f_globals.get('__name__', '__main__') + except (AttributeError, ValueError): + pass return result From python-checkins at python.org Tue May 5 03:01:52 2009 From: python-checkins at python.org (r.david.murray) Date: Tue, 5 May 2009 03:01:52 +0200 (CEST) Subject: [Python-checkins] r72304 - in python/branches/release30-maint: Lib/test/test_property.py Misc/NEWS Objects/descrobject.c Message-ID: <20090505010152.AD7CC1E403C@bag.python.org> Author: r.david.murray Date: Tue May 5 03:01:52 2009 New Revision: 72304 Log: Merged revisions 72301 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72301 | r.david.murray | 2009-05-04 18:59:07 -0400 (Mon, 04 May 2009) | 13 lines Merged revisions 72299 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72299 | r.david.murray | 2009-05-04 18:16:24 -0400 (Mon, 04 May 2009) | 7 lines Fix issue 5890: (property subclass shadows __doc__ string) by inserting the __doc__ into the subclass instance __dict__. The fix refactors property_copy to call property_init in such a way that the __doc__ logic is re-executed correctly when getter_doc is 1, thus simplifying property_copy. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_property.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Objects/descrobject.c Modified: python/branches/release30-maint/Lib/test/test_property.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_property.py (original) +++ python/branches/release30-maint/Lib/test/test_property.py Tue May 5 03:01:52 2009 @@ -60,6 +60,22 @@ """The decorator does not use this doc string""" return self._spam +class PropertySubNewGetter(BaseClass): + @BaseClass.spam.getter + def spam(self): + """new docstring""" + return 5 + +class PropertyNewGetter(object): + @property + def spam(self): + """original docstring""" + return 1 + @spam.getter + def spam(self): + """new docstring""" + return 8 + class PropertyTests(unittest.TestCase): def test_property_decorator_baseclass(self): # see #1620 @@ -91,8 +107,106 @@ self.assertEqual(base.__class__.spam.__doc__, "spam spam spam") self.assertEqual(sub.__class__.spam.__doc__, "spam spam spam") + def test_property_getter_doc_override(self): + newgettersub = PropertySubNewGetter() + self.assertEqual(newgettersub.spam, 5) + self.assertEqual(newgettersub.__class__.spam.__doc__, "new docstring") + newgetter = PropertyNewGetter() + self.assertEqual(newgetter.spam, 8) + self.assertEqual(newgetter.__class__.spam.__doc__, "new docstring") + + +# Issue 5890: subclasses of property do not preserve method __doc__ strings +class PropertySub(property): + """This is a subclass of property""" + +class PropertySubSlots(property): + """This is a subclass of property that defines __slots__""" + __slots__ = () + +class PropertySubclassTests(unittest.TestCase): + + def test_docstring_copy(self): + class Foo(object): + @PropertySub + def spam(self): + """spam wrapped in property subclass""" + return 1 + self.assertEqual( + Foo.spam.__doc__, + "spam wrapped in property subclass") + + def test_slots_docstring_copy_exception(self): + try: + class Foo(object): + @PropertySubSlots + def spam(self): + """Trying to copy this docstring will raise an exception""" + return 1 + except AttributeError: + pass + else: + raise Exception("AttributeError not raised") + + def test_property_setter_copies_getter_docstring(self): + class Foo(object): + def __init__(self): self._spam = 1 + @PropertySub + def spam(self): + """spam wrapped in property subclass""" + return self._spam + @spam.setter + def spam(self, value): + """this docstring is ignored""" + self._spam = value + foo = Foo() + self.assertEqual(foo.spam, 1) + foo.spam = 2 + self.assertEqual(foo.spam, 2) + self.assertEqual( + Foo.spam.__doc__, + "spam wrapped in property subclass") + class FooSub(Foo): + @Foo.spam.setter + def spam(self, value): + """another ignored docstring""" + self._spam = 'eggs' + foosub = FooSub() + self.assertEqual(foosub.spam, 1) + foosub.spam = 7 + self.assertEqual(foosub.spam, 'eggs') + self.assertEqual( + FooSub.spam.__doc__, + "spam wrapped in property subclass") + + def test_property_new_getter_new_docstring(self): + + class Foo(object): + @PropertySub + def spam(self): + """a docstring""" + return 1 + @spam.getter + def spam(self): + """a new docstring""" + return 2 + self.assertEqual(Foo.spam.__doc__, "a new docstring") + class FooBase(object): + @PropertySub + def spam(self): + """a docstring""" + return 1 + class Foo2(FooBase): + @FooBase.spam.getter + def spam(self): + """a new docstring""" + return 2 + self.assertEqual(Foo.spam.__doc__, "a new docstring") + + + def test_main(): - run_unittest(PropertyTests) + run_unittest(PropertyTests, PropertySubclassTests) if __name__ == '__main__': test_main() Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Tue May 5 03:01:52 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #5890: in subclasses of 'property' the __doc__ attribute was + shadowed by classtype's, even if it was None. property now + inserts the __doc__ into the subclass instance __dict__. + - Issue #5724: (See also issue #4575.) Fix Py_IS_INFINITY macro to work correctly on x87 FPUs: it now forces its argument to double before testing for infinity. Modified: python/branches/release30-maint/Objects/descrobject.c ============================================================================== --- python/branches/release30-maint/Objects/descrobject.c (original) +++ python/branches/release30-maint/Objects/descrobject.c Tue May 5 03:01:52 2009 @@ -1246,25 +1246,19 @@ } if (doc == NULL || doc == Py_None) { Py_XDECREF(doc); - doc = pold->prop_doc ? pold->prop_doc : Py_None; + if (pold->getter_doc && get != Py_None) { + /* make _init use __doc__ from getter */ + doc = Py_None; + } + else { + doc = pold->prop_doc ? pold->prop_doc : Py_None; + } } - + new = PyObject_CallFunction(type, "OOOO", get, set, del, doc); Py_DECREF(type); if (new == NULL) return NULL; - pnew = (propertyobject *)new; - - if (pold->getter_doc && get != Py_None) { - PyObject *get_doc = PyObject_GetAttrString(get, "__doc__"); - if (get_doc != NULL) { - Py_XDECREF(pnew->prop_doc); - pnew->prop_doc = get_doc; /* get_doc already INCREF'd by GetAttr */ - pnew->getter_doc = 1; - } else { - PyErr_Clear(); - } - } return new; } @@ -1301,8 +1295,21 @@ if ((doc == NULL || doc == Py_None) && get != NULL) { PyObject *get_doc = PyObject_GetAttrString(get, "__doc__"); if (get_doc != NULL) { - Py_XDECREF(prop->prop_doc); - prop->prop_doc = get_doc; /* get_doc already INCREF'd by GetAttr */ + /* get_doc already INCREF'd by GetAttr */ + if (Py_TYPE(self)==&PyProperty_Type) { + Py_XDECREF(prop->prop_doc); + prop->prop_doc = get_doc; + } else { + /* Put __doc__ in dict of the subclass instance instead, + otherwise it gets shadowed by class's __doc__. */ + if (PyObject_SetAttrString(self, "__doc__", get_doc) != 0) + { + /* DECREF for props handled by _dealloc */ + Py_DECREF(get_doc); + return -1; + } + Py_DECREF(get_doc); + } prop->getter_doc = 1; } else { PyErr_Clear(); From python-checkins at python.org Tue May 5 03:11:21 2009 From: python-checkins at python.org (r.david.murray) Date: Tue, 5 May 2009 03:11:21 +0200 (CEST) Subject: [Python-checkins] r72305 - in python/branches/release26-maint: Doc/library/turtle.rst Message-ID: <20090505011121.E9F071E403C@bag.python.org> Author: r.david.murray Date: Tue May 5 03:11:21 2009 New Revision: 72305 Log: Merged revisions 72149 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72149 | r.david.murray | 2009-04-30 08:42:32 -0400 (Thu, 30 Apr 2009) | 4 lines Make the turtle.rst doctests pass. I have a feeling there should be more cleanup, but I don't know now to kill turtles. Especially unexpected ones... ;) ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/library/turtle.rst Modified: python/branches/release26-maint/Doc/library/turtle.rst ============================================================================== --- python/branches/release26-maint/Doc/library/turtle.rst (original) +++ python/branches/release26-maint/Doc/library/turtle.rst Tue May 5 03:11:21 2009 @@ -6,6 +6,11 @@ :synopsis: Turtle graphics for Tk .. sectionauthor:: Gregor Lingl +.. testsetup:: default + + from turtle import * + turtle = Turtle() + Introduction ============ @@ -223,14 +228,16 @@ Move the turtle forward by the specified *distance*, in the direction the turtle is headed. - >>> turtle.position() - (0.00, 0.00) - >>> turtle.forward(25) - >>> turtle.position() - (25.00,0.00) - >>> turtle.forward(-75) - >>> turtle.position() - (-50.00,0.00) + .. doctest:: + + >>> turtle.position() + (0.00,0.00) + >>> turtle.forward(25) + >>> turtle.position() + (25.00,0.00) + >>> turtle.forward(-75) + >>> turtle.position() + (-50.00,0.00) .. function:: back(distance) @@ -242,11 +249,18 @@ Move the turtle backward by *distance*, opposite to the direction the turtle is headed. Do not change the turtle's heading. - >>> turtle.position() - (0.00, 0.00) - >>> turtle.backward(30) - >>> turtle.position() - (-30.00, 0.00) + .. doctest:: + :hide: + + >>> turtle.goto(0, 0) + + .. doctest:: + + >>> turtle.position() + (0.00,0.00) + >>> turtle.backward(30) + >>> turtle.position() + (-30.00,0.00) .. function:: right(angle) @@ -258,11 +272,18 @@ can be set via the :func:`degrees` and :func:`radians` functions.) Angle orientation depends on the turtle mode, see :func:`mode`. - >>> turtle.heading() - 22.0 - >>> turtle.right(45) - >>> turtle.heading() - 337.0 + .. doctest:: + :hide: + + >>> turtle.setheading(22) + + .. doctest:: + + >>> turtle.heading() + 22.0 + >>> turtle.right(45) + >>> turtle.heading() + 337.0 .. function:: left(angle) @@ -274,37 +295,52 @@ can be set via the :func:`degrees` and :func:`radians` functions.) Angle orientation depends on the turtle mode, see :func:`mode`. - >>> turtle.heading() - 22.0 - >>> turtle.left(45) - >>> turtle.heading() - 67.0 + .. doctest:: + :hide: + + >>> turtle.setheading(22) + + .. doctest:: + + >>> turtle.heading() + 22.0 + >>> turtle.left(45) + >>> turtle.heading() + 67.0 + .. function:: goto(x, y=None) setpos(x, y=None) setposition(x, y=None) - :param x: a number or a pair/vector of numbers - :param y: a number or ``None`` + :param x: a number or a pair/vector of numbers + :param y: a number or ``None`` - If *y* is ``None``, *x* must be a pair of coordinates or a :class:`Vec2D` - (e.g. as returned by :func:`pos`). + If *y* is ``None``, *x* must be a pair of coordinates or a :class:`Vec2D` + (e.g. as returned by :func:`pos`). - Move turtle to an absolute position. If the pen is down, draw line. Do - not change the turtle's orientation. + Move turtle to an absolute position. If the pen is down, draw line. Do + not change the turtle's orientation. - >>> tp = turtle.pos() - >>> tp - (0.00, 0.00) - >>> turtle.setpos(60,30) - >>> turtle.pos() - (60.00,30.00) - >>> turtle.setpos((20,80)) - >>> turtle.pos() - (20.00,80.00) - >>> turtle.setpos(tp) - >>> turtle.pos() - (0.00,0.00) + .. doctest:: + :hide: + + >>> turtle.goto(0, 0) + + .. doctest:: + + >>> tp = turtle.pos() + >>> tp + (0.00,0.00) + >>> turtle.setpos(60,30) + >>> turtle.pos() + (60.00,30.00) + >>> turtle.setpos((20,80)) + >>> turtle.pos() + (20.00,80.00) + >>> turtle.setpos(tp) + >>> turtle.pos() + (0.00,0.00) .. function:: setx(x) @@ -314,11 +350,18 @@ Set the turtle's first coordinate to *x*, leave second coordinate unchanged. - >>> turtle.position() - (0.00, 240.00) - >>> turtle.setx(10) - >>> turtle.position() - (10.00, 240.00) + .. doctest:: + :hide: + + >>> turtle.goto(0, 240) + + .. doctest:: + + >>> turtle.position() + (0.00,240.00) + >>> turtle.setx(10) + >>> turtle.position() + (10.00,240.00) .. function:: sety(y) @@ -327,11 +370,18 @@ Set the turtle's second coordinate to *y*, leave first coordinate unchanged. - >>> turtle.position() - (0.00, 40.00) - >>> turtle.sety(-10) - >>> turtle.position() - (0.00, -10.00) + .. doctest:: + :hide: + + >>> turtle.goto(0, 40) + + .. doctest:: + + >>> turtle.position() + (0.00,40.00) + >>> turtle.sety(-10) + >>> turtle.position() + (0.00,-10.00) .. function:: setheading(to_angle) @@ -351,9 +401,11 @@ 270 - south 270 - west =================== ==================== - >>> turtle.setheading(90) - >>> turtle.heading() - 90 + .. doctest:: + + >>> turtle.setheading(90) + >>> turtle.heading() + 90.0 .. function:: home() @@ -361,6 +413,24 @@ Move turtle to the origin -- coordinates (0,0) -- and set its heading to its start-orientation (which depends on the mode, see :func:`mode`). + .. doctest:: + :hide: + + >>> turtle.setheading(90) + >>> turtle.goto(0, -10) + + .. doctest:: + + >>> turtle.heading() + 90.0 + >>> turtle.position() + (0.00,-10.00) + >>> turtle.home() + >>> turtle.position() + (0.00,0.00) + >>> turtle.heading() + 0.0 + .. function:: circle(radius, extent=None, steps=None) @@ -380,8 +450,23 @@ determines the number of steps to use. If not given, it will be calculated automatically. May be used to draw regular polygons. - >>> turtle.circle(50) - >>> turtle.circle(120, 180) # draw a semicircle + .. doctest:: + + >>> turtle.home() + >>> turtle.position() + (0.00,0.00) + >>> turtle.heading() + 0.0 + >>> turtle.circle(50) + >>> turtle.position() + (-0.00,0.00) + >>> turtle.heading() + 0.0 + >>> turtle.circle(120, 180) # draw a semicircle + >>> turtle.position() + (0.00,240.00) + >>> turtle.heading() + 180.0 .. function:: dot(size=None, *color) @@ -392,8 +477,16 @@ Draw a circular dot with diameter *size*, using *color*. If *size* is not given, the maximum of pensize+4 and 2*pensize is used. - >>> turtle.dot() - >>> turtle.fd(50); turtle.dot(20, "blue"); turtle.fd(50) + + .. doctest:: + + >>> turtle.home() + >>> turtle.dot() + >>> turtle.fd(50); turtle.dot(20, "blue"); turtle.fd(50) + >>> turtle.position() + (100.00,-0.00) + >>> turtle.heading() + 0.0 .. function:: stamp() @@ -402,10 +495,12 @@ position. Return a stamp_id for that stamp, which can be used to delete it by calling ``clearstamp(stamp_id)``. - >>> turtle.color("blue") - >>> turtle.stamp() - 13 - >>> turtle.fd(50) + .. doctest:: + + >>> turtle.color("blue") + >>> turtle.stamp() + 11 + >>> turtle.fd(50) .. function:: clearstamp(stampid) @@ -415,10 +510,18 @@ Delete stamp with given *stampid*. - >>> turtle.color("blue") - >>> astamp = turtle.stamp() - >>> turtle.fd(50) - >>> turtle.clearstamp(astamp) + .. doctest:: + + >>> turtle.position() + (150.00,-0.00) + >>> turtle.color("blue") + >>> astamp = turtle.stamp() + >>> turtle.fd(50) + >>> turtle.position() + (200.00,-0.00) + >>> turtle.clearstamp(astamp) + >>> turtle.position() + (200.00,-0.00) .. function:: clearstamps(n=None) @@ -429,11 +532,21 @@ all stamps, if *n* > 0 delete first *n* stamps, else if *n* < 0 delete last *n* stamps. - >>> for i in range(8): - ... turtle.stamp(); turtle.fd(30) - >>> turtle.clearstamps(2) - >>> turtle.clearstamps(-2) - >>> turtle.clearstamps() + .. doctest:: + + >>> for i in range(8): + ... turtle.stamp(); turtle.fd(30) + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + >>> turtle.clearstamps(2) + >>> turtle.clearstamps(-2) + >>> turtle.clearstamps() .. function:: undo() @@ -441,11 +554,13 @@ Undo (repeatedly) the last turtle action(s). Number of available undo actions is determined by the size of the undobuffer. - >>> for i in range(4): - ... turtle.fd(50); turtle.lt(80) - ... - >>> for i in range(8): - ... turtle.undo() + .. doctest:: + + >>> for i in range(4): + ... turtle.fd(50); turtle.lt(80) + ... + >>> for i in range(8): + ... turtle.undo() .. function:: speed(speed=None) @@ -471,7 +586,16 @@ place. forward/back makes turtle jump and likewise left/right make the turtle turn instantly. - >>> turtle.speed(3) + .. doctest:: + + >>> turtle.speed() + 3 + >>> turtle.speed('normal') + >>> turtle.speed() + 6 + >>> turtle.speed(9) + >>> turtle.speed() + 9 Tell Turtle's state @@ -482,8 +606,10 @@ Return the turtle's current location (x,y) (as a :class:`Vec2D` vector). - >>> turtle.pos() - (0.00, 240.00) + .. doctest:: + + >>> turtle.pos() + (440.00,-0.00) .. function:: towards(x, y=None) @@ -495,32 +621,41 @@ by (x,y), the vector or the other turtle. This depends on the turtle's start orientation which depends on the mode - "standard"/"world" or "logo"). - >>> turtle.pos() - (10.00, 10.00) - >>> turtle.towards(0,0) - 225.0 + .. doctest:: + + >>> turtle.goto(10, 10) + >>> turtle.towards(0,0) + 225.0 .. function:: xcor() Return the turtle's x coordinate. - >>> reset() - >>> turtle.left(60) - >>> turtle.forward(100) - >>> print turtle.xcor() - 50.0 + .. doctest:: + + >>> turtle.home() + >>> turtle.left(50) + >>> turtle.forward(100) + >>> turtle.pos() + (64.28,76.60) + >>> print turtle.xcor() + 64.2787609687 .. function:: ycor() Return the turtle's y coordinate. - >>> reset() - >>> turtle.left(60) - >>> turtle.forward(100) - >>> print turtle.ycor() - 86.6025403784 + .. doctest:: + + >>> turtle.home() + >>> turtle.left(60) + >>> turtle.forward(100) + >>> print turtle.pos() + (50.00,86.60) + >>> print turtle.ycor() + 86.6025403784 .. function:: heading() @@ -528,9 +663,12 @@ Return the turtle's current heading (value depends on the turtle mode, see :func:`mode`). - >>> turtle.left(67) - >>> turtle.heading() - 67.0 + .. doctest:: + + >>> turtle.home() + >>> turtle.left(67) + >>> turtle.heading() + 67.0 .. function:: distance(x, y=None) @@ -541,14 +679,17 @@ Return the distance from the turtle to (x,y), the given vector, or the given other turtle, in turtle step units. - >>> turtle.pos() - (0.00, 0.00) - >>> turtle.distance(30,40) - 50.0 - >>> joe = Turtle() - >>> joe.forward(77) - >>> turtle.distance(joe) - 77.0 + .. doctest:: + + >>> turtle.home() + >>> turtle.distance(30,40) + 50.0 + >>> turtle.distance((30,40)) + 50.0 + >>> joe = Turtle() + >>> joe.forward(77) + >>> turtle.distance(joe) + 77.0 Settings for measurement @@ -561,12 +702,18 @@ Set angle measurement units, i.e. set number of "degrees" for a full circle. Default value is 360 degrees. - >>> turtle.left(90) - >>> turtle.heading() - 90 - >>> turtle.degrees(400.0) # angle measurement in gon - >>> turtle.heading() - 100 + .. doctest:: + + >>> turtle.home() + >>> turtle.left(90) + >>> turtle.heading() + 90.0 + >>> turtle.degrees(400.0) # angle measurement in gon + >>> turtle.heading() + 100.0 + >>> turtle.degrees(360) + >>> turtle.heading() + 90.0 .. function:: radians() @@ -574,11 +721,20 @@ Set the angle measurement units to radians. Equivalent to ``degrees(2*math.pi)``. - >>> turtle.heading() - 90 - >>> turtle.radians() - >>> turtle.heading() - 1.5707963267948966 + .. doctest:: + + >>> turtle.home() + >>> turtle.left(90) + >>> turtle.heading() + 90.0 + >>> turtle.radians() + >>> turtle.heading() + 1.5707963267948966 + + .. doctest:: + :hide: + + >>> turtle.degrees(360) Pen control @@ -610,9 +766,11 @@ "auto" and turtleshape is a polygon, that polygon is drawn with the same line thickness. If no argument is given, the current pensize is returned. - >>> turtle.pensize() - 1 - >>> turtle.pensize(10) # from here on lines of width 10 are drawn + .. doctest:: + + >>> turtle.pensize() + 1 + >>> turtle.pensize(10) # from here on lines of width 10 are drawn .. function:: pen(pen=None, **pendict) @@ -634,40 +792,45 @@ * "outline": positive number * "tilt": number - This dicionary can be used as argument for a subsequent call to :func:`pen` + This dictionary can be used as argument for a subsequent call to :func:`pen` to restore the former pen-state. Moreover one or more of these attributes can be provided as keyword-arguments. This can be used to set several pen attributes in one statement. - >>> turtle.pen(fillcolor="black", pencolor="red", pensize=10) - >>> turtle.pen() - {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1, - 'pencolor': 'red', 'pendown': True, 'fillcolor': 'black', - 'stretchfactor': (1,1), 'speed': 3} - >>> penstate=turtle.pen() - >>> turtle.color("yellow","") - >>> turtle.penup() - >>> turtle.pen() - {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1, - 'pencolor': 'yellow', 'pendown': False, 'fillcolor': '', - 'stretchfactor': (1,1), 'speed': 3} - >>> p.pen(penstate, fillcolor="green") - >>> p.pen() - {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1, - 'pencolor': 'red', 'pendown': True, 'fillcolor': 'green', - 'stretchfactor': (1,1), 'speed': 3} + .. doctest:: + :options: +NORMALIZE_WHITESPACE + + >>> turtle.pen(fillcolor="black", pencolor="red", pensize=10) + >>> sorted(turtle.pen().items()) + [('fillcolor', 'black'), ('outline', 1), ('pencolor', 'red'), + ('pendown', True), ('pensize', 10), ('resizemode', 'noresize'), + ('shown', True), ('speed', 9), ('stretchfactor', (1, 1)), ('tilt', 0)] + >>> penstate=turtle.pen() + >>> turtle.color("yellow", "") + >>> turtle.penup() + >>> sorted(turtle.pen().items()) + [('fillcolor', ''), ('outline', 1), ('pencolor', 'yellow'), + ('pendown', False), ('pensize', 10), ('resizemode', 'noresize'), + ('shown', True), ('speed', 9), ('stretchfactor', (1, 1)), ('tilt', 0)] + >>> turtle.pen(penstate, fillcolor="green") + >>> sorted(turtle.pen().items()) + [('fillcolor', 'green'), ('outline', 1), ('pencolor', 'red'), + ('pendown', True), ('pensize', 10), ('resizemode', 'noresize'), + ('shown', True), ('speed', 9), ('stretchfactor', (1, 1)), ('tilt', 0)] .. function:: isdown() Return ``True`` if pen is down, ``False`` if it's up. - >>> turtle.penup() - >>> turtle.isdown() - False - >>> turtle.pendown() - >>> turtle.isdown() - True + .. doctest:: + + >>> turtle.penup() + >>> turtle.isdown() + False + >>> turtle.pendown() + >>> turtle.isdown() + True Color control @@ -680,8 +843,8 @@ Four input formats are allowed: ``pencolor()`` - Return the current pencolor as color specification string, possibly in - hex-number format (see example). May be used as input to another + Return the current pencolor as color specification string or + as a tuple (see example). May be used as input to another color/pencolor/fillcolor call. ``pencolor(colorstring)`` @@ -700,11 +863,25 @@ If turtleshape is a polygon, the outline of that polygon is drawn with the newly set pencolor. - >>> turtle.pencolor("brown") - >>> tup = (0.2, 0.8, 0.55) - >>> turtle.pencolor(tup) - >>> turtle.pencolor() - "#33cc8c" + .. doctest:: + + >>> colormode() + 1.0 + >>> turtle.pencolor() + 'red' + >>> turtle.pencolor("brown") + >>> turtle.pencolor() + 'brown' + >>> tup = (0.2, 0.8, 0.55) + >>> turtle.pencolor(tup) + >>> turtle.pencolor() + (0.20000000000000001, 0.80000000000000004, 0.5490196078431373) + >>> colormode(255) + >>> turtle.pencolor() + (51, 204, 140) + >>> turtle.pencolor('#32c18f') + >>> turtle.pencolor() + (50, 193, 143) .. function:: fillcolor(*args) @@ -714,8 +891,8 @@ Four input formats are allowed: ``fillcolor()`` - Return the current fillcolor as color specification string, possibly in - hex-number format (see example). May be used as input to another + Return the current fillcolor as color specification string, possibly + in tuple format (see example). May be used as input to another color/pencolor/fillcolor call. ``fillcolor(colorstring)`` @@ -734,10 +911,20 @@ If turtleshape is a polygon, the interior of that polygon is drawn with the newly set fillcolor. - >>> turtle.fillcolor("violet") - >>> col = turtle.pencolor() - >>> turtle.fillcolor(col) - >>> turtle.fillcolor(0, .5, 0) + .. doctest:: + + >>> turtle.fillcolor("violet") + >>> turtle.fillcolor() + 'violet' + >>> col = turtle.pencolor() + >>> col + (50, 193, 143) + >>> turtle.fillcolor(col) + >>> turtle.fillcolor() + (50, 193, 143) + >>> turtle.fillcolor('#ffffff') + >>> turtle.fillcolor() + (255, 255, 255) .. function:: color(*args) @@ -749,7 +936,7 @@ ``color()`` Return the current pencolor and the current fillcolor as a pair of color - specification strings as returned by :func:`pencolor` and + specification strings or tuples as returned by :func:`pencolor` and :func:`fillcolor`. ``color(colorstring)``, ``color((r,g,b))``, ``color(r,g,b)`` @@ -763,13 +950,14 @@ If turtleshape is a polygon, outline and interior of that polygon is drawn with the newly set colors. - >>> turtle.color("red", "green") - >>> turtle.color() - ("red", "green") - >>> colormode(255) - >>> color((40, 80, 120), (160, 200, 240)) - >>> color() - ("#285078", "#a0c8f0") + .. doctest:: + + >>> turtle.color("red", "green") + >>> turtle.color() + ('red', 'green') + >>> color("#285078", "#a0c8f0") + >>> color() + ((40, 80, 120), (160, 200, 240)) See also: Screen method :func:`colormode`. @@ -778,6 +966,11 @@ Filling ~~~~~~~ +.. doctest:: + :hide: + + >>> turtle.home() + .. function:: fill(flag) :param flag: True/False (or 1/0 respectively) @@ -786,29 +979,33 @@ ``fill(False)`` when done. When used without argument: return fillstate (``True`` if filling, ``False`` else). - >>> turtle.fill(True) - >>> for _ in range(3): - ... turtle.forward(100) - ... turtle.left(120) - ... - >>> turtle.fill(False) + .. doctest:: + + >>> turtle.fill(True) + >>> for _ in range(3): + ... turtle.forward(100) + ... turtle.left(120) + ... + >>> turtle.fill(False) .. function:: begin_fill() Call just before drawing a shape to be filled. Equivalent to ``fill(True)``. - >>> turtle.color("black", "red") - >>> turtle.begin_fill() - >>> turtle.circle(60) - >>> turtle.end_fill() - .. function:: end_fill() Fill the shape drawn after the last call to :func:`begin_fill`. Equivalent to ``fill(False)``. + .. doctest:: + + >>> turtle.color("black", "red") + >>> turtle.begin_fill() + >>> turtle.circle(80) + >>> turtle.end_fill() + More drawing control ~~~~~~~~~~~~~~~~~~~~ @@ -818,15 +1015,19 @@ Delete the turtle's drawings from the screen, re-center the turtle and set variables to the default values. - >>> turtle.position() - (0.00,-22.00) - >>> turtle.heading() - 100.0 - >>> turtle.reset() - >>> turtle.position() - (0.00,0.00) - >>> turtle.heading() - 0.0 + .. doctest:: + + >>> turtle.goto(0,-22) + >>> turtle.left(100) + >>> turtle.position() + (0.00,-22.00) + >>> turtle.heading() + 100.0 + >>> turtle.reset() + >>> turtle.position() + (0.00,0.00) + >>> turtle.heading() + 0.0 .. function:: clear() @@ -857,15 +1058,6 @@ Visibility ~~~~~~~~~~ -.. function:: showturtle() - st() - - Make the turtle visible. - - >>> turtle.hideturtle() - >>> turtle.showturtle() - - .. function:: hideturtle() ht() @@ -873,7 +1065,19 @@ middle of doing some complex drawing, because hiding the turtle speeds up the drawing observably. - >>> turtle.hideturtle() + .. doctest:: + + >>> turtle.hideturtle() + + +.. function:: showturtle() + st() + + Make the turtle visible. + + .. doctest:: + + >>> turtle.showturtle() .. function:: isvisible() @@ -881,8 +1085,11 @@ Return True if the Turtle is shown, False if it's hidden. >>> turtle.hideturtle() - >>> print turtle.isvisible(): + >>> turtle.isvisible() False + >>> turtle.showturtle() + >>> turtle.isvisible() + True Appearance @@ -898,11 +1105,13 @@ "turtle", "circle", "square", "triangle", "classic". To learn about how to deal with shapes see Screen method :func:`register_shape`. - >>> turtle.shape() - "arrow" - >>> turtle.shape("turtle") - >>> turtle.shape() - "turtle" + .. doctest:: + + >>> turtle.shape() + 'classic' + >>> turtle.shape("turtle") + >>> turtle.shape() + 'turtle' .. function:: resizemode(rmode=None) @@ -921,9 +1130,13 @@ resizemode("user") is called by :func:`shapesize` when used with arguments. - >>> turtle.resizemode("noresize") - >>> turtle.resizemode() - "noresize" + .. doctest:: + + >>> turtle.resizemode() + 'noresize' + >>> turtle.resizemode("auto") + >>> turtle.resizemode() + 'auto' .. function:: shapesize(stretch_wid=None, stretch_len=None, outline=None) @@ -939,9 +1152,17 @@ stretchfactor in direction of its orientation, *outline* determines the width of the shapes's outline. - >>> turtle.resizemode("user") - >>> turtle.shapesize(5, 5, 12) - >>> turtle.shapesize(outline=8) + .. doctest:: + + >>> turtle.shapesize() + (1, 1, 1) + >>> turtle.resizemode("user") + >>> turtle.shapesize(5, 5, 12) + >>> turtle.shapesize() + (5, 5, 12) + >>> turtle.shapesize(outline=8) + >>> turtle.shapesize() + (5, 5, 8) .. function:: tilt(angle) @@ -951,12 +1172,15 @@ Rotate the turtleshape by *angle* from its current tilt-angle, but do *not* change the turtle's heading (direction of movement). - >>> turtle.shape("circle") - >>> turtle.shapesize(5,2) - >>> turtle.tilt(30) - >>> turtle.fd(50) - >>> turtle.tilt(30) - >>> turtle.fd(50) + .. doctest:: + + >>> turtle.reset() + >>> turtle.shape("circle") + >>> turtle.shapesize(5,2) + >>> turtle.tilt(30) + >>> turtle.fd(50) + >>> turtle.tilt(30) + >>> turtle.fd(50) .. function:: settiltangle(angle) @@ -967,14 +1191,15 @@ regardless of its current tilt-angle. *Do not* change the turtle's heading (direction of movement). - >>> turtle.shape("circle") - >>> turtle.shapesize(5,2) - >>> turtle.settiltangle(45) - >>> stamp() - >>> turtle.fd(50) - >>> turtle.settiltangle(-45) - >>> stamp() - >>> turtle.fd(50) + .. doctest:: + + >>> turtle.reset() + >>> turtle.shape("circle") + >>> turtle.shapesize(5,2) + >>> turtle.settiltangle(45) + >>> turtle.fd(50) + >>> turtle.settiltangle(-45) + >>> turtle.fd(50) .. function:: tiltangle() @@ -982,11 +1207,14 @@ Return the current tilt-angle, i.e. the angle between the orientation of the turtleshape and the heading of the turtle (its direction of movement). - >>> turtle.shape("circle") - >>> turtle.shapesize(5,2) - >>> turtle.tilt(45) - >>> turtle.tiltangle() - 45 + .. doctest:: + + >>> turtle.reset() + >>> turtle.shape("circle") + >>> turtle.shapesize(5,2) + >>> turtle.tilt(45) + >>> turtle.tiltangle() + 45.0 Using events @@ -1004,11 +1232,13 @@ existing bindings are removed. Example for the anonymous turtle, i.e. the procedural way: - >>> def turn(x, y): - ... left(180) - ... - >>> onclick(turn) # Now clicking into the turtle will turn it. - >>> onclick(None) # event-binding will be removed + .. doctest:: + + >>> def turn(x, y): + ... left(180) + ... + >>> onclick(turn) # Now clicking into the turtle will turn it. + >>> onclick(None) # event-binding will be removed .. function:: onrelease(fun, btn=1, add=None) @@ -1022,15 +1252,17 @@ Bind *fun* to mouse-button-release events on this turtle. If *fun* is ``None``, existing bindings are removed. - >>> class MyTurtle(Turtle): - ... def glow(self,x,y): - ... self.fillcolor("red") - ... def unglow(self,x,y): - ... self.fillcolor("") - ... - >>> turtle = MyTurtle() - >>> turtle.onclick(turtle.glow) # clicking on turtle turns fillcolor red, - >>> turtle.onrelease(turtle.unglow) # releasing turns it to transparent. + .. doctest:: + + >>> class MyTurtle(Turtle): + ... def glow(self,x,y): + ... self.fillcolor("red") + ... def unglow(self,x,y): + ... self.fillcolor("") + ... + >>> turtle = MyTurtle() + >>> turtle.onclick(turtle.glow) # clicking on turtle turns fillcolor red, + >>> turtle.onrelease(turtle.unglow) # releasing turns it to transparent. .. function:: ondrag(fun, btn=1, add=None) @@ -1047,9 +1279,12 @@ Remark: Every sequence of mouse-move-events on a turtle is preceded by a mouse-click event on that turtle. - >>> turtle.ondrag(turtle.goto) - # Subsequently, clicking and dragging the Turtle will move it across - # the screen thereby producing handdrawings (if pen is down). + .. doctest:: + + >>> turtle.ondrag(turtle.goto) + + Subsequently, clicking and dragging the Turtle will move it across + the screen thereby producing handdrawings (if pen is down). Special Turtle methods @@ -1071,8 +1306,18 @@ Return the last recorded polygon. - >>> p = turtle.get_poly() - >>> turtle.register_shape("myFavouriteShape", p) + .. doctest:: + + >>> turtle.home() + >>> turtle.begin_poly() + >>> turtle.fd(100) + >>> turtle.left(20) + >>> turtle.fd(30) + >>> turtle.left(60) + >>> turtle.fd(50) + >>> turtle.end_poly() + >>> p = turtle.get_poly() + >>> register_shape("myFavouriteShape", p) .. function:: clone() @@ -1080,8 +1325,10 @@ Create and return a clone of the turtle with same position, heading and turtle properties. - >>> mick = Turtle() - >>> joe = mick.clone() + .. doctest:: + + >>> mick = Turtle() + >>> joe = mick.clone() .. function:: getturtle() @@ -1089,12 +1336,12 @@ Return the Turtle object itself. Only reasonable use: as a function to return the "anonymous turtle": - >>> pet = getturtle() - >>> pet.fd(50) - >>> pet - - >>> turtles() - [] + .. doctest:: + + >>> pet = getturtle() + >>> pet.fd(50) + >>> pet + .. function:: getscreen() @@ -1102,10 +1349,12 @@ Return the :class:`TurtleScreen` object the turtle is drawing on. TurtleScreen methods can then be called for that object. - >>> ts = turtle.getscreen() - >>> ts - - >>> ts.bgcolor("pink") + .. doctest:: + + >>> ts = turtle.getscreen() + >>> ts + + >>> ts.bgcolor("pink") .. function:: setundobuffer(size) @@ -1117,15 +1366,19 @@ that can be undone by the :func:`undo` method/function. If *size* is ``None``, the undobuffer is disabled. - >>> turtle.setundobuffer(42) + .. doctest:: + + >>> turtle.setundobuffer(42) .. function:: undobufferentries() Return number of entries in the undobuffer. - >>> while undobufferentries(): - ... undo() + .. doctest:: + + >>> while undobufferentries(): + ... undo() .. function:: tracer(flag=None, delay=None) @@ -1158,16 +1411,20 @@ For example: - >>> s = Shape("compound") - >>> poly1 = ((0,0),(10,-5),(0,10),(-10,-5)) - >>> s.addcomponent(poly1, "red", "blue") - >>> poly2 = ((0,0),(10,-5),(-10,-5)) - >>> s.addcomponent(poly2, "blue", "red") + .. doctest:: + + >>> s = Shape("compound") + >>> poly1 = ((0,0),(10,-5),(0,10),(-10,-5)) + >>> s.addcomponent(poly1, "red", "blue") + >>> poly2 = ((0,0),(10,-5),(-10,-5)) + >>> s.addcomponent(poly2, "blue", "red") 3. Now add the Shape to the Screen's shapelist and use it: - >>> register_shape("myshape", s) - >>> shape("myshape") + .. doctest:: + + >>> register_shape("myshape", s) + >>> shape("myshape") .. note:: @@ -1183,6 +1440,10 @@ Most of the examples in this section refer to a TurtleScreen instance called ``screen``. +.. doctest:: + :hide: + + >>> screen = Screen() Window control -------------- @@ -1194,12 +1455,14 @@ Set or return background color of the TurtleScreen. - >>> screen.bgcolor("orange") - >>> screen.bgcolor() - "orange" - >>> screen.bgcolor(0.5,0,0.5) - >>> screen.bgcolor() - "#800080" + .. doctest:: + + >>> screen.bgcolor("orange") + >>> screen.bgcolor() + 'orange' + >>> screen.bgcolor("#800080") + >>> screen.bgcolor() + (128, 0, 128) .. function:: bgpic(picname=None) @@ -1209,13 +1472,13 @@ Set background image or return name of current backgroundimage. If *picname* is a filename, set the corresponding image as background. If *picname* is ``"nopic"``, delete background image, if present. If *picname* is ``None``, - return the filename of the current backgroundimage. + return the filename of the current backgroundimage. :: - >>> screen.bgpic() - "nopic" - >>> screen.bgpic("landscape.gif") - >>> screen.bgpic() - "landscape.gif" + >>> screen.bgpic() + 'nopic' + >>> screen.bgpic("landscape.gif") + >>> screen.bgpic() + "landscape.gif" .. function:: clear() @@ -1254,8 +1517,13 @@ method, one can make visible those parts of a drawing which were outside the canvas before. - >>> turtle.screensize(2000,1500) - # e.g. to search for an erroneously escaped turtle ;-) + >>> screen.screensize() + (400, 300) + >>> screen.screensize(2000,1500) + >>> screen.screensize() + (2000, 1500) + + e.g. to search for an erroneously escaped turtle ;-) .. function:: setworldcoordinates(llx, lly, urx, ury) @@ -1272,13 +1540,22 @@ **ATTENTION**: in user-defined coordinate systems angles may appear distorted. - >>> screen.reset() - >>> screen.setworldcoordinates(-50,-7.5,50,7.5) - >>> for _ in range(72): - ... left(10) - ... - >>> for _ in range(8): - ... left(45); fd(2) # a regular octagon + .. doctest:: + + >>> screen.reset() + >>> screen.setworldcoordinates(-50,-7.5,50,7.5) + >>> for _ in range(72): + ... left(10) + ... + >>> for _ in range(8): + ... left(45); fd(2) # a regular octagon + + .. doctest:: + :hide: + + >>> screen.reset() + >>> for t in turtles(): + ... t.reset() Animation control @@ -1294,9 +1571,13 @@ Optional argument: - >>> screen.delay(15) - >>> screen.delay() - 15 + .. doctest:: + + >>> screen.delay() + 10 + >>> screen.delay(5) + >>> screen.delay() + 5 .. function:: tracer(n=None, delay=None) @@ -1309,12 +1590,14 @@ used to accelerate the drawing of complex graphics.) Second argument sets delay value (see :func:`delay`). - >>> screen.tracer(8, 25) - >>> dist = 2 - >>> for i in range(200): - ... fd(dist) - ... rt(90) - ... dist += 2 + .. doctest:: + + >>> screen.tracer(8, 25) + >>> dist = 2 + >>> for i in range(200): + ... fd(dist) + ... rt(90) + ... dist += 2 .. function:: update() @@ -1342,12 +1625,14 @@ are removed. Remark: in order to be able to register key-events, TurtleScreen must have the focus. (See method :func:`listen`.) - >>> def f(): - ... fd(50) - ... lt(60) - ... - >>> screen.onkey(f, "Up") - >>> screen.listen() + .. doctest:: + + >>> def f(): + ... fd(50) + ... lt(60) + ... + >>> screen.onkey(f, "Up") + >>> screen.listen() .. function:: onclick(fun, btn=1, add=None) @@ -1365,10 +1650,11 @@ Example for a TurtleScreen instance named ``screen`` and a Turtle instance named turtle: - >>> screen.onclick(turtle.goto) - # Subsequently clicking into the TurtleScreen will - # make the turtle move to the clicked point. - >>> screen.onclick(None) # remove event binding again + .. doctest:: + + >>> screen.onclick(turtle.goto) # Subsequently clicking into the TurtleScreen will + >>> # make the turtle move to the clicked point. + >>> screen.onclick(None) # remove event binding again .. note:: This TurtleScreen method is available as a global function only under the @@ -1383,14 +1669,16 @@ Install a timer that calls *fun* after *t* milliseconds. - >>> running = True - >>> def f(): - if running: - fd(50) - lt(60) - screen.ontimer(f, 250) - >>> f() ### makes the turtle marching around - >>> running = False + .. doctest:: + + >>> running = True + >>> def f(): + ... if running: + ... fd(50) + ... lt(60) + ... screen.ontimer(f, 250) + >>> f() ### makes the turtle march around + >>> running = False Settings and special methods @@ -1415,9 +1703,11 @@ "logo" upward (north) clockwise ============ ========================= =================== - >>> mode("logo") # resets turtle heading to north - >>> mode() - "logo" + .. doctest:: + + >>> mode("logo") # resets turtle heading to north + >>> mode() + 'logo' .. function:: colormode(cmode=None) @@ -1427,10 +1717,19 @@ Return the colormode or set it to 1.0 or 255. Subsequently *r*, *g*, *b* values of color triples have to be in the range 0..\ *cmode*. - >>> screen.colormode() - 1.0 - >>> screen.colormode(255) - >>> turtle.pencolor(240,160,80) + .. doctest:: + + >>> screen.colormode(1) + >>> turtle.pencolor(240, 160, 80) + Traceback (most recent call last): + ... + TurtleGraphicsError: bad color sequence: (240, 160, 80) + >>> screen.colormode() + 1.0 + >>> screen.colormode(255) + >>> screen.colormode() + 255 + >>> turtle.pencolor(240,160,80) .. function:: getcanvas() @@ -1438,17 +1737,21 @@ Return the Canvas of this TurtleScreen. Useful for insiders who know what to do with a Tkinter Canvas. - >>> cv = screen.getcanvas() - >>> cv - + .. doctest:: + + >>> cv = screen.getcanvas() + >>> cv + .. function:: getshapes() Return a list of names of all currently available turtle shapes. - >>> screen.getshapes() - ["arrow", "blank", "circle", ..., "turtle"] + .. doctest:: + + >>> screen.getshapes() + ['arrow', 'blank', 'circle', ..., 'turtle'] .. function:: register_shape(name, shape=None) @@ -1457,7 +1760,9 @@ There are three different ways to call this function: (1) *name* is the name of a gif-file and *shape* is ``None``: Install the - corresponding image shape. + corresponding image shape. :: + + >>> screen.register_shape("turtle.gif") .. note:: Image shapes *do not* rotate when turning the turtle, so they do not @@ -1466,38 +1771,41 @@ (2) *name* is an arbitrary string and *shape* is a tuple of pairs of coordinates: Install the corresponding polygon shape. + .. doctest:: + + >>> screen.register_shape("triangle", ((5,-3), (0,5), (-5,-3))) + (3) *name* is an arbitrary string and shape is a (compound) :class:`Shape` object: Install the corresponding compound shape. Add a turtle shape to TurtleScreen's shapelist. Only thusly registered shapes can be used by issuing the command ``shape(shapename)``. - >>> screen.register_shape("turtle.gif") - >>> screen.register_shape("triangle", ((5,-3), (0,5), (-5,-3))) - .. function:: turtles() Return the list of turtles on the screen. - >>> for turtle in screen.turtles() - ... turtle.color("red") + .. doctest:: + + >>> for turtle in screen.turtles(): + ... turtle.color("red") .. function:: window_height() - Return the height of the turtle window. + Return the height of the turtle window. :: - >>> screen.window_height() - 480 + >>> screen.window_height() + 480 .. function:: window_width() - Return the width of the turtle window. + Return the width of the turtle window. :: - >>> screen.window_width() - 640 + >>> screen.window_width() + 640 .. _screenspecific: @@ -1539,10 +1847,12 @@ edge of the screen, if negative from the bottom edge, if None, center window vertically - >>> screen.setup (width=200, height=200, startx=0, starty=0) - # sets window to 200x200 pixels, in upper left of screen - >>> screen.setup(width=.75, height=0.5, startx=None, starty=None) - # sets window to 75% of screen by 50% of screen and centers + .. doctest:: + + >>> screen.setup (width=200, height=200, startx=0, starty=0) + >>> # sets window to 200x200 pixels, in upper left of screen + >>> screen.setup(width=.75, height=0.5, startx=None, starty=None) + >>> # sets window to 75% of screen by 50% of screen and centers .. function:: title(titlestring) @@ -1552,7 +1862,9 @@ Set title of turtle window to *titlestring*. - >>> screen.title("Welcome to the turtle zoo!") + .. doctest:: + + >>> screen.title("Welcome to the turtle zoo!") The public classes of the module :mod:`turtle` @@ -1565,14 +1877,14 @@ :param canvas: a :class:`Tkinter.Canvas`, a :class:`ScrolledCanvas` or a :class:`TurtleScreen` - Create a turtle. The turtle has all methods described above as "methods of - Turtle/RawTurtle". + Create a turtle. The turtle has all methods described above as "methods of + Turtle/RawTurtle". .. class:: Turtle() - Subclass of RawTurtle, has the same interface but draws on a default - :class:`Screen` object created automatically when needed for the first time. + Subclass of RawTurtle, has the same interface but draws on a default + :class:`Screen` object created automatically when needed for the first time. .. class:: TurtleScreen(cv) @@ -1620,10 +1932,12 @@ Example: - >>> poly = ((0,0),(10,-5),(0,10),(-10,-5)) - >>> s = Shape("compound") - >>> s.addcomponent(poly, "red", "blue") - # .. add more components and then use register_shape() + .. doctest:: + + >>> poly = ((0,0),(10,-5),(0,10),(-10,-5)) + >>> s = Shape("compound") + >>> s.addcomponent(poly, "red", "blue") + >>> # ... add more components and then use register_shape() See :ref:`compoundshapes`. @@ -1889,3 +2203,22 @@ +----------------+------------------------------+-----------------------+ Have fun! + +.. doctest:: + :hide: + + >>> for turtle in turtles(): + ... turtle.reset() + >>> turtle.penup() + >>> turtle.goto(-200,25) + >>> turtle.pendown() + >>> turtle.write("No one expects the Spanish Inquisition!", + ... font=("Arial", 20, "normal")) + >>> turtle.penup() + >>> turtle.goto(-100,-50) + >>> turtle.pendown() + >>> turtle.write("Our two chief Turtles are...", + ... font=("Arial", 16, "normal")) + >>> turtle.penup() + >>> turtle.goto(-450,-75) + >>> turtle.write(str(turtles())) From python-checkins at python.org Tue May 5 03:31:22 2009 From: python-checkins at python.org (steven.bethard) Date: Tue, 5 May 2009 03:31:22 +0200 (CEST) Subject: [Python-checkins] r72306 - python/trunk/Lib/distutils/command/bdist_msi.py Message-ID: <20090505013122.B99711E403C@bag.python.org> Author: steven.bethard Date: Tue May 5 03:31:22 2009 New Revision: 72306 Log: Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.) Modified: python/trunk/Lib/distutils/command/bdist_msi.py Modified: python/trunk/Lib/distutils/command/bdist_msi.py ============================================================================== --- python/trunk/Lib/distutils/command/bdist_msi.py (original) +++ python/trunk/Lib/distutils/command/bdist_msi.py Tue May 5 03:31:22 2009 @@ -117,6 +117,12 @@ boolean_options = ['keep-temp', 'no-target-compile', 'no-target-optimize', 'skip-build'] + all_versions = ['2.0', '2.1', '2.2', '2.3', '2.4', + '2.5', '2.6', '2.7', '2.8', '2.9', + '3.0', '3.1', '3.2', '3.3', '3.4', + '3.5', '3.6', '3.7', '3.8', '3.9'] + other_version = 'X' + def initialize_options (self): self.bdist_dir = None self.plat_name = None @@ -128,6 +134,7 @@ self.skip_build = 0 self.install_script = None self.pre_install_script = None + self.versions = None def finalize_options (self): if self.bdist_dir is None: @@ -135,13 +142,14 @@ self.bdist_dir = os.path.join(bdist_base, 'msi') short_version = get_python_version() if self.target_version: + self.versions = [self.target_version] if not self.skip_build and self.distribution.has_ext_modules()\ and self.target_version != short_version: raise DistutilsOptionError, \ "target version can only be %s, or the '--skip_build'" \ " option must be specified" % (short_version,) else: - self.target_version = short_version + self.versions = list(self.all_versions) self.set_undefined_options('bdist', ('dist_dir', 'dist_dir'), @@ -223,8 +231,11 @@ # Prefix ProductName with Python x.y, so that # it sorts together with the other Python packages # in Add-Remove-Programs (APR) - product_name = "Python %s %s" % (self.target_version, - self.distribution.get_fullname()) + fullname = self.distribution.get_fullname() + if self.target_version: + product_name = "Python %s %s" % (self.target_version, fullname) + else: + product_name = "Python %s" % (fullname) self.db = msilib.init_database(installer_name, schema, product_name, msilib.gen_uuid(), sversion, author) @@ -245,7 +256,8 @@ self.db.Commit() if hasattr(self.distribution, 'dist_files'): - self.distribution.dist_files.append(('bdist_msi', self.target_version, fullname)) + tup = 'bdist_msi', self.target_version or 'any', fullname + self.distribution.dist_files.append(tup) if not self.keep_temp: remove_tree(self.bdist_dir, dry_run=self.dry_run) @@ -253,65 +265,121 @@ def add_files(self): db = self.db cab = msilib.CAB("distfiles") - f = Feature(db, "default", "Default Feature", "Everything", 1, directory="TARGETDIR") - f.set_current() rootdir = os.path.abspath(self.bdist_dir) + root = Directory(db, cab, None, rootdir, "TARGETDIR", "SourceDir") + f = Feature(db, "Python", "Python", "Everything", + 0, 1, directory="TARGETDIR") + + items = [(f, root, '')] + for version in self.versions + [self.other_version]: + target = "TARGETDIR" + version + name = default = "Python" + version + desc = "Everything" + if version is self.other_version: + title = "Python from another location" + level = 2 + else: + title = "Python %s from registry" % version + level = 1 + f = Feature(db, name, title, desc, 1, level, directory=target) + dir = Directory(db, cab, root, rootdir, target, default) + items.append((f, dir, version)) db.Commit() - todo = [root] - while todo: - dir = todo.pop() - for file in os.listdir(dir.absolute): - afile = os.path.join(dir.absolute, file) - if os.path.isdir(afile): - newdir = Directory(db, cab, dir, file, file, "%s|%s" % (dir.make_short(file), file)) - todo.append(newdir) - else: - key = dir.add_file(file) - if file==self.install_script: - if self.install_script_key: - raise DistutilsOptionError, "Multiple files with name %s" % file - self.install_script_key = '[#%s]' % key + + seen = {} + for feature, dir, version in items: + todo = [dir] + while todo: + dir = todo.pop() + for file in os.listdir(dir.absolute): + afile = os.path.join(dir.absolute, file) + if os.path.isdir(afile): + short = "%s|%s" % (dir.make_short(file), file) + default = file + version + newdir = Directory(db, cab, dir, file, default, short) + todo.append(newdir) + else: + if not dir.component: + dir.start_component(dir.logical, feature, 0) + if afile not in seen: + key = seen[afile] = dir.add_file(file) + if file==self.install_script: + if self.install_script_key: + raise DistutilsOptionError( + "Multiple files with name %s" % file) + self.install_script_key = '[#%s]' % key + else: + key = seen[afile] + add_data(self.db, "DuplicateFile", + [(key + version, dir.component, key, None, dir.logical)]) + cab.commit(db) def add_find_python(self): """Adds code to the installer to compute the location of Python. - Properties PYTHON.MACHINE, PYTHON.USER, PYTHONDIR and PYTHON will be set - in both the execute and UI sequences; PYTHONDIR will be set from - PYTHON.USER if defined, else from PYTHON.MACHINE. - PYTHON is PYTHONDIR\python.exe""" - install_path = r"SOFTWARE\Python\PythonCore\%s\InstallPath" % self.target_version - add_data(self.db, "RegLocator", - [("python.machine", 2, install_path, None, 2), - ("python.user", 1, install_path, None, 2)]) - add_data(self.db, "AppSearch", - [("PYTHON.MACHINE", "python.machine"), - ("PYTHON.USER", "python.user")]) - add_data(self.db, "CustomAction", - [("PythonFromMachine", 51+256, "PYTHONDIR", "[PYTHON.MACHINE]"), - ("PythonFromUser", 51+256, "PYTHONDIR", "[PYTHON.USER]"), - ("PythonExe", 51+256, "PYTHON", "[PYTHONDIR]\\python.exe"), - ("InitialTargetDir", 51+256, "TARGETDIR", "[PYTHONDIR]")]) - add_data(self.db, "InstallExecuteSequence", - [("PythonFromMachine", "PYTHON.MACHINE", 401), - ("PythonFromUser", "PYTHON.USER", 402), - ("PythonExe", None, 403), - ("InitialTargetDir", 'TARGETDIR=""', 404), - ]) - add_data(self.db, "InstallUISequence", - [("PythonFromMachine", "PYTHON.MACHINE", 401), - ("PythonFromUser", "PYTHON.USER", 402), - ("PythonExe", None, 403), - ("InitialTargetDir", 'TARGETDIR=""', 404), - ]) - def add_scripts(self): - if self.install_script: + Properties PYTHON.MACHINE.X.Y and PYTHON.USER.X.Y will be set from the + registry for each version of Python. + + Properties TARGETDIRX.Y will be set from PYTHON.USER.X.Y if defined, + else from PYTHON.MACHINE.X.Y. + + Properties PYTHONX.Y will be set to TARGETDIRX.Y\\python.exe""" + + start = 402 + for ver in self.versions: + install_path = r"SOFTWARE\Python\PythonCore\%s\InstallPath" % ver + machine_reg = "python.machine." + ver + user_reg = "python.user." + ver + machine_prop = "PYTHON.MACHINE." + ver + user_prop = "PYTHON.USER." + ver + machine_action = "PythonFromMachine" + ver + user_action = "PythonFromUser" + ver + exe_action = "PythonExe" + ver + target_dir_prop = "TARGETDIR" + ver + exe_prop = "PYTHON" + ver + add_data(self.db, "RegLocator", + [(machine_reg, 2, install_path, None, 2), + (user_reg, 1, install_path, None, 2)]) + add_data(self.db, "AppSearch", + [(machine_prop, machine_reg), + (user_prop, user_reg)]) add_data(self.db, "CustomAction", - [("install_script", 50, "PYTHON", self.install_script_key)]) + [(machine_action, 51+256, target_dir_prop, "[" + machine_prop + "]"), + (user_action, 51+256, target_dir_prop, "[" + user_prop + "]"), + (exe_action, 51+256, exe_prop, "[" + target_dir_prop + "]\\python.exe"), + ]) add_data(self.db, "InstallExecuteSequence", - [("install_script", "NOT Installed", 6800)]) + [(machine_action, machine_prop, start), + (user_action, user_prop, start + 1), + (exe_action, None, start + 2), + ]) + add_data(self.db, "InstallUISequence", + [(machine_action, machine_prop, start), + (user_action, user_prop, start + 1), + (exe_action, None, start + 2), + ]) + add_data(self.db, "Condition", + [("Python" + ver, 0, "NOT TARGETDIR" + ver)]) + start += 4 + assert start < 500 + + def add_scripts(self): + if self.install_script: + start = 6800 + for ver in self.versions + [self.other_version]: + install_action = "install_script." + ver + exe_prop = "PYTHON" + ver + add_data(self.db, "CustomAction", + [(install_action, 50, exe_prop, self.install_script_key)]) + add_data(self.db, "InstallExecuteSequence", + [(install_action, "&Python%s=3" % ver, start)]) + start += 1 + # XXX pre-install scripts are currently refused in finalize_options() + # but if this feature is completed, it will also need to add + # entries for each version as the above code does if self.pre_install_script: scriptfn = os.path.join(self.bdist_dir, "preinstall.bat") f = open(scriptfn, "w") @@ -375,7 +443,7 @@ [("PrepareDlg", "Not Privileged or Windows9x or Installed", 140), ("WhichUsersDlg", "Privileged and not Windows9x and not Installed", 141), # In the user interface, assume all-users installation if privileged. - ("SelectDirectoryDlg", "Not Installed", 1230), + ("SelectFeaturesDlg", "Not Installed", 1230), # XXX no support for resume installations yet #("ResumeDlg", "Installed AND (RESUME OR Preselected)", 1240), ("MaintenanceTypeDlg", "Installed AND NOT RESUME AND NOT Preselected", 1250), @@ -498,33 +566,49 @@ c.event("SpawnDialog", "CancelDlg") ##################################################################### - # Target directory selection - seldlg = PyDialog(db, "SelectDirectoryDlg", x, y, w, h, modal, title, + # Feature (Python directory) selection + seldlg = PyDialog(db, "SelectFeaturesDlg", x, y, w, h, modal, title, "Next", "Next", "Cancel") - seldlg.title("Select Destination Directory") + seldlg.title("Select Python Installations") - version = sys.version[:3]+" " - seldlg.text("Hint", 15, 30, 300, 40, 3, - "The destination directory should contain a Python %sinstallation" % version) + seldlg.text("Hint", 15, 30, 300, 20, 3, + "Select the Python locations where %s should be installed." + % self.distribution.get_fullname()) seldlg.back("< Back", None, active=0) c = seldlg.next("Next >", "Cancel") - c.event("SetTargetPath", "TARGETDIR", ordering=1) - c.event("SpawnWaitDialog", "WaitForCostingDlg", ordering=2) - c.event("EndDialog", "Return", ordering=3) - - c = seldlg.cancel("Cancel", "DirectoryCombo") + order = 1 + c.event("[TARGETDIR]", "[SourceDir]", ordering=order) + for version in self.versions + [self.other_version]: + order += 1 + c.event("[TARGETDIR]", "[TARGETDIR%s]" % version, + "FEATURE_SELECTED AND &Python%s=3" % version, + ordering=order) + c.event("SpawnWaitDialog", "WaitForCostingDlg", ordering=order + 1) + c.event("EndDialog", "Return", ordering=order + 2) + c = seldlg.cancel("Cancel", "Features") c.event("SpawnDialog", "CancelDlg") - seldlg.control("DirectoryCombo", "DirectoryCombo", 15, 70, 272, 80, 393219, - "TARGETDIR", None, "DirectoryList", None) - seldlg.control("DirectoryList", "DirectoryList", 15, 90, 308, 136, 3, "TARGETDIR", - None, "PathEdit", None) - seldlg.control("PathEdit", "PathEdit", 15, 230, 306, 16, 3, "TARGETDIR", None, "Next", None) - c = seldlg.pushbutton("Up", 306, 70, 18, 18, 3, "Up", None) - c.event("DirectoryListUp", "0") - c = seldlg.pushbutton("NewDir", 324, 70, 30, 18, 3, "New", None) - c.event("DirectoryListNew", "0") + c = seldlg.control("Features", "SelectionTree", 15, 60, 300, 120, 3, + "FEATURE", None, "PathEdit", None) + c.event("[FEATURE_SELECTED]", "1") + ver = self.other_version + install_other_cond = "FEATURE_SELECTED AND &Python%s=3" % ver + dont_install_other_cond = "FEATURE_SELECTED AND &Python%s<>3" % ver + + c = seldlg.text("Other", 15, 200, 300, 15, 3, + "Provide an alternate Python location") + c.condition("Enable", install_other_cond) + c.condition("Show", install_other_cond) + c.condition("Disable", dont_install_other_cond) + c.condition("Hide", dont_install_other_cond) + + c = seldlg.control("PathEdit", "PathEdit", 15, 215, 300, 16, 1, + "TARGETDIR" + ver, None, "Next", None) + c.condition("Enable", install_other_cond) + c.condition("Show", install_other_cond) + c.condition("Disable", dont_install_other_cond) + c.condition("Hide", dont_install_other_cond) ##################################################################### # Disk cost @@ -640,7 +724,10 @@ def get_installer_filename(self, fullname): # Factored out to allow overriding in subclasses - base_name = "%s.%s-py%s.msi" % (fullname, self.plat_name, - self.target_version) + if self.target_version: + base_name = "%s.%s-py%s.msi" % (fullname, self.plat_name, + self.target_version) + else: + base_name = "%s.%s.msi" % (fullname, self.plat_name) installer_name = os.path.join(self.dist_dir, base_name) return installer_name From buildbot at python.org Tue May 5 03:40:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 01:40:38 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090505014040.464E21E403C@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/4932 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_time make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue May 5 03:47:49 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 01:47:49 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090505014750.0D6CC1E403C@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%202.6/builds/320 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Tue May 5 04:08:53 2009 From: python-checkins at python.org (r.david.murray) Date: Tue, 5 May 2009 04:08:53 +0200 (CEST) Subject: [Python-checkins] r72307 - in python/branches/py3k: Doc/library/turtle.rst Message-ID: <20090505020853.44B921E403C@bag.python.org> Author: r.david.murray Date: Tue May 5 04:08:52 2009 New Revision: 72307 Log: Merged revisions 72149 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72149 | r.david.murray | 2009-04-30 08:42:32 -0400 (Thu, 30 Apr 2009) | 4 lines Make the turtle.rst doctests pass. I have a feeling there should be more cleanup, but I don't know now to kill turtles. Especially unexpected ones... ;) ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/turtle.rst Modified: python/branches/py3k/Doc/library/turtle.rst ============================================================================== --- python/branches/py3k/Doc/library/turtle.rst (original) +++ python/branches/py3k/Doc/library/turtle.rst Tue May 5 04:08:52 2009 @@ -6,6 +6,11 @@ :synopsis: Turtle graphics for Tk .. sectionauthor:: Gregor Lingl +.. testsetup:: default + + from turtle import * + turtle = Turtle() + Introduction ============ @@ -220,14 +225,16 @@ Move the turtle forward by the specified *distance*, in the direction the turtle is headed. - >>> turtle.position() - (0.00, 0.00) - >>> turtle.forward(25) - >>> turtle.position() - (25.00,0.00) - >>> turtle.forward(-75) - >>> turtle.position() - (-50.00,0.00) + .. doctest:: + + >>> turtle.position() + (0.00,0.00) + >>> turtle.forward(25) + >>> turtle.position() + (25.00,0.00) + >>> turtle.forward(-75) + >>> turtle.position() + (-50.00,0.00) .. function:: back(distance) @@ -239,11 +246,18 @@ Move the turtle backward by *distance*, opposite to the direction the turtle is headed. Do not change the turtle's heading. - >>> turtle.position() - (0.00, 0.00) - >>> turtle.backward(30) - >>> turtle.position() - (-30.00, 0.00) + .. doctest:: + :hide: + + >>> turtle.goto(0, 0) + + .. doctest:: + + >>> turtle.position() + (0.00,0.00) + >>> turtle.backward(30) + >>> turtle.position() + (-30.00,0.00) .. function:: right(angle) @@ -255,11 +269,18 @@ can be set via the :func:`degrees` and :func:`radians` functions.) Angle orientation depends on the turtle mode, see :func:`mode`. - >>> turtle.heading() - 22.0 - >>> turtle.right(45) - >>> turtle.heading() - 337.0 + .. doctest:: + :hide: + + >>> turtle.setheading(22) + + .. doctest:: + + >>> turtle.heading() + 22.0 + >>> turtle.right(45) + >>> turtle.heading() + 337.0 .. function:: left(angle) @@ -271,37 +292,52 @@ can be set via the :func:`degrees` and :func:`radians` functions.) Angle orientation depends on the turtle mode, see :func:`mode`. - >>> turtle.heading() - 22.0 - >>> turtle.left(45) - >>> turtle.heading() - 67.0 + .. doctest:: + :hide: + + >>> turtle.setheading(22) + + .. doctest:: + + >>> turtle.heading() + 22.0 + >>> turtle.left(45) + >>> turtle.heading() + 67.0 + .. function:: goto(x, y=None) setpos(x, y=None) setposition(x, y=None) - :param x: a number or a pair/vector of numbers - :param y: a number or ``None`` + :param x: a number or a pair/vector of numbers + :param y: a number or ``None`` - If *y* is ``None``, *x* must be a pair of coordinates or a :class:`Vec2D` - (e.g. as returned by :func:`pos`). + If *y* is ``None``, *x* must be a pair of coordinates or a :class:`Vec2D` + (e.g. as returned by :func:`pos`). - Move turtle to an absolute position. If the pen is down, draw line. Do - not change the turtle's orientation. + Move turtle to an absolute position. If the pen is down, draw line. Do + not change the turtle's orientation. - >>> tp = turtle.pos() - >>> tp - (0.00, 0.00) - >>> turtle.setpos(60,30) - >>> turtle.pos() - (60.00,30.00) - >>> turtle.setpos((20,80)) - >>> turtle.pos() - (20.00,80.00) - >>> turtle.setpos(tp) - >>> turtle.pos() - (0.00,0.00) + .. doctest:: + :hide: + + >>> turtle.goto(0, 0) + + .. doctest:: + + >>> tp = turtle.pos() + >>> tp + (0.00,0.00) + >>> turtle.setpos(60,30) + >>> turtle.pos() + (60.00,30.00) + >>> turtle.setpos((20,80)) + >>> turtle.pos() + (20.00,80.00) + >>> turtle.setpos(tp) + >>> turtle.pos() + (0.00,0.00) .. function:: setx(x) @@ -311,11 +347,18 @@ Set the turtle's first coordinate to *x*, leave second coordinate unchanged. - >>> turtle.position() - (0.00, 240.00) - >>> turtle.setx(10) - >>> turtle.position() - (10.00, 240.00) + .. doctest:: + :hide: + + >>> turtle.goto(0, 240) + + .. doctest:: + + >>> turtle.position() + (0.00,240.00) + >>> turtle.setx(10) + >>> turtle.position() + (10.00,240.00) .. function:: sety(y) @@ -324,11 +367,18 @@ Set the turtle's second coordinate to *y*, leave first coordinate unchanged. - >>> turtle.position() - (0.00, 40.00) - >>> turtle.sety(-10) - >>> turtle.position() - (0.00, -10.00) + .. doctest:: + :hide: + + >>> turtle.goto(0, 40) + + .. doctest:: + + >>> turtle.position() + (0.00,40.00) + >>> turtle.sety(-10) + >>> turtle.position() + (0.00,-10.00) .. function:: setheading(to_angle) @@ -348,9 +398,11 @@ 270 - south 270 - west =================== ==================== - >>> turtle.setheading(90) - >>> turtle.heading() - 90 + .. doctest:: + + >>> turtle.setheading(90) + >>> turtle.heading() + 90.0 .. function:: home() @@ -358,6 +410,24 @@ Move turtle to the origin -- coordinates (0,0) -- and set its heading to its start-orientation (which depends on the mode, see :func:`mode`). + .. doctest:: + :hide: + + >>> turtle.setheading(90) + >>> turtle.goto(0, -10) + + .. doctest:: + + >>> turtle.heading() + 90.0 + >>> turtle.position() + (0.00,-10.00) + >>> turtle.home() + >>> turtle.position() + (0.00,0.00) + >>> turtle.heading() + 0.0 + .. function:: circle(radius, extent=None, steps=None) @@ -377,8 +447,23 @@ determines the number of steps to use. If not given, it will be calculated automatically. May be used to draw regular polygons. - >>> turtle.circle(50) - >>> turtle.circle(120, 180) # draw a semicircle + .. doctest:: + + >>> turtle.home() + >>> turtle.position() + (0.00,0.00) + >>> turtle.heading() + 0.0 + >>> turtle.circle(50) + >>> turtle.position() + (-0.00,0.00) + >>> turtle.heading() + 0.0 + >>> turtle.circle(120, 180) # draw a semicircle + >>> turtle.position() + (0.00,240.00) + >>> turtle.heading() + 180.0 .. function:: dot(size=None, *color) @@ -389,8 +474,16 @@ Draw a circular dot with diameter *size*, using *color*. If *size* is not given, the maximum of pensize+4 and 2*pensize is used. - >>> turtle.dot() - >>> turtle.fd(50); turtle.dot(20, "blue"); turtle.fd(50) + + .. doctest:: + + >>> turtle.home() + >>> turtle.dot() + >>> turtle.fd(50); turtle.dot(20, "blue"); turtle.fd(50) + >>> turtle.position() + (100.00,-0.00) + >>> turtle.heading() + 0.0 .. function:: stamp() @@ -399,10 +492,12 @@ position. Return a stamp_id for that stamp, which can be used to delete it by calling ``clearstamp(stamp_id)``. - >>> turtle.color("blue") - >>> turtle.stamp() - 13 - >>> turtle.fd(50) + .. doctest:: + + >>> turtle.color("blue") + >>> turtle.stamp() + 11 + >>> turtle.fd(50) .. function:: clearstamp(stampid) @@ -412,10 +507,18 @@ Delete stamp with given *stampid*. - >>> turtle.color("blue") - >>> astamp = turtle.stamp() - >>> turtle.fd(50) - >>> turtle.clearstamp(astamp) + .. doctest:: + + >>> turtle.position() + (150.00,-0.00) + >>> turtle.color("blue") + >>> astamp = turtle.stamp() + >>> turtle.fd(50) + >>> turtle.position() + (200.00,-0.00) + >>> turtle.clearstamp(astamp) + >>> turtle.position() + (200.00,-0.00) .. function:: clearstamps(n=None) @@ -426,11 +529,21 @@ all stamps, if *n* > 0 delete first *n* stamps, else if *n* < 0 delete last *n* stamps. - >>> for i in range(8): - ... turtle.stamp(); turtle.fd(30) - >>> turtle.clearstamps(2) - >>> turtle.clearstamps(-2) - >>> turtle.clearstamps() + .. doctest:: + + >>> for i in range(8): + ... turtle.stamp(); turtle.fd(30) + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + >>> turtle.clearstamps(2) + >>> turtle.clearstamps(-2) + >>> turtle.clearstamps() .. function:: undo() @@ -438,11 +551,13 @@ Undo (repeatedly) the last turtle action(s). Number of available undo actions is determined by the size of the undobuffer. - >>> for i in range(4): - ... turtle.fd(50); turtle.lt(80) - ... - >>> for i in range(8): - ... turtle.undo() + .. doctest:: + + >>> for i in range(4): + ... turtle.fd(50); turtle.lt(80) + ... + >>> for i in range(8): + ... turtle.undo() .. function:: speed(speed=None) @@ -468,7 +583,16 @@ place. forward/back makes turtle jump and likewise left/right make the turtle turn instantly. - >>> turtle.speed(3) + .. doctest:: + + >>> turtle.speed() + 3 + >>> turtle.speed('normal') + >>> turtle.speed() + 6 + >>> turtle.speed(9) + >>> turtle.speed() + 9 Tell Turtle's state @@ -479,8 +603,10 @@ Return the turtle's current location (x,y) (as a :class:`Vec2D` vector). - >>> turtle.pos() - (0.00, 240.00) + .. doctest:: + + >>> turtle.pos() + (440.00,-0.00) .. function:: towards(x, y=None) @@ -492,32 +618,41 @@ by (x,y), the vector or the other turtle. This depends on the turtle's start orientation which depends on the mode - "standard"/"world" or "logo"). - >>> turtle.pos() - (10.00, 10.00) - >>> turtle.towards(0,0) - 225.0 + .. doctest:: + + >>> turtle.goto(10, 10) + >>> turtle.towards(0,0) + 225.0 .. function:: xcor() Return the turtle's x coordinate. - >>> reset() - >>> turtle.left(60) - >>> turtle.forward(100) - >>> print turtle.xcor() - 50.0 + .. doctest:: + + >>> turtle.home() + >>> turtle.left(50) + >>> turtle.forward(100) + >>> turtle.pos() + (64.28,76.60) + >>> print turtle.xcor() + 64.2787609687 .. function:: ycor() Return the turtle's y coordinate. - >>> reset() - >>> turtle.left(60) - >>> turtle.forward(100) - >>> print turtle.ycor() - 86.6025403784 + .. doctest:: + + >>> turtle.home() + >>> turtle.left(60) + >>> turtle.forward(100) + >>> print turtle.pos() + (50.00,86.60) + >>> print turtle.ycor() + 86.6025403784 .. function:: heading() @@ -525,9 +660,12 @@ Return the turtle's current heading (value depends on the turtle mode, see :func:`mode`). - >>> turtle.left(67) - >>> turtle.heading() - 67.0 + .. doctest:: + + >>> turtle.home() + >>> turtle.left(67) + >>> turtle.heading() + 67.0 .. function:: distance(x, y=None) @@ -538,14 +676,17 @@ Return the distance from the turtle to (x,y), the given vector, or the given other turtle, in turtle step units. - >>> turtle.pos() - (0.00, 0.00) - >>> turtle.distance(30,40) - 50.0 - >>> joe = Turtle() - >>> joe.forward(77) - >>> turtle.distance(joe) - 77.0 + .. doctest:: + + >>> turtle.home() + >>> turtle.distance(30,40) + 50.0 + >>> turtle.distance((30,40)) + 50.0 + >>> joe = Turtle() + >>> joe.forward(77) + >>> turtle.distance(joe) + 77.0 Settings for measurement @@ -558,12 +699,18 @@ Set angle measurement units, i.e. set number of "degrees" for a full circle. Default value is 360 degrees. - >>> turtle.left(90) - >>> turtle.heading() - 90 - >>> turtle.degrees(400.0) # angle measurement in gon - >>> turtle.heading() - 100 + .. doctest:: + + >>> turtle.home() + >>> turtle.left(90) + >>> turtle.heading() + 90.0 + >>> turtle.degrees(400.0) # angle measurement in gon + >>> turtle.heading() + 100.0 + >>> turtle.degrees(360) + >>> turtle.heading() + 90.0 .. function:: radians() @@ -571,11 +718,20 @@ Set the angle measurement units to radians. Equivalent to ``degrees(2*math.pi)``. - >>> turtle.heading() - 90 - >>> turtle.radians() - >>> turtle.heading() - 1.5707963267948966 + .. doctest:: + + >>> turtle.home() + >>> turtle.left(90) + >>> turtle.heading() + 90.0 + >>> turtle.radians() + >>> turtle.heading() + 1.5707963267948966 + + .. doctest:: + :hide: + + >>> turtle.degrees(360) Pen control @@ -607,9 +763,11 @@ "auto" and turtleshape is a polygon, that polygon is drawn with the same line thickness. If no argument is given, the current pensize is returned. - >>> turtle.pensize() - 1 - >>> turtle.pensize(10) # from here on lines of width 10 are drawn + .. doctest:: + + >>> turtle.pensize() + 1 + >>> turtle.pensize(10) # from here on lines of width 10 are drawn .. function:: pen(pen=None, **pendict) @@ -631,40 +789,45 @@ * "outline": positive number * "tilt": number - This dicionary can be used as argument for a subsequent call to :func:`pen` + This dictionary can be used as argument for a subsequent call to :func:`pen` to restore the former pen-state. Moreover one or more of these attributes can be provided as keyword-arguments. This can be used to set several pen attributes in one statement. - >>> turtle.pen(fillcolor="black", pencolor="red", pensize=10) - >>> turtle.pen() - {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1, - 'pencolor': 'red', 'pendown': True, 'fillcolor': 'black', - 'stretchfactor': (1,1), 'speed': 3} - >>> penstate=turtle.pen() - >>> turtle.color("yellow","") - >>> turtle.penup() - >>> turtle.pen() - {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1, - 'pencolor': 'yellow', 'pendown': False, 'fillcolor': '', - 'stretchfactor': (1,1), 'speed': 3} - >>> p.pen(penstate, fillcolor="green") - >>> p.pen() - {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1, - 'pencolor': 'red', 'pendown': True, 'fillcolor': 'green', - 'stretchfactor': (1,1), 'speed': 3} + .. doctest:: + :options: +NORMALIZE_WHITESPACE + + >>> turtle.pen(fillcolor="black", pencolor="red", pensize=10) + >>> sorted(turtle.pen().items()) + [('fillcolor', 'black'), ('outline', 1), ('pencolor', 'red'), + ('pendown', True), ('pensize', 10), ('resizemode', 'noresize'), + ('shown', True), ('speed', 9), ('stretchfactor', (1, 1)), ('tilt', 0)] + >>> penstate=turtle.pen() + >>> turtle.color("yellow", "") + >>> turtle.penup() + >>> sorted(turtle.pen().items()) + [('fillcolor', ''), ('outline', 1), ('pencolor', 'yellow'), + ('pendown', False), ('pensize', 10), ('resizemode', 'noresize'), + ('shown', True), ('speed', 9), ('stretchfactor', (1, 1)), ('tilt', 0)] + >>> turtle.pen(penstate, fillcolor="green") + >>> sorted(turtle.pen().items()) + [('fillcolor', 'green'), ('outline', 1), ('pencolor', 'red'), + ('pendown', True), ('pensize', 10), ('resizemode', 'noresize'), + ('shown', True), ('speed', 9), ('stretchfactor', (1, 1)), ('tilt', 0)] .. function:: isdown() Return ``True`` if pen is down, ``False`` if it's up. - >>> turtle.penup() - >>> turtle.isdown() - False - >>> turtle.pendown() - >>> turtle.isdown() - True + .. doctest:: + + >>> turtle.penup() + >>> turtle.isdown() + False + >>> turtle.pendown() + >>> turtle.isdown() + True Color control @@ -677,8 +840,8 @@ Four input formats are allowed: ``pencolor()`` - Return the current pencolor as color specification string, possibly in - hex-number format (see example). May be used as input to another + Return the current pencolor as color specification string or + as a tuple (see example). May be used as input to another color/pencolor/fillcolor call. ``pencolor(colorstring)`` @@ -697,11 +860,25 @@ If turtleshape is a polygon, the outline of that polygon is drawn with the newly set pencolor. - >>> turtle.pencolor("brown") - >>> tup = (0.2, 0.8, 0.55) - >>> turtle.pencolor(tup) - >>> turtle.pencolor() - "#33cc8c" + .. doctest:: + + >>> colormode() + 1.0 + >>> turtle.pencolor() + 'red' + >>> turtle.pencolor("brown") + >>> turtle.pencolor() + 'brown' + >>> tup = (0.2, 0.8, 0.55) + >>> turtle.pencolor(tup) + >>> turtle.pencolor() + (0.20000000000000001, 0.80000000000000004, 0.5490196078431373) + >>> colormode(255) + >>> turtle.pencolor() + (51, 204, 140) + >>> turtle.pencolor('#32c18f') + >>> turtle.pencolor() + (50, 193, 143) .. function:: fillcolor(*args) @@ -711,8 +888,8 @@ Four input formats are allowed: ``fillcolor()`` - Return the current fillcolor as color specification string, possibly in - hex-number format (see example). May be used as input to another + Return the current fillcolor as color specification string, possibly + in tuple format (see example). May be used as input to another color/pencolor/fillcolor call. ``fillcolor(colorstring)`` @@ -731,10 +908,20 @@ If turtleshape is a polygon, the interior of that polygon is drawn with the newly set fillcolor. - >>> turtle.fillcolor("violet") - >>> col = turtle.pencolor() - >>> turtle.fillcolor(col) - >>> turtle.fillcolor(0, .5, 0) + .. doctest:: + + >>> turtle.fillcolor("violet") + >>> turtle.fillcolor() + 'violet' + >>> col = turtle.pencolor() + >>> col + (50, 193, 143) + >>> turtle.fillcolor(col) + >>> turtle.fillcolor() + (50, 193, 143) + >>> turtle.fillcolor('#ffffff') + >>> turtle.fillcolor() + (255, 255, 255) .. function:: color(*args) @@ -746,7 +933,7 @@ ``color()`` Return the current pencolor and the current fillcolor as a pair of color - specification strings as returned by :func:`pencolor` and + specification strings or tuples as returned by :func:`pencolor` and :func:`fillcolor`. ``color(colorstring)``, ``color((r,g,b))``, ``color(r,g,b)`` @@ -760,13 +947,14 @@ If turtleshape is a polygon, outline and interior of that polygon is drawn with the newly set colors. - >>> turtle.color("red", "green") - >>> turtle.color() - ("red", "green") - >>> colormode(255) - >>> color((40, 80, 120), (160, 200, 240)) - >>> color() - ("#285078", "#a0c8f0") + .. doctest:: + + >>> turtle.color("red", "green") + >>> turtle.color() + ('red', 'green') + >>> color("#285078", "#a0c8f0") + >>> color() + ((40, 80, 120), (160, 200, 240)) See also: Screen method :func:`colormode`. @@ -775,31 +963,41 @@ Filling ~~~~~~~ +.. doctest:: + :hide: + + >>> turtle.home() + .. function:: filling() Return fillstate (``True`` if filling, ``False`` else). - >>> turtle.begin_fill() - >>> if turtle.filling(): - ... turtle.pensize(5) - else: - ... turtle.pensize(3) + .. doctest:: + + >>> turtle.begin_fill() + >>> if turtle.filling(): + ... turtle.pensize(5) + ... else: + ... turtle.pensize(3) + .. function:: begin_fill() To be called just before drawing a shape to be filled. - >>> turtle.color("black", "red") - >>> turtle.begin_fill() - >>> turtle.circle(60) - >>> turtle.end_fill() - .. function:: end_fill() Fill the shape drawn after the last call to :func:`begin_fill`. + .. doctest:: + + >>> turtle.color("black", "red") + >>> turtle.begin_fill() + >>> turtle.circle(80) + >>> turtle.end_fill() + More drawing control ~~~~~~~~~~~~~~~~~~~~ @@ -809,15 +1007,19 @@ Delete the turtle's drawings from the screen, re-center the turtle and set variables to the default values. - >>> turtle.position() - (0.00,-22.00) - >>> turtle.heading() - 100.0 - >>> turtle.reset() - >>> turtle.position() - (0.00,0.00) - >>> turtle.heading() - 0.0 + .. doctest:: + + >>> turtle.goto(0,-22) + >>> turtle.left(100) + >>> turtle.position() + (0.00,-22.00) + >>> turtle.heading() + 100.0 + >>> turtle.reset() + >>> turtle.position() + (0.00,0.00) + >>> turtle.heading() + 0.0 .. function:: clear() @@ -848,15 +1050,6 @@ Visibility ~~~~~~~~~~ -.. function:: showturtle() - st() - - Make the turtle visible. - - >>> turtle.hideturtle() - >>> turtle.showturtle() - - .. function:: hideturtle() ht() @@ -864,7 +1057,19 @@ middle of doing some complex drawing, because hiding the turtle speeds up the drawing observably. - >>> turtle.hideturtle() + .. doctest:: + + >>> turtle.hideturtle() + + +.. function:: showturtle() + st() + + Make the turtle visible. + + .. doctest:: + + >>> turtle.showturtle() .. function:: isvisible() @@ -872,8 +1077,11 @@ Return True if the Turtle is shown, False if it's hidden. >>> turtle.hideturtle() - >>> print turtle.isvisible(): + >>> turtle.isvisible() False + >>> turtle.showturtle() + >>> turtle.isvisible() + True Appearance @@ -889,11 +1097,13 @@ "turtle", "circle", "square", "triangle", "classic". To learn about how to deal with shapes see Screen method :func:`register_shape`. - >>> turtle.shape() - "arrow" - >>> turtle.shape("turtle") - >>> turtle.shape() - "turtle" + .. doctest:: + + >>> turtle.shape() + 'classic' + >>> turtle.shape("turtle") + >>> turtle.shape() + 'turtle' .. function:: resizemode(rmode=None) @@ -912,9 +1122,13 @@ resizemode("user") is called by :func:`shapesize` when used with arguments. - >>> turtle.resizemode("noresize") - >>> turtle.resizemode() - "noresize" + .. doctest:: + + >>> turtle.resizemode() + 'noresize' + >>> turtle.resizemode("auto") + >>> turtle.resizemode() + 'auto' .. function:: shapesize(stretch_wid=None, stretch_len=None, outline=None) @@ -930,9 +1144,17 @@ stretchfactor in direction of its orientation, *outline* determines the width of the shapes's outline. - >>> turtle.resizemode("user") - >>> turtle.shapesize(5, 5, 12) - >>> turtle.shapesize(outline=8) + .. doctest:: + + >>> turtle.shapesize() + (1, 1, 1) + >>> turtle.resizemode("user") + >>> turtle.shapesize(5, 5, 12) + >>> turtle.shapesize() + (5, 5, 12) + >>> turtle.shapesize(outline=8) + >>> turtle.shapesize() + (5, 5, 8) .. function:: tilt(angle) @@ -942,12 +1164,15 @@ Rotate the turtleshape by *angle* from its current tilt-angle, but do *not* change the turtle's heading (direction of movement). - >>> turtle.shape("circle") - >>> turtle.shapesize(5,2) - >>> turtle.tilt(30) - >>> turtle.fd(50) - >>> turtle.tilt(30) - >>> turtle.fd(50) + .. doctest:: + + >>> turtle.reset() + >>> turtle.shape("circle") + >>> turtle.shapesize(5,2) + >>> turtle.tilt(30) + >>> turtle.fd(50) + >>> turtle.tilt(30) + >>> turtle.fd(50) .. function:: settiltangle(angle) @@ -958,14 +1183,15 @@ regardless of its current tilt-angle. *Do not* change the turtle's heading (direction of movement). - >>> turtle.shape("circle") - >>> turtle.shapesize(5,2) - >>> turtle.settiltangle(45) - >>> stamp() - >>> turtle.fd(50) - >>> turtle.settiltangle(-45) - >>> stamp() - >>> turtle.fd(50) + .. doctest:: + + >>> turtle.reset() + >>> turtle.shape("circle") + >>> turtle.shapesize(5,2) + >>> turtle.settiltangle(45) + >>> turtle.fd(50) + >>> turtle.settiltangle(-45) + >>> turtle.fd(50) .. function:: tiltangle() @@ -973,11 +1199,14 @@ Return the current tilt-angle, i.e. the angle between the orientation of the turtleshape and the heading of the turtle (its direction of movement). - >>> turtle.shape("circle") - >>> turtle.shapesize(5,2) - >>> turtle.tilt(45) - >>> turtle.tiltangle() - 45 + .. doctest:: + + >>> turtle.reset() + >>> turtle.shape("circle") + >>> turtle.shapesize(5,2) + >>> turtle.tilt(45) + >>> turtle.tiltangle() + 45.0 Using events @@ -995,11 +1224,13 @@ existing bindings are removed. Example for the anonymous turtle, i.e. the procedural way: - >>> def turn(x, y): - ... left(180) - ... - >>> onclick(turn) # Now clicking into the turtle will turn it. - >>> onclick(None) # event-binding will be removed + .. doctest:: + + >>> def turn(x, y): + ... left(180) + ... + >>> onclick(turn) # Now clicking into the turtle will turn it. + >>> onclick(None) # event-binding will be removed .. function:: onrelease(fun, btn=1, add=None) @@ -1013,15 +1244,17 @@ Bind *fun* to mouse-button-release events on this turtle. If *fun* is ``None``, existing bindings are removed. - >>> class MyTurtle(Turtle): - ... def glow(self,x,y): - ... self.fillcolor("red") - ... def unglow(self,x,y): - ... self.fillcolor("") - ... - >>> turtle = MyTurtle() - >>> turtle.onclick(turtle.glow) # clicking on turtle turns fillcolor red, - >>> turtle.onrelease(turtle.unglow) # releasing turns it to transparent. + .. doctest:: + + >>> class MyTurtle(Turtle): + ... def glow(self,x,y): + ... self.fillcolor("red") + ... def unglow(self,x,y): + ... self.fillcolor("") + ... + >>> turtle = MyTurtle() + >>> turtle.onclick(turtle.glow) # clicking on turtle turns fillcolor red, + >>> turtle.onrelease(turtle.unglow) # releasing turns it to transparent. .. function:: ondrag(fun, btn=1, add=None) @@ -1038,9 +1271,12 @@ Remark: Every sequence of mouse-move-events on a turtle is preceded by a mouse-click event on that turtle. - >>> turtle.ondrag(turtle.goto) - # Subsequently, clicking and dragging the Turtle will move it across - # the screen thereby producing handdrawings (if pen is down). + .. doctest:: + + >>> turtle.ondrag(turtle.goto) + + Subsequently, clicking and dragging the Turtle will move it across + the screen thereby producing handdrawings (if pen is down). Special Turtle methods @@ -1062,8 +1298,18 @@ Return the last recorded polygon. - >>> p = turtle.get_poly() - >>> turtle.register_shape("myFavouriteShape", p) + .. doctest:: + + >>> turtle.home() + >>> turtle.begin_poly() + >>> turtle.fd(100) + >>> turtle.left(20) + >>> turtle.fd(30) + >>> turtle.left(60) + >>> turtle.fd(50) + >>> turtle.end_poly() + >>> p = turtle.get_poly() + >>> register_shape("myFavouriteShape", p) .. function:: clone() @@ -1071,8 +1317,10 @@ Create and return a clone of the turtle with same position, heading and turtle properties. - >>> mick = Turtle() - >>> joe = mick.clone() + .. doctest:: + + >>> mick = Turtle() + >>> joe = mick.clone() .. function:: getturtle() @@ -1080,12 +1328,12 @@ Return the Turtle object itself. Only reasonable use: as a function to return the "anonymous turtle": - >>> pet = getturtle() - >>> pet.fd(50) - >>> pet - - >>> turtles() - [] + .. doctest:: + + >>> pet = getturtle() + >>> pet.fd(50) + >>> pet + .. function:: getscreen() @@ -1093,10 +1341,12 @@ Return the :class:`TurtleScreen` object the turtle is drawing on. TurtleScreen methods can then be called for that object. - >>> ts = turtle.getscreen() - >>> ts - - >>> ts.bgcolor("pink") + .. doctest:: + + >>> ts = turtle.getscreen() + >>> ts + + >>> ts.bgcolor("pink") .. function:: setundobuffer(size) @@ -1108,15 +1358,20 @@ that can be undone by the :func:`undo` method/function. If *size* is ``None``, the undobuffer is disabled. - >>> turtle.setundobuffer(42) + .. doctest:: + + >>> turtle.setundobuffer(42) .. function:: undobufferentries() Return number of entries in the undobuffer. - >>> while undobufferentries(): - ... undo() + .. doctest:: + + >>> while undobufferentries(): + ... undo() + .. _compoundshapes: @@ -1134,16 +1389,20 @@ For example: - >>> s = Shape("compound") - >>> poly1 = ((0,0),(10,-5),(0,10),(-10,-5)) - >>> s.addcomponent(poly1, "red", "blue") - >>> poly2 = ((0,0),(10,-5),(-10,-5)) - >>> s.addcomponent(poly2, "blue", "red") + .. doctest:: + + >>> s = Shape("compound") + >>> poly1 = ((0,0),(10,-5),(0,10),(-10,-5)) + >>> s.addcomponent(poly1, "red", "blue") + >>> poly2 = ((0,0),(10,-5),(-10,-5)) + >>> s.addcomponent(poly2, "blue", "red") 3. Now add the Shape to the Screen's shapelist and use it: - >>> register_shape("myshape", s) - >>> shape("myshape") + .. doctest:: + + >>> register_shape("myshape", s) + >>> shape("myshape") .. note:: @@ -1159,6 +1418,10 @@ Most of the examples in this section refer to a TurtleScreen instance called ``screen``. +.. doctest:: + :hide: + + >>> screen = Screen() Window control -------------- @@ -1170,12 +1433,14 @@ Set or return background color of the TurtleScreen. - >>> screen.bgcolor("orange") - >>> screen.bgcolor() - "orange" - >>> screen.bgcolor(0.5,0,0.5) - >>> screen.bgcolor() - "#800080" + .. doctest:: + + >>> screen.bgcolor("orange") + >>> screen.bgcolor() + 'orange' + >>> screen.bgcolor("#800080") + >>> screen.bgcolor() + (128, 0, 128) .. function:: bgpic(picname=None) @@ -1185,13 +1450,13 @@ Set background image or return name of current backgroundimage. If *picname* is a filename, set the corresponding image as background. If *picname* is ``"nopic"``, delete background image, if present. If *picname* is ``None``, - return the filename of the current backgroundimage. + return the filename of the current backgroundimage. :: - >>> screen.bgpic() - "nopic" - >>> screen.bgpic("landscape.gif") - >>> screen.bgpic() - "landscape.gif" + >>> screen.bgpic() + 'nopic' + >>> screen.bgpic("landscape.gif") + >>> screen.bgpic() + "landscape.gif" .. function:: clear() @@ -1230,8 +1495,13 @@ method, one can make visible those parts of a drawing which were outside the canvas before. - >>> turtle.screensize(2000,1500) - # e.g. to search for an erroneously escaped turtle ;-) + >>> screen.screensize() + (400, 300) + >>> screen.screensize(2000,1500) + >>> screen.screensize() + (2000, 1500) + + e.g. to search for an erroneously escaped turtle ;-) .. function:: setworldcoordinates(llx, lly, urx, ury) @@ -1248,13 +1518,22 @@ **ATTENTION**: in user-defined coordinate systems angles may appear distorted. - >>> screen.reset() - >>> screen.setworldcoordinates(-50,-7.5,50,7.5) - >>> for _ in range(72): - ... left(10) - ... - >>> for _ in range(8): - ... left(45); fd(2) # a regular octagon + .. doctest:: + + >>> screen.reset() + >>> screen.setworldcoordinates(-50,-7.5,50,7.5) + >>> for _ in range(72): + ... left(10) + ... + >>> for _ in range(8): + ... left(45); fd(2) # a regular octagon + + .. doctest:: + :hide: + + >>> screen.reset() + >>> for t in turtles(): + ... t.reset() Animation control @@ -1270,9 +1549,13 @@ Optional argument: - >>> screen.delay(15) - >>> screen.delay() - 15 + .. doctest:: + + >>> screen.delay() + 10 + >>> screen.delay(5) + >>> screen.delay() + 5 .. function:: tracer(n=None, delay=None) @@ -1285,12 +1568,14 @@ used to accelerate the drawing of complex graphics.) Second argument sets delay value (see :func:`delay`). - >>> screen.tracer(8, 25) - >>> dist = 2 - >>> for i in range(200): - ... fd(dist) - ... rt(90) - ... dist += 2 + .. doctest:: + + >>> screen.tracer(8, 25) + >>> dist = 2 + >>> for i in range(200): + ... fd(dist) + ... rt(90) + ... dist += 2 .. function:: update() @@ -1318,12 +1603,14 @@ are removed. Remark: in order to be able to register key-events, TurtleScreen must have the focus. (See method :func:`listen`.) - >>> def f(): - ... fd(50) - ... lt(60) - ... - >>> screen.onkey(f, "Up") - >>> screen.listen() + .. doctest:: + + >>> def f(): + ... fd(50) + ... lt(60) + ... + >>> screen.onkey(f, "Up") + >>> screen.listen() .. function:: onclick(fun, btn=1, add=None) @@ -1341,10 +1628,11 @@ Example for a TurtleScreen instance named ``screen`` and a Turtle instance named turtle: - >>> screen.onclick(turtle.goto) - # Subsequently clicking into the TurtleScreen will - # make the turtle move to the clicked point. - >>> screen.onclick(None) # remove event binding again + .. doctest:: + + >>> screen.onclick(turtle.goto) # Subsequently clicking into the TurtleScreen will + >>> # make the turtle move to the clicked point. + >>> screen.onclick(None) # remove event binding again .. note:: This TurtleScreen method is available as a global function only under the @@ -1359,14 +1647,16 @@ Install a timer that calls *fun* after *t* milliseconds. - >>> running = True - >>> def f(): - if running: - fd(50) - lt(60) - screen.ontimer(f, 250) - >>> f() ### makes the turtle marching around - >>> running = False + .. doctest:: + + >>> running = True + >>> def f(): + ... if running: + ... fd(50) + ... lt(60) + ... screen.ontimer(f, 250) + >>> f() ### makes the turtle march around + >>> running = False Settings and special methods @@ -1391,9 +1681,11 @@ "logo" upward (north) clockwise ============ ========================= =================== - >>> mode("logo") # resets turtle heading to north - >>> mode() - "logo" + .. doctest:: + + >>> mode("logo") # resets turtle heading to north + >>> mode() + 'logo' .. function:: colormode(cmode=None) @@ -1403,10 +1695,19 @@ Return the colormode or set it to 1.0 or 255. Subsequently *r*, *g*, *b* values of color triples have to be in the range 0..\ *cmode*. - >>> screen.colormode() - 1.0 - >>> screen.colormode(255) - >>> turtle.pencolor(240,160,80) + .. doctest:: + + >>> screen.colormode(1) + >>> turtle.pencolor(240, 160, 80) + Traceback (most recent call last): + ... + TurtleGraphicsError: bad color sequence: (240, 160, 80) + >>> screen.colormode() + 1.0 + >>> screen.colormode(255) + >>> screen.colormode() + 255 + >>> turtle.pencolor(240,160,80) .. function:: getcanvas() @@ -1414,17 +1715,21 @@ Return the Canvas of this TurtleScreen. Useful for insiders who know what to do with a Tkinter Canvas. - >>> cv = screen.getcanvas() - >>> cv - + .. doctest:: + + >>> cv = screen.getcanvas() + >>> cv + .. function:: getshapes() Return a list of names of all currently available turtle shapes. - >>> screen.getshapes() - ["arrow", "blank", "circle", ..., "turtle"] + .. doctest:: + + >>> screen.getshapes() + ['arrow', 'blank', 'circle', ..., 'turtle'] .. function:: register_shape(name, shape=None) @@ -1433,7 +1738,9 @@ There are three different ways to call this function: (1) *name* is the name of a gif-file and *shape* is ``None``: Install the - corresponding image shape. + corresponding image shape. :: + + >>> screen.register_shape("turtle.gif") .. note:: Image shapes *do not* rotate when turning the turtle, so they do not @@ -1442,38 +1749,41 @@ (2) *name* is an arbitrary string and *shape* is a tuple of pairs of coordinates: Install the corresponding polygon shape. + .. doctest:: + + >>> screen.register_shape("triangle", ((5,-3), (0,5), (-5,-3))) + (3) *name* is an arbitrary string and shape is a (compound) :class:`Shape` object: Install the corresponding compound shape. Add a turtle shape to TurtleScreen's shapelist. Only thusly registered shapes can be used by issuing the command ``shape(shapename)``. - >>> screen.register_shape("turtle.gif") - >>> screen.register_shape("triangle", ((5,-3), (0,5), (-5,-3))) - .. function:: turtles() Return the list of turtles on the screen. - >>> for turtle in screen.turtles() - ... turtle.color("red") + .. doctest:: + + >>> for turtle in screen.turtles(): + ... turtle.color("red") .. function:: window_height() - Return the height of the turtle window. + Return the height of the turtle window. :: - >>> screen.window_height() - 480 + >>> screen.window_height() + 480 .. function:: window_width() - Return the width of the turtle window. + Return the width of the turtle window. :: - >>> screen.window_width() - 640 + >>> screen.window_width() + 640 .. _screenspecific: @@ -1515,10 +1825,12 @@ edge of the screen, if negative from the bottom edge, if None, center window vertically - >>> screen.setup (width=200, height=200, startx=0, starty=0) - # sets window to 200x200 pixels, in upper left of screen - >>> screen.setup(width=.75, height=0.5, startx=None, starty=None) - # sets window to 75% of screen by 50% of screen and centers + .. doctest:: + + >>> screen.setup (width=200, height=200, startx=0, starty=0) + >>> # sets window to 200x200 pixels, in upper left of screen + >>> screen.setup(width=.75, height=0.5, startx=None, starty=None) + >>> # sets window to 75% of screen by 50% of screen and centers .. function:: title(titlestring) @@ -1528,7 +1840,9 @@ Set title of turtle window to *titlestring*. - >>> screen.title("Welcome to the turtle zoo!") + .. doctest:: + + >>> screen.title("Welcome to the turtle zoo!") The public classes of the module :mod:`turtle` @@ -1541,14 +1855,14 @@ :param canvas: a :class:`Tkinter.Canvas`, a :class:`ScrolledCanvas` or a :class:`TurtleScreen` - Create a turtle. The turtle has all methods described above as "methods of - Turtle/RawTurtle". + Create a turtle. The turtle has all methods described above as "methods of + Turtle/RawTurtle". .. class:: Turtle() - Subclass of RawTurtle, has the same interface but draws on a default - :class:`Screen` object created automatically when needed for the first time. + Subclass of RawTurtle, has the same interface but draws on a default + :class:`Screen` object created automatically when needed for the first time. .. class:: TurtleScreen(cv) @@ -1596,10 +1910,12 @@ Example: - >>> poly = ((0,0),(10,-5),(0,10),(-10,-5)) - >>> s = Shape("compound") - >>> s.addcomponent(poly, "red", "blue") - # .. add more components and then use register_shape() + .. doctest:: + + >>> poly = ((0,0),(10,-5),(0,10),(-10,-5)) + >>> s = Shape("compound") + >>> s.addcomponent(poly, "red", "blue") + >>> # ... add more components and then use register_shape() See :ref:`compoundshapes`. @@ -1888,3 +2204,22 @@ This behaviour corresponds to a ``fill()`` call without arguments in Python 2.6. + +.. doctest:: + :hide: + + >>> for turtle in turtles(): + ... turtle.reset() + >>> turtle.penup() + >>> turtle.goto(-200,25) + >>> turtle.pendown() + >>> turtle.write("No one expects the Spanish Inquisition!", + ... font=("Arial", 20, "normal")) + >>> turtle.penup() + >>> turtle.goto(-100,-50) + >>> turtle.pendown() + >>> turtle.write("Our two chief Turtles are...", + ... font=("Arial", 16, "normal")) + >>> turtle.penup() + >>> turtle.goto(-450,-75) + >>> turtle.write(str(turtles())) From python-checkins at python.org Tue May 5 04:19:59 2009 From: python-checkins at python.org (r.david.murray) Date: Tue, 5 May 2009 04:19:59 +0200 (CEST) Subject: [Python-checkins] r72308 - in python/branches/release30-maint: Doc/library/turtle.rst Message-ID: <20090505021959.BE3B91E403C@bag.python.org> Author: r.david.murray Date: Tue May 5 04:19:58 2009 New Revision: 72308 Log: Merged revisions 72307 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72307 | r.david.murray | 2009-05-04 22:08:52 -0400 (Mon, 04 May 2009) | 11 lines Merged revisions 72149 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72149 | r.david.murray | 2009-04-30 08:42:32 -0400 (Thu, 30 Apr 2009) | 4 lines Make the turtle.rst doctests pass. I have a feeling there should be more cleanup, but I don't know now to kill turtles. Especially unexpected ones... ;) ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/library/turtle.rst Modified: python/branches/release30-maint/Doc/library/turtle.rst ============================================================================== --- python/branches/release30-maint/Doc/library/turtle.rst (original) +++ python/branches/release30-maint/Doc/library/turtle.rst Tue May 5 04:19:58 2009 @@ -6,6 +6,11 @@ :synopsis: Turtle graphics for Tk .. sectionauthor:: Gregor Lingl +.. testsetup:: default + + from turtle import * + turtle = Turtle() + Introduction ============ @@ -220,14 +225,16 @@ Move the turtle forward by the specified *distance*, in the direction the turtle is headed. - >>> turtle.position() - (0.00, 0.00) - >>> turtle.forward(25) - >>> turtle.position() - (25.00,0.00) - >>> turtle.forward(-75) - >>> turtle.position() - (-50.00,0.00) + .. doctest:: + + >>> turtle.position() + (0.00,0.00) + >>> turtle.forward(25) + >>> turtle.position() + (25.00,0.00) + >>> turtle.forward(-75) + >>> turtle.position() + (-50.00,0.00) .. function:: back(distance) @@ -239,11 +246,18 @@ Move the turtle backward by *distance*, opposite to the direction the turtle is headed. Do not change the turtle's heading. - >>> turtle.position() - (0.00, 0.00) - >>> turtle.backward(30) - >>> turtle.position() - (-30.00, 0.00) + .. doctest:: + :hide: + + >>> turtle.goto(0, 0) + + .. doctest:: + + >>> turtle.position() + (0.00,0.00) + >>> turtle.backward(30) + >>> turtle.position() + (-30.00,0.00) .. function:: right(angle) @@ -255,11 +269,18 @@ can be set via the :func:`degrees` and :func:`radians` functions.) Angle orientation depends on the turtle mode, see :func:`mode`. - >>> turtle.heading() - 22.0 - >>> turtle.right(45) - >>> turtle.heading() - 337.0 + .. doctest:: + :hide: + + >>> turtle.setheading(22) + + .. doctest:: + + >>> turtle.heading() + 22.0 + >>> turtle.right(45) + >>> turtle.heading() + 337.0 .. function:: left(angle) @@ -271,37 +292,52 @@ can be set via the :func:`degrees` and :func:`radians` functions.) Angle orientation depends on the turtle mode, see :func:`mode`. - >>> turtle.heading() - 22.0 - >>> turtle.left(45) - >>> turtle.heading() - 67.0 + .. doctest:: + :hide: + + >>> turtle.setheading(22) + + .. doctest:: + + >>> turtle.heading() + 22.0 + >>> turtle.left(45) + >>> turtle.heading() + 67.0 + .. function:: goto(x, y=None) setpos(x, y=None) setposition(x, y=None) - :param x: a number or a pair/vector of numbers - :param y: a number or ``None`` + :param x: a number or a pair/vector of numbers + :param y: a number or ``None`` - If *y* is ``None``, *x* must be a pair of coordinates or a :class:`Vec2D` - (e.g. as returned by :func:`pos`). + If *y* is ``None``, *x* must be a pair of coordinates or a :class:`Vec2D` + (e.g. as returned by :func:`pos`). - Move turtle to an absolute position. If the pen is down, draw line. Do - not change the turtle's orientation. + Move turtle to an absolute position. If the pen is down, draw line. Do + not change the turtle's orientation. - >>> tp = turtle.pos() - >>> tp - (0.00, 0.00) - >>> turtle.setpos(60,30) - >>> turtle.pos() - (60.00,30.00) - >>> turtle.setpos((20,80)) - >>> turtle.pos() - (20.00,80.00) - >>> turtle.setpos(tp) - >>> turtle.pos() - (0.00,0.00) + .. doctest:: + :hide: + + >>> turtle.goto(0, 0) + + .. doctest:: + + >>> tp = turtle.pos() + >>> tp + (0.00,0.00) + >>> turtle.setpos(60,30) + >>> turtle.pos() + (60.00,30.00) + >>> turtle.setpos((20,80)) + >>> turtle.pos() + (20.00,80.00) + >>> turtle.setpos(tp) + >>> turtle.pos() + (0.00,0.00) .. function:: setx(x) @@ -311,11 +347,18 @@ Set the turtle's first coordinate to *x*, leave second coordinate unchanged. - >>> turtle.position() - (0.00, 240.00) - >>> turtle.setx(10) - >>> turtle.position() - (10.00, 240.00) + .. doctest:: + :hide: + + >>> turtle.goto(0, 240) + + .. doctest:: + + >>> turtle.position() + (0.00,240.00) + >>> turtle.setx(10) + >>> turtle.position() + (10.00,240.00) .. function:: sety(y) @@ -324,11 +367,18 @@ Set the turtle's second coordinate to *y*, leave first coordinate unchanged. - >>> turtle.position() - (0.00, 40.00) - >>> turtle.sety(-10) - >>> turtle.position() - (0.00, -10.00) + .. doctest:: + :hide: + + >>> turtle.goto(0, 40) + + .. doctest:: + + >>> turtle.position() + (0.00,40.00) + >>> turtle.sety(-10) + >>> turtle.position() + (0.00,-10.00) .. function:: setheading(to_angle) @@ -348,9 +398,11 @@ 270 - south 270 - west =================== ==================== - >>> turtle.setheading(90) - >>> turtle.heading() - 90 + .. doctest:: + + >>> turtle.setheading(90) + >>> turtle.heading() + 90.0 .. function:: home() @@ -358,6 +410,24 @@ Move turtle to the origin -- coordinates (0,0) -- and set its heading to its start-orientation (which depends on the mode, see :func:`mode`). + .. doctest:: + :hide: + + >>> turtle.setheading(90) + >>> turtle.goto(0, -10) + + .. doctest:: + + >>> turtle.heading() + 90.0 + >>> turtle.position() + (0.00,-10.00) + >>> turtle.home() + >>> turtle.position() + (0.00,0.00) + >>> turtle.heading() + 0.0 + .. function:: circle(radius, extent=None, steps=None) @@ -377,8 +447,23 @@ determines the number of steps to use. If not given, it will be calculated automatically. May be used to draw regular polygons. - >>> turtle.circle(50) - >>> turtle.circle(120, 180) # draw a semicircle + .. doctest:: + + >>> turtle.home() + >>> turtle.position() + (0.00,0.00) + >>> turtle.heading() + 0.0 + >>> turtle.circle(50) + >>> turtle.position() + (-0.00,0.00) + >>> turtle.heading() + 0.0 + >>> turtle.circle(120, 180) # draw a semicircle + >>> turtle.position() + (0.00,240.00) + >>> turtle.heading() + 180.0 .. function:: dot(size=None, *color) @@ -389,8 +474,16 @@ Draw a circular dot with diameter *size*, using *color*. If *size* is not given, the maximum of pensize+4 and 2*pensize is used. - >>> turtle.dot() - >>> turtle.fd(50); turtle.dot(20, "blue"); turtle.fd(50) + + .. doctest:: + + >>> turtle.home() + >>> turtle.dot() + >>> turtle.fd(50); turtle.dot(20, "blue"); turtle.fd(50) + >>> turtle.position() + (100.00,-0.00) + >>> turtle.heading() + 0.0 .. function:: stamp() @@ -399,10 +492,12 @@ position. Return a stamp_id for that stamp, which can be used to delete it by calling ``clearstamp(stamp_id)``. - >>> turtle.color("blue") - >>> turtle.stamp() - 13 - >>> turtle.fd(50) + .. doctest:: + + >>> turtle.color("blue") + >>> turtle.stamp() + 11 + >>> turtle.fd(50) .. function:: clearstamp(stampid) @@ -412,10 +507,18 @@ Delete stamp with given *stampid*. - >>> turtle.color("blue") - >>> astamp = turtle.stamp() - >>> turtle.fd(50) - >>> turtle.clearstamp(astamp) + .. doctest:: + + >>> turtle.position() + (150.00,-0.00) + >>> turtle.color("blue") + >>> astamp = turtle.stamp() + >>> turtle.fd(50) + >>> turtle.position() + (200.00,-0.00) + >>> turtle.clearstamp(astamp) + >>> turtle.position() + (200.00,-0.00) .. function:: clearstamps(n=None) @@ -426,11 +529,21 @@ all stamps, if *n* > 0 delete first *n* stamps, else if *n* < 0 delete last *n* stamps. - >>> for i in range(8): - ... turtle.stamp(); turtle.fd(30) - >>> turtle.clearstamps(2) - >>> turtle.clearstamps(-2) - >>> turtle.clearstamps() + .. doctest:: + + >>> for i in range(8): + ... turtle.stamp(); turtle.fd(30) + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + >>> turtle.clearstamps(2) + >>> turtle.clearstamps(-2) + >>> turtle.clearstamps() .. function:: undo() @@ -438,11 +551,13 @@ Undo (repeatedly) the last turtle action(s). Number of available undo actions is determined by the size of the undobuffer. - >>> for i in range(4): - ... turtle.fd(50); turtle.lt(80) - ... - >>> for i in range(8): - ... turtle.undo() + .. doctest:: + + >>> for i in range(4): + ... turtle.fd(50); turtle.lt(80) + ... + >>> for i in range(8): + ... turtle.undo() .. function:: speed(speed=None) @@ -468,7 +583,16 @@ place. forward/back makes turtle jump and likewise left/right make the turtle turn instantly. - >>> turtle.speed(3) + .. doctest:: + + >>> turtle.speed() + 3 + >>> turtle.speed('normal') + >>> turtle.speed() + 6 + >>> turtle.speed(9) + >>> turtle.speed() + 9 Tell Turtle's state @@ -479,8 +603,10 @@ Return the turtle's current location (x,y) (as a :class:`Vec2D` vector). - >>> turtle.pos() - (0.00, 240.00) + .. doctest:: + + >>> turtle.pos() + (440.00,-0.00) .. function:: towards(x, y=None) @@ -492,32 +618,41 @@ by (x,y), the vector or the other turtle. This depends on the turtle's start orientation which depends on the mode - "standard"/"world" or "logo"). - >>> turtle.pos() - (10.00, 10.00) - >>> turtle.towards(0,0) - 225.0 + .. doctest:: + + >>> turtle.goto(10, 10) + >>> turtle.towards(0,0) + 225.0 .. function:: xcor() Return the turtle's x coordinate. - >>> reset() - >>> turtle.left(60) - >>> turtle.forward(100) - >>> print turtle.xcor() - 50.0 + .. doctest:: + + >>> turtle.home() + >>> turtle.left(50) + >>> turtle.forward(100) + >>> turtle.pos() + (64.28,76.60) + >>> print turtle.xcor() + 64.2787609687 .. function:: ycor() Return the turtle's y coordinate. - >>> reset() - >>> turtle.left(60) - >>> turtle.forward(100) - >>> print turtle.ycor() - 86.6025403784 + .. doctest:: + + >>> turtle.home() + >>> turtle.left(60) + >>> turtle.forward(100) + >>> print turtle.pos() + (50.00,86.60) + >>> print turtle.ycor() + 86.6025403784 .. function:: heading() @@ -525,9 +660,12 @@ Return the turtle's current heading (value depends on the turtle mode, see :func:`mode`). - >>> turtle.left(67) - >>> turtle.heading() - 67.0 + .. doctest:: + + >>> turtle.home() + >>> turtle.left(67) + >>> turtle.heading() + 67.0 .. function:: distance(x, y=None) @@ -538,14 +676,17 @@ Return the distance from the turtle to (x,y), the given vector, or the given other turtle, in turtle step units. - >>> turtle.pos() - (0.00, 0.00) - >>> turtle.distance(30,40) - 50.0 - >>> joe = Turtle() - >>> joe.forward(77) - >>> turtle.distance(joe) - 77.0 + .. doctest:: + + >>> turtle.home() + >>> turtle.distance(30,40) + 50.0 + >>> turtle.distance((30,40)) + 50.0 + >>> joe = Turtle() + >>> joe.forward(77) + >>> turtle.distance(joe) + 77.0 Settings for measurement @@ -558,12 +699,18 @@ Set angle measurement units, i.e. set number of "degrees" for a full circle. Default value is 360 degrees. - >>> turtle.left(90) - >>> turtle.heading() - 90 - >>> turtle.degrees(400.0) # angle measurement in gon - >>> turtle.heading() - 100 + .. doctest:: + + >>> turtle.home() + >>> turtle.left(90) + >>> turtle.heading() + 90.0 + >>> turtle.degrees(400.0) # angle measurement in gon + >>> turtle.heading() + 100.0 + >>> turtle.degrees(360) + >>> turtle.heading() + 90.0 .. function:: radians() @@ -571,11 +718,20 @@ Set the angle measurement units to radians. Equivalent to ``degrees(2*math.pi)``. - >>> turtle.heading() - 90 - >>> turtle.radians() - >>> turtle.heading() - 1.5707963267948966 + .. doctest:: + + >>> turtle.home() + >>> turtle.left(90) + >>> turtle.heading() + 90.0 + >>> turtle.radians() + >>> turtle.heading() + 1.5707963267948966 + + .. doctest:: + :hide: + + >>> turtle.degrees(360) Pen control @@ -607,9 +763,11 @@ "auto" and turtleshape is a polygon, that polygon is drawn with the same line thickness. If no argument is given, the current pensize is returned. - >>> turtle.pensize() - 1 - >>> turtle.pensize(10) # from here on lines of width 10 are drawn + .. doctest:: + + >>> turtle.pensize() + 1 + >>> turtle.pensize(10) # from here on lines of width 10 are drawn .. function:: pen(pen=None, **pendict) @@ -631,40 +789,45 @@ * "outline": positive number * "tilt": number - This dicionary can be used as argument for a subsequent call to :func:`pen` + This dictionary can be used as argument for a subsequent call to :func:`pen` to restore the former pen-state. Moreover one or more of these attributes can be provided as keyword-arguments. This can be used to set several pen attributes in one statement. - >>> turtle.pen(fillcolor="black", pencolor="red", pensize=10) - >>> turtle.pen() - {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1, - 'pencolor': 'red', 'pendown': True, 'fillcolor': 'black', - 'stretchfactor': (1,1), 'speed': 3} - >>> penstate=turtle.pen() - >>> turtle.color("yellow","") - >>> turtle.penup() - >>> turtle.pen() - {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1, - 'pencolor': 'yellow', 'pendown': False, 'fillcolor': '', - 'stretchfactor': (1,1), 'speed': 3} - >>> p.pen(penstate, fillcolor="green") - >>> p.pen() - {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1, - 'pencolor': 'red', 'pendown': True, 'fillcolor': 'green', - 'stretchfactor': (1,1), 'speed': 3} + .. doctest:: + :options: +NORMALIZE_WHITESPACE + + >>> turtle.pen(fillcolor="black", pencolor="red", pensize=10) + >>> sorted(turtle.pen().items()) + [('fillcolor', 'black'), ('outline', 1), ('pencolor', 'red'), + ('pendown', True), ('pensize', 10), ('resizemode', 'noresize'), + ('shown', True), ('speed', 9), ('stretchfactor', (1, 1)), ('tilt', 0)] + >>> penstate=turtle.pen() + >>> turtle.color("yellow", "") + >>> turtle.penup() + >>> sorted(turtle.pen().items()) + [('fillcolor', ''), ('outline', 1), ('pencolor', 'yellow'), + ('pendown', False), ('pensize', 10), ('resizemode', 'noresize'), + ('shown', True), ('speed', 9), ('stretchfactor', (1, 1)), ('tilt', 0)] + >>> turtle.pen(penstate, fillcolor="green") + >>> sorted(turtle.pen().items()) + [('fillcolor', 'green'), ('outline', 1), ('pencolor', 'red'), + ('pendown', True), ('pensize', 10), ('resizemode', 'noresize'), + ('shown', True), ('speed', 9), ('stretchfactor', (1, 1)), ('tilt', 0)] .. function:: isdown() Return ``True`` if pen is down, ``False`` if it's up. - >>> turtle.penup() - >>> turtle.isdown() - False - >>> turtle.pendown() - >>> turtle.isdown() - True + .. doctest:: + + >>> turtle.penup() + >>> turtle.isdown() + False + >>> turtle.pendown() + >>> turtle.isdown() + True Color control @@ -677,8 +840,8 @@ Four input formats are allowed: ``pencolor()`` - Return the current pencolor as color specification string, possibly in - hex-number format (see example). May be used as input to another + Return the current pencolor as color specification string or + as a tuple (see example). May be used as input to another color/pencolor/fillcolor call. ``pencolor(colorstring)`` @@ -697,11 +860,25 @@ If turtleshape is a polygon, the outline of that polygon is drawn with the newly set pencolor. - >>> turtle.pencolor("brown") - >>> tup = (0.2, 0.8, 0.55) - >>> turtle.pencolor(tup) - >>> turtle.pencolor() - "#33cc8c" + .. doctest:: + + >>> colormode() + 1.0 + >>> turtle.pencolor() + 'red' + >>> turtle.pencolor("brown") + >>> turtle.pencolor() + 'brown' + >>> tup = (0.2, 0.8, 0.55) + >>> turtle.pencolor(tup) + >>> turtle.pencolor() + (0.20000000000000001, 0.80000000000000004, 0.5490196078431373) + >>> colormode(255) + >>> turtle.pencolor() + (51, 204, 140) + >>> turtle.pencolor('#32c18f') + >>> turtle.pencolor() + (50, 193, 143) .. function:: fillcolor(*args) @@ -711,8 +888,8 @@ Four input formats are allowed: ``fillcolor()`` - Return the current fillcolor as color specification string, possibly in - hex-number format (see example). May be used as input to another + Return the current fillcolor as color specification string, possibly + in tuple format (see example). May be used as input to another color/pencolor/fillcolor call. ``fillcolor(colorstring)`` @@ -731,10 +908,20 @@ If turtleshape is a polygon, the interior of that polygon is drawn with the newly set fillcolor. - >>> turtle.fillcolor("violet") - >>> col = turtle.pencolor() - >>> turtle.fillcolor(col) - >>> turtle.fillcolor(0, .5, 0) + .. doctest:: + + >>> turtle.fillcolor("violet") + >>> turtle.fillcolor() + 'violet' + >>> col = turtle.pencolor() + >>> col + (50, 193, 143) + >>> turtle.fillcolor(col) + >>> turtle.fillcolor() + (50, 193, 143) + >>> turtle.fillcolor('#ffffff') + >>> turtle.fillcolor() + (255, 255, 255) .. function:: color(*args) @@ -746,7 +933,7 @@ ``color()`` Return the current pencolor and the current fillcolor as a pair of color - specification strings as returned by :func:`pencolor` and + specification strings or tuples as returned by :func:`pencolor` and :func:`fillcolor`. ``color(colorstring)``, ``color((r,g,b))``, ``color(r,g,b)`` @@ -760,13 +947,14 @@ If turtleshape is a polygon, outline and interior of that polygon is drawn with the newly set colors. - >>> turtle.color("red", "green") - >>> turtle.color() - ("red", "green") - >>> colormode(255) - >>> color((40, 80, 120), (160, 200, 240)) - >>> color() - ("#285078", "#a0c8f0") + .. doctest:: + + >>> turtle.color("red", "green") + >>> turtle.color() + ('red', 'green') + >>> color("#285078", "#a0c8f0") + >>> color() + ((40, 80, 120), (160, 200, 240)) See also: Screen method :func:`colormode`. @@ -775,31 +963,41 @@ Filling ~~~~~~~ +.. doctest:: + :hide: + + >>> turtle.home() + .. function:: filling() Return fillstate (``True`` if filling, ``False`` else). - >>> turtle.begin_fill() - >>> if turtle.filling(): - ... turtle.pensize(5) - else: - ... turtle.pensize(3) + .. doctest:: + + >>> turtle.begin_fill() + >>> if turtle.filling(): + ... turtle.pensize(5) + ... else: + ... turtle.pensize(3) + .. function:: begin_fill() To be called just before drawing a shape to be filled. - >>> turtle.color("black", "red") - >>> turtle.begin_fill() - >>> turtle.circle(60) - >>> turtle.end_fill() - .. function:: end_fill() Fill the shape drawn after the last call to :func:`begin_fill`. + .. doctest:: + + >>> turtle.color("black", "red") + >>> turtle.begin_fill() + >>> turtle.circle(80) + >>> turtle.end_fill() + More drawing control ~~~~~~~~~~~~~~~~~~~~ @@ -809,15 +1007,19 @@ Delete the turtle's drawings from the screen, re-center the turtle and set variables to the default values. - >>> turtle.position() - (0.00,-22.00) - >>> turtle.heading() - 100.0 - >>> turtle.reset() - >>> turtle.position() - (0.00,0.00) - >>> turtle.heading() - 0.0 + .. doctest:: + + >>> turtle.goto(0,-22) + >>> turtle.left(100) + >>> turtle.position() + (0.00,-22.00) + >>> turtle.heading() + 100.0 + >>> turtle.reset() + >>> turtle.position() + (0.00,0.00) + >>> turtle.heading() + 0.0 .. function:: clear() @@ -848,15 +1050,6 @@ Visibility ~~~~~~~~~~ -.. function:: showturtle() - st() - - Make the turtle visible. - - >>> turtle.hideturtle() - >>> turtle.showturtle() - - .. function:: hideturtle() ht() @@ -864,7 +1057,19 @@ middle of doing some complex drawing, because hiding the turtle speeds up the drawing observably. - >>> turtle.hideturtle() + .. doctest:: + + >>> turtle.hideturtle() + + +.. function:: showturtle() + st() + + Make the turtle visible. + + .. doctest:: + + >>> turtle.showturtle() .. function:: isvisible() @@ -872,8 +1077,11 @@ Return True if the Turtle is shown, False if it's hidden. >>> turtle.hideturtle() - >>> print turtle.isvisible(): + >>> turtle.isvisible() False + >>> turtle.showturtle() + >>> turtle.isvisible() + True Appearance @@ -889,11 +1097,13 @@ "turtle", "circle", "square", "triangle", "classic". To learn about how to deal with shapes see Screen method :func:`register_shape`. - >>> turtle.shape() - "arrow" - >>> turtle.shape("turtle") - >>> turtle.shape() - "turtle" + .. doctest:: + + >>> turtle.shape() + 'classic' + >>> turtle.shape("turtle") + >>> turtle.shape() + 'turtle' .. function:: resizemode(rmode=None) @@ -912,9 +1122,13 @@ resizemode("user") is called by :func:`shapesize` when used with arguments. - >>> turtle.resizemode("noresize") - >>> turtle.resizemode() - "noresize" + .. doctest:: + + >>> turtle.resizemode() + 'noresize' + >>> turtle.resizemode("auto") + >>> turtle.resizemode() + 'auto' .. function:: shapesize(stretch_wid=None, stretch_len=None, outline=None) @@ -930,9 +1144,17 @@ stretchfactor in direction of its orientation, *outline* determines the width of the shapes's outline. - >>> turtle.resizemode("user") - >>> turtle.shapesize(5, 5, 12) - >>> turtle.shapesize(outline=8) + .. doctest:: + + >>> turtle.shapesize() + (1, 1, 1) + >>> turtle.resizemode("user") + >>> turtle.shapesize(5, 5, 12) + >>> turtle.shapesize() + (5, 5, 12) + >>> turtle.shapesize(outline=8) + >>> turtle.shapesize() + (5, 5, 8) .. function:: tilt(angle) @@ -942,12 +1164,15 @@ Rotate the turtleshape by *angle* from its current tilt-angle, but do *not* change the turtle's heading (direction of movement). - >>> turtle.shape("circle") - >>> turtle.shapesize(5,2) - >>> turtle.tilt(30) - >>> turtle.fd(50) - >>> turtle.tilt(30) - >>> turtle.fd(50) + .. doctest:: + + >>> turtle.reset() + >>> turtle.shape("circle") + >>> turtle.shapesize(5,2) + >>> turtle.tilt(30) + >>> turtle.fd(50) + >>> turtle.tilt(30) + >>> turtle.fd(50) .. function:: settiltangle(angle) @@ -958,14 +1183,15 @@ regardless of its current tilt-angle. *Do not* change the turtle's heading (direction of movement). - >>> turtle.shape("circle") - >>> turtle.shapesize(5,2) - >>> turtle.settiltangle(45) - >>> stamp() - >>> turtle.fd(50) - >>> turtle.settiltangle(-45) - >>> stamp() - >>> turtle.fd(50) + .. doctest:: + + >>> turtle.reset() + >>> turtle.shape("circle") + >>> turtle.shapesize(5,2) + >>> turtle.settiltangle(45) + >>> turtle.fd(50) + >>> turtle.settiltangle(-45) + >>> turtle.fd(50) .. function:: tiltangle() @@ -973,11 +1199,14 @@ Return the current tilt-angle, i.e. the angle between the orientation of the turtleshape and the heading of the turtle (its direction of movement). - >>> turtle.shape("circle") - >>> turtle.shapesize(5,2) - >>> turtle.tilt(45) - >>> turtle.tiltangle() - 45 + .. doctest:: + + >>> turtle.reset() + >>> turtle.shape("circle") + >>> turtle.shapesize(5,2) + >>> turtle.tilt(45) + >>> turtle.tiltangle() + 45.0 Using events @@ -995,11 +1224,13 @@ existing bindings are removed. Example for the anonymous turtle, i.e. the procedural way: - >>> def turn(x, y): - ... left(180) - ... - >>> onclick(turn) # Now clicking into the turtle will turn it. - >>> onclick(None) # event-binding will be removed + .. doctest:: + + >>> def turn(x, y): + ... left(180) + ... + >>> onclick(turn) # Now clicking into the turtle will turn it. + >>> onclick(None) # event-binding will be removed .. function:: onrelease(fun, btn=1, add=None) @@ -1013,15 +1244,17 @@ Bind *fun* to mouse-button-release events on this turtle. If *fun* is ``None``, existing bindings are removed. - >>> class MyTurtle(Turtle): - ... def glow(self,x,y): - ... self.fillcolor("red") - ... def unglow(self,x,y): - ... self.fillcolor("") - ... - >>> turtle = MyTurtle() - >>> turtle.onclick(turtle.glow) # clicking on turtle turns fillcolor red, - >>> turtle.onrelease(turtle.unglow) # releasing turns it to transparent. + .. doctest:: + + >>> class MyTurtle(Turtle): + ... def glow(self,x,y): + ... self.fillcolor("red") + ... def unglow(self,x,y): + ... self.fillcolor("") + ... + >>> turtle = MyTurtle() + >>> turtle.onclick(turtle.glow) # clicking on turtle turns fillcolor red, + >>> turtle.onrelease(turtle.unglow) # releasing turns it to transparent. .. function:: ondrag(fun, btn=1, add=None) @@ -1038,9 +1271,12 @@ Remark: Every sequence of mouse-move-events on a turtle is preceded by a mouse-click event on that turtle. - >>> turtle.ondrag(turtle.goto) - # Subsequently, clicking and dragging the Turtle will move it across - # the screen thereby producing handdrawings (if pen is down). + .. doctest:: + + >>> turtle.ondrag(turtle.goto) + + Subsequently, clicking and dragging the Turtle will move it across + the screen thereby producing handdrawings (if pen is down). Special Turtle methods @@ -1062,8 +1298,18 @@ Return the last recorded polygon. - >>> p = turtle.get_poly() - >>> turtle.register_shape("myFavouriteShape", p) + .. doctest:: + + >>> turtle.home() + >>> turtle.begin_poly() + >>> turtle.fd(100) + >>> turtle.left(20) + >>> turtle.fd(30) + >>> turtle.left(60) + >>> turtle.fd(50) + >>> turtle.end_poly() + >>> p = turtle.get_poly() + >>> register_shape("myFavouriteShape", p) .. function:: clone() @@ -1071,8 +1317,10 @@ Create and return a clone of the turtle with same position, heading and turtle properties. - >>> mick = Turtle() - >>> joe = mick.clone() + .. doctest:: + + >>> mick = Turtle() + >>> joe = mick.clone() .. function:: getturtle() @@ -1080,12 +1328,12 @@ Return the Turtle object itself. Only reasonable use: as a function to return the "anonymous turtle": - >>> pet = getturtle() - >>> pet.fd(50) - >>> pet - - >>> turtles() - [] + .. doctest:: + + >>> pet = getturtle() + >>> pet.fd(50) + >>> pet + .. function:: getscreen() @@ -1093,10 +1341,12 @@ Return the :class:`TurtleScreen` object the turtle is drawing on. TurtleScreen methods can then be called for that object. - >>> ts = turtle.getscreen() - >>> ts - - >>> ts.bgcolor("pink") + .. doctest:: + + >>> ts = turtle.getscreen() + >>> ts + + >>> ts.bgcolor("pink") .. function:: setundobuffer(size) @@ -1108,15 +1358,20 @@ that can be undone by the :func:`undo` method/function. If *size* is ``None``, the undobuffer is disabled. - >>> turtle.setundobuffer(42) + .. doctest:: + + >>> turtle.setundobuffer(42) .. function:: undobufferentries() Return number of entries in the undobuffer. - >>> while undobufferentries(): - ... undo() + .. doctest:: + + >>> while undobufferentries(): + ... undo() + .. _compoundshapes: @@ -1134,16 +1389,20 @@ For example: - >>> s = Shape("compound") - >>> poly1 = ((0,0),(10,-5),(0,10),(-10,-5)) - >>> s.addcomponent(poly1, "red", "blue") - >>> poly2 = ((0,0),(10,-5),(-10,-5)) - >>> s.addcomponent(poly2, "blue", "red") + .. doctest:: + + >>> s = Shape("compound") + >>> poly1 = ((0,0),(10,-5),(0,10),(-10,-5)) + >>> s.addcomponent(poly1, "red", "blue") + >>> poly2 = ((0,0),(10,-5),(-10,-5)) + >>> s.addcomponent(poly2, "blue", "red") 3. Now add the Shape to the Screen's shapelist and use it: - >>> register_shape("myshape", s) - >>> shape("myshape") + .. doctest:: + + >>> register_shape("myshape", s) + >>> shape("myshape") .. note:: @@ -1159,6 +1418,10 @@ Most of the examples in this section refer to a TurtleScreen instance called ``screen``. +.. doctest:: + :hide: + + >>> screen = Screen() Window control -------------- @@ -1170,12 +1433,14 @@ Set or return background color of the TurtleScreen. - >>> screen.bgcolor("orange") - >>> screen.bgcolor() - "orange" - >>> screen.bgcolor(0.5,0,0.5) - >>> screen.bgcolor() - "#800080" + .. doctest:: + + >>> screen.bgcolor("orange") + >>> screen.bgcolor() + 'orange' + >>> screen.bgcolor("#800080") + >>> screen.bgcolor() + (128, 0, 128) .. function:: bgpic(picname=None) @@ -1185,13 +1450,13 @@ Set background image or return name of current backgroundimage. If *picname* is a filename, set the corresponding image as background. If *picname* is ``"nopic"``, delete background image, if present. If *picname* is ``None``, - return the filename of the current backgroundimage. + return the filename of the current backgroundimage. :: - >>> screen.bgpic() - "nopic" - >>> screen.bgpic("landscape.gif") - >>> screen.bgpic() - "landscape.gif" + >>> screen.bgpic() + 'nopic' + >>> screen.bgpic("landscape.gif") + >>> screen.bgpic() + "landscape.gif" .. function:: clear() @@ -1230,8 +1495,13 @@ method, one can make visible those parts of a drawing which were outside the canvas before. - >>> turtle.screensize(2000,1500) - # e.g. to search for an erroneously escaped turtle ;-) + >>> screen.screensize() + (400, 300) + >>> screen.screensize(2000,1500) + >>> screen.screensize() + (2000, 1500) + + e.g. to search for an erroneously escaped turtle ;-) .. function:: setworldcoordinates(llx, lly, urx, ury) @@ -1248,13 +1518,22 @@ **ATTENTION**: in user-defined coordinate systems angles may appear distorted. - >>> screen.reset() - >>> screen.setworldcoordinates(-50,-7.5,50,7.5) - >>> for _ in range(72): - ... left(10) - ... - >>> for _ in range(8): - ... left(45); fd(2) # a regular octagon + .. doctest:: + + >>> screen.reset() + >>> screen.setworldcoordinates(-50,-7.5,50,7.5) + >>> for _ in range(72): + ... left(10) + ... + >>> for _ in range(8): + ... left(45); fd(2) # a regular octagon + + .. doctest:: + :hide: + + >>> screen.reset() + >>> for t in turtles(): + ... t.reset() Animation control @@ -1270,9 +1549,13 @@ Optional argument: - >>> screen.delay(15) - >>> screen.delay() - 15 + .. doctest:: + + >>> screen.delay() + 10 + >>> screen.delay(5) + >>> screen.delay() + 5 .. function:: tracer(n=None, delay=None) @@ -1285,12 +1568,14 @@ used to accelerate the drawing of complex graphics.) Second argument sets delay value (see :func:`delay`). - >>> screen.tracer(8, 25) - >>> dist = 2 - >>> for i in range(200): - ... fd(dist) - ... rt(90) - ... dist += 2 + .. doctest:: + + >>> screen.tracer(8, 25) + >>> dist = 2 + >>> for i in range(200): + ... fd(dist) + ... rt(90) + ... dist += 2 .. function:: update() @@ -1318,12 +1603,14 @@ are removed. Remark: in order to be able to register key-events, TurtleScreen must have the focus. (See method :func:`listen`.) - >>> def f(): - ... fd(50) - ... lt(60) - ... - >>> screen.onkey(f, "Up") - >>> screen.listen() + .. doctest:: + + >>> def f(): + ... fd(50) + ... lt(60) + ... + >>> screen.onkey(f, "Up") + >>> screen.listen() .. function:: onclick(fun, btn=1, add=None) @@ -1341,10 +1628,11 @@ Example for a TurtleScreen instance named ``screen`` and a Turtle instance named turtle: - >>> screen.onclick(turtle.goto) - # Subsequently clicking into the TurtleScreen will - # make the turtle move to the clicked point. - >>> screen.onclick(None) # remove event binding again + .. doctest:: + + >>> screen.onclick(turtle.goto) # Subsequently clicking into the TurtleScreen will + >>> # make the turtle move to the clicked point. + >>> screen.onclick(None) # remove event binding again .. note:: This TurtleScreen method is available as a global function only under the @@ -1359,14 +1647,16 @@ Install a timer that calls *fun* after *t* milliseconds. - >>> running = True - >>> def f(): - if running: - fd(50) - lt(60) - screen.ontimer(f, 250) - >>> f() ### makes the turtle marching around - >>> running = False + .. doctest:: + + >>> running = True + >>> def f(): + ... if running: + ... fd(50) + ... lt(60) + ... screen.ontimer(f, 250) + >>> f() ### makes the turtle march around + >>> running = False Settings and special methods @@ -1391,9 +1681,11 @@ "logo" upward (north) clockwise ============ ========================= =================== - >>> mode("logo") # resets turtle heading to north - >>> mode() - "logo" + .. doctest:: + + >>> mode("logo") # resets turtle heading to north + >>> mode() + 'logo' .. function:: colormode(cmode=None) @@ -1403,10 +1695,19 @@ Return the colormode or set it to 1.0 or 255. Subsequently *r*, *g*, *b* values of color triples have to be in the range 0..\ *cmode*. - >>> screen.colormode() - 1.0 - >>> screen.colormode(255) - >>> turtle.pencolor(240,160,80) + .. doctest:: + + >>> screen.colormode(1) + >>> turtle.pencolor(240, 160, 80) + Traceback (most recent call last): + ... + TurtleGraphicsError: bad color sequence: (240, 160, 80) + >>> screen.colormode() + 1.0 + >>> screen.colormode(255) + >>> screen.colormode() + 255 + >>> turtle.pencolor(240,160,80) .. function:: getcanvas() @@ -1414,17 +1715,21 @@ Return the Canvas of this TurtleScreen. Useful for insiders who know what to do with a Tkinter Canvas. - >>> cv = screen.getcanvas() - >>> cv - + .. doctest:: + + >>> cv = screen.getcanvas() + >>> cv + .. function:: getshapes() Return a list of names of all currently available turtle shapes. - >>> screen.getshapes() - ["arrow", "blank", "circle", ..., "turtle"] + .. doctest:: + + >>> screen.getshapes() + ['arrow', 'blank', 'circle', ..., 'turtle'] .. function:: register_shape(name, shape=None) @@ -1433,7 +1738,9 @@ There are three different ways to call this function: (1) *name* is the name of a gif-file and *shape* is ``None``: Install the - corresponding image shape. + corresponding image shape. :: + + >>> screen.register_shape("turtle.gif") .. note:: Image shapes *do not* rotate when turning the turtle, so they do not @@ -1442,38 +1749,41 @@ (2) *name* is an arbitrary string and *shape* is a tuple of pairs of coordinates: Install the corresponding polygon shape. + .. doctest:: + + >>> screen.register_shape("triangle", ((5,-3), (0,5), (-5,-3))) + (3) *name* is an arbitrary string and shape is a (compound) :class:`Shape` object: Install the corresponding compound shape. Add a turtle shape to TurtleScreen's shapelist. Only thusly registered shapes can be used by issuing the command ``shape(shapename)``. - >>> screen.register_shape("turtle.gif") - >>> screen.register_shape("triangle", ((5,-3), (0,5), (-5,-3))) - .. function:: turtles() Return the list of turtles on the screen. - >>> for turtle in screen.turtles() - ... turtle.color("red") + .. doctest:: + + >>> for turtle in screen.turtles(): + ... turtle.color("red") .. function:: window_height() - Return the height of the turtle window. + Return the height of the turtle window. :: - >>> screen.window_height() - 480 + >>> screen.window_height() + 480 .. function:: window_width() - Return the width of the turtle window. + Return the width of the turtle window. :: - >>> screen.window_width() - 640 + >>> screen.window_width() + 640 .. _screenspecific: @@ -1515,10 +1825,12 @@ edge of the screen, if negative from the bottom edge, if None, center window vertically - >>> screen.setup (width=200, height=200, startx=0, starty=0) - # sets window to 200x200 pixels, in upper left of screen - >>> screen.setup(width=.75, height=0.5, startx=None, starty=None) - # sets window to 75% of screen by 50% of screen and centers + .. doctest:: + + >>> screen.setup (width=200, height=200, startx=0, starty=0) + >>> # sets window to 200x200 pixels, in upper left of screen + >>> screen.setup(width=.75, height=0.5, startx=None, starty=None) + >>> # sets window to 75% of screen by 50% of screen and centers .. function:: title(titlestring) @@ -1528,7 +1840,9 @@ Set title of turtle window to *titlestring*. - >>> screen.title("Welcome to the turtle zoo!") + .. doctest:: + + >>> screen.title("Welcome to the turtle zoo!") The public classes of the module :mod:`turtle` @@ -1541,14 +1855,14 @@ :param canvas: a :class:`Tkinter.Canvas`, a :class:`ScrolledCanvas` or a :class:`TurtleScreen` - Create a turtle. The turtle has all methods described above as "methods of - Turtle/RawTurtle". + Create a turtle. The turtle has all methods described above as "methods of + Turtle/RawTurtle". .. class:: Turtle() - Subclass of RawTurtle, has the same interface but draws on a default - :class:`Screen` object created automatically when needed for the first time. + Subclass of RawTurtle, has the same interface but draws on a default + :class:`Screen` object created automatically when needed for the first time. .. class:: TurtleScreen(cv) @@ -1596,10 +1910,12 @@ Example: - >>> poly = ((0,0),(10,-5),(0,10),(-10,-5)) - >>> s = Shape("compound") - >>> s.addcomponent(poly, "red", "blue") - # .. add more components and then use register_shape() + .. doctest:: + + >>> poly = ((0,0),(10,-5),(0,10),(-10,-5)) + >>> s = Shape("compound") + >>> s.addcomponent(poly, "red", "blue") + >>> # ... add more components and then use register_shape() See :ref:`compoundshapes`. @@ -1888,3 +2204,22 @@ This behaviour corresponds to a ``fill()`` call without arguments in Python 2.6. + +.. doctest:: + :hide: + + >>> for turtle in turtles(): + ... turtle.reset() + >>> turtle.penup() + >>> turtle.goto(-200,25) + >>> turtle.pendown() + >>> turtle.write("No one expects the Spanish Inquisition!", + ... font=("Arial", 20, "normal")) + >>> turtle.penup() + >>> turtle.goto(-100,-50) + >>> turtle.pendown() + >>> turtle.write("Our two chief Turtles are...", + ... font=("Arial", 16, "normal")) + >>> turtle.penup() + >>> turtle.goto(-450,-75) + >>> turtle.write(str(turtles())) From python-checkins at python.org Tue May 5 04:22:38 2009 From: python-checkins at python.org (steven.bethard) Date: Tue, 5 May 2009 04:22:38 +0200 (CEST) Subject: [Python-checkins] r72309 - in python/branches/py3k: Lib/distutils/command/bdist_msi.py Message-ID: <20090505022238.7CBA01E403C@bag.python.org> Author: steven.bethard Date: Tue May 5 04:22:38 2009 New Revision: 72309 Log: Merged revisions 72306 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72306 | steven.bethard | 2009-05-04 18:31:22 -0700 (Mon, 04 May 2009) | 1 line Update bdist_msi so that the generated MSIs for pure Python modules can install to any version of Python, like the generated EXEs from bdist_wininst. (Previously, you had to create a new MSI for each version of Python.) ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/command/bdist_msi.py Modified: python/branches/py3k/Lib/distutils/command/bdist_msi.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/bdist_msi.py (original) +++ python/branches/py3k/Lib/distutils/command/bdist_msi.py Tue May 5 04:22:38 2009 @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2005, 2006 Martin v. L??wis +# Copyright (C) 2005, 2006 Martin v. L?wis # Licensed to PSF under a Contributor Agreement. # The bdist_wininst command proper # based on bdist_wininst @@ -117,6 +117,12 @@ boolean_options = ['keep-temp', 'no-target-compile', 'no-target-optimize', 'skip-build'] + all_versions = ['2.0', '2.1', '2.2', '2.3', '2.4', + '2.5', '2.6', '2.7', '2.8', '2.9', + '3.0', '3.1', '3.2', '3.3', '3.4', + '3.5', '3.6', '3.7', '3.8', '3.9'] + other_version = 'X' + def initialize_options(self): self.bdist_dir = None self.plat_name = None @@ -128,6 +134,7 @@ self.skip_build = 0 self.install_script = None self.pre_install_script = None + self.versions = None def finalize_options(self): if self.bdist_dir is None: @@ -135,13 +142,14 @@ self.bdist_dir = os.path.join(bdist_base, 'msi') short_version = get_python_version() if self.target_version: + self.versions = [self.target_version] if not self.skip_build and self.distribution.has_ext_modules()\ and self.target_version != short_version: raise DistutilsOptionError( "target version can only be %s, or the '--skip_build'" " option must be specified" % (short_version,)) else: - self.target_version = short_version + self.versions = list(self.all_versions) self.set_undefined_options('bdist', ('dist_dir', 'dist_dir'), @@ -222,8 +230,11 @@ # Prefix ProductName with Python x.y, so that # it sorts together with the other Python packages # in Add-Remove-Programs (APR) - product_name = "Python %s %s" % (self.target_version, - self.distribution.get_fullname()) + fullname = self.distribution.get_fullname() + if self.target_version: + product_name = "Python %s %s" % (self.target_version, fullname) + else: + product_name = "Python %s" % (fullname) self.db = msilib.init_database(installer_name, schema, product_name, msilib.gen_uuid(), sversion, author) @@ -244,7 +255,8 @@ self.db.Commit() if hasattr(self.distribution, 'dist_files'): - self.distribution.dist_files.append(('bdist_msi', self.target_version, fullname)) + tup = 'bdist_msi', self.target_version or 'any', fullname + self.distribution.dist_files.append(tup) if not self.keep_temp: remove_tree(self.bdist_dir, dry_run=self.dry_run) @@ -252,66 +264,121 @@ def add_files(self): db = self.db cab = msilib.CAB("distfiles") - f = Feature(db, "default", "Default Feature", "Everything", 1, directory="TARGETDIR") - f.set_current() rootdir = os.path.abspath(self.bdist_dir) + root = Directory(db, cab, None, rootdir, "TARGETDIR", "SourceDir") + f = Feature(db, "Python", "Python", "Everything", + 0, 1, directory="TARGETDIR") + + items = [(f, root, '')] + for version in self.versions + [self.other_version]: + target = "TARGETDIR" + version + name = default = "Python" + version + desc = "Everything" + if version is self.other_version: + title = "Python from another location" + level = 2 + else: + title = "Python %s from registry" % version + level = 1 + f = Feature(db, name, title, desc, 1, level, directory=target) + dir = Directory(db, cab, root, rootdir, target, default) + items.append((f, dir, version)) db.Commit() - todo = [root] - while todo: - dir = todo.pop() - for file in os.listdir(dir.absolute): - afile = os.path.join(dir.absolute, file) - if os.path.isdir(afile): - newdir = Directory(db, cab, dir, file, file, "%s|%s" % (dir.make_short(file), file)) - todo.append(newdir) - else: - key = dir.add_file(file) - if file==self.install_script: - if self.install_script_key: - raise DistutilsOptionError( - "Multiple files with name %s" % file) - self.install_script_key = '[#%s]' % key + + seen = {} + for feature, dir, version in items: + todo = [dir] + while todo: + dir = todo.pop() + for file in os.listdir(dir.absolute): + afile = os.path.join(dir.absolute, file) + if os.path.isdir(afile): + short = "%s|%s" % (dir.make_short(file), file) + default = file + version + newdir = Directory(db, cab, dir, file, default, short) + todo.append(newdir) + else: + if not dir.component: + dir.start_component(dir.logical, feature, 0) + if afile not in seen: + key = seen[afile] = dir.add_file(file) + if file==self.install_script: + if self.install_script_key: + raise DistutilsOptionError( + "Multiple files with name %s" % file) + self.install_script_key = '[#%s]' % key + else: + key = seen[afile] + add_data(self.db, "DuplicateFile", + [(key + version, dir.component, key, None, dir.logical)]) + cab.commit(db) def add_find_python(self): """Adds code to the installer to compute the location of Python. - Properties PYTHON.MACHINE, PYTHON.USER, PYTHONDIR and PYTHON will be set - in both the execute and UI sequences; PYTHONDIR will be set from - PYTHON.USER if defined, else from PYTHON.MACHINE. - PYTHON is PYTHONDIR\python.exe""" - install_path = r"SOFTWARE\Python\PythonCore\%s\InstallPath" % self.target_version - add_data(self.db, "RegLocator", - [("python.machine", 2, install_path, None, 2), - ("python.user", 1, install_path, None, 2)]) - add_data(self.db, "AppSearch", - [("PYTHON.MACHINE", "python.machine"), - ("PYTHON.USER", "python.user")]) - add_data(self.db, "CustomAction", - [("PythonFromMachine", 51+256, "PYTHONDIR", "[PYTHON.MACHINE]"), - ("PythonFromUser", 51+256, "PYTHONDIR", "[PYTHON.USER]"), - ("PythonExe", 51+256, "PYTHON", "[PYTHONDIR]\\python.exe"), - ("InitialTargetDir", 51+256, "TARGETDIR", "[PYTHONDIR]")]) - add_data(self.db, "InstallExecuteSequence", - [("PythonFromMachine", "PYTHON.MACHINE", 401), - ("PythonFromUser", "PYTHON.USER", 402), - ("PythonExe", None, 403), - ("InitialTargetDir", 'TARGETDIR=""', 404), - ]) - add_data(self.db, "InstallUISequence", - [("PythonFromMachine", "PYTHON.MACHINE", 401), - ("PythonFromUser", "PYTHON.USER", 402), - ("PythonExe", None, 403), - ("InitialTargetDir", 'TARGETDIR=""', 404), - ]) - def add_scripts(self): - if self.install_script: + Properties PYTHON.MACHINE.X.Y and PYTHON.USER.X.Y will be set from the + registry for each version of Python. + + Properties TARGETDIRX.Y will be set from PYTHON.USER.X.Y if defined, + else from PYTHON.MACHINE.X.Y. + + Properties PYTHONX.Y will be set to TARGETDIRX.Y\\python.exe""" + + start = 402 + for ver in self.versions: + install_path = r"SOFTWARE\Python\PythonCore\%s\InstallPath" % ver + machine_reg = "python.machine." + ver + user_reg = "python.user." + ver + machine_prop = "PYTHON.MACHINE." + ver + user_prop = "PYTHON.USER." + ver + machine_action = "PythonFromMachine" + ver + user_action = "PythonFromUser" + ver + exe_action = "PythonExe" + ver + target_dir_prop = "TARGETDIR" + ver + exe_prop = "PYTHON" + ver + add_data(self.db, "RegLocator", + [(machine_reg, 2, install_path, None, 2), + (user_reg, 1, install_path, None, 2)]) + add_data(self.db, "AppSearch", + [(machine_prop, machine_reg), + (user_prop, user_reg)]) add_data(self.db, "CustomAction", - [("install_script", 50, "PYTHON", self.install_script_key)]) + [(machine_action, 51+256, target_dir_prop, "[" + machine_prop + "]"), + (user_action, 51+256, target_dir_prop, "[" + user_prop + "]"), + (exe_action, 51+256, exe_prop, "[" + target_dir_prop + "]\\python.exe"), + ]) add_data(self.db, "InstallExecuteSequence", - [("install_script", "NOT Installed", 6800)]) + [(machine_action, machine_prop, start), + (user_action, user_prop, start + 1), + (exe_action, None, start + 2), + ]) + add_data(self.db, "InstallUISequence", + [(machine_action, machine_prop, start), + (user_action, user_prop, start + 1), + (exe_action, None, start + 2), + ]) + add_data(self.db, "Condition", + [("Python" + ver, 0, "NOT TARGETDIR" + ver)]) + start += 4 + assert start < 500 + + def add_scripts(self): + if self.install_script: + start = 6800 + for ver in self.versions + [self.other_version]: + install_action = "install_script." + ver + exe_prop = "PYTHON" + ver + add_data(self.db, "CustomAction", + [(install_action, 50, exe_prop, self.install_script_key)]) + add_data(self.db, "InstallExecuteSequence", + [(install_action, "&Python%s=3" % ver, start)]) + start += 1 + # XXX pre-install scripts are currently refused in finalize_options() + # but if this feature is completed, it will also need to add + # entries for each version as the above code does if self.pre_install_script: scriptfn = os.path.join(self.bdist_dir, "preinstall.bat") f = open(scriptfn, "w") @@ -375,7 +442,7 @@ [("PrepareDlg", "Not Privileged or Windows9x or Installed", 140), ("WhichUsersDlg", "Privileged and not Windows9x and not Installed", 141), # In the user interface, assume all-users installation if privileged. - ("SelectDirectoryDlg", "Not Installed", 1230), + ("SelectFeaturesDlg", "Not Installed", 1230), # XXX no support for resume installations yet #("ResumeDlg", "Installed AND (RESUME OR Preselected)", 1240), ("MaintenanceTypeDlg", "Installed AND NOT RESUME AND NOT Preselected", 1250), @@ -498,33 +565,49 @@ c.event("SpawnDialog", "CancelDlg") ##################################################################### - # Target directory selection - seldlg = PyDialog(db, "SelectDirectoryDlg", x, y, w, h, modal, title, + # Feature (Python directory) selection + seldlg = PyDialog(db, "SelectFeaturesDlg", x, y, w, h, modal, title, "Next", "Next", "Cancel") - seldlg.title("Select Destination Directory") + seldlg.title("Select Python Installations") - version = sys.version[:3]+" " - seldlg.text("Hint", 15, 30, 300, 40, 3, - "The destination directory should contain a Python %sinstallation" % version) + seldlg.text("Hint", 15, 30, 300, 20, 3, + "Select the Python locations where %s should be installed." + % self.distribution.get_fullname()) seldlg.back("< Back", None, active=0) c = seldlg.next("Next >", "Cancel") - c.event("SetTargetPath", "TARGETDIR", ordering=1) - c.event("SpawnWaitDialog", "WaitForCostingDlg", ordering=2) - c.event("EndDialog", "Return", ordering=3) - - c = seldlg.cancel("Cancel", "DirectoryCombo") + order = 1 + c.event("[TARGETDIR]", "[SourceDir]", ordering=order) + for version in self.versions + [self.other_version]: + order += 1 + c.event("[TARGETDIR]", "[TARGETDIR%s]" % version, + "FEATURE_SELECTED AND &Python%s=3" % version, + ordering=order) + c.event("SpawnWaitDialog", "WaitForCostingDlg", ordering=order + 1) + c.event("EndDialog", "Return", ordering=order + 2) + c = seldlg.cancel("Cancel", "Features") c.event("SpawnDialog", "CancelDlg") - seldlg.control("DirectoryCombo", "DirectoryCombo", 15, 70, 272, 80, 393219, - "TARGETDIR", None, "DirectoryList", None) - seldlg.control("DirectoryList", "DirectoryList", 15, 90, 308, 136, 3, "TARGETDIR", - None, "PathEdit", None) - seldlg.control("PathEdit", "PathEdit", 15, 230, 306, 16, 3, "TARGETDIR", None, "Next", None) - c = seldlg.pushbutton("Up", 306, 70, 18, 18, 3, "Up", None) - c.event("DirectoryListUp", "0") - c = seldlg.pushbutton("NewDir", 324, 70, 30, 18, 3, "New", None) - c.event("DirectoryListNew", "0") + c = seldlg.control("Features", "SelectionTree", 15, 60, 300, 120, 3, + "FEATURE", None, "PathEdit", None) + c.event("[FEATURE_SELECTED]", "1") + ver = self.other_version + install_other_cond = "FEATURE_SELECTED AND &Python%s=3" % ver + dont_install_other_cond = "FEATURE_SELECTED AND &Python%s<>3" % ver + + c = seldlg.text("Other", 15, 200, 300, 15, 3, + "Provide an alternate Python location") + c.condition("Enable", install_other_cond) + c.condition("Show", install_other_cond) + c.condition("Disable", dont_install_other_cond) + c.condition("Hide", dont_install_other_cond) + + c = seldlg.control("PathEdit", "PathEdit", 15, 215, 300, 16, 1, + "TARGETDIR" + ver, None, "Next", None) + c.condition("Enable", install_other_cond) + c.condition("Show", install_other_cond) + c.condition("Disable", dont_install_other_cond) + c.condition("Hide", dont_install_other_cond) ##################################################################### # Disk cost @@ -640,7 +723,10 @@ def get_installer_filename(self, fullname): # Factored out to allow overriding in subclasses - base_name = "%s.%s-py%s.msi" % (fullname, self.plat_name, - self.target_version) + if self.target_version: + base_name = "%s.%s-py%s.msi" % (fullname, self.plat_name, + self.target_version) + else: + base_name = "%s.%s.msi" % (fullname, self.plat_name) installer_name = os.path.join(self.dist_dir, base_name) return installer_name From buildbot at python.org Tue May 5 05:42:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 03:42:31 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090505034231.7BDF91E403C@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/331 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_distutils test_posix ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 45, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/Include ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Tue May 5 06:02:03 2009 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 5 May 2009 06:02:03 +0200 (CEST) Subject: [Python-checkins] r72310 - in python/branches/pep-0383: Lib/test/test_codecs.py Lib/test/test_os.py Modules/python.c Message-ID: <20090505040203.78B001E403C@bag.python.org> Author: martin.v.loewis Date: Tue May 5 06:02:02 2009 New Revision: 72310 Log: Address comments from rietveld #52095 patchset 2. Modified: python/branches/pep-0383/Lib/test/test_codecs.py python/branches/pep-0383/Lib/test/test_os.py python/branches/pep-0383/Modules/python.c Modified: python/branches/pep-0383/Lib/test/test_codecs.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_codecs.py (original) +++ python/branches/pep-0383/Lib/test/test_codecs.py Tue May 5 06:02:02 2009 @@ -1541,7 +1541,7 @@ # bad byte: \xa5 is unmapped in iso-8859-3 self.assertEqual(b"foo\xa5bar".decode("iso-8859-3", "utf8b"), "foo\udca5bar") - self.assertEqual("foo\udca5bar".encode("iso-8859-4", "utf8b"), + self.assertEqual("foo\udca5bar".encode("iso-8859-3", "utf8b"), b"foo\xa5bar") Modified: python/branches/pep-0383/Lib/test/test_os.py ============================================================================== --- python/branches/pep-0383/Lib/test/test_os.py (original) +++ python/branches/pep-0383/Lib/test/test_os.py Tue May 5 06:02:02 2009 @@ -701,7 +701,7 @@ self.assertRaises(OverflowError, os.setregid, 0, 1<<32) class Pep383Tests(unittest.TestCase): - filenames = [b'foo\xf6bar', b'foo\xf6bar'] + filenames = [b'foo\xf6bar', 'foo\xf6bar'.encode("utf-8")] def setUp(self): self.fsencoding = sys.getfilesystemencoding() Modified: python/branches/pep-0383/Modules/python.c ============================================================================== --- python/branches/pep-0383/Modules/python.c (original) +++ python/branches/pep-0383/Modules/python.c Tue May 5 06:02:02 2009 @@ -44,7 +44,7 @@ } /* Conversion failed. Fall back to escaping with utf8b. */ #ifdef HAVE_MBRTOWC - /* Try conversion with mbsrtwocs (C99), and escape non-decodable bytes. */ + /* Try conversion with mbrtwoc (C99), and escape non-decodable bytes. */ /* Overallocate; as multi-byte characters are in the argument, the actual output could use less memory. */ From python-checkins at python.org Tue May 5 06:05:29 2009 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 5 May 2009 06:05:29 +0200 (CEST) Subject: [Python-checkins] r72311 - in python/branches/pep-0383/Doc/library: codecs.rst os.rst Message-ID: <20090505040529.C41BD1E403C@bag.python.org> Author: martin.v.loewis Date: Tue May 5 06:05:28 2009 New Revision: 72311 Log: Documentation patch from Georg. Modified: python/branches/pep-0383/Doc/library/codecs.rst python/branches/pep-0383/Doc/library/os.rst Modified: python/branches/pep-0383/Doc/library/codecs.rst ============================================================================== --- python/branches/pep-0383/Doc/library/codecs.rst (original) +++ python/branches/pep-0383/Doc/library/codecs.rst Tue May 5 06:05:28 2009 @@ -335,7 +335,7 @@ +------------------+---------+--------------------------------------------+ .. versionadded:: 3.1 - The ``'surrogates'`` error handler. + The ``'utf8b'`` and ``'surrogates'`` error handlers. The set of allowed values can be extended via :meth:`register_error`. Modified: python/branches/pep-0383/Doc/library/os.rst ============================================================================== --- python/branches/pep-0383/Doc/library/os.rst (original) +++ python/branches/pep-0383/Doc/library/os.rst Tue May 5 06:05:28 2009 @@ -50,6 +50,7 @@ have currently been registered: ``'posix'``, ``'nt'``, ``'mac'``, ``'os2'``, ``'ce'``, ``'java'``. + .. _os-filenames: File Names, Command Line Arguments, and Environment Variables @@ -64,13 +65,16 @@ .. versionchanged:: 3.1 On some systems, conversion using the file system encoding may fail. In this case, Python uses the ``utf8b`` encoding error - handler. + handler, which means that undecodable bytes are replaced by a + Unicode character U+DCxx on decoding, and these are again + translated to the original byte on encoding. The file system encoding must guarantee to successfully decode all bytes below 128. If the file system encoding fails to provide this guarantee, API functions may raise UnicodeErrors. + .. _os-procinfo: Process Parameters @@ -709,6 +713,7 @@ .. function:: getcwd() Return a string representing the current working directory. + Availability: Unix, Windows. .. function:: getcwdb() @@ -815,7 +820,7 @@ entries ``'.'`` and ``'..'`` even if they are present in the directory. Availability: Unix, Windows. - This function can be called with a bytes or string argument, and return + This function can be called with a bytes or string argument, and returns filenames of the same datatype. From buildbot at python.org Tue May 5 06:21:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 04:21:35 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090505042135.72B781E403F@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/886 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: steven.bethard BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_os make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Tue May 5 06:30:06 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 5 May 2009 00:30:06 -0400 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090505043006.GA25957@python.psfb.org> rm -rf build/* rm -rf tools/sphinx Checking out Sphinx... svn: PROPFIND request failed on '/projects/external/Sphinx-0.6.1/sphinx' svn: PROPFIND of '/projects/external/Sphinx-0.6.1/sphinx': could not connect to server (http://svn.python.org) make: *** [checkout] Error 1 From python-checkins at python.org Tue May 5 06:37:58 2009 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 5 May 2009 06:37:58 +0200 (CEST) Subject: [Python-checkins] r72312 - python/branches/pep-0383/Modules/posixmodule.c Message-ID: <20090505043758.3962C1E403C@bag.python.org> Author: martin.v.loewis Date: Tue May 5 06:37:57 2009 New Revision: 72312 Log: Fix Windows compilation problems. Modified: python/branches/pep-0383/Modules/posixmodule.c Modified: python/branches/pep-0383/Modules/posixmodule.c ============================================================================== --- python/branches/pep-0383/Modules/posixmodule.c (original) +++ python/branches/pep-0383/Modules/posixmodule.c Tue May 5 06:37:57 2009 @@ -1686,7 +1686,7 @@ if (!PyArg_ParseTuple(args, "O&i:access", PyUnicode_FSConverter, &opath, &mode)) return 0; - path = bytes2str(opath); + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS attr = GetFileAttributesA(path); Py_END_ALLOW_THREADS @@ -2225,6 +2225,7 @@ HANDLE hFindFile; BOOL result; WIN32_FIND_DATA FileData; + PyObject *opath; char namebuf[MAX_PATH+5]; /* Overallocate for \\*.*\0 */ char *bufptr = namebuf; Py_ssize_t len = sizeof(namebuf)-5; /* only claim to have space for MAX_PATH */ @@ -2589,7 +2590,7 @@ release_bytes(opath); return NULL; } - release_bytes(path); + release_bytes(opath); if (PyUnicode_Check(PyTuple_GetItem(args, 0))) { return PyUnicode_Decode(outbuf, strlen(outbuf), Py_FileSystemDefaultEncoding, NULL); @@ -2946,7 +2947,7 @@ if (!PyArg_ParseTuple(args, "O&O:utime", PyUnicode_FSConverter, &oapath, &arg)) return NULL; - apath = bytes2str(oapath); + apath = bytes2str(oapath, 1); Py_BEGIN_ALLOW_THREADS hFile = CreateFileA(apath, FILE_WRITE_ATTRIBUTES, 0, NULL, OPEN_EXISTING, @@ -2954,7 +2955,7 @@ Py_END_ALLOW_THREADS if (hFile == INVALID_HANDLE_VALUE) { win32_error("utime", apath); - release(oapath); + release_bytes(oapath); return NULL; } release_bytes(oapath); @@ -3352,7 +3353,6 @@ PyObject *opath; char *path; PyObject *argv; - PyObject **oargvlist; char **argvlist; int mode, i; Py_ssize_t argc; @@ -3366,7 +3366,7 @@ PyUnicode_FSConverter, &opath, &argv)) return NULL; - path = bytes2str(opath); + path = bytes2str(opath, 1); if (PyList_Check(argv)) { argc = PyList_Size(argv); getitem = PyList_GetItem; @@ -3389,7 +3389,7 @@ } for (i = 0; i < argc; i++) { if (!fsconvert_strdup((*getitem)(argv, i), - &oargvlist[i])) { + &argvlist[i])) { free_string_array(argvlist, i); PyErr_SetString( PyExc_TypeError, @@ -3459,7 +3459,7 @@ PyUnicode_FSConverter, &opath, &argv, &env)) return NULL; - path = bytes2str(opath); + path = bytes2str(opath, 1); if (PyList_Check(argv)) { argc = PyList_Size(argv); getitem = PyList_GetItem; @@ -6795,6 +6795,7 @@ static PyObject * win32_startfile(PyObject *self, PyObject *args) { + PyObject *ofilepath; char *filepath; char *operation = NULL; HINSTANCE rc; @@ -6840,7 +6841,7 @@ PyUnicode_FSConverter, &ofilepath, &operation)) return NULL; - filepath = bytes2str(ofilepath); + filepath = bytes2str(ofilepath, 1); Py_BEGIN_ALLOW_THREADS rc = ShellExecute((HWND)0, operation, filepath, NULL, NULL, SW_SHOWNORMAL); From python-checkins at python.org Tue May 5 06:43:18 2009 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 5 May 2009 06:43:18 +0200 (CEST) Subject: [Python-checkins] r72313 - in python/branches/py3k: Doc/library/codecs.rst Doc/library/os.rst Include/unicodeobject.h Lib/test/test_codecs.py Lib/test/test_os.py Misc/NEWS Modules/_io/fileio.c Modules/posixmodule.c Modules/python.c Objects/unicodeobject.c Python/codecs.c Python/pythonrun.c configure configure.in pyconfig.h.in Message-ID: <20090505044318.C99301E403C@bag.python.org> Author: martin.v.loewis Date: Tue May 5 06:43:17 2009 New Revision: 72313 Log: Issue #5915: Implement PEP 383, Non-decodable Bytes in System Character Interfaces. Modified: python/branches/py3k/Doc/library/codecs.rst python/branches/py3k/Doc/library/os.rst python/branches/py3k/Include/unicodeobject.h python/branches/py3k/Lib/test/test_codecs.py python/branches/py3k/Lib/test/test_os.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_io/fileio.c python/branches/py3k/Modules/posixmodule.c python/branches/py3k/Modules/python.c python/branches/py3k/Objects/unicodeobject.c python/branches/py3k/Python/codecs.c python/branches/py3k/Python/pythonrun.c python/branches/py3k/configure python/branches/py3k/configure.in python/branches/py3k/pyconfig.h.in Modified: python/branches/py3k/Doc/library/codecs.rst ============================================================================== --- python/branches/py3k/Doc/library/codecs.rst (original) +++ python/branches/py3k/Doc/library/codecs.rst Tue May 5 06:43:17 2009 @@ -322,6 +322,8 @@ | ``'backslashreplace'`` | Replace with backslashed escape sequences | | | (only for encoding). | +-------------------------+-----------------------------------------------+ +| ``'utf8b'`` | Replace byte with surrogate U+DCxx. | ++-------------------------+-----------------------------------------------+ In addition, the following error handlers are specific to a single codec: @@ -333,7 +335,7 @@ +------------------+---------+--------------------------------------------+ .. versionadded:: 3.1 - The ``'surrogates'`` error handler. + The ``'utf8b'`` and ``'surrogates'`` error handlers. The set of allowed values can be extended via :meth:`register_error`. Modified: python/branches/py3k/Doc/library/os.rst ============================================================================== --- python/branches/py3k/Doc/library/os.rst (original) +++ python/branches/py3k/Doc/library/os.rst Tue May 5 06:43:17 2009 @@ -51,6 +51,30 @@ ``'ce'``, ``'java'``. +.. _os-filenames: + +File Names, Command Line Arguments, and Environment Variables +------------------------------------------------------------- + +In Python, file names, command line arguments, and environment +variables are represented using the string type. On some systems, +decoding these strings to and from bytes is necessary before passing +them to the operating system. Python uses the file system encoding to +perform this conversion (see :func:`sys.getfilesystemencoding`). + +.. versionchanged:: 3.1 + On some systems, conversion using the file system encoding may + fail. In this case, Python uses the ``utf8b`` encoding error + handler, which means that undecodable bytes are replaced by a + Unicode character U+DCxx on decoding, and these are again + translated to the original byte on encoding. + + +The file system encoding must guarantee to successfully decode all +bytes below 128. If the file system encoding fails to provide this +guarantee, API functions may raise UnicodeErrors. + + .. _os-procinfo: Process Parameters @@ -688,12 +712,8 @@ .. function:: getcwd() - Return a string representing the current working directory. On Unix - platforms, this function may raise :exc:`UnicodeDecodeError` if the name of - the current directory is not decodable in the file system encoding. Use - :func:`getcwdb` if you need the call to never fail. Availability: Unix, - Windows. - + Return a string representing the current working directory. + Availability: Unix, Windows. .. function:: getcwdb() @@ -800,10 +820,8 @@ entries ``'.'`` and ``'..'`` even if they are present in the directory. Availability: Unix, Windows. - This function can be called with a bytes or string argument. In the bytes - case, all filenames will be listed as returned by the underlying API. In the - string case, filenames will be decoded using the file system encoding, and - skipped if a decoding error occurs. + This function can be called with a bytes or string argument, and returns + filenames of the same datatype. .. function:: lstat(path) Modified: python/branches/py3k/Include/unicodeobject.h ============================================================================== --- python/branches/py3k/Include/unicodeobject.h (original) +++ python/branches/py3k/Include/unicodeobject.h Tue May 5 06:43:17 2009 @@ -198,6 +198,7 @@ # define PyUnicode_FromStringAndSize PyUnicodeUCS2_FromStringAndSize # define PyUnicode_FromUnicode PyUnicodeUCS2_FromUnicode # define PyUnicode_FromWideChar PyUnicodeUCS2_FromWideChar +# define PyUnicode_FSConverter PyUnicodeUCS2_FSConverter # define PyUnicode_GetDefaultEncoding PyUnicodeUCS2_GetDefaultEncoding # define PyUnicode_GetMax PyUnicodeUCS2_GetMax # define PyUnicode_GetSize PyUnicodeUCS2_GetSize @@ -296,6 +297,7 @@ # define PyUnicode_FromStringAndSize PyUnicodeUCS4_FromStringAndSize # define PyUnicode_FromUnicode PyUnicodeUCS4_FromUnicode # define PyUnicode_FromWideChar PyUnicodeUCS4_FromWideChar +# define PyUnicode_FSConverter PyUnicodeUCS4_FSConverter # define PyUnicode_GetDefaultEncoding PyUnicodeUCS4_GetDefaultEncoding # define PyUnicode_GetMax PyUnicodeUCS4_GetMax # define PyUnicode_GetSize PyUnicodeUCS4_GetSize @@ -693,25 +695,6 @@ PyObject *unicode, const char *errors); -/* Decode a null-terminated string using Py_FileSystemDefaultEncoding. - - If the encoding is supported by one of the built-in codecs (i.e., UTF-8, - UTF-16, UTF-32, Latin-1 or MBCS), otherwise fallback to UTF-8 and replace - invalid characters with '?'. - - The function is intended to be used for paths and file names only - during bootstrapping process where the codecs are not set up. -*/ - -PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefault( - const char *s /* encoded string */ - ); - -PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefaultAndSize( - const char *s, /* encoded string */ - Py_ssize_t size /* size */ - ); - /* Returns a pointer to the default encoding (normally, UTF-8) of the Unicode object unicode and the size of the encoded representation in bytes stored in *size. @@ -1252,6 +1235,33 @@ const char *errors /* error handling */ ); +/* --- File system encoding ---------------------------------------------- */ + +/* ParseTuple converter which converts a Unicode object into the file + system encoding, using the PEP 383 error handler; bytes objects are + output as-is. */ + +PyAPI_FUNC(int) PyUnicode_FSConverter(PyObject*, void*); + +/* Decode a null-terminated string using Py_FileSystemDefaultEncoding. + + If the encoding is supported by one of the built-in codecs (i.e., UTF-8, + UTF-16, UTF-32, Latin-1 or MBCS), otherwise fallback to UTF-8 and replace + invalid characters with '?'. + + The function is intended to be used for paths and file names only + during bootstrapping process where the codecs are not set up. +*/ + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefault( + const char *s /* encoded string */ + ); + +PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefaultAndSize( + const char *s, /* encoded string */ + Py_ssize_t size /* size */ + ); + /* --- Methods & Slots ---------------------------------------------------- These are capable of handling Unicode objects and strings on input Modified: python/branches/py3k/Lib/test/test_codecs.py ============================================================================== --- python/branches/py3k/Lib/test/test_codecs.py (original) +++ python/branches/py3k/Lib/test/test_codecs.py Tue May 5 06:43:17 2009 @@ -1516,6 +1516,34 @@ self.assertEquals(codecs.raw_unicode_escape_decode(r"\u1234"), ("\u1234", 6)) self.assertEquals(codecs.raw_unicode_escape_decode(br"\u1234"), ("\u1234", 6)) +class Utf8bTest(unittest.TestCase): + + def test_utf8(self): + # Bad byte + self.assertEqual(b"foo\x80bar".decode("utf-8", "utf8b"), + "foo\udc80bar") + self.assertEqual("foo\udc80bar".encode("utf-8", "utf8b"), + b"foo\x80bar") + # bad-utf-8 encoded surrogate + self.assertEqual(b"\xed\xb0\x80".decode("utf-8", "utf8b"), + "\udced\udcb0\udc80") + self.assertEqual("\udced\udcb0\udc80".encode("utf-8", "utf8b"), + b"\xed\xb0\x80") + + def test_ascii(self): + # bad byte + self.assertEqual(b"foo\x80bar".decode("ascii", "utf8b"), + "foo\udc80bar") + self.assertEqual("foo\udc80bar".encode("ascii", "utf8b"), + b"foo\x80bar") + + def test_charmap(self): + # bad byte: \xa5 is unmapped in iso-8859-3 + self.assertEqual(b"foo\xa5bar".decode("iso-8859-3", "utf8b"), + "foo\udca5bar") + self.assertEqual("foo\udca5bar".encode("iso-8859-3", "utf8b"), + b"foo\xa5bar") + def test_main(): support.run_unittest( @@ -1543,6 +1571,7 @@ CharmapTest, WithStmtTest, TypesTest, + Utf8bTest, ) Modified: python/branches/py3k/Lib/test/test_os.py ============================================================================== --- python/branches/py3k/Lib/test/test_os.py (original) +++ python/branches/py3k/Lib/test/test_os.py Tue May 5 06:43:17 2009 @@ -7,6 +7,7 @@ import unittest import warnings import sys +import shutil from test import support # Tests creating TESTFN @@ -698,9 +699,44 @@ self.assertRaises(os.error, os.setregid, 0, 0) self.assertRaises(OverflowError, os.setregid, 1<<32, 0) self.assertRaises(OverflowError, os.setregid, 0, 1<<32) + + class Pep383Tests(unittest.TestCase): + filenames = [b'foo\xf6bar', 'foo\xf6bar'.encode("utf-8")] + + def setUp(self): + self.fsencoding = sys.getfilesystemencoding() + sys.setfilesystemencoding("utf-8") + self.dir = support.TESTFN + self.bdir = self.dir.encode("utf-8", "utf8b") + os.mkdir(self.dir) + self.unicodefn = [] + for fn in self.filenames: + f = open(os.path.join(self.bdir, fn), "w") + f.close() + self.unicodefn.append(fn.decode("utf-8", "utf8b")) + + def tearDown(self): + shutil.rmtree(self.dir) + sys.setfilesystemencoding(self.fsencoding) + + def test_listdir(self): + expected = set(self.unicodefn) + found = set(os.listdir(support.TESTFN)) + self.assertEquals(found, expected) + + def test_open(self): + for fn in self.unicodefn: + f = open(os.path.join(self.dir, fn)) + f.close() + + def test_stat(self): + for fn in self.unicodefn: + os.stat(os.path.join(self.dir, fn)) else: class PosixUidGidTests(unittest.TestCase): pass + class Pep383Tests(unittest.TestCase): + pass def test_main(): support.run_unittest( @@ -714,7 +750,8 @@ ExecTests, Win32ErrorTests, TestInvalidFD, - PosixUidGidTests + PosixUidGidTests, + Pep383Tests ) if __name__ == "__main__": Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue May 5 06:43:17 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Implement PEP 383, Non-decodable Bytes in System Character Interfaces. + - Issue #5890: in subclasses of 'property' the __doc__ attribute was shadowed by classtype's, even if it was None. property now inserts the __doc__ into the subclass instance __dict__. Modified: python/branches/py3k/Modules/_io/fileio.c ============================================================================== --- python/branches/py3k/Modules/_io/fileio.c (original) +++ python/branches/py3k/Modules/_io/fileio.c Tue May 5 06:43:17 2009 @@ -245,7 +245,7 @@ return -1; stringobj = PyUnicode_AsEncodedString( - u, Py_FileSystemDefaultEncoding, NULL); + u, Py_FileSystemDefaultEncoding, "utf8b"); Py_DECREF(u); if (stringobj == NULL) return -1; Modified: python/branches/py3k/Modules/posixmodule.c ============================================================================== --- python/branches/py3k/Modules/posixmodule.c (original) +++ python/branches/py3k/Modules/posixmodule.c Tue May 5 06:43:17 2009 @@ -493,12 +493,14 @@ char *p = strchr(*e, '='); if (p == NULL) continue; - k = PyUnicode_FromStringAndSize(*e, (int)(p-*e)); + k = PyUnicode_Decode(*e, (int)(p-*e), + Py_FileSystemDefaultEncoding, "utf8b"); if (k == NULL) { PyErr_Clear(); continue; } - v = PyUnicode_FromString(p+1); + v = PyUnicode_Decode(p+1, strlen(p+1), + Py_FileSystemDefaultEncoding, "utf8b"); if (v == NULL) { PyErr_Clear(); Py_DECREF(k); @@ -534,6 +536,37 @@ return d; } +/* Convert a bytes object to a char*. Optionally lock the buffer if it is a + bytes array. */ + +static char* +bytes2str(PyObject* o, int lock) +{ + if(PyBytes_Check(o)) + return PyBytes_AsString(o); + else if(PyByteArray_Check(o)) { + if (lock && PyObject_GetBuffer(o, NULL, 0) < 0) + /* On a bytearray, this should not fail. */ + PyErr_BadInternalCall(); + return PyByteArray_AsString(o); + } else { + /* The FS converter should have verified that this + is either bytes or bytearray. */ + Py_FatalError("bad object passed to bytes2str"); + /* not reached. */ + return ""; + } +} + +/* Release the lock, decref the object. */ +static void +release_bytes(PyObject* o) +{ + if (PyByteArray_Check(o)) + o->ob_type->tp_as_buffer->bf_releasebuffer(NULL, 0); + Py_DECREF(o); +} + /* Set a POSIX-specific error from errno, and return NULL */ @@ -558,10 +591,11 @@ static PyObject * -posix_error_with_allocated_filename(char* name) +posix_error_with_allocated_filename(PyObject* name) { - PyObject *rc = PyErr_SetFromErrnoWithFilename(PyExc_OSError, name); - PyMem_Free(name); + PyObject *rc = PyErr_SetFromErrnoWithFilename(PyExc_OSError, + bytes2str(name, 0)); + release_bytes(name); return rc; } @@ -728,17 +762,19 @@ static PyObject * posix_1str(PyObject *args, char *format, int (*func)(const char*)) { - char *path1 = NULL; + PyObject *opath1 = NULL; + char *path1; int res; if (!PyArg_ParseTuple(args, format, - Py_FileSystemDefaultEncoding, &path1)) + PyUnicode_FSConverter, &opath1)) return NULL; + path1 = bytes2str(opath1, 1); Py_BEGIN_ALLOW_THREADS res = (*func)(path1); Py_END_ALLOW_THREADS if (res < 0) - return posix_error_with_allocated_filename(path1); - PyMem_Free(path1); + return posix_error_with_allocated_filename(opath1); + release_bytes(opath1); Py_INCREF(Py_None); return Py_None; } @@ -748,17 +784,20 @@ char *format, int (*func)(const char *, const char *)) { - char *path1 = NULL, *path2 = NULL; + PyObject *opath1, *opath2; + char *path1, *path2; int res; if (!PyArg_ParseTuple(args, format, - Py_FileSystemDefaultEncoding, &path1, - Py_FileSystemDefaultEncoding, &path2)) + PyUnicode_FSConverter, &opath1, + PyUnicode_FSConverter, &opath2)) return NULL; + path1 = bytes2str(opath1, 1); + path2 = bytes2str(opath2, 1); Py_BEGIN_ALLOW_THREADS res = (*func)(path1, path2); Py_END_ALLOW_THREADS - PyMem_Free(path1); - PyMem_Free(path2); + release_bytes(opath1); + release_bytes(opath2); if (res != 0) /* XXX how to report both path1 and path2??? */ return posix_error(); @@ -1560,8 +1599,8 @@ int (*wstatfunc)(const Py_UNICODE *, STRUCT_STAT *)) { STRUCT_STAT st; - char *path = NULL; /* pass this to stat; do not free() it */ - char *pathfree = NULL; /* this memory must be free'd */ + PyObject *opath; + char *path; int res; PyObject *result; @@ -1590,25 +1629,24 @@ #endif if (!PyArg_ParseTuple(args, format, - Py_FileSystemDefaultEncoding, &path)) + PyUnicode_FSConverter, &opath)) return NULL; - pathfree = path; - + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS res = (*statfunc)(path, &st); Py_END_ALLOW_THREADS if (res != 0) { #ifdef MS_WINDOWS - result = win32_error("stat", pathfree); + result = win32_error("stat", path); #else - result = posix_error_with_filename(pathfree); + result = posix_error_with_filename(path); #endif } else result = _pystat_fromstructstat(&st); - PyMem_Free(pathfree); + release_bytes(opath); return result; } @@ -1625,6 +1663,7 @@ static PyObject * posix_access(PyObject *self, PyObject *args) { + PyObject *opath; char *path; int mode; @@ -1644,13 +1683,14 @@ are also valid. */ PyErr_Clear(); } - if (!PyArg_ParseTuple(args, "eti:access", - Py_FileSystemDefaultEncoding, &path, &mode)) + if (!PyArg_ParseTuple(args, "O&i:access", + PyUnicode_FSConverter, &opath, &mode)) return 0; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS attr = GetFileAttributesA(path); Py_END_ALLOW_THREADS - PyMem_Free(path); + release_bytes(opath); finish: if (attr == 0xFFFFFFFF) /* File does not exist, or cannot read attributes */ @@ -1663,13 +1703,14 @@ || (attr & FILE_ATTRIBUTE_DIRECTORY)); #else int res; - if (!PyArg_ParseTuple(args, "eti:access", - Py_FileSystemDefaultEncoding, &path, &mode)) + if (!PyArg_ParseTuple(args, "O&i:access", + PyUnicode_FSConverter, &opath, &mode)) return NULL; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS res = access(path, mode); Py_END_ALLOW_THREADS - PyMem_Free(path); + release_bytes(opath); return PyBool_FromLong(res == 0); #endif } @@ -1750,11 +1791,11 @@ #ifdef MS_WINDOWS return win32_1str(args, "chdir", "y:chdir", win32_chdir, "U:chdir", win32_wchdir); #elif defined(PYOS_OS2) && defined(PYCC_GCC) - return posix_1str(args, "et:chdir", _chdir2); + return posix_1str(args, "O&:chdir", _chdir2); #elif defined(__VMS) - return posix_1str(args, "et:chdir", (int (*)(const char *))chdir); + return posix_1str(args, "O&:chdir", (int (*)(const char *))chdir); #else - return posix_1str(args, "et:chdir", chdir); + return posix_1str(args, "O&:chdir", chdir); #endif } @@ -1779,6 +1820,7 @@ static PyObject * posix_chmod(PyObject *self, PyObject *args) { + PyObject *opath = NULL; char *path = NULL; int i; int res; @@ -1809,9 +1851,10 @@ are also valid. */ PyErr_Clear(); } - if (!PyArg_ParseTuple(args, "eti:chmod", Py_FileSystemDefaultEncoding, - &path, &i)) + if (!PyArg_ParseTuple(args, "O&i:chmod", PyUnicode_FSConverter, + &opath, &i)) return NULL; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS attr = GetFileAttributesA(path); if (attr != 0xFFFFFFFF) { @@ -1826,22 +1869,23 @@ Py_END_ALLOW_THREADS if (!res) { win32_error("chmod", path); - PyMem_Free(path); + release_bytes(opath); return NULL; } - PyMem_Free(path); + release_bytes(opath); Py_INCREF(Py_None); return Py_None; #else /* Py_WIN_WIDE_FILENAMES */ - if (!PyArg_ParseTuple(args, "eti:chmod", Py_FileSystemDefaultEncoding, - &path, &i)) + if (!PyArg_ParseTuple(args, "O&i:chmod", PyUnicode_FSConverter, + &opath, &i)) return NULL; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS res = chmod(path, i); Py_END_ALLOW_THREADS if (res < 0) - return posix_error_with_allocated_filename(path); - PyMem_Free(path); + return posix_error_with_allocated_filename(opath); + release_bytes(opath); Py_INCREF(Py_None); return Py_None; #endif @@ -1877,18 +1921,20 @@ static PyObject * posix_lchmod(PyObject *self, PyObject *args) { - char *path = NULL; + PyObject *opath; + char *path; int i; int res; - if (!PyArg_ParseTuple(args, "eti:lchmod", Py_FileSystemDefaultEncoding, - &path, &i)) + if (!PyArg_ParseTuple(args, "O&i:lchmod", PyUnicode_FSConverter, + &opath, &i)) return NULL; + path = bytes2str(opath, 1) Py_BEGIN_ALLOW_THREADS res = lchmod(path, i); Py_END_ALLOW_THREADS if (res < 0) - return posix_error_with_allocated_filename(path); - PyMem_Free(path); + return posix_error_with_allocated_filename(opath); + release_bytes(opath); Py_RETURN_NONE; } #endif /* HAVE_LCHMOD */ @@ -1902,18 +1948,20 @@ static PyObject * posix_chflags(PyObject *self, PyObject *args) { + PyObject *opath; char *path; unsigned long flags; int res; - if (!PyArg_ParseTuple(args, "etk:chflags", - Py_FileSystemDefaultEncoding, &path, &flags)) + if (!PyArg_ParseTuple(args, "O&k:chflags", + PyUnicode_FSConverter, &opath, &flags)) return NULL; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS res = chflags(path, flags); Py_END_ALLOW_THREADS if (res < 0) - return posix_error_with_allocated_filename(path); - PyMem_Free(path); + return posix_error_with_allocated_filename(opath); + release_bytes(opath); Py_INCREF(Py_None); return Py_None; } @@ -1928,18 +1976,20 @@ static PyObject * posix_lchflags(PyObject *self, PyObject *args) { + PyObject *opath; char *path; unsigned long flags; int res; - if (!PyArg_ParseTuple(args, "etk:lchflags", - Py_FileSystemDefaultEncoding, &path, &flags)) + if (!PyArg_ParseTuple(args, "O&k:lchflags", + PyUnicode_FSConverter, &path, &flags)) return NULL; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS res = lchflags(path, flags); Py_END_ALLOW_THREADS if (res < 0) - return posix_error_with_allocated_filename(path); - PyMem_Free(path); + return posix_error_with_allocated_filename(opath); + release_bytes(opath); Py_INCREF(Py_None); return Py_None; } @@ -1953,7 +2003,7 @@ static PyObject * posix_chroot(PyObject *self, PyObject *args) { - return posix_1str(args, "et:chroot", chroot); + return posix_1str(args, "O&:chroot", chroot); } #endif @@ -1996,19 +2046,21 @@ static PyObject * posix_chown(PyObject *self, PyObject *args) { - char *path = NULL; + PyObject *opath; + char *path; long uid, gid; int res; - if (!PyArg_ParseTuple(args, "etll:chown", - Py_FileSystemDefaultEncoding, &path, + if (!PyArg_ParseTuple(args, "O&ll:chown", + PyUnicode_FSConverter, &opath, &uid, &gid)) return NULL; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS res = chown(path, (uid_t) uid, (gid_t) gid); Py_END_ALLOW_THREADS if (res < 0) - return posix_error_with_allocated_filename(path); - PyMem_Free(path); + return posix_error_with_allocated_filename(opath); + release_bytes(opath); Py_INCREF(Py_None); return Py_None; } @@ -2045,19 +2097,21 @@ static PyObject * posix_lchown(PyObject *self, PyObject *args) { - char *path = NULL; + PyObject *opath; + char *path; int uid, gid; int res; - if (!PyArg_ParseTuple(args, "etii:lchown", - Py_FileSystemDefaultEncoding, &path, + if (!PyArg_ParseTuple(args, "O&ii:lchown", + PyUnicode_FSConverter, &opath, &uid, &gid)) return NULL; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS res = lchown(path, (uid_t) uid, (gid_t) gid); Py_END_ALLOW_THREADS if (res < 0) - return posix_error_with_allocated_filename(path); - PyMem_Free(path); + return posix_error_with_allocated_filename(opath); + release_bytes(opath); Py_INCREF(Py_None); return Py_None; } @@ -2113,7 +2167,7 @@ return posix_error(); if (use_bytes) return PyBytes_FromStringAndSize(buf, strlen(buf)); - return PyUnicode_Decode(buf, strlen(buf), Py_FileSystemDefaultEncoding,"strict"); + return PyUnicode_Decode(buf, strlen(buf), Py_FileSystemDefaultEncoding,"utf8b"); } PyDoc_STRVAR(posix_getcwd__doc__, @@ -2146,7 +2200,7 @@ static PyObject * posix_link(PyObject *self, PyObject *args) { - return posix_2str(args, "etet:link", link); + return posix_2str(args, "O&O&:link", link); } #endif /* HAVE_LINK */ @@ -2171,6 +2225,7 @@ HANDLE hFindFile; BOOL result; WIN32_FIND_DATA FileData; + PyObject *opath; char namebuf[MAX_PATH+5]; /* Overallocate for \\*.*\0 */ char *bufptr = namebuf; Py_ssize_t len = sizeof(namebuf)-5; /* only claim to have space for MAX_PATH */ @@ -2260,9 +2315,16 @@ } #endif - if (!PyArg_ParseTuple(args, "et#:listdir", - Py_FileSystemDefaultEncoding, &bufptr, &len)) + if (!PyArg_ParseTuple(args, "O&:listdir", + PyUnicode_FSConverter, &opath)) return NULL; + if (PyObject_Size(opath)+1 > MAX_PATH) { + PyErr_SetString(PyExc_ValueError, "path too long"); + Py_DECREF(opath); + return NULL; + } + strcpy(namebuf, bytes2str(opath, 0)); + len = PyObject_Size(opath); if (len > 0) { char ch = namebuf[len-1]; if (ch != SEP && ch != ALTSEP && ch != ':') @@ -2324,6 +2386,7 @@ #ifndef MAX_PATH #define MAX_PATH CCHMAXPATH #endif + PyObject *oname; char *name, *pt; Py_ssize_t len; PyObject *d, *v; @@ -2333,11 +2396,13 @@ FILEFINDBUF3 ep; APIRET rc; - if (!PyArg_ParseTuple(args, "et#:listdir", - Py_FileSystemDefaultEncoding, &name, &len)) + if (!PyArg_ParseTuple(args, "O&:listdir", + PyUnicode_FSConverter, &oname)) return NULL; + name = bytes2str(oname); + len = PyObject_Size(oname); if (len >= MAX_PATH) { - PyMem_Free(name); + release_bytes(oname); PyErr_SetString(PyExc_ValueError, "path too long"); return NULL; } @@ -2350,7 +2415,7 @@ strcpy(namebuf + len, "*.*"); if ((d = PyList_New(0)) == NULL) { - PyMem_Free(name); + release_bytes(oname); return NULL; } @@ -2363,7 +2428,7 @@ if (rc != NO_ERROR) { errno = ENOENT; - return posix_error_with_allocated_filename(name); + return posix_error_with_allocated_filename(oname); } if (srchcnt > 0) { /* If Directory is NOT Totally Empty, */ @@ -2393,11 +2458,11 @@ } while (DosFindNext(hdir, &ep, sizeof(ep), &srchcnt) == NO_ERROR && srchcnt > 0); } - PyMem_Free(name); + release_bytes(oname); return d; #else - - char *name = NULL; + PyObject *oname; + char *name; PyObject *d, *v; DIR *dirp; struct dirent *ep; @@ -2408,14 +2473,15 @@ arg_is_unicode = 0; PyErr_Clear(); } - if (!PyArg_ParseTuple(args, "et:listdir", Py_FileSystemDefaultEncoding, &name)) + if (!PyArg_ParseTuple(args, "O&:listdir", PyUnicode_FSConverter, &oname)) return NULL; + name = bytes2str(oname, 1); if ((dirp = opendir(name)) == NULL) { - return posix_error_with_allocated_filename(name); + return posix_error_with_allocated_filename(oname); } if ((d = PyList_New(0)) == NULL) { closedir(dirp); - PyMem_Free(name); + release_bytes(oname); return NULL; } for (;;) { @@ -2429,7 +2495,7 @@ } else { closedir(dirp); Py_DECREF(d); - return posix_error_with_allocated_filename(name); + return posix_error_with_allocated_filename(oname); } } if (ep->d_name[0] == '.' && @@ -2447,18 +2513,16 @@ w = PyUnicode_FromEncodedObject(v, Py_FileSystemDefaultEncoding, - "strict"); - if (w != NULL) { - Py_DECREF(v); + "utf8b"); + Py_DECREF(v); + if (w != NULL) v = w; - } else { - /* Ignore undecodable filenames, as discussed - * in issue 3187. To include these, - * use getcwdb(). */ - PyErr_Clear(); - Py_DECREF(v); - continue; + /* Encoding failed to decode ASCII bytes. + Raise exception. */ + Py_DECREF(d); + d = NULL; + break; } } if (PyList_Append(d, v) != 0) { @@ -2470,7 +2534,7 @@ Py_DECREF(v); } closedir(dirp); - PyMem_Free(name); + release_bytes(oname); return d; @@ -2482,10 +2546,8 @@ static PyObject * posix__getfullpathname(PyObject *self, PyObject *args) { - /* assume encoded strings won't more than double no of chars */ - char inbuf[MAX_PATH*2]; - char *inbufp = inbuf; - Py_ssize_t insize = sizeof(inbuf); + PyObject *opath; + char *path; char outbuf[MAX_PATH*2]; char *temp; #ifdef Py_WIN_WIDE_FILENAMES @@ -2519,13 +2581,17 @@ PyErr_Clear(); } #endif - if (!PyArg_ParseTuple (args, "et#:_getfullpathname", - Py_FileSystemDefaultEncoding, &inbufp, - &insize)) - return NULL; - if (!GetFullPathName(inbuf, sizeof(outbuf)/sizeof(outbuf[0]), - outbuf, &temp)) - return win32_error("GetFullPathName", inbuf); + if (!PyArg_ParseTuple (args, "O&:_getfullpathname", + PyUnicode_FSConverter, &opath)) + return NULL; + path = bytes2str(opath, 1); + if (!GetFullPathName(path, sizeof(outbuf)/sizeof(outbuf[0]), + outbuf, &temp)) { + win32_error("GetFullPathName", path); + release_bytes(opath); + return NULL; + } + release_bytes(opath); if (PyUnicode_Check(PyTuple_GetItem(args, 0))) { return PyUnicode_Decode(outbuf, strlen(outbuf), Py_FileSystemDefaultEncoding, NULL); @@ -2542,7 +2608,8 @@ posix_mkdir(PyObject *self, PyObject *args) { int res; - char *path = NULL; + PyObject *opath; + char *path; int mode = 0777; #ifdef Py_WIN_WIDE_FILENAMES @@ -2563,9 +2630,10 @@ are also valid. */ PyErr_Clear(); } - if (!PyArg_ParseTuple(args, "et|i:mkdir", - Py_FileSystemDefaultEncoding, &path, &mode)) + if (!PyArg_ParseTuple(args, "O&|i:mkdir", + PyUnicode_FSConverter, &opath, &mode)) return NULL; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS /* PyUnicode_AS_UNICODE OK without thread lock as it is a simple dereference. */ @@ -2573,17 +2641,18 @@ Py_END_ALLOW_THREADS if (!res) { win32_error("mkdir", path); - PyMem_Free(path); + release_bytes(opath); return NULL; } - PyMem_Free(path); + release_bytes(opath); Py_INCREF(Py_None); return Py_None; #else - if (!PyArg_ParseTuple(args, "et|i:mkdir", - Py_FileSystemDefaultEncoding, &path, &mode)) + if (!PyArg_ParseTuple(args, "O&|i:mkdir", + PyUnicode_FSConverter, &opath, &mode)) return NULL; + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS #if ( defined(__WATCOMC__) || defined(PYCC_VACPP) ) && !defined(__QNX__) res = mkdir(path); @@ -2592,8 +2661,8 @@ #endif Py_END_ALLOW_THREADS if (res < 0) - return posix_error_with_allocated_filename(path); - PyMem_Free(path); + return posix_error_with_allocated_filename(opath); + release_bytes(opath); Py_INCREF(Py_None); return Py_None; #endif @@ -2685,7 +2754,7 @@ Py_INCREF(Py_None); return Py_None; #else - return posix_2str(args, "etet:rename", rename); + return posix_2str(args, "O&O&:rename", rename); #endif } @@ -2700,7 +2769,7 @@ #ifdef MS_WINDOWS return win32_1str(args, "rmdir", "y:rmdir", RemoveDirectoryA, "U:rmdir", RemoveDirectoryW); #else - return posix_1str(args, "et:rmdir", rmdir); + return posix_1str(args, "O&:rmdir", rmdir); #endif } @@ -2713,9 +2782,9 @@ posix_stat(PyObject *self, PyObject *args) { #ifdef MS_WINDOWS - return posix_do_stat(self, args, "et:stat", STAT, "U:stat", win32_wstat); + return posix_do_stat(self, args, "O&:stat", STAT, "U:stat", win32_wstat); #else - return posix_do_stat(self, args, "et:stat", STAT, NULL, NULL); + return posix_do_stat(self, args, "O&:stat", STAT, NULL, NULL); #endif } @@ -2781,7 +2850,7 @@ #ifdef MS_WINDOWS return win32_1str(args, "remove", "y:remove", DeleteFileA, "U:remove", DeleteFileW); #else - return posix_1str(args, "et:remove", unlink); + return posix_1str(args, "O&:remove", unlink); #endif } @@ -2853,7 +2922,8 @@ PyObject *arg; PyUnicodeObject *obwpath; wchar_t *wpath = NULL; - char *apath = NULL; + PyObject *oapath; + char *apath; HANDLE hFile; long atimesec, mtimesec, ausec, musec; FILETIME atime, mtime; @@ -2875,9 +2945,10 @@ PyErr_Clear(); } if (!wpath) { - if (!PyArg_ParseTuple(args, "etO:utime", - Py_FileSystemDefaultEncoding, &apath, &arg)) + if (!PyArg_ParseTuple(args, "O&O:utime", + PyUnicode_FSConverter, &oapath, &arg)) return NULL; + apath = bytes2str(oapath, 1); Py_BEGIN_ALLOW_THREADS hFile = CreateFileA(apath, FILE_WRITE_ATTRIBUTES, 0, NULL, OPEN_EXISTING, @@ -2885,10 +2956,10 @@ Py_END_ALLOW_THREADS if (hFile == INVALID_HANDLE_VALUE) { win32_error("utime", apath); - PyMem_Free(apath); + release_bytes(oapath); return NULL; } - PyMem_Free(apath); + release_bytes(oapath); } if (arg == Py_None) { @@ -2929,7 +3000,8 @@ return result; #else /* Py_WIN_WIDE_FILENAMES */ - char *path = NULL; + PyObject *opath; + char *path; long atime, mtime, ausec, musec; int res; PyObject* arg; @@ -2952,9 +3024,10 @@ #endif /* HAVE_UTIMES */ - if (!PyArg_ParseTuple(args, "etO:utime", - Py_FileSystemDefaultEncoding, &path, &arg)) + if (!PyArg_ParseTuple(args, "O&O:utime", + PyUnicode_FSConverter, &opath, &arg)) return NULL; + path = bytes2str(opath, 1); if (arg == Py_None) { /* optional time values not given */ Py_BEGIN_ALLOW_THREADS @@ -2964,18 +3037,18 @@ else if (!PyTuple_Check(arg) || PyTuple_Size(arg) != 2) { PyErr_SetString(PyExc_TypeError, "utime() arg 2 must be a tuple (atime, mtime)"); - PyMem_Free(path); + release_bytes(opath); return NULL; } else { if (extract_time(PyTuple_GET_ITEM(arg, 0), &atime, &ausec) == -1) { - PyMem_Free(path); + release_bytes(opath); return NULL; } if (extract_time(PyTuple_GET_ITEM(arg, 1), &mtime, &musec) == -1) { - PyMem_Free(path); + release_bytes(opath); return NULL; } ATIME = atime; @@ -2993,9 +3066,9 @@ #endif /* HAVE_UTIMES */ } if (res < 0) { - return posix_error_with_allocated_filename(path); + return posix_error_with_allocated_filename(opath); } - PyMem_Free(path); + release_bytes(opath); Py_INCREF(Py_None); return Py_None; #undef UTIME_ARG @@ -3030,6 +3103,22 @@ PyMem_Free(array[i]); PyMem_DEL(array); } + +int fsconvert_strdup(PyObject *o, char**out) +{ + PyObject *bytes; + Py_ssize_t size; + if (!PyUnicode_FSConverter(o, &bytes)) + return 0; + size = PyObject_Size(bytes); + *out = PyMem_Malloc(size+1); + if (!*out) + return 0; + /* Don't lock bytes, as we hold the GIL */ + memcpy(*out, bytes2str(bytes, 0), size+1); + Py_DECREF(bytes); + return 1; +} #endif @@ -3044,6 +3133,7 @@ static PyObject * posix_execv(PyObject *self, PyObject *args) { + PyObject *opath; char *path; PyObject *argv; char **argvlist; @@ -3053,10 +3143,11 @@ /* execv has two arguments: (path, argv), where argv is a list or tuple of strings. */ - if (!PyArg_ParseTuple(args, "etO:execv", - Py_FileSystemDefaultEncoding, - &path, &argv)) + if (!PyArg_ParseTuple(args, "O&O:execv", + PyUnicode_FSConverter, + &opath, &argv)) return NULL; + path = bytes2str(opath, 1); if (PyList_Check(argv)) { argc = PyList_Size(argv); getitem = PyList_GetItem; @@ -3067,28 +3158,27 @@ } else { PyErr_SetString(PyExc_TypeError, "execv() arg 2 must be a tuple or list"); - PyMem_Free(path); + release_bytes(opath); return NULL; } if (argc < 1) { PyErr_SetString(PyExc_ValueError, "execv() arg 2 must not be empty"); - PyMem_Free(path); + release_bytes(opath); return NULL; } argvlist = PyMem_NEW(char *, argc+1); if (argvlist == NULL) { - PyMem_Free(path); + release_bytes(opath); return PyErr_NoMemory(); } for (i = 0; i < argc; i++) { - if (!PyArg_Parse((*getitem)(argv, i), "et", - Py_FileSystemDefaultEncoding, - &argvlist[i])) { + if (!fsconvert_strdup((*getitem)(argv, i), + &argvlist[i])) { free_string_array(argvlist, i); PyErr_SetString(PyExc_TypeError, "execv() arg 2 must contain only strings"); - PyMem_Free(path); + release_bytes(opath); return NULL; } @@ -3100,7 +3190,7 @@ /* If we get here it's definitely an error */ free_string_array(argvlist, argc); - PyMem_Free(path); + release_bytes(opath); return posix_error(); } @@ -3116,6 +3206,7 @@ static PyObject * posix_execve(PyObject *self, PyObject *args) { + PyObject *opath; char *path; PyObject *argv, *env; char **argvlist; @@ -3129,10 +3220,11 @@ argv is a list or tuple of strings and env is a dictionary like posix.environ. */ - if (!PyArg_ParseTuple(args, "etOO:execve", - Py_FileSystemDefaultEncoding, - &path, &argv, &env)) + if (!PyArg_ParseTuple(args, "O&OO:execve", + PyUnicode_FSConverter, + &opath, &argv, &env)) return NULL; + path = bytes2str(opath, 1); if (PyList_Check(argv)) { argc = PyList_Size(argv); getitem = PyList_GetItem; @@ -3158,10 +3250,8 @@ goto fail_0; } for (i = 0; i < argc; i++) { - if (!PyArg_Parse((*getitem)(argv, i), - "et;execve() arg 2 must contain only strings", - Py_FileSystemDefaultEncoding, - &argvlist[i])) + if (!fsconvert_strdup((*getitem)(argv, i), + &argvlist[i])) { lastarg = i; goto fail_1; @@ -3243,7 +3333,7 @@ Py_XDECREF(vals); Py_XDECREF(keys); fail_0: - PyMem_Free(path); + release_bytes(opath); return NULL; } #endif /* HAVE_EXECV */ @@ -3261,6 +3351,7 @@ static PyObject * posix_spawnv(PyObject *self, PyObject *args) { + PyObject *opath; char *path; PyObject *argv; char **argvlist; @@ -3272,10 +3363,11 @@ /* spawnv has three arguments: (mode, path, argv), where argv is a list or tuple of strings. */ - if (!PyArg_ParseTuple(args, "ietO:spawnv", &mode, - Py_FileSystemDefaultEncoding, - &path, &argv)) + if (!PyArg_ParseTuple(args, "iO&O:spawnv", &mode, + PyUnicode_FSConverter, + &opath, &argv)) return NULL; + path = bytes2str(opath, 1); if (PyList_Check(argv)) { argc = PyList_Size(argv); getitem = PyList_GetItem; @@ -3287,24 +3379,23 @@ else { PyErr_SetString(PyExc_TypeError, "spawnv() arg 2 must be a tuple or list"); - PyMem_Free(path); + release_bytes(opath); return NULL; } argvlist = PyMem_NEW(char *, argc+1); if (argvlist == NULL) { - PyMem_Free(path); + release_bytes(opath); return PyErr_NoMemory(); } for (i = 0; i < argc; i++) { - if (!PyArg_Parse((*getitem)(argv, i), "et", - Py_FileSystemDefaultEncoding, - &argvlist[i])) { + if (!fsconvert_strdup((*getitem)(argv, i), + &argvlist[i])) { free_string_array(argvlist, i); PyErr_SetString( PyExc_TypeError, "spawnv() arg 2 must contain only strings"); - PyMem_Free(path); + release_bytes(opath); return NULL; } } @@ -3324,7 +3415,7 @@ #endif free_string_array(argvlist, argc); - PyMem_Free(path); + release_bytes(opath); if (spawnval == -1) return posix_error(); @@ -3349,6 +3440,7 @@ static PyObject * posix_spawnve(PyObject *self, PyObject *args) { + PyObject *opath; char *path; PyObject *argv, *env; char **argvlist; @@ -3364,10 +3456,11 @@ argv is a list or tuple of strings and env is a dictionary like posix.environ. */ - if (!PyArg_ParseTuple(args, "ietOO:spawnve", &mode, - Py_FileSystemDefaultEncoding, - &path, &argv, &env)) + if (!PyArg_ParseTuple(args, "iO&OO:spawnve", &mode, + PyUnicode_FSConverter, + &opath, &argv, &env)) return NULL; + path = bytes2str(opath, 1); if (PyList_Check(argv)) { argc = PyList_Size(argv); getitem = PyList_GetItem; @@ -3393,10 +3486,8 @@ goto fail_0; } for (i = 0; i < argc; i++) { - if (!PyArg_Parse((*getitem)(argv, i), - "et;spawnve() arg 2 must contain only strings", - Py_FileSystemDefaultEncoding, - &argvlist[i])) + if (!fsconvert_strdup((*getitem)(argv, i), + &argvlist[i])) { lastarg = i; goto fail_1; @@ -3486,7 +3577,7 @@ Py_XDECREF(vals); Py_XDECREF(keys); fail_0: - PyMem_Free(path); + release_bytes(opath); return res; } @@ -3504,6 +3595,7 @@ static PyObject * posix_spawnvp(PyObject *self, PyObject *args) { + PyObject *opath; char *path; PyObject *argv; char **argvlist; @@ -3514,10 +3606,11 @@ /* spawnvp has three arguments: (mode, path, argv), where argv is a list or tuple of strings. */ - if (!PyArg_ParseTuple(args, "ietO:spawnvp", &mode, - Py_FileSystemDefaultEncoding, - &path, &argv)) + if (!PyArg_ParseTuple(args, "iO&O:spawnvp", &mode, + PyUnicode_FSConverter, + &opath, &argv)) return NULL; + path = bytes2str(opath); if (PyList_Check(argv)) { argc = PyList_Size(argv); getitem = PyList_GetItem; @@ -3529,24 +3622,23 @@ else { PyErr_SetString(PyExc_TypeError, "spawnvp() arg 2 must be a tuple or list"); - PyMem_Free(path); + release_bytes(opath); return NULL; } argvlist = PyMem_NEW(char *, argc+1); if (argvlist == NULL) { - PyMem_Free(path); + release_bytes(opath); return PyErr_NoMemory(); } for (i = 0; i < argc; i++) { - if (!PyArg_Parse((*getitem)(argv, i), "et", - Py_FileSystemDefaultEncoding, - &argvlist[i])) { + if (!fsconvert_strdup((*getitem)(argv, i), + &argvlist[i])) { free_string_array(argvlist, i); PyErr_SetString( PyExc_TypeError, "spawnvp() arg 2 must contain only strings"); - PyMem_Free(path); + release_bytes(opath); return NULL; } } @@ -3561,7 +3653,7 @@ Py_END_ALLOW_THREADS free_string_array(argvlist, argc); - PyMem_Free(path); + release_bytes(opath); if (spawnval == -1) return posix_error(); @@ -3583,6 +3675,7 @@ static PyObject * posix_spawnvpe(PyObject *self, PyObject *args) { + PyObject *opath char *path; PyObject *argv, *env; char **argvlist; @@ -3598,9 +3691,10 @@ like posix.environ. */ if (!PyArg_ParseTuple(args, "ietOO:spawnvpe", &mode, - Py_FileSystemDefaultEncoding, - &path, &argv, &env)) + PyUnicode_FSConverter, + &opath, &argv, &env)) return NULL; + path = bytes2str(opath); if (PyList_Check(argv)) { argc = PyList_Size(argv); getitem = PyList_GetItem; @@ -3626,10 +3720,8 @@ goto fail_0; } for (i = 0; i < argc; i++) { - if (!PyArg_Parse((*getitem)(argv, i), - "et;spawnvpe() arg 2 must contain only strings", - Py_FileSystemDefaultEncoding, - &argvlist[i])) + if (!fsconvert_strdup((*getitem)(argv, i), + &argvlist[i])) { lastarg = i; goto fail_1; @@ -3710,7 +3802,7 @@ Py_XDECREF(vals); Py_XDECREF(keys); fail_0: - PyMem_Free(path); + release_bytes(opath); return res; } #endif /* PYOS_OS2 */ @@ -4549,12 +4641,12 @@ posix_lstat(PyObject *self, PyObject *args) { #ifdef HAVE_LSTAT - return posix_do_stat(self, args, "et:lstat", lstat, NULL, NULL); + return posix_do_stat(self, args, "O&:lstat", lstat, NULL, NULL); #else /* !HAVE_LSTAT */ #ifdef MS_WINDOWS - return posix_do_stat(self, args, "et:lstat", STAT, "U:lstat", win32_wstat); + return posix_do_stat(self, args, "O&:lstat", STAT, "U:lstat", win32_wstat); #else - return posix_do_stat(self, args, "et:lstat", STAT, NULL, NULL); + return posix_do_stat(self, args, "O&:lstat", STAT, NULL, NULL); #endif #endif /* !HAVE_LSTAT */ } @@ -4570,16 +4662,18 @@ { PyObject* v; char buf[MAXPATHLEN]; + PyObject *opath; char *path; int n; int arg_is_unicode = 0; - if (!PyArg_ParseTuple(args, "et:readlink", - Py_FileSystemDefaultEncoding, &path)) + if (!PyArg_ParseTuple(args, "O&:readlink", + PyUnicode_FSConverter, &opath)) return NULL; + path = bytes2str(opath, 1); v = PySequence_GetItem(args, 0); if (v == NULL) { - PyMem_Free(path); + release_bytes(opath); return NULL; } @@ -4592,16 +4686,16 @@ n = readlink(path, buf, (int) sizeof buf); Py_END_ALLOW_THREADS if (n < 0) - return posix_error_with_allocated_filename(path); + return posix_error_with_allocated_filename(opath); - PyMem_Free(path); + release_bytes(opath); v = PyBytes_FromStringAndSize(buf, n); if (arg_is_unicode) { PyObject *w; w = PyUnicode_FromEncodedObject(v, Py_FileSystemDefaultEncoding, - "strict"); + "utf8b"); if (w != NULL) { Py_DECREF(v); v = w; @@ -4623,7 +4717,7 @@ static PyObject * posix_symlink(PyObject *self, PyObject *args) { - return posix_2str(args, "etet:symlink", symlink); + return posix_2str(args, "O&O&:symlink", symlink); } #endif /* HAVE_SYMLINK */ @@ -4811,7 +4905,8 @@ static PyObject * posix_open(PyObject *self, PyObject *args) { - char *file = NULL; + PyObject *ofile; + char *file; int flag; int mode = 0777; int fd; @@ -4835,17 +4930,17 @@ } #endif - if (!PyArg_ParseTuple(args, "eti|i", - Py_FileSystemDefaultEncoding, &file, + if (!PyArg_ParseTuple(args, "O&i|i", + PyUnicode_FSConverter, &ofile, &flag, &mode)) return NULL; - + file = bytes2str(ofile, 1); Py_BEGIN_ALLOW_THREADS fd = open(file, flag, mode); Py_END_ALLOW_THREADS if (fd < 0) - return posix_error_with_allocated_filename(file); - PyMem_Free(file); + return posix_error_with_allocated_filename(ofile); + release_bytes(ofile); return PyLong_FromLong((long)fd); } @@ -5289,20 +5384,27 @@ wchar_t *s1, *s2; wchar_t *newenv; #else + PyObject *os1, *os2; char *s1, *s2; char *newenv; #endif PyObject *newstr; size_t len; - if (!PyArg_ParseTuple(args, #ifdef MS_WINDOWS + if (!PyArg_ParseTuple(args, "uu:putenv", -#else - "ss:putenv", -#endif &s1, &s2)) return NULL; +#else + if (!PyArg_ParseTuple(args, + "O&O&:putenv", + PyUnicode_FSConverter, &os1, + PyUnicode_FSConverter, &os2)) + return NULL; + s1 = bytes2str(os1, 1); + s2 = bytes2str(os2, 1); +#endif #if defined(PYOS_OS2) if (stricmp(s1, "BEGINLIBPATH") == 0) { @@ -5345,6 +5447,8 @@ PyOS_snprintf(newenv, len, "%s=%s", s1, s2); if (putenv(newenv)) { Py_DECREF(newstr); + release_bytes(os1); + release_bytes(os2); posix_error(); return NULL; } @@ -5365,6 +5469,10 @@ #if defined(PYOS_OS2) } #endif +#ifndef MS_WINDOWS + release_bytes(os1); + release_bytes(os2); +#endif Py_INCREF(Py_None); return Py_None; } @@ -6688,6 +6796,7 @@ static PyObject * win32_startfile(PyObject *self, PyObject *args) { + PyObject *ofilepath; char *filepath; char *operation = NULL; HINSTANCE rc; @@ -6729,20 +6838,21 @@ #endif normal: - if (!PyArg_ParseTuple(args, "et|s:startfile", - Py_FileSystemDefaultEncoding, &filepath, + if (!PyArg_ParseTuple(args, "O&|s:startfile", + PyUnicode_FSConverter, &ofilepath, &operation)) return NULL; + filepath = bytes2str(ofilepath, 1); Py_BEGIN_ALLOW_THREADS rc = ShellExecute((HWND)0, operation, filepath, NULL, NULL, SW_SHOWNORMAL); Py_END_ALLOW_THREADS if (rc <= (HINSTANCE)32) { PyObject *errval = win32_error("startfile", filepath); - PyMem_Free(filepath); + release_bytes(ofilepath); return errval; } - PyMem_Free(filepath); + release_bytes(ofilepath); Py_INCREF(Py_None); return Py_None; } Modified: python/branches/py3k/Modules/python.c ============================================================================== --- python/branches/py3k/Modules/python.c (original) +++ python/branches/py3k/Modules/python.c Tue May 5 06:43:17 2009 @@ -14,6 +14,93 @@ return Py_Main(argc, argv); } #else +static wchar_t* +char2wchar(char* arg) +{ + wchar_t *res; +#ifdef HAVE_BROKEN_MBSTOWCS + /* Some platforms have a broken implementation of + * mbstowcs which does not count the characters that + * would result from conversion. Use an upper bound. + */ + size_t argsize = strlen(arg); +#else + size_t argsize = mbstowcs(NULL, arg, 0); +#endif + size_t count; + unsigned char *in; + wchar_t *out; +#ifdef HAVE_MBRTOWC + mbstate_t mbs; +#endif + if (argsize != (size_t)-1) { + res = (wchar_t *)PyMem_Malloc((argsize+1)*sizeof(wchar_t)); + if (!res) + goto oom; + count = mbstowcs(res, arg, argsize+1); + if (count != (size_t)-1) + return res; + PyMem_Free(res); + } + /* Conversion failed. Fall back to escaping with utf8b. */ +#ifdef HAVE_MBRTOWC + /* Try conversion with mbrtwoc (C99), and escape non-decodable bytes. */ + + /* Overallocate; as multi-byte characters are in the argument, the + actual output could use less memory. */ + argsize = strlen(arg) + 1; + res = PyMem_Malloc(argsize*sizeof(wchar_t)); + if (!res) goto oom; + in = (unsigned char*)arg; + out = res; + memset(&mbs, 0, sizeof mbs); + while (argsize) { + size_t converted = mbrtowc(out, (char*)in, argsize, &mbs); + if (converted == 0) + /* Reached end of string; null char stored. */ + break; + if (converted == (size_t)-2) { + /* Incomplete character. This should never happen, + since we provide everything that we have - + unless there is a bug in the C library, or I + misunderstood how mbrtowc works. */ + fprintf(stderr, "unexpected mbrtowc result -2\n"); + return NULL; + } + if (converted == (size_t)-1) { + /* Conversion error. Escape as UTF-8b, and start over + in the initial shift state. */ + *out++ = 0xdc00 + *in++; + argsize--; + memset(&mbs, 0, sizeof mbs); + continue; + } + /* successfully converted some bytes */ + in += converted; + argsize -= converted; + out++; + } +#else + /* Cannot use C locale for escaping; manually escape as if charset + is ASCII (i.e. escape all bytes > 128. This will still roundtrip + correctly in the locale's charset, which must be an ASCII superset. */ + res = PyMem_Malloc((strlen(arg)+1)*sizeof(wchar_t)); + if (!res) goto oom; + in = (unsigned char*)arg; + out = res; + while(*in) + if(*in < 128) + *out++ = *in++; + else + *out++ = 0xdc00 + *in++; + *out = 0; +#endif + return res; +oom: + fprintf(stderr, "out of memory\n"); + return NULL; +} + int main(int argc, char **argv) { @@ -40,31 +127,9 @@ oldloc = strdup(setlocale(LC_ALL, NULL)); setlocale(LC_ALL, ""); for (i = 0; i < argc; i++) { -#ifdef HAVE_BROKEN_MBSTOWCS - /* Some platforms have a broken implementation of - * mbstowcs which does not count the characters that - * would result from conversion. Use an upper bound. - */ - size_t argsize = strlen(argv[i]); -#else - size_t argsize = mbstowcs(NULL, argv[i], 0); -#endif - size_t count; - if (argsize == (size_t)-1) { - fprintf(stderr, "Could not convert argument %d to string\n", i); + argv_copy2[i] = argv_copy[i] = char2wchar(argv[i]); + if (!argv_copy[i]) return 1; - } - argv_copy[i] = (wchar_t *)PyMem_Malloc((argsize+1)*sizeof(wchar_t)); - argv_copy2[i] = argv_copy[i]; - if (!argv_copy[i]) { - fprintf(stderr, "out of memory\n"); - return 1; - } - count = mbstowcs(argv_copy[i], argv[i], argsize+1); - if (count == (size_t)-1) { - fprintf(stderr, "Could not convert argument %d to string\n", i); - return 1; - } } setlocale(LC_ALL, oldloc); free(oldloc); Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Tue May 5 06:43:17 2009 @@ -1530,6 +1530,53 @@ } } +/* Convert the argument to a bytes object, according to the file + system encoding */ + +int +PyUnicode_FSConverter(PyObject* arg, void* addr) +{ + PyObject *output = NULL; + Py_ssize_t size; + void *data; + if (PyBytes_Check(arg) || PyByteArray_Check(arg)) { + output = arg; + Py_INCREF(output); + } + else { + arg = PyUnicode_FromObject(arg); + if (!arg) + return 0; + output = PyUnicode_AsEncodedObject(arg, + Py_FileSystemDefaultEncoding, + "utf8b"); + Py_DECREF(arg); + if (!output) + return 0; + if (!PyBytes_Check(output)) { + Py_DECREF(output); + PyErr_SetString(PyExc_TypeError, "encoder failed to return bytes"); + return 0; + } + } + if (PyBytes_Check(output)) { + size = PyBytes_GET_SIZE(output); + data = PyBytes_AS_STRING(output); + } + else { + size = PyByteArray_GET_SIZE(output); + data = PyByteArray_AS_STRING(output); + } + if (size != strlen(data)) { + PyErr_SetString(PyExc_TypeError, "embedded NUL character"); + Py_DECREF(output); + return 0; + } + *(PyObject**)addr = output; + return 1; +} + + char* _PyUnicode_AsStringAndSize(PyObject *unicode, Py_ssize_t *psize) { @@ -4154,11 +4201,22 @@ collstart-startp, collend-startp, &newpos); if (repunicode == NULL) goto onError; - if (!PyUnicode_Check(repunicode)) { - /* Implementation limitation: byte results not supported yet. */ - PyErr_SetString(PyExc_TypeError, "error handler should return unicode"); + if (PyBytes_Check(repunicode)) { + /* Directly copy bytes result to output. */ + repsize = PyBytes_Size(repunicode); + if (repsize > 1) { + /* Make room for all additional bytes. */ + if (_PyBytes_Resize(&res, ressize+repsize-1)) { + Py_DECREF(repunicode); + goto onError; + } + ressize += repsize-1; + } + memcpy(str, PyBytes_AsString(repunicode), repsize); + str += repsize; + p = startp + newpos; Py_DECREF(repunicode); - goto onError; + break; } /* need more space? (at least enough for what we have+the replacement+the rest of the string, so @@ -5123,11 +5181,24 @@ collstartpos, collendpos, &newpos); if (repunicode == NULL) return -1; - if (!PyUnicode_Check(repunicode)) { - /* Implementation limitation: byte results not supported yet. */ - PyErr_SetString(PyExc_TypeError, "error handler should return unicode"); + if (PyBytes_Check(repunicode)) { + /* Directly copy bytes result to output. */ + Py_ssize_t outsize = PyBytes_Size(*res); + Py_ssize_t requiredsize; + repsize = PyBytes_Size(repunicode); + requiredsize = *respos + repsize; + if (requiredsize > outsize) + /* Make room for all additional bytes. */ + if (charmapencode_resize(res, respos, requiredsize)) { + Py_DECREF(repunicode); + return -1; + } + memcpy(PyBytes_AsString(*res) + *respos, + PyBytes_AsString(repunicode), repsize); + *respos += repsize; + *inpos = newpos; Py_DECREF(repunicode); - return -1; + break; } /* generate replacement */ repsize = PyUnicode_GET_SIZE(repunicode); @@ -5691,7 +5762,7 @@ if (repunicode == NULL) goto onError; if (!PyUnicode_Check(repunicode)) { - /* Implementation limitation: byte results not supported yet. */ + /* Byte results not supported, since they have no decimal property. */ PyErr_SetString(PyExc_TypeError, "error handler should return unicode"); Py_DECREF(repunicode); goto onError; Modified: python/branches/py3k/Python/codecs.c ============================================================================== --- python/branches/py3k/Python/codecs.c (original) +++ python/branches/py3k/Python/codecs.c Tue May 5 06:43:17 2009 @@ -829,6 +829,82 @@ } } +static PyObject * +PyCodec_UTF8bErrors(PyObject *exc) +{ + PyObject *restuple; + PyObject *object; + Py_ssize_t start; + Py_ssize_t end; + PyObject *res; + if (PyObject_IsInstance(exc, PyExc_UnicodeEncodeError)) { + Py_UNICODE *p; + Py_UNICODE *startp; + char *outp; + if (PyUnicodeEncodeError_GetStart(exc, &start)) + return NULL; + if (PyUnicodeEncodeError_GetEnd(exc, &end)) + return NULL; + if (!(object = PyUnicodeEncodeError_GetObject(exc))) + return NULL; + startp = PyUnicode_AS_UNICODE(object); + res = PyBytes_FromStringAndSize(NULL, end-start); + if (!res) { + Py_DECREF(object); + return NULL; + } + outp = PyBytes_AsString(res); + for (p = startp+start; p < startp+end; p++) { + Py_UNICODE ch = *p; + if (ch < 0xdc80 || ch > 0xdcff) { + /* Not a UTF-8b surrogate, fail with original exception */ + PyErr_SetObject(PyExceptionInstance_Class(exc), exc); + Py_DECREF(res); + Py_DECREF(object); + return NULL; + } + *outp++ = ch - 0xdc00; + } + restuple = Py_BuildValue("(On)", res, end); + Py_DECREF(res); + Py_DECREF(object); + return restuple; + } + else if (PyObject_IsInstance(exc, PyExc_UnicodeDecodeError)) { + unsigned char *p; + Py_UNICODE ch[4]; /* decode up to 4 bad bytes. */ + int consumed = 0; + if (PyUnicodeDecodeError_GetStart(exc, &start)) + return NULL; + if (PyUnicodeDecodeError_GetEnd(exc, &end)) + return NULL; + if (!(object = PyUnicodeDecodeError_GetObject(exc))) + return NULL; + if (!(p = (unsigned char*)PyBytes_AsString(object))) { + Py_DECREF(object); + return NULL; + } + while (consumed < 4 && consumed < end-start) { + /* Refuse to escape ASCII bytes. */ + if (p[start+consumed] < 128) + break; + ch[consumed] = 0xdc00 + p[start+consumed]; + consumed++; + } + Py_DECREF(object); + if (!consumed) { + /* codec complained about ASCII byte. */ + PyErr_SetObject(PyExceptionInstance_Class(exc), exc); + return NULL; + } + return Py_BuildValue("(u#n)", ch, consumed, start+consumed); + } + else { + wrong_exception_type(exc); + return NULL; + } +} + static PyObject *strict_errors(PyObject *self, PyObject *exc) { @@ -864,6 +940,11 @@ return PyCodec_SurrogateErrors(exc); } +static PyObject *utf8b_errors(PyObject *self, PyObject *exc) +{ + return PyCodec_UTF8bErrors(exc); +} + static int _PyCodecRegistry_Init(void) { static struct { @@ -918,6 +999,14 @@ surrogates_errors, METH_O } + }, + { + "utf8b", + { + "utf8b", + utf8b_errors, + METH_O + } } }; Modified: python/branches/py3k/Python/pythonrun.c ============================================================================== --- python/branches/py3k/Python/pythonrun.c (original) +++ python/branches/py3k/Python/pythonrun.c Tue May 5 06:43:17 2009 @@ -262,6 +262,22 @@ _PyImportHooks_Init(); +#if defined(HAVE_LANGINFO_H) && defined(CODESET) + /* On Unix, set the file system encoding according to the + user's preference, if the CODESET names a well-known + Python codec, and Py_FileSystemDefaultEncoding isn't + initialized by other means. Also set the encoding of + stdin and stdout if these are terminals. */ + + codeset = get_codeset(); + if (codeset) { + if (!Py_FileSystemDefaultEncoding) + Py_FileSystemDefaultEncoding = codeset; + else + free(codeset); + } +#endif + if (install_sigs) initsigs(); /* Signal handling stuff, including initintr() */ @@ -285,22 +301,6 @@ #ifdef WITH_THREAD _PyGILState_Init(interp, tstate); #endif /* WITH_THREAD */ - -#if defined(HAVE_LANGINFO_H) && defined(CODESET) - /* On Unix, set the file system encoding according to the - user's preference, if the CODESET names a well-known - Python codec, and Py_FileSystemDefaultEncoding isn't - initialized by other means. Also set the encoding of - stdin and stdout if these are terminals. */ - - codeset = get_codeset(); - if (codeset) { - if (!Py_FileSystemDefaultEncoding) - Py_FileSystemDefaultEncoding = codeset; - else - free(codeset); - } -#endif } void Modified: python/branches/py3k/configure ============================================================================== --- python/branches/py3k/configure (original) +++ python/branches/py3k/configure Tue May 5 06:43:17 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 71731 . +# From configure.in Revision: 72144 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 3.1. # @@ -16299,11 +16299,12 @@ + for ac_func in alarm setitimer getitimer bind_textdomain_codeset chown \ clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \ getpriority getpwent getspnam getspent getsid getwd \ - kill killpg lchmod lchown lstat mkfifo mknod mktime \ + kill killpg lchmod lchown lstat mbrtowc mkfifo mknod mktime \ mremap nice pathconf pause plock poll pthread_init \ putenv readlink realpath \ select sem_open sem_timedwait sem_getvalue sem_unlink setegid seteuid \ Modified: python/branches/py3k/configure.in ============================================================================== --- python/branches/py3k/configure.in (original) +++ python/branches/py3k/configure.in Tue May 5 06:43:17 2009 @@ -2403,7 +2403,7 @@ clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \ getpriority getpwent getspnam getspent getsid getwd \ - kill killpg lchmod lchown lstat mkfifo mknod mktime \ + kill killpg lchmod lchown lstat mbrtowc mkfifo mknod mktime \ mremap nice pathconf pause plock poll pthread_init \ putenv readlink realpath \ select sem_open sem_timedwait sem_getvalue sem_unlink setegid seteuid \ Modified: python/branches/py3k/pyconfig.h.in ============================================================================== --- python/branches/py3k/pyconfig.h.in (original) +++ python/branches/py3k/pyconfig.h.in Tue May 5 06:43:17 2009 @@ -419,6 +419,9 @@ /* Define this if you have the makedev macro. */ #undef HAVE_MAKEDEV +/* Define to 1 if you have the `mbrtowc' function. */ +#undef HAVE_MBRTOWC + /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE From buildbot at python.org Tue May 5 07:23:43 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 05:23:43 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090505052343.979611E4015@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%202.6/builds/306 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Tue May 5 07:25:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 05:25:29 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090505052529.471091E4015@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/630 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Tue May 5 08:36:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 06:36:46 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.0 Message-ID: <20090505063647.37C851E441D@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.0/builds/339 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Tue May 5 09:48:13 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 5 May 2009 09:48:13 +0200 (CEST) Subject: [Python-checkins] r72314 - in python/trunk: Lib/json/tests/test_scanstring.py Modules/_json.c Message-ID: <20090505074813.0548B1E4012@bag.python.org> Author: georg.brandl Date: Tue May 5 09:48:12 2009 New Revision: 72314 Log: #5932: fix error return in _convertPyInt_AsSsize_t() conversion function. Modified: python/trunk/Lib/json/tests/test_scanstring.py python/trunk/Modules/_json.c Modified: python/trunk/Lib/json/tests/test_scanstring.py ============================================================================== --- python/trunk/Lib/json/tests/test_scanstring.py (original) +++ python/trunk/Lib/json/tests/test_scanstring.py Tue May 5 09:48:12 2009 @@ -107,3 +107,6 @@ "xxx") self.assertRaises(UnicodeDecodeError, json.encoder.encode_basestring_ascii, b"xx\xff") + + def test_overflow(self): + self.assertRaises(OverflowError, json.decoder.scanstring, b"xxx", sys.maxsize+1) Modified: python/trunk/Modules/_json.c ============================================================================== --- python/trunk/Modules/_json.c (original) +++ python/trunk/Modules/_json.c Tue May 5 09:48:12 2009 @@ -143,9 +143,9 @@ { /* PyObject to Py_ssize_t converter */ *size_ptr = PyInt_AsSsize_t(o); - if (*size_ptr == -1 && PyErr_Occurred()); - return 1; - return 0; + if (*size_ptr == -1 && PyErr_Occurred()) + return 0; + return 1; } static PyObject * From python-checkins at python.org Tue May 5 09:52:05 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 5 May 2009 09:52:05 +0200 (CEST) Subject: [Python-checkins] r72315 - in python/branches/py3k: Lib/json/tests/test_scanstring.py Modules/_json.c Message-ID: <20090505075205.4CF3B1E4039@bag.python.org> Author: georg.brandl Date: Tue May 5 09:52:05 2009 New Revision: 72315 Log: Merged revisions 72314 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72314 | georg.brandl | 2009-05-05 09:48:12 +0200 (Di, 05 Mai 2009) | 1 line #5932: fix error return in _convertPyInt_AsSsize_t() conversion function. ........ Modified: python/branches/py3k/Lib/json/tests/test_scanstring.py python/branches/py3k/Modules/_json.c Modified: python/branches/py3k/Lib/json/tests/test_scanstring.py ============================================================================== --- python/branches/py3k/Lib/json/tests/test_scanstring.py (original) +++ python/branches/py3k/Lib/json/tests/test_scanstring.py Tue May 5 09:52:05 2009 @@ -102,3 +102,6 @@ self.assertEquals( scanstring('["Bad value", truth]', 2, True), ('Bad value', 12)) + + def test_overflow(self): + self.assertRaises(OverflowError, json.decoder.scanstring, b"xxx", sys.maxsize+1) Modified: python/branches/py3k/Modules/_json.c ============================================================================== --- python/branches/py3k/Modules/_json.c (original) +++ python/branches/py3k/Modules/_json.c Tue May 5 09:52:05 2009 @@ -133,9 +133,9 @@ { /* PyObject to Py_ssize_t converter */ *size_ptr = PyLong_AsSsize_t(o); - if (*size_ptr == -1 && PyErr_Occurred()); - return 1; - return 0; + if (*size_ptr == -1 && PyErr_Occurred()) + return 0; + return 1; } static PyObject * From python-checkins at python.org Tue May 5 09:52:29 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 5 May 2009 09:52:29 +0200 (CEST) Subject: [Python-checkins] r72316 - python/branches/py3k Message-ID: <20090505075229.766A31E4012@bag.python.org> Author: georg.brandl Date: Tue May 5 09:52:29 2009 New Revision: 72316 Log: Mark 72314 as integrated. Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Tue May 5 09:55:27 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 5 May 2009 09:55:27 +0200 (CEST) Subject: [Python-checkins] r72317 - in python/branches/py3k/Doc/includes: noddy.c noddy2.c noddy3.c noddy4.c Message-ID: <20090505075527.2C8001E441B@bag.python.org> Author: georg.brandl Date: Tue May 5 09:55:26 2009 New Revision: 72317 Log: #5938: use PyVarObject_HEAD_INIT instead of PyObject_HEAD_INIT in noddy examples. Modified: python/branches/py3k/Doc/includes/noddy.c python/branches/py3k/Doc/includes/noddy2.c python/branches/py3k/Doc/includes/noddy3.c python/branches/py3k/Doc/includes/noddy4.c Modified: python/branches/py3k/Doc/includes/noddy.c ============================================================================== --- python/branches/py3k/Doc/includes/noddy.c (original) +++ python/branches/py3k/Doc/includes/noddy.c Tue May 5 09:55:26 2009 @@ -6,7 +6,7 @@ } noddy_NoddyObject; static PyTypeObject noddy_NoddyType = { - PyObject_HEAD_INIT(NULL) + PyVarObject_HEAD_INIT(NULL, 0) "noddy.Noddy", /* tp_name */ sizeof(noddy_NoddyObject), /* tp_basicsize */ 0, /* tp_itemsize */ Modified: python/branches/py3k/Doc/includes/noddy2.c ============================================================================== --- python/branches/py3k/Doc/includes/noddy2.c (original) +++ python/branches/py3k/Doc/includes/noddy2.c Tue May 5 09:55:26 2009 @@ -123,7 +123,7 @@ }; static PyTypeObject NoddyType = { - PyObject_HEAD_INIT(NULL) + PyVarObject_HEAD_INIT(NULL, 0) "noddy.Noddy", /* tp_name */ sizeof(Noddy), /* tp_basicsize */ 0, /* tp_itemsize */ Modified: python/branches/py3k/Doc/includes/noddy3.c ============================================================================== --- python/branches/py3k/Doc/includes/noddy3.c (original) +++ python/branches/py3k/Doc/includes/noddy3.c Tue May 5 09:55:26 2009 @@ -176,7 +176,7 @@ }; static PyTypeObject NoddyType = { - PyObject_HEAD_INIT(NULL) + PyVarObject_HEAD_INIT(NULL, 0) "noddy.Noddy", /* tp_name */ sizeof(Noddy), /* tp_basicsize */ 0, /* tp_itemsize */ Modified: python/branches/py3k/Doc/includes/noddy4.c ============================================================================== --- python/branches/py3k/Doc/includes/noddy4.c (original) +++ python/branches/py3k/Doc/includes/noddy4.c Tue May 5 09:55:26 2009 @@ -157,7 +157,7 @@ }; static PyTypeObject NoddyType = { - PyObject_HEAD_INIT(NULL) + PyVarObject_HEAD_INIT(NULL, 0) "noddy.Noddy", /* tp_name */ sizeof(Noddy), /* tp_basicsize */ 0, /* tp_itemsize */ From buildbot at python.org Tue May 5 10:06:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 08:06:37 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc trunk Message-ID: <20090505080637.B7C2A1E4012@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%20trunk/builds/374 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: steven.bethard BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_time sincerely, -The Buildbot From python-checkins at python.org Tue May 5 10:14:34 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 5 May 2009 10:14:34 +0200 (CEST) Subject: [Python-checkins] r72318 - in python/branches/py3k: Demo/turtle/tdemo_nim.py Demo/turtle/tdemo_round_dance.py Doc/library/turtle.rst Lib/turtle.py Misc/NEWS Message-ID: <20090505081434.66AA61E4012@bag.python.org> Author: georg.brandl Date: Tue May 5 10:14:33 2009 New Revision: 72318 Log: #5923: update turtle module to version 1.1. Added: python/branches/py3k/Demo/turtle/tdemo_nim.py (contents, props changed) python/branches/py3k/Demo/turtle/tdemo_round_dance.py (contents, props changed) Modified: python/branches/py3k/Doc/library/turtle.rst python/branches/py3k/Lib/turtle.py python/branches/py3k/Misc/NEWS Added: python/branches/py3k/Demo/turtle/tdemo_nim.py ============================================================================== --- (empty file) +++ python/branches/py3k/Demo/turtle/tdemo_nim.py Tue May 5 10:14:33 2009 @@ -0,0 +1,227 @@ +""" turtle-example-suite: + + tdemo_nim.py + +Play nim against the computer. The player +who takes the last stick is the winner. + +Implements the model-view-controller +design pattern. +""" + + +import turtle +import random +import time + +SCREENWIDTH = 640 +SCREENHEIGHT = 480 + +MINSTICKS = 7 +MAXSTICKS = 31 + +HUNIT = SCREENHEIGHT // 12 +WUNIT = SCREENWIDTH // ((MAXSTICKS // 5) * 11 + (MAXSTICKS % 5) * 2) + +SCOLOR = (63, 63, 31) +HCOLOR = (255, 204, 204) +COLOR = (204, 204, 255) + +def randomrow(): + return random.randint(MINSTICKS, MAXSTICKS) + +def computerzug(state): + xored = state[0] ^ state[1] ^ state[2] + if xored == 0: + return randommove(state) + for z in range(3): + s = state[z] ^ xored + if s <= state[z]: + move = (z, s) + return move + +def randommove(state): + m = max(state) + while True: + z = random.randint(0,2) + if state[z] > (m > 1): + break + rand = random.randint(m > 1, state[z]-1) + return z, rand + + +class NimModel(object): + def __init__(self, game): + self.game = game + + def setup(self): + if self.game.state not in [Nim.CREATED, Nim.OVER]: + return + self.sticks = [randomrow(), randomrow(), randomrow()] + self.player = 0 + self.winner = None + self.game.view.setup() + self.game.state = Nim.RUNNING + + def move(self, row, col): + maxspalte = self.sticks[row] + self.sticks[row] = col + self.game.view.notify_move(row, col, maxspalte, self.player) + if self.game_over(): + self.game.state = Nim.OVER + self.winner = self.player + self.game.view.notify_over() + elif self.player == 0: + self.player = 1 + row, col = computerzug(self.sticks) + self.move(row, col) + self.player = 0 + + def game_over(self): + return self.sticks == [0, 0, 0] + + def notify_move(self, row, col): + if self.sticks[row] <= col: + return + self.move(row, col) + + +class Stick(turtle.Turtle): + def __init__(self, row, col, game): + turtle.Turtle.__init__(self, visible=False) + self.row = row + self.col = col + self.game = game + x, y = self.coords(row, col) + self.shape("square") + self.shapesize(HUNIT/10.0, WUNIT/20.0) + self.speed(0) + self.pu() + self.goto(x,y) + self.color("white") + self.showturtle() + + def coords(self, row, col): + packet, remainder = divmod(col, 5) + x = (3 + 11 * packet + 2 * remainder) * WUNIT + y = (2 + 3 * row) * HUNIT + return x - SCREENWIDTH // 2 + WUNIT // 2, SCREENHEIGHT // 2 - y - HUNIT // 2 + + def makemove(self, x, y): + if self.game.state != Nim.RUNNING: + return + self.game.controller.notify_move(self.row, self.col) + + +class NimView(object): + def __init__(self, game): + self.game = game + self.screen = game.screen + self.model = game.model + self.screen.colormode(255) + self.screen.tracer(False) + self.screen.bgcolor((240, 240, 255)) + self.writer = turtle.Turtle(visible=False) + self.writer.pu() + self.writer.speed(0) + self.sticks = {} + for row in range(3): + for col in range(MAXSTICKS): + self.sticks[(row, col)] = Stick(row, col, game) + self.display("... a moment please ...") + self.screen.tracer(True) + + def display(self, msg1, msg2=None): + self.screen.tracer(False) + self.writer.clear() + if msg2 is not None: + self.writer.goto(0, - SCREENHEIGHT // 2 + 48) + self.writer.pencolor("red") + self.writer.write(msg2, align="center", font=("Courier",18,"bold")) + self.writer.goto(0, - SCREENHEIGHT // 2 + 20) + self.writer.pencolor("black") + self.writer.write(msg1, align="center", font=("Courier",14,"bold")) + self.screen.tracer(True) + + + def setup(self): + self.screen.tracer(False) + for row in range(3): + for col in range(self.model.sticks[row]): + self.sticks[(row, col)].color(SCOLOR) + for row in range(3): + for col in range(self.model.sticks[row], MAXSTICKS): + self.sticks[(row, col)].color("white") + self.display("Your turn! Click leftmost stick to remove.") + self.screen.tracer(True) + + def notify_move(self, row, col, maxspalte, player): + if player == 0: + farbe = HCOLOR + for s in range(col, maxspalte): + self.sticks[(row, s)].color(farbe) + else: + self.display(" ... thinking ... ") + time.sleep(0.5) + self.display(" ... thinking ... aaah ...") + farbe = COLOR + for s in range(maxspalte-1, col-1, -1): + time.sleep(0.2) + self.sticks[(row, s)].color(farbe) + self.display("Your turn! Click leftmost stick to remove.") + + def notify_over(self): + if self.game.model.winner == 0: + msg2 = "Congrats. You're the winner!!!" + else: + msg2 = "Sorry, the computer is the winner." + self.display("To play again press space bar. To leave press ESC.", msg2) + + def clear(self): + if self.game.state == Nim.OVER: + self.screen.clear() + +class NimController(object): + + def __init__(self, game): + self.game = game + self.sticks = game.view.sticks + self.BUSY = False + for stick in self.sticks.values(): + stick.onclick(stick.makemove) + self.game.screen.onkey(self.game.model.setup, "space") + self.game.screen.onkey(self.game.view.clear, "Escape") + self.game.view.display("Press space bar to start game") + self.game.screen.listen() + + def notify_move(self, row, col): + if self.BUSY: + return + self.BUSY = True + self.game.model.notify_move(row, col) + self.BUSY = False + +class Nim(object): + CREATED = 0 + RUNNING = 1 + OVER = 2 + def __init__(self, screen): + self.state = Nim.CREATED + self.screen = screen + self.model = NimModel(self) + self.view = NimView(self) + self.controller = NimController(self) + + +mainscreen = turtle.Screen() +mainscreen.mode("standard") +mainscreen.setup(SCREENWIDTH, SCREENHEIGHT) + +def main(): + nim = Nim(mainscreen) + return "EVENTLOOP!" + +if __name__ == "__main__": + main() + turtle.mainloop() + Added: python/branches/py3k/Demo/turtle/tdemo_round_dance.py ============================================================================== --- (empty file) +++ python/branches/py3k/Demo/turtle/tdemo_round_dance.py Tue May 5 10:14:33 2009 @@ -0,0 +1,90 @@ +""" turtle-example-suite: + + tdemo_round_dance.py + +(Needs version 1.1 of the turtle module that +comes with Python 3.1) + +Dancing turtles have a compound shape +consisting of a series of triangles of +decreasing size. + +Turtles march along a circle while rotating +pairwise in opposite direction, with one +exception. Does that breaking of symmetry +enhance the attractiveness of the example? + +Press any key to stop the animation. + +Technically: demonstrates use of compound +shapes, transformation of shapes as well as +cloning turtles. The animation is +controlled through update(). +""" + +from turtle import * + +def stop(): + global running + running = False + +def main(): + global running + clearscreen() + bgcolor("gray10") + tracer(False) + shape("triangle") + f = 0.793402 + phi = 9.064678 + s = 5 + c = 1 + # create compound shape + sh = Shape("compound") + for i in range(10): + shapesize(s) + p =get_shapepoly() + s *= f + c *= f + tilt(-phi) + sh.addcomponent(p, (c, 0.25, 1-c), "black") + register_shape("multitri", sh) + # create dancers + shapesize(1) + shape("multitri") + pu() + setpos(0, -200) + dancers = [] + for i in range(180): + fd(7) + tilt(-4) + lt(2) + update() + if i % 12 == 0: + dancers.append(clone()) + home() + # dance + running = True + onkeypress(stop) + listen() + cs = 1 + while running: + ta = -4 + for dancer in dancers: + dancer.fd(7) + dancer.lt(2) + dancer.tilt(ta) + ta = -4 if ta > 0 else 2 + if cs < 180: + right(4) + shapesize(cs) + cs *= 1.005 + update() + return "DONE!" + +if __name__=='__main__': + print(main()) + mainloop() + + + + Modified: python/branches/py3k/Doc/library/turtle.rst ============================================================================== --- python/branches/py3k/Doc/library/turtle.rst (original) +++ python/branches/py3k/Doc/library/turtle.rst Tue May 5 10:14:33 2009 @@ -149,9 +149,12 @@ | :func:`shape` | :func:`resizemode` | :func:`shapesize` | :func:`turtlesize` + | :func:`shearfactor` | :func:`settiltangle` | :func:`tiltangle` | :func:`tilt` + | :func:`shapetransform` + | :func:`get_shapepoly` Using events | :func:`onclick` @@ -187,9 +190,11 @@ Using screen events | :func:`listen` - | :func:`onkey` + | :func:`onkey` | :func:`onkeyrelease` + | :func:`onkeypress` | :func:`onclick` | :func:`onscreenclick` | :func:`ontimer` + | :func:`mainloop` Settings and special methods | :func:`mode` @@ -201,6 +206,10 @@ | :func:`window_height` | :func:`window_width` +Input methods + | :func:`textinput` + | :func:`numinput` + Methods specific to Screen | :func:`bye` | :func:`exitonclick` @@ -1157,6 +1166,26 @@ (5, 5, 8) +.. function:: shearfactor(self, shear=None): + + :param shear: number (optional) + + Set or return the current shearfactor. Shear the turtleshape according to + the given shearfactor shear, which is the tangent of the shear angle. + Do *not* change the turtle's heading (direction of movement). + If shear is not given: return the current shearfactor, i. e. the + tangent of the shear angle, by which lines parallel to the + heading of the turtle are sheared. + + .. doctest:: + + >>> turtle.shape("circle") + >>> turtle.shapesize(5,2) + >>> turtle.shearfactor(0.5) + >>> turtle.shearfactor() + >>> 0.5 + + .. function:: tilt(angle) :param angle: a number @@ -1194,10 +1223,19 @@ >>> turtle.fd(50) -.. function:: tiltangle() +.. function:: tiltangle(angle=None) + + :param angle: a number (optional) - Return the current tilt-angle, i.e. the angle between the orientation of the - turtleshape and the heading of the turtle (its direction of movement). + Set or return the current tilt-angle. If angle is given, rotate the + turtleshape to point in the direction specified by angle, + regardless of its current tilt-angle. Do *not* change the turtle's + heading (direction of movement). + If angle is not given: return the current tilt-angle, i. e. the angle + between the orientation of the turtleshape and the heading of the + turtle (its direction of movement). + + Deprecated since Python 3.1 .. doctest:: @@ -1209,6 +1247,46 @@ 45.0 +.. function:: shapetransform(t11=None, t12=None, t21=None, t22=None) + + :param t11: a number (optional) + :param t12: a number (optional) + :param t21: a number (optional) + :param t12: a number (optional) + + Set or return the current transformation matrix of the turtle shape. + + If none of the matrix elements are given, return the transformation + matrix as a tuple of 4 elements. + Otherwise set the given elements and transform the turtleshape + according to the matrix consisting of first row t11, t12 and + second row t21, 22. The determinant t11 * t22 - t12 * t21 must not be + zero, otherwise an error is raised. + Modify stretchfactor, shearfactor and tiltangle according to the + given matrix. + + .. doctest:: + + >>> turtle.shape("square") + >>> turtle.shapesize(4,2) + >>> turtle.shearfactor(-0.5) + >>> turtle.shapetransform() + >>> (4.0, -1.0, -0.0, 2.0) + + +.. function:: get_shapepoly(): + + Return the current shape polygon as tuple of coordinate pairs. This + can be used to define a new shape or components of a compound shape. + + .. doctest:: + + >>> turtle.shape("square") + >>> turtle.shapetransform(4, -1, 0, 2) + >>> turtle.get_shapepoly() + ((50, -20), (30, 20), (-50, 20), (-30, -20)) + + Using events ------------ @@ -1595,6 +1673,7 @@ .. function:: onkey(fun, key) + onkeyrelease(fun, key) :param fun: a function with no arguments or ``None`` :param key: a string: key (e.g. "a") or key-symbol (e.g. "space") @@ -1613,6 +1692,25 @@ >>> screen.listen() +.. function:: onkeypress(fun, key=None): + + :param fun: a function with no arguments or ``None`` + :param key: a string: key (e.g. "a") or key-symbol (e.g. "space") + + Bind *fun* to key-press event of key if key is given, + or to any key-press-event if no key is given. + Remark: in order to be able to register key-events, TurtleScreen + must have focus. (See method :func:`listen`.) + + .. doctest:: + + >>> def f(): + ... fd(50) + ... + >>> screen.onkey(f, "Up") + >>> screen.listen() + + .. function:: onclick(fun, btn=1, add=None) onscreenclick(fun, btn=1, add=None) @@ -1659,6 +1757,53 @@ >>> running = False +.. function:: mainloop() + + Starts event loop - calling Tkinter's mainloop function. + Must be the last statement in a turtle graphics program. + Must *not* be used if a script is run from within IDLE in -n mode + (No subprocess) - for interactive use of turtle graphics. :: + + >>> screen.mainloop() + + +Input methods +------------- + +.. function:: textinput(title, prompt) + + :param title: string + :param prompt: string + + Pop up a dialog window for input of a string. Parameter title is + the title of the dialog window, propmt is a text mostly describing + what information to input. + Return the string input. If the dialog is canceled, return None. :: + + >>> screen.textinput("NIM", "Name of first player:") + + +.. function:: numinput(self, title, prompt, + default=None, minval=None, maxval=None): + + :param title: string + :param prompt: string + :param default: number (optional) + :param prompt: number (optional) + :param prompt: number (optional) + + Pop up a dialog window for input of a number. title is the title of the + dialog window, prompt is a text mostly describing what numerical information + to input. default: default value, minval: minimum value for imput, + maxval: maximum value for input + The number input must be in the range minval .. maxval if these are + given. If not, a hint is issued and the dialog remains open for + correction. + Return the number input. If the dialog is canceled, return None. :: + + >>> screen.numinput("Poker", "Your stakes:", 1000, minval=10, maxval=10000) + + Settings and special methods ---------------------------- @@ -2159,6 +2304,10 @@ | | | as Hanoi discs | | | | (shape, shapesize) | +----------------+------------------------------+-----------------------+ +| nim | play the classical nim game | turtles as nimsticks, | +| | with three heaps of sticks | event driven (mouse, | +| | against the computer. | keyboard) | ++----------------+------------------------------+-----------------------+ | paint | super minimalistic | :func:`onclick` | | | drawing program | | +----------------+------------------------------+-----------------------+ @@ -2171,6 +2320,10 @@ | planet_and_moon| simulation of | compound shapes, | | | gravitational system | :class:`Vec2D` | +----------------+------------------------------+-----------------------+ +| round_dance | dancing turtles rotating | compound shapes, clone| +| | pairwise in opposite | shapesize, tilt, | +| | direction | get_polyshape, update | ++----------------+------------------------------+-----------------------+ | tree | a (graphical) breadth | :func:`clone` | | | first tree (using generators)| | +----------------+------------------------------+-----------------------+ @@ -2204,6 +2357,32 @@ This behaviour corresponds to a ``fill()`` call without arguments in Python 2.6. +Changes since Python 3.0 +======================== + +- The methods :meth:`Turtle.shearfactor`, :meth:`Turtle.shapetransform` and + :meth:`Turtle.get_shapepoly` have been added. Thus the full range of + regular linear transforms is now available for transforming turtle shapes. + :meth:`Turtle.tiltangle` has been enhanced in functionality: it now can + be used to get or set the tiltangle. :meth:`Turtle.settiltangle` has been + deprecated. + +- The method :meth:`Screen.onkeypress` has been added as a complement to + :meth:`Screen.onkey` which in fact binds actions to the keyrelease event. + Accordingly the latter has got an alias: :meth:`Screen.onkeyrelease`. + +- The method :meth:`Screen.mainloop` has been added. So when working only + with Screen and Turtle objects one must not additonally import + :func:`mainloop` anymore. + +- Two input methods has been added :meth:`Screen.textinput` and + :meth:`Screen.numinput`. These popup input dialogs and return + strings and numbers respectively. + +- Two example scripts :file:`tdemo_nim.py` and :file:`tdemo_round_dance.py` + have been added to the Demo directory (source distribution only). As usual + they can be viewed and executed within the demo viewer :file:`turtleDemo.py`. + .. doctest:: :hide: Modified: python/branches/py3k/Lib/turtle.py ============================================================================== --- python/branches/py3k/Lib/turtle.py (original) +++ python/branches/py3k/Lib/turtle.py Tue May 5 10:14:33 2009 @@ -1,8 +1,8 @@ # # turtle.py: a Tkinter based turtle graphics module for Python -# Version 1.0b1 - 31. 5. 2008 +# Version 1.1b - 4. 5. 2009 # -# Copyright (C) 2006 - 2008 Gregor Lingl +# Copyright (C) 2006 - 2009 Gregor Lingl # email: glingl at aon.at # # This software is provided 'as-is', without any express or implied @@ -100,7 +100,7 @@ """ -_ver = "turtle 1.0b1- - for Python 3.0 - 9. 6. 2008, 01:15" +_ver = "turtle 1.1b- - for Python 3.1 - 4. 5. 2009" # print(_ver) @@ -112,36 +112,31 @@ from os.path import isfile, split, join from copy import deepcopy - -#from math import * ## for compatibility with old turtle module +from tkinter import simpledialog _tg_classes = ['ScrolledCanvas', 'TurtleScreen', 'Screen', 'RawTurtle', 'Turtle', 'RawPen', 'Pen', 'Shape', 'Vec2D'] _tg_screen_functions = ['addshape', 'bgcolor', 'bgpic', 'bye', 'clearscreen', 'colormode', 'delay', 'exitonclick', 'getcanvas', - 'getshapes', 'listen', 'mode', 'onkey', 'onscreenclick', 'ontimer', + 'getshapes', 'listen', 'mainloop', 'mode', 'numinput', + 'onkey', 'onkeypress', 'onkeyrelease', 'onscreenclick', 'ontimer', 'register_shape', 'resetscreen', 'screensize', 'setup', - 'setworldcoordinates', 'title', 'tracer', 'turtles', 'update', + 'setworldcoordinates', 'textinput', 'title', 'tracer', 'turtles', 'update', 'window_height', 'window_width'] _tg_turtle_functions = ['back', 'backward', 'begin_fill', 'begin_poly', 'bk', 'circle', 'clear', 'clearstamp', 'clearstamps', 'clone', 'color', 'degrees', 'distance', 'dot', 'down', 'end_fill', 'end_poly', 'fd', - #'fill', - 'fillcolor', 'forward', 'get_poly', 'getpen', 'getscreen', + 'fillcolor', 'forward', 'get_poly', 'getpen', 'getscreen', 'get_shapepoly', 'getturtle', 'goto', 'heading', 'hideturtle', 'home', 'ht', 'isdown', 'isvisible', 'left', 'lt', 'onclick', 'ondrag', 'onrelease', 'pd', 'pen', 'pencolor', 'pendown', 'pensize', 'penup', 'pos', 'position', 'pu', 'radians', 'right', 'reset', 'resizemode', 'rt', 'seth', 'setheading', 'setpos', 'setposition', 'settiltangle', - 'setundobuffer', 'setx', 'sety', 'shape', 'shapesize', 'showturtle', - 'speed', 'st', 'stamp', 'tilt', 'tiltangle', 'towards', #'tracer', + 'setundobuffer', 'setx', 'sety', 'shape', 'shapesize', 'shapetransform', 'shearfactor', 'showturtle', + 'speed', 'st', 'stamp', 'tilt', 'tiltangle', 'towards', 'turtlesize', 'undo', 'undobufferentries', 'up', 'width', - #'window_height', 'window_width', 'write', 'xcor', 'ycor'] -_tg_utilities = ['write_docstringdict', 'done', 'mainloop'] -##_math_functions = ['acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'cosh', -## 'e', 'exp', 'fabs', 'floor', 'fmod', 'frexp', 'hypot', 'ldexp', 'log', -## 'log10', 'modf', 'pi', 'pow', 'sin', 'sinh', 'sqrt', 'tan', 'tanh'] +_tg_utilities = ['write_docstringdict', 'done'] __all__ = (_tg_classes + _tg_screen_functions + _tg_turtle_functions + _tg_utilities) # + _math_functions) @@ -172,16 +167,6 @@ "using_IDLE": False } -##print "cwd:", os.getcwd() -##print "__file__:", __file__ -## -##def show(dictionary): -## print "==========================" -## for key in sorted(dictionary.keys()): -## print key, ":", dictionary[key] -## print "==========================" -## print - def config_dict(filename): """Convert content of config-file into dictionary.""" f = open(filename, "r") @@ -230,7 +215,6 @@ cfgdict2 = {} if isfile(default_cfg): cfgdict1 = config_dict(default_cfg) - #print "1. Loading config-file %s from: %s" % (default_cfg, os.getcwd()) if "importconfig" in cfgdict1: default_cfg = "turtle_%s.cfg" % cfgdict1["importconfig"] try: @@ -239,15 +223,9 @@ except: cfg_file2 = "" if isfile(cfg_file2): - #print "2. Loading config-file %s:" % cfg_file2 cfgdict2 = config_dict(cfg_file2) -## show(_CFG) -## show(cfgdict2) _CFG.update(cfgdict2) -## show(_CFG) -## show(cfgdict1) _CFG.update(cfgdict1) -## show(_CFG) try: readconfig(_CFG) @@ -697,7 +675,7 @@ fun(x, y) self.cv.bind("" % num, eventfun, add) - def _onkey(self, fun, key): + def _onkeyrelease(self, fun, key): """Bind fun to key-release event of key. Canvas must have focus. See method listen """ @@ -708,6 +686,24 @@ fun() self.cv.bind("" % key, eventfun) + def _onkeypress(self, fun, key=None): + """If key is given, bind fun to key-press event of key. + Otherwise bind fun to any key-press. + Canvas must have focus. See method listen. + """ + if fun is None: + if key is None: + self.cv.unbind("", None) + else: + self.cv.unbind("" % key, None) + else: + def eventfun(event): + fun() + if key is None: + self.cv.bind("", eventfun) + else: + self.cv.bind("" % key, eventfun) + def _listen(self): """Set focus on canvas (in order to collect key-events) """ @@ -801,6 +797,57 @@ height = self.cv['height'] return width, height + def mainloop(self): + """Starts event loop - calling Tkinter's mainloop function. + + No argument. + + Must be last statement in a turtle graphics program. + Must NOT be used if a script is run from within IDLE in -n mode + (No subprocess) - for interactive use of turtle graphics. + + Example (for a TurtleScreen instance named screen): + >>> screen.mainloop() + + """ + TK.mainloop() + + def textinput(self, title, prompt): + """Pop up a dialog window for input of a string. + + Arguments: title is the title of the dialog window, + prompt is a text mostly describing what information to input. + + Return the string input + If the dialog is canceled, return None. + + Example (for a TurtleScreen instance named screen): + >>> screen.textinput("NIM", "Name of first player:") + + """ + return simpledialog.askstring(title, prompt) + + def numinput(self, title, prompt, default=None, minval=None, maxval=None): + """Pop up a dialog window for input of a number. + + Arguments: title is the title of the dialog window, + prompt is a text mostly describing what numerical information to input. + default: default value + minval: minimum value for imput + maxval: maximum value for input + + The number input must be in the range minval .. maxval if these are + given. If not, a hint is issued and the dialog remains open for + correction. Return the number input. + If the dialog is canceled, return None. + + Example (for a TurtleScreen instance named screen): + >>> screen.numinput("Poker", "Your stakes:", 1000, minval=10, maxval=10000) + + """ + return simpledialog.askfloat(title, prompt, initialvalue=default, + minvalue=minval, maxvalue=maxval) + ############################################################################## ### End of Tkinter - interface ### @@ -913,7 +960,6 @@ upon components of the underlying graphics toolkit - which is Tkinter in this case. """ -# _STANDARD_DELAY = 5 _RUNNING = True def __init__(self, cv, mode=_CFG["mode"], @@ -951,11 +997,11 @@ def clear(self): """Delete all drawings and all turtles from the TurtleScreen. + No argument. + Reset empty TurtleScreen to its initial state: white background, no backgroundimage, no eventbindings and tracing on. - No argument. - Example (for a TurtleScreen instance named screen): screen.clear() @@ -972,8 +1018,10 @@ self.bgcolor("white") for btn in 1, 2, 3: self.onclick(None, btn) + self.onkeypress(None) for key in self._keys[:]: self.onkey(None, key) + self.onkeypress(None, key) Turtle._pen = None def mode(self, mode=None): @@ -1083,7 +1131,6 @@ shape = Shape("polygon", shape) ## else shape assumed to be Shape-instance self._shapes[name] = shape - # print "shape added:" , self._shapes def _colorstr(self, color): """Return color string corresponding to args. @@ -1243,9 +1290,12 @@ def update(self): """Perform a TurtleScreen update. """ + tracing = self._tracing + self._tracing = True for t in self.turtles(): t._update_data() t._drawturtle() + self._tracing = tracing self._update() def window_width(self): @@ -1336,10 +1386,44 @@ ### consequently drawing a hexagon """ if fun == None: - self._keys.remove(key) + if key in self._keys: + self._keys.remove(key) elif key not in self._keys: self._keys.append(key) - self._onkey(fun, key) + self._onkeyrelease(fun, key) + + def onkeypress(self, fun, key=None): + """Bind fun to key-press event of key if key is given, + or to any key-press-event if no key is given. + + Arguments: + fun -- a function with no arguments + key -- a string: key (e.g. "a") or key-symbol (e.g. "space") + + In order to be able to register key-events, TurtleScreen + must have focus. (See method listen.) + + Example (for a TurtleScreen instance named screen + and a Turtle instance named turtle): + + >>> def f(): + fd(50) + + + >>> screen.onkey(f, "Up") + >>> screen.listen() + + ### Subsequently the turtle can be moved by + ### repeatedly pressing the up-arrow key, + ### or by keeping pressed the up-arrow key. + ### consequently drawing a hexagon. + """ + if fun == None: + if key in self._keys: + self._keys.remove(key) + elif key is not None and key not in self._keys: + self._keys.append(key) + self._onkeypress(fun, key) def listen(self, xdummy=None, ydummy=None): """Set focus on TurtleScreen (in order to collect key-events) @@ -1421,6 +1505,7 @@ resetscreen = reset clearscreen = clear addshape = register_shape + onkeyrelease = onkey class TNavigator(object): """Navigation part of the RawTurtle. @@ -1947,10 +2032,11 @@ self._fillcolor = fillcolor self._drawing = True self._speed = 3 - self._stretchfactor = (1, 1) - self._tilt = 0 + self._stretchfactor = (1., 1.) + self._shearfactor = 0. + self._tilt = 0. + self._shapetrafo = (1., 0., 0., 1.) self._outlinewidth = 1 - ### self.screen = None # to override by child class def resizemode(self, rmode=None): """Set resizemode to one of the values: "auto", "user", "noresize". @@ -2262,6 +2348,7 @@ "speed" : number in range 0..10 "resizemode" : "auto" or "user" or "noresize" "stretchfactor": (positive number, positive number) + "shearfactor": number "outline" : positive number "tilt" : number @@ -2276,19 +2363,19 @@ >>> turtle.pen() {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1, 'pencolor': 'red', 'pendown': True, 'fillcolor': 'black', - 'stretchfactor': (1,1), 'speed': 3} + 'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0} >>> penstate=turtle.pen() >>> turtle.color("yellow","") >>> turtle.penup() >>> turtle.pen() {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1, 'pencolor': 'yellow', 'pendown': False, 'fillcolor': '', - 'stretchfactor': (1,1), 'speed': 3} + 'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0} >>> p.pen(penstate, fillcolor="green") >>> p.pen() {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1, 'pencolor': 'red', 'pendown': True, 'fillcolor': 'green', - 'stretchfactor': (1,1), 'speed': 3} + 'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0} """ _pd = {"shown" : self._shown, "pendown" : self._drawing, @@ -2298,6 +2385,7 @@ "speed" : self._speed, "resizemode" : self._resizemode, "stretchfactor" : self._stretchfactor, + "shearfactor" : self._shearfactor, "outline" : self._outlinewidth, "tilt" : self._tilt } @@ -2351,12 +2439,20 @@ if isinstance(sf, (int, float)): sf = (sf, sf) self._stretchfactor = sf + if "shearfactor" in p: + self._shearfactor = p["shearfactor"] if "outline" in p: self._outlinewidth = p["outline"] if "shown" in p: self._shown = p["shown"] if "tilt" in p: self._tilt = p["tilt"] + if "stretchfactor" in p or "tilt" in p or "shearfactor" in p: + scx, scy = self._stretchfactor + shf = self._shearfactor + sa, ca = math.sin(self._tilt), math.cos(self._tilt) + self._shapetrafo = ( scx*ca, scy*(shf*ca + sa), + -scx*sa, scy*(ca - shf*sa)) self._update() ## three dummy methods to be implemented by child class: @@ -2389,7 +2485,7 @@ self._setshape(shapeIndex) def _setshape(self, shapeIndex): - screen = self.screen # RawTurtle.screens[self.screenIndex] + screen = self.screen self.shapeIndex = shapeIndex if self._type == "polygon" == screen._shapes[shapeIndex]._type: return @@ -2699,9 +2795,11 @@ >>> turtle.shapesize(5, 5, 12) >>> turtle.shapesize(outline=8) """ - if stretch_wid is None and stretch_len is None and outline == None: + if stretch_wid is stretch_len is outline == None: stretch_wid, stretch_len = self._stretchfactor return stretch_wid, stretch_len, self._outlinewidth + if stretch_wid == 0 or stretch_len == 0: + raise TurtleGraphicsError("stretch_wid/stretch_len must not be zero") if stretch_wid is not None: if stretch_len is None: stretchfactor = stretch_wid, stretch_wid @@ -2716,11 +2814,33 @@ self.pen(resizemode="user", stretchfactor=stretchfactor, outline=outline) + def shearfactor(self, shear=None): + """Set or return the current shearfactor. + + Optional argument: shear -- number, tangent of the shear angle + + Shear the turtleshape according to the given shearfactor shear, + which is the tangent of the shear angle. DO NOT change the + turtle's heading (direction of movement). + If shear is not given: return the current shearfactor, i. e. the + tangent of the shear angle, by which lines parallel to the + heading of the turtle are sheared. + + Examples (for a Turtle instance named turtle): + >>> turtle.shape("circle") + >>> turtle.shapesize(5,2) + >>> turtle.shearfactor(0.5) + >>> turtle.shearfactor() + >>> 0.5 + """ + if shear is None: + return self._shearfactor + self.pen(resizemode="user", shearfactor=shear) + def settiltangle(self, angle): """Rotate the turtleshape to point in the specified direction - Optional argument: - angle -- number + Argument: angle -- number Rotate the turtleshape to point in the direction specified by angle, regardless of its current tilt-angle. DO NOT change the turtle's @@ -2741,14 +2861,19 @@ tilt = (tilt * math.pi / 180.0) % (2*math.pi) self.pen(resizemode="user", tilt=tilt) - def tiltangle(self): - """Return the current tilt-angle. + def tiltangle(self, angle=None): + """Set or return the current tilt-angle. - No argument. + Optional argument: angle -- number - Return the current tilt-angle, i. e. the angle between the - orientation of the turtleshape and the heading of the turtle - (its direction of movement). + Rotate the turtleshape to point in the direction specified by angle, + regardless of its current tilt-angle. DO NOT change the turtle's + heading (direction of movement). + If angle is not given: return the current tilt-angle, i. e. the angle + between the orientation of the turtleshape and the heading of the + turtle (its direction of movement). + + Deprecated since Python 3.1 Examples (for a Turtle instance named turtle): >>> turtle.shape("circle") @@ -2757,8 +2882,11 @@ >>> turtle.tiltangle() >>> """ - tilt = -self._tilt * (180.0/math.pi) * self._angleOrient - return (tilt / self._degreesPerAU) % self._fullcircle + if angle is None: + tilt = -self._tilt * (180.0/math.pi) * self._angleOrient + return (tilt / self._degreesPerAU) % self._fullcircle + else: + self.settiltangle(angle) def tilt(self, angle): """Rotate the turtleshape by angle. @@ -2779,6 +2907,46 @@ """ self.settiltangle(angle + self.tiltangle()) + def shapetransform(self, t11=None, t12=None, t21=None, t22=None): + """Set or return the current transformation matrix of the turtle shape. + + Optional arguments: t11, t12, t21, t22 -- numbers. + + If none of the matrix elements are given, return the transformation + matrix. + Otherwise set the given elements and transform the turtleshape + according to the matrix consisting of first row t11, t12 and + second row t21, 22. + Modify stretchfactor, shearfactor and tiltangle according to the + given matrix. + + Examples (for a Turtle instance named turtle): + >>> turtle.shape("square") + >>> turtle.shapesize(4,2) + >>> turtle.shearfactor(-0.5) + >>> turtle.shapetransform() + >>> (4.0, -1.0, -0.0, 2.0) + """ + if t11 is t12 is t21 is t22 is None: + return self._shapetrafo + m11, m12, m21, m22 = self._shapetrafo + if t11 is not None: m11 = t11 + if t12 is not None: m12 = t12 + if t21 is not None: m21 = t21 + if t22 is not None: m22 = t22 + if t11 * t22 - t12 * t21 == 0: + raise TurtleGraphicsError("Bad shape transform matrix: must not be singular") + self._shapetrafo = (m11, m12, m21, m22) + alfa = math.atan2(-m21, m11) % (2 * math.pi) + sa, ca = math.sin(alfa), math.cos(alfa) + a11, a12, a21, a22 = (ca*m11 - sa*m21, ca*m12 - sa*m22, + sa*m11 + ca*m21, sa*m12 + ca*m22) + self._stretchfactor = a11, a22 + self._shearfactor = a12/a22 + self._tilt = alfa + self._update() + + def _polytrafo(self, poly): """Computes transformed polygon shapes from a shape according to current position and heading. @@ -2791,6 +2959,36 @@ return [(p0+(e1*x+e0*y)/screen.xscale, p1+(-e0*x+e1*y)/screen.yscale) for (x, y) in poly] + def get_shapepoly(self): + """Return the current shape polygon as tuple of coordinate pairs. + + No argument. + + Examples (for a Turtle instance named turtle): + >>> turtle.shape("square") + >>> turtle.shapetransform(4, -1, 0, 2) + >>> turtle.get_shapepoly() + ((50, -20), (30, 20), (-50, 20), (-30, -20)) + + """ + shape = self.screen._shapes[self.turtle.shapeIndex] + if shape._type == "polygon": + return self._getshapepoly(shape._data, shape._type == "compound") + # else return None + + def _getshapepoly(self, polygon, compound=False): + """Calculate transformed shape polygon according to resizemode + and shapetransform. + """ + if self._resizemode == "user" or compound: + t11, t12, t21, t22 = self._shapetrafo + elif self._resizemode == "auto": + l = max(1, self._pensize/5.0) + t11, t12, t21, t22 = l, 0, 0, l + elif self._resizemode == "noresize": + return polygon + return tuple([(t11*x + t12*y, t21*x + t22*y) for (x, y) in polygon]) + def _drawturtle(self): """Manages the correct rendering of the turtle with respect to its shape, resizemode, stretch and tilt etc.""" @@ -2802,35 +3000,20 @@ self._hidden_from_screen = False tshape = shape._data if ttype == "polygon": - if self._resizemode == "noresize": - w = 1 - shape = tshape - else: - if self._resizemode == "auto": - lx = ly = max(1, self._pensize/5.0) - w = self._pensize - tiltangle = 0 - elif self._resizemode == "user": - lx, ly = self._stretchfactor - w = self._outlinewidth - tiltangle = self._tilt - shape = [(lx*x, ly*y) for (x, y) in tshape] - t0, t1 = math.sin(tiltangle), math.cos(tiltangle) - shape = [(t1*x+t0*y, -t0*x+t1*y) for (x, y) in shape] - shape = self._polytrafo(shape) + if self._resizemode == "noresize": w = 1 + elif self._resizemode == "auto": w = self._pensize + else: w =self._outlinewidth + shape = self._polytrafo(self._getshapepoly(tshape)) fc, oc = self._fillcolor, self._pencolor screen._drawpoly(titem, shape, fill=fc, outline=oc, width=w, top=True) elif ttype == "image": screen._drawimage(titem, self._position, tshape) elif ttype == "compound": - lx, ly = self._stretchfactor - w = self._outlinewidth for item, (poly, fc, oc) in zip(titem, tshape): - poly = [(lx*x, ly*y) for (x, y) in poly] - poly = self._polytrafo(poly) + poly = self._polytrafo(self._getshapepoly(poly, True)) screen._drawpoly(item, poly, fill=self._cc(fc), - outline=self._cc(oc), width=w, top=True) + outline=self._cc(oc), width=self._outlinewidth, top=True) else: if self._hidden_from_screen: return @@ -2867,22 +3050,10 @@ tshape = shape._data if ttype == "polygon": stitem = screen._createpoly() - if self._resizemode == "noresize": - w = 1 - shape = tshape - else: - if self._resizemode == "auto": - lx = ly = max(1, self._pensize/5.0) - w = self._pensize - tiltangle = 0 - elif self._resizemode == "user": - lx, ly = self._stretchfactor - w = self._outlinewidth - tiltangle = self._tilt - shape = [(lx*x, ly*y) for (x, y) in tshape] - t0, t1 = math.sin(tiltangle), math.cos(tiltangle) - shape = [(t1*x+t0*y, -t0*x+t1*y) for (x, y) in shape] - shape = self._polytrafo(shape) + if self._resizemode == "noresize": w = 1 + elif self._resizemode == "auto": w = self._pensize + else: w =self._outlinewidth + shape = self._polytrafo(self._getshapepoly(tshape)) fc, oc = self._fillcolor, self._pencolor screen._drawpoly(stitem, shape, fill=fc, outline=oc, width=w, top=True) @@ -2895,13 +3066,10 @@ item = screen._createpoly() stitem.append(item) stitem = tuple(stitem) - lx, ly = self._stretchfactor - w = self._outlinewidth for item, (poly, fc, oc) in zip(stitem, tshape): - poly = [(lx*x, ly*y) for (x, y) in poly] - poly = self._polytrafo(poly) + poly = self._polytrafo(self._getshapepoly(poly, True)) screen._drawpoly(item, poly, fill=self._cc(fc), - outline=self._cc(oc), width=w, top=True) + outline=self._cc(oc), width=self._outlinewidth, top=True) self.stampItems.append(stitem) self.undobuffer.push(("stamp", stitem)) return stitem @@ -3137,57 +3305,6 @@ """ return isinstance(self._fillpath, list) -## def fill(self, flag=None): -## """Call fill(True) before drawing a shape to fill, fill(False) when done. -## -## Optional argument: -## flag -- True/False (or 1/0 respectively) -## -## Call fill(True) before drawing the shape you want to fill, -## and fill(False) when done. -## When used without argument: return fillstate (True if filling, -## False else) -## -## Example (for a Turtle instance named turtle): -## >>> turtle.fill(True) -## >>> turtle.forward(100) -## >>> turtle.left(90) -## >>> turtle.forward(100) -## >>> turtle.left(90) -## >>> turtle.forward(100) -## >>> turtle.left(90) -## >>> turtle.forward(100) -## >>> turtle.fill(False) -## """ -## filling = isinstance(self._fillpath, list) -## if flag is None: -## return filling -## screen = self.screen -## entry1 = entry2 = () -## if filling: -## if len(self._fillpath) > 2: -## self.screen._drawpoly(self._fillitem, self._fillpath, -## fill=self._fillcolor) -## entry1 = ("dofill", self._fillitem) -## if flag: -## self._fillitem = self.screen._createpoly() -## self.items.append(self._fillitem) -## self._fillpath = [self._position] -## entry2 = ("beginfill", self._fillitem) # , self._fillpath) -## self._newLine() -## else: -## self._fillitem = self._fillpath = None -## if self.undobuffer: -## if entry1 == (): -## if entry2 != (): -## self.undobuffer.push(entry2) -## else: -## if entry2 == (): -## self.undobuffer.push(entry1) -## else: -## self.undobuffer.push(["seq", entry1, entry2]) -## self._update() - def begin_fill(self): """Called just before drawing a shape to be filled. @@ -3243,7 +3360,6 @@ >>> turtle.dot() >>> turtle.fd(50); turtle.dot(20, "blue"); turtle.fd(50) """ - #print "dot-1:", size, color if not color: if isinstance(size, (str, tuple)): color = self._colorstr(size) @@ -3256,10 +3372,8 @@ if size is None: size = self._pensize + max(self._pensize, 4) color = self._colorstr(color) - #print "dot-2:", size, color if hasattr(self.screen, "_dot"): item = self.screen._dot(self._position, size, color) - #print "dot:", size, color, "item:", item self.items.append(item) if self.undobuffer: self.undobuffer.push(("dot", item)) @@ -3355,7 +3469,7 @@ >>> p = turtle.get_poly() >>> turtle.register_shape("myFavouriteShape", p) """ - ## check if there is any poly? -- 1st solution: + ## check if there is any poly? if self._poly is not None: return tuple(self._poly) @@ -3399,35 +3513,11 @@ ### screen oriented methods recurring to methods of TurtleScreen ################################################################ -## def window_width(self): -## """ Returns the width of the turtle window. -## -## No argument. -## -## Example (for a TurtleScreen instance named screen): -## >>> screen.window_width() -## 640 -## """ -## return self.screen._window_size()[0] -## -## def window_height(self): -## """ Return the height of the turtle window. -## -## No argument. -## -## Example (for a TurtleScreen instance named screen): -## >>> screen.window_height() -## 480 -## """ -## return self.screen._window_size()[1] - def _delay(self, delay=None): """Set delay value which determines speed of turtle animation. """ return self.screen.delay(delay) - ##### event binding methods ##### - def onclick(self, fun, btn=1, add=None): """Bind fun to mouse-click event on this turtle on canvas. @@ -3593,8 +3683,8 @@ topbottom = _CFG["topbottom"] self._root.setupcanvas(width, height, canvwidth, canvheight) _Screen._canvas = self._root._getcanvas() - self.setup(width, height, leftright, topbottom) TurtleScreen.__init__(self, _Screen._canvas) + self.setup(width, height, leftright, topbottom) def setup(self, width=_CFG["width"], height=_CFG["height"], startx=_CFG["leftright"], starty=_CFG["topbottom"]): @@ -3634,6 +3724,7 @@ if starty is None: starty = (sh - height) / 2 self._root.set_geometry(width, height, startx, starty) + self.update() def title(self, titlestring): """Set title of turtle-window @@ -3803,16 +3894,8 @@ argText1 = argText2 = "" # bit of a hack for methods - turn it into a function # but we drop the "self" param. -## if type(ob)==types.MethodType: -## fob = ob.im_func -## argOffset = 1 -## else: -## fob = ob -## argOffset = 0 # Try and build one for Python defined functions argOffset = 1 -## if type(fob) in [types.FunctionType, types.LambdaType]: -## try: counter = ob.__code__.co_argcount items2 = list(ob.__code__.co_varnames[argOffset:counter]) realArgs = ob.__code__.co_varnames[argOffset:counter] @@ -3831,8 +3914,6 @@ argText1 = "(%s)" % argText1 argText2 = ", ".join(items2) argText2 = "(%s)" % argText2 -## except: -## pass return argText1, argText2 def _turtle_docrevise(docstr): @@ -3871,7 +3952,6 @@ continue defstr = ("def %(key)s%(pl1)s: return _getscreen().%(key)s%(pl2)s" % {'key':methodname, 'pl1':pl1, 'pl2':pl2}) -## print("Screen:", defstr) exec(defstr) eval(methodname).__doc__ = _screen_docrevise(eval('_Screen.'+methodname).__doc__) @@ -3882,13 +3962,11 @@ continue defstr = ("def %(key)s%(pl1)s: return _getpen().%(key)s%(pl2)s" % {'key':methodname, 'pl1':pl1, 'pl2':pl2}) -## print("Turtle:", defstr) exec(defstr) eval(methodname).__doc__ = _turtle_docrevise(eval('Turtle.'+methodname).__doc__) -done = mainloop = TK.mainloop -#del pl1, pl2, defstr +done = mainloop if __name__ == "__main__": def switchpen(): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue May 5 10:14:33 2009 @@ -118,6 +118,9 @@ Library ------- +- Issue #5923: Update the ``turtle`` module to version 1.1, add two new + turtle demos in Demo/turtle. + - Issue #5692: In :class:`zipfile.Zipfile`, fix wrong path calculation when extracting a file to the root directory. From python-checkins at python.org Tue May 5 10:28:50 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 5 May 2009 10:28:50 +0200 (CEST) Subject: [Python-checkins] r72319 - in python/trunk/Lib: linecache.py test/test_linecache.py Message-ID: <20090505082850.1ECC61E4015@bag.python.org> Author: georg.brandl Date: Tue May 5 10:28:49 2009 New Revision: 72319 Log: #1309567: fix linecache behavior of stripping subdirectories from paths when looking for relative filename matches. Also add a linecache test suite. Added: python/trunk/Lib/test/test_linecache.py (contents, props changed) Modified: python/trunk/Lib/linecache.py Modified: python/trunk/Lib/linecache.py ============================================================================== --- python/trunk/Lib/linecache.py (original) +++ python/trunk/Lib/linecache.py Tue May 5 10:28:49 2009 @@ -79,7 +79,7 @@ try: stat = os.stat(fullname) except os.error, msg: - basename = os.path.split(filename)[1] + basename = filename # Try for a __loader__, if available if module_globals and '__loader__' in module_globals: @@ -103,7 +103,10 @@ ) return cache[filename][2] - # Try looking through the module search path. + # Try looking through the module search path, which is only useful + # when handling a relative filename. + if os.path.isabs(filename): + return [] for dirname in sys.path: # When using imputil, sys.path may contain things other than Added: python/trunk/Lib/test/test_linecache.py ============================================================================== --- (empty file) +++ python/trunk/Lib/test/test_linecache.py Tue May 5 10:28:49 2009 @@ -0,0 +1,129 @@ +""" Tests for the linecache module """ + +import linecache +import unittest +import os.path +from test import test_support as support + + +FILENAME = linecache.__file__ +INVALID_NAME = '!@$)(!@#_1' +EMPTY = '' +TESTS = 'cjkencodings_test inspect_fodder inspect_fodder2 mapping_tests' +TESTS = TESTS.split() +TEST_PATH = os.path.dirname(support.__file__) +MODULES = "linecache unittest".split() +MODULE_PATH = os.path.dirname(FILENAME) + +SOURCE_1 = ''' +" Docstring " + +def function(): + return result + +''' + +SOURCE_2 = ''' +def f(): + return 1 + 1 + +a = f() + +''' + +class LineCacheTests(unittest.TestCase): + + def test_getline(self): + getline = linecache.getline + + # Bad values for line number should return an empty string + self.assertEquals(getline(FILENAME, 2**15), EMPTY) + self.assertEquals(getline(FILENAME, -1), EMPTY) + + # Float values currently raise TypeError, should it? + self.assertRaises(TypeError, getline, FILENAME, 1.1) + + # Bad filenames should return an empty string + self.assertEquals(getline(EMPTY, 1), EMPTY) + self.assertEquals(getline(INVALID_NAME, 1), EMPTY) + + # Check whether lines correspond to those from file iteration + for entry in TESTS: + filename = os.path.join(TEST_PATH, entry) + '.py' + for index, line in enumerate(open(filename)): + self.assertEquals(line, getline(filename, index + 1)) + + # Check module loading + for entry in MODULES: + filename = os.path.join(MODULE_PATH, entry) + '.py' + for index, line in enumerate(open(filename)): + self.assertEquals(line, getline(filename, index + 1)) + + # Check that bogus data isn't returned (issue #1309567) + empty = linecache.getlines('a/b/c/__init__.py') + self.assertEquals(empty, []) + + def test_clearcache(self): + cached = [] + for entry in TESTS: + filename = os.path.join(TEST_PATH, entry) + '.py' + cached.append(filename) + linecache.getline(filename, 1) + + # Are all files cached? + cached_empty = [fn for fn in cached if fn not in linecache.cache] + self.assertEquals(cached_empty, []) + + # Can we clear the cache? + linecache.clearcache() + cached_empty = [fn for fn in cached if fn in linecache.cache] + self.assertEquals(cached_empty, []) + + def test_checkcache(self): + getline = linecache.getline + try: + # Create a source file and cache its contents + source_name = os.path.join(TEST_PATH, 'linecache_test.py') + source = open(source_name, 'w') + source.write(SOURCE_1) + source.close() + getline(source_name, 1) + + # Keep a copy of the old contents + source_list = [] + source = open(source_name) + for index, line in enumerate(source): + self.assertEquals(line, getline(source_name, index + 1)) + source_list.append(line) + source.close() + + source = open(source_name, 'w') + source.write(SOURCE_2) + source.close() + + # Try to update a bogus cache entry + linecache.checkcache('dummy') + + # Check that the cache matches the old contents + for index, line in enumerate(source_list): + self.assertEquals(line, getline(source_name, index + 1)) + + # Update the cache and check whether it matches the new source file + linecache.checkcache(source_name) + source = open(source_name) + for index, line in enumerate(source): + self.assertEquals(line, getline(source_name, index + 1)) + source_list.append(line) + source.close() + + finally: + try: + source.close() + finally: + support.unlink(source_name) + +def test_main(): + support.run_unittest(LineCacheTests) + +if __name__ == "__main__": + test_main() From python-checkins at python.org Tue May 5 10:30:28 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 5 May 2009 10:30:28 +0200 (CEST) Subject: [Python-checkins] r72320 - python/trunk/Misc/NEWS Message-ID: <20090505083028.9F13B1E44B2@bag.python.org> Author: georg.brandl Date: Tue May 5 10:30:28 2009 New Revision: 72320 Log: Add a news entry for r72319. Modified: python/trunk/Misc/NEWS Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue May 5 10:30:28 2009 @@ -273,6 +273,9 @@ Library ------- +- Issue #1309567: Fix linecache behavior of stripping subdirectories when + looking for files given by a relative filename. + - Issue #5692: In :class:`zipfile.Zipfile`, fix wrong path calculation when extracting a file to the root directory. From python-checkins at python.org Tue May 5 10:31:54 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 5 May 2009 10:31:54 +0200 (CEST) Subject: [Python-checkins] r72321 - in python/branches/py3k: Lib/linecache.py Lib/test/test_linecache.py Misc/NEWS Message-ID: <20090505083154.E5C841E4015@bag.python.org> Author: georg.brandl Date: Tue May 5 10:31:54 2009 New Revision: 72321 Log: Merged revisions 72319-72320 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72319 | georg.brandl | 2009-05-05 10:28:49 +0200 (Di, 05 Mai 2009) | 1 line #1309567: fix linecache behavior of stripping subdirectories from paths when looking for relative filename matches. Also add a linecache test suite. ........ r72320 | georg.brandl | 2009-05-05 10:30:28 +0200 (Di, 05 Mai 2009) | 1 line Add a news entry for r72319. ........ Added: python/branches/py3k/Lib/test/test_linecache.py - copied, changed from r72320, /python/trunk/Lib/test/test_linecache.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/linecache.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/linecache.py ============================================================================== --- python/branches/py3k/Lib/linecache.py (original) +++ python/branches/py3k/Lib/linecache.py Tue May 5 10:31:54 2009 @@ -80,7 +80,7 @@ try: stat = os.stat(fullname) except os.error as msg: - basename = os.path.split(filename)[1] + basename = filename # Try for a __loader__, if available if module_globals and '__loader__' in module_globals: @@ -104,7 +104,10 @@ ) return cache[filename][2] - # Try looking through the module search path. + # Try looking through the module search path, which is only useful + # when handling a relative filename. + if os.path.isabs(filename): + return [] for dirname in sys.path: try: Copied: python/branches/py3k/Lib/test/test_linecache.py (from r72320, /python/trunk/Lib/test/test_linecache.py) ============================================================================== --- /python/trunk/Lib/test/test_linecache.py (original) +++ python/branches/py3k/Lib/test/test_linecache.py Tue May 5 10:31:54 2009 @@ -3,7 +3,7 @@ import linecache import unittest import os.path -from test import test_support as support +from test import support FILENAME = linecache.__file__ Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue May 5 10:31:54 2009 @@ -118,6 +118,9 @@ Library ------- +- Issue #1309567: Fix linecache behavior of stripping subdirectories when + looking for files given by a relative filename. + - Issue #5923: Update the ``turtle`` module to version 1.1, add two new turtle demos in Demo/turtle. From buildbot at python.org Tue May 5 10:41:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 08:41:48 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090505084149.963691E40A7@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/889 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_time ====================================================================== FAIL: test_tzset (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_time.py", line 166, in test_tzset self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) AssertionError: time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) == time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue May 5 10:54:11 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 5 May 2009 10:54:11 +0200 (CEST) Subject: [Python-checkins] r72322 - in python/trunk: Doc/library/pdb.rst Lib/bdb.py Lib/pdb.py Lib/test/test_pdb.py Misc/NEWS Message-ID: <20090505085411.E676C1E4012@bag.python.org> Author: georg.brandl Date: Tue May 5 10:54:11 2009 New Revision: 72322 Log: #5142: add module skipping feature to pdb. Added: python/trunk/Lib/test/test_pdb.py (contents, props changed) Modified: python/trunk/Doc/library/pdb.rst python/trunk/Lib/bdb.py python/trunk/Lib/pdb.py python/trunk/Misc/NEWS Modified: python/trunk/Doc/library/pdb.rst ============================================================================== --- python/trunk/Doc/library/pdb.rst (original) +++ python/trunk/Doc/library/pdb.rst Tue May 5 10:54:11 2009 @@ -1,4 +1,3 @@ - .. _debugger: :mod:`pdb` --- The Python Debugger @@ -53,7 +52,16 @@ .. versionadded:: 2.4 Restarting post-mortem behavior added. -Typical usage to inspect a crashed program is:: +The typical usage to break into the debugger from a running program is to +insert :: + + import pdb; pdb.set_trace() + +at the location you want to break into the debugger. You can then step through +the code following this statement, and continue running without debugger using +the ``c`` command. + +The typical usage to inspect a crashed program is:: >>> import pdb >>> import mymodule @@ -70,10 +78,10 @@ -> print spam (Pdb) + The module defines the following functions; each enters the debugger in a slightly different way: - .. function:: run(statement[, globals[, locals]]) Execute the *statement* (given as a string) under debugger control. The @@ -117,7 +125,38 @@ .. function:: pm() - Enter post-mortem debugging of the traceback found in ``sys.last_traceback``. + Enter post-mortem debugging of the traceback found in + :data:`sys.last_traceback`. + + +The ``run_*`` functions and :func:`set_trace` are aliases for instantiating the +:class:`Pdb` class and calling the method of the same name. If you want to +access further features, you have to do this yourself: + +.. class:: Pdb(completekey='tab', stdin=None, stdout=None, skip=None) + + :class:`Pdb` is the debugger class. + + The *completekey*, *stdin* and *stdout* arguments are passed to the + underlying :class:`cmd.Cmd` class; see the description there. + + The *skip* argument, if given, must be an iterable of glob-style module name + patterns. The debugger will not step into frames that originate in a module + that matches one of these patterns. [1]_ + + Example call to enable tracing with *skip*:: + + import pdb; pdb.Pdb(skip=['django.*']).set_trace() + + .. versionadded:: 2.7 + The *skip* argument. + + .. method:: run(statement[, globals[, locals]]) + runeval(expression[, globals[, locals]]) + runcall(function[, argument, ...]) + set_trace() + + See the documentation for the functions explained above. .. _debugger-commands: @@ -351,3 +390,9 @@ q(uit) Quit from the debugger. The program being executed is aborted. + + +.. rubric:: Footnotes + +.. [1] Whether a frame is considered to originate in a certain module + is determined by the ``__name__`` in the frame globals. Modified: python/trunk/Lib/bdb.py ============================================================================== --- python/trunk/Lib/bdb.py (original) +++ python/trunk/Lib/bdb.py Tue May 5 10:54:11 2009 @@ -1,5 +1,6 @@ """Debugger basics""" +import fnmatch import sys import os import types @@ -19,7 +20,8 @@ The standard debugger class (pdb.Pdb) is an example. """ - def __init__(self): + def __init__(self, skip=None): + self.skip = set(skip) if skip else None self.breaks = {} self.fncache = {} @@ -94,9 +96,18 @@ # methods, but they may if they want to redefine the # definition of stopping and breakpoints. + def is_skipped_module(self, module_name): + for pattern in self.skip: + if fnmatch.fnmatch(module_name, pattern): + return True + return False + def stop_here(self, frame): # (CT) stopframe may now also be None, see dispatch_call. # (CT) the former test for None is therefore removed from here. + if self.skip and \ + self.is_skipped_module(frame.f_globals.get('__name__')): + return False if frame is self.stopframe: return frame.f_lineno >= self.stoplineno while frame is not None and frame is not self.stopframe: Modified: python/trunk/Lib/pdb.py ============================================================================== --- python/trunk/Lib/pdb.py (original) +++ python/trunk/Lib/pdb.py Tue May 5 10:54:11 2009 @@ -58,8 +58,8 @@ class Pdb(bdb.Bdb, cmd.Cmd): - def __init__(self, completekey='tab', stdin=None, stdout=None): - bdb.Bdb.__init__(self) + def __init__(self, completekey='tab', stdin=None, stdout=None, skip=None): + bdb.Bdb.__init__(self, skip=skip) cmd.Cmd.__init__(self, completekey, stdin, stdout) if stdout: self.use_rawinput = 0 Added: python/trunk/Lib/test/test_pdb.py ============================================================================== --- (empty file) +++ python/trunk/Lib/test/test_pdb.py Tue May 5 10:54:11 2009 @@ -0,0 +1,99 @@ +# A test suite for pdb; at the moment, this only validates skipping of +# specified test modules (RFE #5142). + +import imp +import os +import sys +import doctest +import tempfile + +from test import test_support +# This little helper class is essential for testing pdb under doctest. +from test_doctest import _FakeInput + + +def test_pdb_skip_modules(): + """This illustrates the simple case of module skipping. + + >>> def skip_module(): + ... import string + ... import pdb;pdb.Pdb(skip=['string*']).set_trace() + ... string.lower('FOO') + >>> real_stdin = sys.stdin + >>> sys.stdin = _FakeInput([ + ... 'step', + ... 'continue', + ... ]) + + >>> try: + ... skip_module() + ... finally: + ... sys.stdin = real_stdin + > (4)skip_module() + -> string.lower('FOO') + (Pdb) step + --Return-- + > (4)skip_module()->None + -> string.lower('FOO') + (Pdb) continue +""" + + +# Module for testing skipping of module that makes a callback +mod = imp.new_module('module_to_skip') +exec 'def foo_pony(callback): x = 1; callback(); return None' in mod.__dict__ + + +def test_pdb_skip_modules_with_callback(): + """This illustrates skipping of modules that call into other code. + + >>> def skip_module(): + ... def callback(): + ... return None + ... import pdb;pdb.Pdb(skip=['module_to_skip*']).set_trace() + ... mod.foo_pony(callback) + >>> real_stdin = sys.stdin + >>> sys.stdin = _FakeInput([ + ... 'step', + ... 'step', + ... 'step', + ... 'step', + ... 'step', + ... 'continue', + ... ]) + + >>> try: + ... skip_module() + ... finally: + ... sys.stdin = real_stdin + > (5)skip_module() + -> mod.foo_pony(callback) + (Pdb) step + --Call-- + > (2)callback() + -> def callback(): + (Pdb) step + > (3)callback() + -> return None + (Pdb) step + --Return-- + > (3)callback()->None + -> return None + (Pdb) step + --Return-- + > (5)skip_module()->None + -> mod.foo_pony(callback) + (Pdb) step + > (4)() + -> sys.stdin = real_stdin + (Pdb) continue +""" + + +def test_main(): + from test import test_pdb + test_support.run_doctest(test_pdb, verbosity=True) + + +if __name__ == '__main__': + test_main() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue May 5 10:54:11 2009 @@ -273,6 +273,8 @@ Library ------- +- Issue #5142: Add the ability to skip modules while stepping to pdb. + - Issue #1309567: Fix linecache behavior of stripping subdirectories when looking for files given by a relative filename. From python-checkins at python.org Tue May 5 11:00:20 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 5 May 2009 11:00:20 +0200 (CEST) Subject: [Python-checkins] r72323 - in python/branches/py3k: Doc/library/pdb.rst Lib/bdb.py Lib/pdb.py Lib/test/test_pdb.py Misc/NEWS Message-ID: <20090505090020.35DD81E441B@bag.python.org> Author: georg.brandl Date: Tue May 5 11:00:19 2009 New Revision: 72323 Log: Merged revisions 72322 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72322 | georg.brandl | 2009-05-05 10:54:11 +0200 (Di, 05 Mai 2009) | 1 line #5142: add module skipping feature to pdb. ........ Added: python/branches/py3k/Lib/test/test_pdb.py - copied, changed from r72322, /python/trunk/Lib/test/test_pdb.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/pdb.rst python/branches/py3k/Lib/bdb.py python/branches/py3k/Lib/pdb.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Doc/library/pdb.rst ============================================================================== --- python/branches/py3k/Doc/library/pdb.rst (original) +++ python/branches/py3k/Doc/library/pdb.rst Tue May 5 11:00:19 2009 @@ -1,4 +1,3 @@ - .. _debugger: :mod:`pdb` --- The Python Debugger @@ -50,7 +49,16 @@ restarting preserves pdb's state (such as breakpoints) and in most cases is more useful than quitting the debugger upon program's exit. -Typical usage to inspect a crashed program is:: +The typical usage to break into the debugger from a running program is to +insert :: + + import pdb; pdb.set_trace() + +at the location you want to break into the debugger. You can then step through +the code following this statement, and continue running without debugger using +the ``c`` command. + +The typical usage to inspect a crashed program is:: >>> import pdb >>> import mymodule @@ -67,10 +75,10 @@ -> print(spam) (Pdb) + The module defines the following functions; each enters the debugger in a slightly different way: - .. function:: run(statement[, globals[, locals]]) Execute the *statement* (given as a string) under debugger control. The @@ -113,7 +121,38 @@ .. function:: pm() - Enter post-mortem debugging of the traceback found in ``sys.last_traceback``. + Enter post-mortem debugging of the traceback found in + :data:`sys.last_traceback`. + + +The ``run_*`` functions and :func:`set_trace` are aliases for instantiating the +:class:`Pdb` class and calling the method of the same name. If you want to +access further features, you have to do this yourself: + +.. class:: Pdb(completekey='tab', stdin=None, stdout=None, skip=None) + + :class:`Pdb` is the debugger class. + + The *completekey*, *stdin* and *stdout* arguments are passed to the + underlying :class:`cmd.Cmd` class; see the description there. + + The *skip* argument, if given, must be an iterable of glob-style module name + patterns. The debugger will not step into frames that originate in a module + that matches one of these patterns. [1]_ + + Example call to enable tracing with *skip*:: + + import pdb; pdb.Pdb(skip=['django.*']).set_trace() + + .. versionadded:: 2.7 + The *skip* argument. + + .. method:: run(statement[, globals[, locals]]) + runeval(expression[, globals[, locals]]) + runcall(function[, argument, ...]) + set_trace() + + See the documentation for the functions explained above. .. _debugger-commands: @@ -336,3 +375,9 @@ q(uit) Quit from the debugger. The program being executed is aborted. + + +.. rubric:: Footnotes + +.. [1] Whether a frame is considered to originate in a certain module + is determined by the ``__name__`` in the frame globals. Modified: python/branches/py3k/Lib/bdb.py ============================================================================== --- python/branches/py3k/Lib/bdb.py (original) +++ python/branches/py3k/Lib/bdb.py Tue May 5 11:00:19 2009 @@ -1,5 +1,6 @@ """Debugger basics""" +import fnmatch import sys import os import types @@ -19,7 +20,8 @@ The standard debugger class (pdb.Pdb) is an example. """ - def __init__(self): + def __init__(self, skip=None): + self.skip = set(skip) if skip else None self.breaks = {} self.fncache = {} @@ -94,9 +96,18 @@ # methods, but they may if they want to redefine the # definition of stopping and breakpoints. + def is_skipped_module(self, module_name): + for pattern in self.skip: + if fnmatch.fnmatch(module_name, pattern): + return True + return False + def stop_here(self, frame): # (CT) stopframe may now also be None, see dispatch_call. # (CT) the former test for None is therefore removed from here. + if self.skip and \ + self.is_skipped_module(frame.f_globals.get('__name__')): + return False if frame is self.stopframe: return frame.f_lineno >= self.stoplineno while frame is not None and frame is not self.stopframe: Modified: python/branches/py3k/Lib/pdb.py ============================================================================== --- python/branches/py3k/Lib/pdb.py (original) +++ python/branches/py3k/Lib/pdb.py Tue May 5 11:00:19 2009 @@ -58,8 +58,8 @@ class Pdb(bdb.Bdb, cmd.Cmd): - def __init__(self, completekey='tab', stdin=None, stdout=None): - bdb.Bdb.__init__(self) + def __init__(self, completekey='tab', stdin=None, stdout=None, skip=None): + bdb.Bdb.__init__(self, skip=skip) cmd.Cmd.__init__(self, completekey, stdin, stdout) if stdout: self.use_rawinput = 0 Copied: python/branches/py3k/Lib/test/test_pdb.py (from r72322, /python/trunk/Lib/test/test_pdb.py) ============================================================================== --- /python/trunk/Lib/test/test_pdb.py (original) +++ python/branches/py3k/Lib/test/test_pdb.py Tue May 5 11:00:19 2009 @@ -7,9 +7,9 @@ import doctest import tempfile -from test import test_support +from test import support # This little helper class is essential for testing pdb under doctest. -from test_doctest import _FakeInput +from test.test_doctest import _FakeInput def test_pdb_skip_modules(): @@ -17,8 +17,8 @@ >>> def skip_module(): ... import string - ... import pdb;pdb.Pdb(skip=['string*']).set_trace() - ... string.lower('FOO') + ... import pdb; pdb.Pdb(skip=['stri*']).set_trace() + ... string.capwords('FOO') >>> real_stdin = sys.stdin >>> sys.stdin = _FakeInput([ ... 'step', @@ -30,18 +30,18 @@ ... finally: ... sys.stdin = real_stdin > (4)skip_module() - -> string.lower('FOO') + -> string.capwords('FOO') (Pdb) step --Return-- > (4)skip_module()->None - -> string.lower('FOO') + -> string.capwords('FOO') (Pdb) continue """ # Module for testing skipping of module that makes a callback mod = imp.new_module('module_to_skip') -exec 'def foo_pony(callback): x = 1; callback(); return None' in mod.__dict__ +exec('def foo_pony(callback): x = 1; callback(); return None', mod.__dict__) def test_pdb_skip_modules_with_callback(): @@ -92,7 +92,7 @@ def test_main(): from test import test_pdb - test_support.run_doctest(test_pdb, verbosity=True) + support.run_doctest(test_pdb, verbosity=True) if __name__ == '__main__': Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue May 5 11:00:19 2009 @@ -118,6 +118,8 @@ Library ------- +- Issue #5142: Add the ability to skip modules while stepping to pdb. + - Issue #1309567: Fix linecache behavior of stripping subdirectories when looking for files given by a relative filename. From buildbot at python.org Tue May 5 11:00:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 09:00:38 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.0 Message-ID: <20090505090039.3829B1E42F2@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.0/builds/293 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue May 5 11:06:02 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 5 May 2009 11:06:02 +0200 (CEST) Subject: [Python-checkins] r72324 - python/trunk/Lib/pdb.py Message-ID: <20090505090602.93CA21E4040@bag.python.org> Author: georg.brandl Date: Tue May 5 11:06:02 2009 New Revision: 72324 Log: Fix overlong lines. Modified: python/trunk/Lib/pdb.py Modified: python/trunk/Lib/pdb.py ============================================================================== --- python/trunk/Lib/pdb.py (original) +++ python/trunk/Lib/pdb.py Tue May 5 11:06:02 2009 @@ -158,10 +158,14 @@ self.interaction(frame, None) def bp_commands(self,frame): - """ Call every command that was set for the current active breakpoint (if there is one) - Returns True if the normal interaction function must be called, False otherwise """ - #self.currentbp is set in bdb.py in bdb.break_here if a breakpoint was hit - if getattr(self,"currentbp",False) and self.currentbp in self.commands: + """Call every command that was set for the current active breakpoint + (if there is one). + + Returns True if the normal interaction function must be called, + False otherwise.""" + # self.currentbp is set in bdb in Bdb.break_here if a breakpoint was hit + if getattr(self, "currentbp", False) and \ + self.currentbp in self.commands: currentbp = self.currentbp self.currentbp = 0 lastcmd_back = self.lastcmd @@ -289,7 +293,8 @@ func = getattr(self, 'do_' + cmd) except AttributeError: func = self.default - if func.func_name in self.commands_resuming : # one of the resuming commands. + # one of the resuming commands + if func.func_name in self.commands_resuming: self.commands_doprompt[self.commands_bnum] = False self.cmdqueue = [] return 1 @@ -302,15 +307,18 @@ do_h = cmd.Cmd.do_help def do_commands(self, arg): - """Defines a list of commands associated to a breakpoint - Those commands will be executed whenever the breakpoint causes the program to stop execution.""" + """Defines a list of commands associated to a breakpoint. + + Those commands will be executed whenever the breakpoint causes + the program to stop execution.""" if not arg: bnum = len(bdb.Breakpoint.bpbynumber)-1 else: try: bnum = int(arg) except: - print >>self.stdout, "Usage : commands [bnum]\n ...\n end" + print >>self.stdout, "Usage : commands [bnum]\n ..." \ + "\n end" return self.commands_bnum = bnum self.commands[bnum] = [] @@ -648,8 +656,8 @@ do_n = do_next def do_run(self, arg): - """Restart program by raising an exception to be caught in the main debugger - loop. If arguments were given, set them in sys.argv.""" + """Restart program by raising an exception to be caught in the main + debugger loop. If arguments were given, set them in sys.argv.""" if arg: import shlex argv0 = sys.argv[0:1] @@ -786,7 +794,8 @@ breaklist = self.get_file_breaks(filename) try: for lineno in range(first, last+1): - line = linecache.getline(filename, lineno, self.curframe.f_globals) + line = linecache.getline(filename, lineno, + self.curframe.f_globals) if not line: print >>self.stdout, '[EOF]' break @@ -950,8 +959,8 @@ breakpoint numbers.""" def help_tbreak(self): - print >>self.stdout, """tbreak same arguments as break, but breakpoint is -removed when first hit.""" + print >>self.stdout, """tbreak same arguments as break, but breakpoint +is removed when first hit.""" def help_enable(self): print >>self.stdout, """enable bpnumber [bpnumber ...] @@ -1097,7 +1106,7 @@ Handles the receipt of EOF as a command.""" def help_alias(self): - print >>self.stdout, """alias [name [command [parameter parameter ...] ]] + print >>self.stdout, """alias [name [command [parameter parameter ...]]] Creates an alias called 'name' the executes 'command'. The command must *not* be enclosed in quotes. Replaceable parameters are indicated by %1, %2, and so on, while %* is replaced by all the @@ -1284,8 +1293,8 @@ # Note on saving/restoring sys.argv: it's a good idea when sys.argv was # modified by the script being debugged. It's a bad idea when it was - # changed by the user from the command line. There is a "restart" command which - # allows explicit specification of command line arguments. + # changed by the user from the command line. There is a "restart" command + # which allows explicit specification of command line arguments. pdb = Pdb() while 1: try: @@ -1306,7 +1315,8 @@ print "Running 'cont' or 'step' will restart the program" t = sys.exc_info()[2] pdb.interaction(None, t) - print "Post mortem debugger finished. The "+mainpyfile+" will be restarted" + print "Post mortem debugger finished. The " + mainpyfile + \ + " will be restarted" # When invoked as main program, invoke the debugger on a script From python-checkins at python.org Tue May 5 11:11:31 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 5 May 2009 11:11:31 +0200 (CEST) Subject: [Python-checkins] r72325 - in python/branches/py3k: Lib/pdb.py Message-ID: <20090505091131.D1D691E4021@bag.python.org> Author: georg.brandl Date: Tue May 5 11:11:31 2009 New Revision: 72325 Log: Merged revisions 72324 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72324 | georg.brandl | 2009-05-05 11:06:02 +0200 (Di, 05 Mai 2009) | 1 line Fix overlong lines. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/pdb.py Modified: python/branches/py3k/Lib/pdb.py ============================================================================== --- python/branches/py3k/Lib/pdb.py (original) +++ python/branches/py3k/Lib/pdb.py Tue May 5 11:11:31 2009 @@ -158,10 +158,14 @@ self.interaction(frame, None) def bp_commands(self,frame): - """ Call every command that was set for the current active breakpoint (if there is one) - Returns True if the normal interaction function must be called, False otherwise """ - #self.currentbp is set in bdb.py in bdb.break_here if a breakpoint was hit - if getattr(self,"currentbp",False) and self.currentbp in self.commands: + """Call every command that was set for the current active breakpoint + (if there is one). + + Returns True if the normal interaction function must be called, + False otherwise.""" + # self.currentbp is set in bdb in Bdb.break_here if a breakpoint was hit + if getattr(self, "currentbp", False) and \ + self.currentbp in self.commands: currentbp = self.currentbp self.currentbp = 0 lastcmd_back = self.lastcmd @@ -287,7 +291,8 @@ func = getattr(self, 'do_' + cmd) except AttributeError: func = self.default - if func.__name__ in self.commands_resuming : # one of the resuming commands. + # one of the resuming commands + if func.__name__ in self.commands_resuming: self.commands_doprompt[self.commands_bnum] = False self.cmdqueue = [] return 1 @@ -300,15 +305,18 @@ do_h = cmd.Cmd.do_help def do_commands(self, arg): - """Defines a list of commands associated to a breakpoint - Those commands will be executed whenever the breakpoint causes the program to stop execution.""" + """Defines a list of commands associated to a breakpoint. + + Those commands will be executed whenever the breakpoint causes + the program to stop execution.""" if not arg: bnum = len(bdb.Breakpoint.bpbynumber)-1 else: try: bnum = int(arg) except: - print("Usage : commands [bnum]\n ...\n end", file=self.stdout) + print("Usage : commands [bnum]\n ...\n end", + file=self.stdout) return self.commands_bnum = bnum self.commands[bnum] = [] @@ -646,8 +654,8 @@ do_n = do_next def do_run(self, arg): - """Restart program by raising an exception to be caught in the main debugger - loop. If arguments were given, set them in sys.argv.""" + """Restart program by raising an exception to be caught in the main + debugger loop. If arguments were given, set them in sys.argv.""" if arg: import shlex argv0 = sys.argv[0:1] @@ -785,7 +793,8 @@ breaklist = self.get_file_breaks(filename) try: for lineno in range(first, last+1): - line = linecache.getline(filename, lineno, self.curframe.f_globals) + line = linecache.getline(filename, lineno, + self.curframe.f_globals) if not line: print('[EOF]', file=self.stdout) break @@ -1279,8 +1288,8 @@ # Note on saving/restoring sys.argv: it's a good idea when sys.argv was # modified by the script being debugged. It's a bad idea when it was - # changed by the user from the command line. There is a "restart" command which - # allows explicit specification of command line arguments. + # changed by the user from the command line. There is a "restart" command + # which allows explicit specification of command line arguments. pdb = Pdb() while 1: try: @@ -1301,7 +1310,8 @@ print("Running 'cont' or 'step' will restart the program") t = sys.exc_info()[2] pdb.interaction(None, t) - print("Post mortem debugger finished. The "+mainpyfile+" will be restarted") + print("Post mortem debugger finished. The " + mainpyfile + + " will be restarted") # When invoked as main program, invoke the debugger on a script From buildbot at python.org Tue May 5 11:18:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 09:18:46 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090505091847.2CB381E4012@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1248 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Tue May 5 11:19:44 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 5 May 2009 11:19:44 +0200 (CEST) Subject: [Python-checkins] r72326 - python/trunk/Objects/unicodeobject.c Message-ID: <20090505091944.2602D1E4012@bag.python.org> Author: georg.brandl Date: Tue May 5 11:19:43 2009 New Revision: 72326 Log: #5929: fix signedness warning. Modified: python/trunk/Objects/unicodeobject.c Modified: python/trunk/Objects/unicodeobject.c ============================================================================== --- python/trunk/Objects/unicodeobject.c (original) +++ python/trunk/Objects/unicodeobject.c Tue May 5 11:19:43 2009 @@ -741,7 +741,7 @@ case 's': { /* UTF-8 */ - unsigned char *s = va_arg(count, unsigned char*); + const char *s = va_arg(count, const char*); PyObject *str = PyUnicode_DecodeUTF8(s, strlen(s), "replace"); if (!str) goto fail; From python-checkins at python.org Tue May 5 11:20:04 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 5 May 2009 11:20:04 +0200 (CEST) Subject: [Python-checkins] r72327 - in python/branches/py3k: Objects/unicodeobject.c Message-ID: <20090505092004.818701E4012@bag.python.org> Author: georg.brandl Date: Tue May 5 11:19:59 2009 New Revision: 72327 Log: Merged revisions 72326 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72326 | georg.brandl | 2009-05-05 11:19:43 +0200 (Di, 05 Mai 2009) | 1 line #5929: fix signedness warning. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Objects/unicodeobject.c Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Tue May 5 11:19:59 2009 @@ -791,7 +791,7 @@ case 's': { /* UTF-8 */ - unsigned char *s = va_arg(count, unsigned char*); + const char *s = va_arg(count, const char*); PyObject *str = PyUnicode_DecodeUTF8(s, strlen(s), "replace"); if (!str) goto fail; From python-checkins at python.org Tue May 5 11:20:52 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 5 May 2009 11:20:52 +0200 (CEST) Subject: [Python-checkins] r72328 - python/trunk/Objects/descrobject.c Message-ID: <20090505092052.D12EF1E4012@bag.python.org> Author: georg.brandl Date: Tue May 5 11:20:52 2009 New Revision: 72328 Log: Remove unused variable. Modified: python/trunk/Objects/descrobject.c Modified: python/trunk/Objects/descrobject.c ============================================================================== --- python/trunk/Objects/descrobject.c (original) +++ python/trunk/Objects/descrobject.c Tue May 5 11:20:52 2009 @@ -1212,7 +1212,6 @@ PyObject *doc) { propertyobject *pold = (propertyobject *)old; - propertyobject *pnew = NULL; PyObject *new, *type; type = PyObject_Type(old); From python-checkins at python.org Tue May 5 11:21:07 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 5 May 2009 11:21:07 +0200 (CEST) Subject: [Python-checkins] r72329 - in python/branches/py3k: Objects/descrobject.c Message-ID: <20090505092107.607F11E402C@bag.python.org> Author: georg.brandl Date: Tue May 5 11:21:07 2009 New Revision: 72329 Log: Merged revisions 72328 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72328 | georg.brandl | 2009-05-05 11:20:52 +0200 (Di, 05 Mai 2009) | 1 line Remove unused variable. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Objects/descrobject.c Modified: python/branches/py3k/Objects/descrobject.c ============================================================================== --- python/branches/py3k/Objects/descrobject.c (original) +++ python/branches/py3k/Objects/descrobject.c Tue May 5 11:21:07 2009 @@ -1225,7 +1225,6 @@ PyObject *doc) { propertyobject *pold = (propertyobject *)old; - propertyobject *pnew = NULL; PyObject *new, *type; type = PyObject_Type(old); From python-checkins at python.org Tue May 5 11:29:51 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 5 May 2009 11:29:51 +0200 (CEST) Subject: [Python-checkins] r72330 - in python/branches/py3k/Doc: c-api/init.rst library/binascii.rst library/gc.rst library/hashlib.rst library/pdb.rst library/test.rst library/unittest.rst library/zlib.rst Message-ID: <20090505092951.6CB7D1E448E@bag.python.org> Author: georg.brandl Date: Tue May 5 11:29:50 2009 New Revision: 72330 Log: 2.7 -> 3.1 versionchanges. Modified: python/branches/py3k/Doc/c-api/init.rst python/branches/py3k/Doc/library/binascii.rst python/branches/py3k/Doc/library/gc.rst python/branches/py3k/Doc/library/hashlib.rst python/branches/py3k/Doc/library/pdb.rst python/branches/py3k/Doc/library/test.rst python/branches/py3k/Doc/library/unittest.rst python/branches/py3k/Doc/library/zlib.rst Modified: python/branches/py3k/Doc/c-api/init.rst ============================================================================== --- python/branches/py3k/Doc/c-api/init.rst (original) +++ python/branches/py3k/Doc/c-api/init.rst Tue May 5 11:29:50 2009 @@ -824,8 +824,7 @@ other system thread. If it is a Python thread, it doesn't matter if it holds the global interpreter lock or not. - .. versionadded:: 2.7 - + .. versionadded:: 3.1 .. _profiling: Modified: python/branches/py3k/Doc/library/binascii.rst ============================================================================== --- python/branches/py3k/Doc/library/binascii.rst (original) +++ python/branches/py3k/Doc/library/binascii.rst Tue May 5 11:29:50 2009 @@ -123,10 +123,6 @@ return value is the correct 32bit binary representation regardless of sign. -.. versionchanged:: 3.0 - The return value is unsigned and in the range [0, 2**32-1] - regardless of platform. - .. function:: b2a_hex(data) hexlify(data) Modified: python/branches/py3k/Doc/library/gc.rst ============================================================================== --- python/branches/py3k/Doc/library/gc.rst (original) +++ python/branches/py3k/Doc/library/gc.rst Tue May 5 11:29:50 2009 @@ -151,7 +151,7 @@ >>> gc.is_tracked({"a": []}) True - .. versionadded:: 2.7 + .. versionadded:: 3.1 The following variable is provided for read-only access (you can mutate its Modified: python/branches/py3k/Doc/library/hashlib.rst ============================================================================== --- python/branches/py3k/Doc/library/hashlib.rst (original) +++ python/branches/py3k/Doc/library/hashlib.rst Tue May 5 11:29:50 2009 @@ -105,7 +105,7 @@ concatenation of all the arguments: ``m.update(a); m.update(b)`` is equivalent to ``m.update(a+b)``. - .. versionchanged:: 2.7 + .. versionchanged:: 3.1 The Python GIL is released to allow other threads to run while hash updates on data larger than 2048 bytes is taking place when Modified: python/branches/py3k/Doc/library/pdb.rst ============================================================================== --- python/branches/py3k/Doc/library/pdb.rst (original) +++ python/branches/py3k/Doc/library/pdb.rst Tue May 5 11:29:50 2009 @@ -144,7 +144,7 @@ import pdb; pdb.Pdb(skip=['django.*']).set_trace() - .. versionadded:: 2.7 + .. versionadded:: 3.1 The *skip* argument. .. method:: run(statement[, globals[, locals]]) Modified: python/branches/py3k/Doc/library/test.rst ============================================================================== --- python/branches/py3k/Doc/library/test.rst (original) +++ python/branches/py3k/Doc/library/test.rst Tue May 5 11:29:50 2009 @@ -389,7 +389,7 @@ manager all changes to environment variables done through this instance will be rolled back. - .. versionchanged:: 2.7 + .. versionchanged:: 3.1 Added dictionary interface. .. method:: EnvironmentVarGuard.set(envvar, value) Modified: python/branches/py3k/Doc/library/unittest.rst ============================================================================== --- python/branches/py3k/Doc/library/unittest.rst (original) +++ python/branches/py3k/Doc/library/unittest.rst Tue May 5 11:29:50 2009 @@ -863,7 +863,7 @@ This signals a test failure if *expr1* and *expr2* don't evaluate to the same object. - .. versionadded:: 2.7 + .. versionadded:: 3.1 .. method:: assertIsNot(expr1, expr2[, msg]) @@ -872,7 +872,7 @@ This signals a test failure if *expr1* and *expr2* evaluate to the same object. - .. versionadded:: 2.7 + .. versionadded:: 3.1 .. method:: assertFalse(expr[, msg]) Modified: python/branches/py3k/Doc/library/zlib.rst ============================================================================== --- python/branches/py3k/Doc/library/zlib.rst (original) +++ python/branches/py3k/Doc/library/zlib.rst Tue May 5 11:29:50 2009 @@ -51,10 +51,6 @@ return value is the correct 32bit binary representation regardless of sign. -.. versionchanged:: 3.0 - The return value is unsigned and in the range [0, 2**32-1] - regardless of platform. - .. function:: compress(string[, level]) @@ -96,10 +92,6 @@ return value is the correct 32bit binary representation regardless of sign. -.. versionchanged:: 3.0 - The return value is unsigned and in the range [0, 2**32-1] - regardless of platform. - .. function:: decompress(string[, wbits[, bufsize]]) From buildbot at python.org Tue May 5 12:07:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 10:07:18 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090505100719.180041E44E9@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/891 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_time ====================================================================== FAIL: test_update2 (test.test_os.EnvironTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_os.py", line 383, in test_update2 self.assertEquals(value, "World") AssertionError: '' != 'World' ====================================================================== FAIL: test_tzset (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_time.py", line 166, in test_tzset self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) AssertionError: time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) == time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue May 5 12:17:55 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 10:17:55 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090505101755.DFAD31E44BE@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/745 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis,steven.bethard BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_time ====================================================================== FAIL: test_update2 (test.test_os.EnvironTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_os.py", line 383, in test_update2 self.assertEquals(value, "World") AssertionError: '' != 'World' ====================================================================== FAIL: test_tzset (test.test_time.TimeTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_time.py", line 166, in test_tzset self.failIfEqual(time.gmtime(xmas2002), time.localtime(xmas2002)) AssertionError: time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) == time.struct_time(tm_year=2002, tm_mon=12, tm_mday=25, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=2, tm_yday=359, tm_isdst=0) make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue May 5 12:31:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 10:31:40 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090505103140.BB2F51E441B@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/632 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_posix test_time ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Tue May 5 13:02:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 11:02:47 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090505110248.7261D1E4012@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/464 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_asynchat make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue May 5 15:07:31 2009 From: python-checkins at python.org (eric.smith) Date: Tue, 5 May 2009 15:07:31 +0200 (CEST) Subject: [Python-checkins] r72331 - python/branches/py3k/Modules/posixmodule.c Message-ID: <20090505130731.06FEA1E4012@bag.python.org> Author: eric.smith Date: Tue May 5 15:07:30 2009 New Revision: 72331 Log: Added missing semicolon. Modified: python/branches/py3k/Modules/posixmodule.c Modified: python/branches/py3k/Modules/posixmodule.c ============================================================================== --- python/branches/py3k/Modules/posixmodule.c (original) +++ python/branches/py3k/Modules/posixmodule.c Tue May 5 15:07:30 2009 @@ -1928,7 +1928,7 @@ if (!PyArg_ParseTuple(args, "O&i:lchmod", PyUnicode_FSConverter, &opath, &i)) return NULL; - path = bytes2str(opath, 1) + path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS res = lchmod(path, i); Py_END_ALLOW_THREADS From python-checkins at python.org Tue May 5 15:08:54 2009 From: python-checkins at python.org (eric.smith) Date: Tue, 5 May 2009 15:08:54 +0200 (CEST) Subject: [Python-checkins] r72332 - python/branches/release30-maint Message-ID: <20090505130854.71FF21E4012@bag.python.org> Author: eric.smith Date: Tue May 5 15:08:54 2009 New Revision: 72332 Log: Blocked revisions 72331 via svnmerge ........ r72331 | eric.smith | 2009-05-05 09:07:30 -0400 (Tue, 05 May 2009) | 1 line Added missing semicolon. ........ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Tue May 5 16:04:19 2009 From: python-checkins at python.org (eric.smith) Date: Tue, 5 May 2009 16:04:19 +0200 (CEST) Subject: [Python-checkins] r72333 - in python/branches/py3k: Doc/c-api/conversion.rst Include/floatobject.h Lib/test/test_complex.py Lib/test/test_float.py Misc/NEWS Objects/complexobject.c Objects/floatobject.c Objects/stringlib/formatter.h Python/pystrtod.c Message-ID: <20090505140419.2633F1E4002@bag.python.org> Author: eric.smith Date: Tue May 5 16:04:18 2009 New Revision: 72333 Log: Issue #5920: Changed format.__float__ and complex.__float__ to use a precision of 12 when using the empty presentation type. This more closely matches str()'s behavior and reduces surprises when adding alignment flags to an empty format string. Patch by Mark Dickinson. Modified: python/branches/py3k/Doc/c-api/conversion.rst python/branches/py3k/Include/floatobject.h python/branches/py3k/Lib/test/test_complex.py python/branches/py3k/Lib/test/test_float.py python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/complexobject.c python/branches/py3k/Objects/floatobject.c python/branches/py3k/Objects/stringlib/formatter.h python/branches/py3k/Python/pystrtod.c Modified: python/branches/py3k/Doc/c-api/conversion.rst ============================================================================== --- python/branches/py3k/Doc/c-api/conversion.rst (original) +++ python/branches/py3k/Doc/c-api/conversion.rst Tue May 5 16:04:18 2009 @@ -119,10 +119,10 @@ Convert a :ctype:`double` *val* to a string using supplied *format_code*, *precision*, and *flags*. - *format_code* must be one of ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, - ``'G'``, ``'s'``, or ``'r'``. For ``'s'`` and ``'r'``, the supplied - *precision* must be 0 and is ignored. These specify the standard - :func:`str` and :func:`repr` formats, respectively. + *format_code* must be one of ``'e'``, ``'E'``, ``'f'``, ``'F'``, + ``'g'``, ``'G'`` or ``'r'``. For ``'r'``, the supplied *precision* + must be 0 and is ignored. The ``'r'`` format code specifies the + standard :func:`repr` format. *flags* can be zero or more of the values *Py_DTSF_SIGN*, *Py_DTSF_ADD_DOT_0*, or *Py_DTSF_ALT*, or-ed together: Modified: python/branches/py3k/Include/floatobject.h ============================================================================== --- python/branches/py3k/Include/floatobject.h (original) +++ python/branches/py3k/Include/floatobject.h Tue May 5 16:04:18 2009 @@ -21,6 +21,12 @@ #define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type) #define PyFloat_CheckExact(op) (Py_TYPE(op) == &PyFloat_Type) +/* The str() precision PyFloat_STR_PRECISION is chosen so that in most cases, + the rounding noise created by various operations is suppressed, while + giving plenty of precision for practical use. */ + +#define PyFloat_STR_PRECISION 12 + #ifdef Py_NAN #define Py_RETURN_NAN return PyFloat_FromDouble(Py_NAN) #endif Modified: python/branches/py3k/Lib/test/test_complex.py ============================================================================== --- python/branches/py3k/Lib/test/test_complex.py (original) +++ python/branches/py3k/Lib/test/test_complex.py Tue May 5 16:04:18 2009 @@ -445,6 +445,16 @@ self.assertEqual(format(3+0j, ''), str(3+0j)) self.assertEqual(format(3.2+0j, ''), str(3.2+0j)) + # empty presentation type should still be analogous to str, + # even when format string is nonempty (issue #5920). + self.assertEqual(format(3.2+0j, '-'), str(3.2+0j)) + self.assertEqual(format(3.2+0j, '<'), str(3.2+0j)) + z = 4/7. - 100j/7. + self.assertEqual(format(z, ''), str(z)) + self.assertEqual(format(z, '-'), str(z)) + self.assertEqual(format(z, '<'), str(z)) + self.assertEqual(format(z, '10'), str(z)) + self.assertEqual(format(1+3j, 'g'), '1+3j') self.assertEqual(format(3j, 'g'), '0+3j') self.assertEqual(format(1.5+3.5j, 'g'), '1.5+3.5j') Modified: python/branches/py3k/Lib/test/test_float.py ============================================================================== --- python/branches/py3k/Lib/test/test_float.py (original) +++ python/branches/py3k/Lib/test/test_float.py Tue May 5 16:04:18 2009 @@ -284,6 +284,13 @@ self.assertEqual(format(0.01, ''), '0.01') self.assertEqual(format(0.01, 'g'), '0.01') + # empty presentation type should format in the same way as str + # (issue 5920) + x = 100/7. + self.assertEqual(format(x, ''), str(x)) + self.assertEqual(format(x, '-'), str(x)) + self.assertEqual(format(x, '>'), str(x)) + self.assertEqual(format(x, '2'), str(x)) self.assertEqual(format(1.0, 'f'), '1.000000') Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue May 5 16:04:18 2009 @@ -12,6 +12,15 @@ Core and Builtins ----------------- +- Issue #5920: For float.__format__, change the behavior with the + empty presentation type (that is, not one of 'e', 'f', 'g', or 'n') + to be like 'g' but with at least one decimal point and with a + default precision of 12. Previously, the behavior the same but with + a default precision of 6. This more closely matches str(), and + reduces surprises when adding alignment flags to the empty + presentation type. This also affects the new complex.__format__ in + the same way. + - Implement PEP 383, Non-decodable Bytes in System Character Interfaces. - Issue #5890: in subclasses of 'property' the __doc__ attribute was Modified: python/branches/py3k/Objects/complexobject.c ============================================================================== --- python/branches/py3k/Objects/complexobject.c (original) +++ python/branches/py3k/Objects/complexobject.c Tue May 5 16:04:18 2009 @@ -330,7 +330,7 @@ static PyObject * -complex_format(PyComplexObject *v, char format_code) +complex_format(PyComplexObject *v, int precision, char format_code) { PyObject *result = NULL; Py_ssize_t len; @@ -350,7 +350,7 @@ if (v->cval.real == 0. && copysign(1.0, v->cval.real)==1.0) { re = ""; im = PyOS_double_to_string(v->cval.imag, format_code, - 0, 0, NULL); + precision, 0, NULL); if (!im) { PyErr_NoMemory(); goto done; @@ -358,7 +358,7 @@ } else { /* Format imaginary part with sign, real part without */ pre = PyOS_double_to_string(v->cval.real, format_code, - 0, 0, NULL); + precision, 0, NULL); if (!pre) { PyErr_NoMemory(); goto done; @@ -366,7 +366,7 @@ re = pre; im = PyOS_double_to_string(v->cval.imag, format_code, - 0, Py_DTSF_SIGN, NULL); + precision, Py_DTSF_SIGN, NULL); if (!im) { PyErr_NoMemory(); goto done; @@ -395,13 +395,13 @@ static PyObject * complex_repr(PyComplexObject *v) { - return complex_format(v, 'r'); + return complex_format(v, 0, 'r'); } static PyObject * complex_str(PyComplexObject *v) { - return complex_format(v, 's'); + return complex_format(v, PyFloat_STR_PRECISION, 'g'); } static long Modified: python/branches/py3k/Objects/floatobject.c ============================================================================== --- python/branches/py3k/Objects/floatobject.c (original) +++ python/branches/py3k/Objects/floatobject.c Tue May 5 16:04:18 2009 @@ -294,11 +294,12 @@ } static PyObject * -float_str_or_repr(PyFloatObject *v, char format_code) +float_str_or_repr(PyFloatObject *v, int precision, char format_code) { PyObject *result; char *buf = PyOS_double_to_string(PyFloat_AS_DOUBLE(v), - format_code, 0, Py_DTSF_ADD_DOT_0, + format_code, precision, + Py_DTSF_ADD_DOT_0, NULL); if (!buf) return PyErr_NoMemory(); @@ -310,13 +311,13 @@ static PyObject * float_repr(PyFloatObject *v) { - return float_str_or_repr(v, 'r'); + return float_str_or_repr(v, 0, 'r'); } static PyObject * float_str(PyFloatObject *v) { - return float_str_or_repr(v, 's'); + return float_str_or_repr(v, PyFloat_STR_PRECISION, 'g'); } /* Comparison is pretty much a nightmare. When comparing float to float, Modified: python/branches/py3k/Objects/stringlib/formatter.h ============================================================================== --- python/branches/py3k/Objects/stringlib/formatter.h (original) +++ python/branches/py3k/Objects/stringlib/formatter.h Tue May 5 16:04:18 2009 @@ -881,6 +881,7 @@ int has_decimal; double val; Py_ssize_t precision = format->precision; + Py_ssize_t default_precision = 6; STRINGLIB_CHAR type = format->type; int add_pct = 0; STRINGLIB_CHAR *p; @@ -907,9 +908,10 @@ } if (type == '\0') { - /* Omitted type specifier. This is like 'g' but with at least - one digit after the decimal point. */ + /* Omitted type specifier. This is like 'g' but with at least one + digit after the decimal point, and different default precision.*/ type = 'g'; + default_precision = PyFloat_STR_PRECISION; flags |= Py_DTSF_ADD_DOT_0; } @@ -933,7 +935,7 @@ } if (precision < 0) - precision = 6; + precision = default_precision; #if PY_VERSION_HEX < 0x03010000 /* 3.1 no longer converts large 'f' to 'g'. */ @@ -1039,6 +1041,7 @@ int re_has_decimal; int im_has_decimal; Py_ssize_t precision = format->precision; + Py_ssize_t default_precision = 6; STRINGLIB_CHAR type = format->type; STRINGLIB_CHAR *p_re; STRINGLIB_CHAR *p_im; @@ -1100,6 +1103,7 @@ if (type == '\0') { /* Omitted type specifier. Should be like str(self). */ type = 'g'; + default_precision = PyFloat_STR_PRECISION; add_parens = 1; if (re == 0.0) skip_re = 1; @@ -1115,7 +1119,7 @@ type = 'f'; if (precision < 0) - precision = 6; + precision = default_precision; /* Cast "type", because if we're in unicode we need to pass a 8-bit char. This is safe, because we've restricted what "type" Modified: python/branches/py3k/Python/pystrtod.c ============================================================================== --- python/branches/py3k/Python/pystrtod.c (original) +++ python/branches/py3k/Python/pystrtod.c Tue May 5 16:04:18 2009 @@ -746,18 +746,15 @@ PyErr_BadInternalCall(); return NULL; } + /* The repr() precision (17 significant decimal digits) is the + minimal number that is guaranteed to have enough precision + so that if the number is read back in the exact same binary + value is recreated. This is true for IEEE floating point + by design, and also happens to work for all other modern + hardware. */ precision = 17; format_code = 'g'; break; - case 's': /* str format */ - /* Supplied precision is unused, must be 0. */ - if (precision != 0) { - PyErr_BadInternalCall(); - return NULL; - } - precision = 12; - format_code = 'g'; - break; default: PyErr_BadInternalCall(); return NULL; @@ -889,18 +886,19 @@ Arguments: d is the double to be converted - format_code is one of 'e', 'f', 'g', 'r' or 's'. 'e', 'f' and 'g' - correspond to '%e', '%f' and '%g'; 'r' and 's' correspond - to repr and str. + format_code is one of 'e', 'f', 'g', 'r'. 'e', 'f' and 'g' + correspond to '%e', '%f' and '%g'; 'r' corresponds to repr. mode is one of '0', '2' or '3', and is completely determined by - format_code: 'e', 'g' and 's' use mode 2; 'f' mode 3, 'r' mode 0. + format_code: 'e' and 'g' use mode 2; 'f' mode 3, 'r' mode 0. precision is the desired precision always_add_sign is nonzero if a '+' sign should be included for positive numbers add_dot_0_if_integer is nonzero if integers in non-exponential form - should have ".0" added. Only applies to format codes 'r', 's', and 'g'. + should have ".0" added. Only applies to format codes 'r' and 'g'. use_alt_formatting is nonzero if alternative formatting should be - used. Only applies to format codes 'e', 'f' and 'g'. + used. Only applies to format codes 'e', 'f' and 'g'. For code 'g', + at most one of use_alt_formatting and add_dot_0_if_integer should + be nonzero. type, if non-NULL, will be set to one of these constants to identify the type of the 'd' argument: Py_DTST_FINITE @@ -1041,13 +1039,6 @@ if (decpt <= -4 || decpt > 16) use_exp = 1; break; - case 's': - /* if we're forcing a digit after the point, convert to - exponential format at 1e11. If not, convert at 1e12. */ - if (decpt <= -4 || decpt > - (add_dot_0_if_integer ? precision-1 : precision)) - use_exp = 1; - break; default: PyErr_BadInternalCall(); goto exit; @@ -1220,17 +1211,6 @@ } break; - /* str format */ - case 's': - mode = 2; - /* Supplied precision is unused, must be 0. */ - if (precision != 0) { - PyErr_BadInternalCall(); - return NULL; - } - precision = 12; - break; - default: PyErr_BadInternalCall(); return NULL; From python-checkins at python.org Tue May 5 16:07:12 2009 From: python-checkins at python.org (eric.smith) Date: Tue, 5 May 2009 16:07:12 +0200 (CEST) Subject: [Python-checkins] r72334 - python/branches/release30-maint Message-ID: <20090505140712.7A96A1E4017@bag.python.org> Author: eric.smith Date: Tue May 5 16:07:12 2009 New Revision: 72334 Log: Blocked revisions 72333 via svnmerge ........ r72333 | eric.smith | 2009-05-05 10:04:18 -0400 (Tue, 05 May 2009) | 1 line Issue #5920: Changed format.__float__ and complex.__float__ to use a precision of 12 when using the empty presentation type. This more closely matches str()'s behavior and reduces surprises when adding alignment flags to an empty format string. Patch by Mark Dickinson. ........ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Tue May 5 16:23:33 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 14:23:33 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090505142333.4AD7E1E4018@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/894 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: eric.smith BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_time make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue May 5 16:50:01 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 14:50:01 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090505145001.7BBA11E4018@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/697 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Tue May 5 17:05:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 15:05:35 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090505150535.C0E701E40AE@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/333 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: eric.smith BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 45, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/Include ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Tue May 5 18:10:16 2009 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 5 May 2009 18:10:16 +0200 (CEST) Subject: [Python-checkins] r72335 - in python/trunk: Misc/NEWS Tools/msi/msi.py Message-ID: <20090505161016.5F36A1E4060@bag.python.org> Author: martin.v.loewis Date: Tue May 5 18:10:16 2009 New Revision: 72335 Log: Issue #5847: Remove -n switch on "Edit with IDLE" menu item. Modified: python/trunk/Misc/NEWS python/trunk/Tools/msi/msi.py Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue May 5 18:10:16 2009 @@ -863,6 +863,8 @@ Build ----- +- Issue #5847: Remove -n switch on "Edit with IDLE" menu item. + - Issue #5726: Make Modules/ld_so_aix return the actual exit code of the linker, rather than always exit successfully. Patch by Floris Bruynooghe. Modified: python/trunk/Tools/msi/msi.py ============================================================================== --- python/trunk/Tools/msi/msi.py (original) +++ python/trunk/Tools/msi/msi.py Tue May 5 18:10:16 2009 @@ -1187,10 +1187,10 @@ if have_tcl: tcl_verbs=[ ("py.IDLE", -1, pat % (testprefix, "", ewi), "", - r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"', + r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -e "%1"', "REGISTRY.tcl"), ("pyw.IDLE", -1, pat % (testprefix, "NoCon", ewi), "", - r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"', + r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -e "%1"', "REGISTRY.tcl"), ] add_data(db, "Registry", From python-checkins at python.org Tue May 5 18:14:30 2009 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 5 May 2009 18:14:30 +0200 (CEST) Subject: [Python-checkins] r72336 - in python/branches/py3k: Misc/NEWS Tools/msi/msi.py Message-ID: <20090505161430.E429C1E4018@bag.python.org> Author: martin.v.loewis Date: Tue May 5 18:14:30 2009 New Revision: 72336 Log: Merged revisions 72335 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72335 | martin.v.loewis | 2009-05-05 18:10:16 +0200 (Di, 05 Mai 2009) | 2 lines Issue #5847: Remove -n switch on "Edit with IDLE" menu item. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Tools/msi/msi.py Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue May 5 18:14:30 2009 @@ -942,6 +942,8 @@ Build ----- +- Issue #5847: Remove -n switch on "Edit with IDLE" menu item. + - Issue #5726: Make Modules/ld_so_aix return the actual exit code of the linker, rather than always exit successfully. Patch by Floris Bruynooghe. Modified: python/branches/py3k/Tools/msi/msi.py ============================================================================== --- python/branches/py3k/Tools/msi/msi.py (original) +++ python/branches/py3k/Tools/msi/msi.py Tue May 5 18:14:30 2009 @@ -1188,10 +1188,10 @@ if have_tcl: tcl_verbs=[ ("py.IDLE", -1, pat % (testprefix, "", ewi), "", - r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"', + r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -e "%1"', "REGISTRY.tcl"), ("pyw.IDLE", -1, pat % (testprefix, "NoCon", ewi), "", - r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"', + r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -e "%1"', "REGISTRY.tcl"), ] add_data(db, "Registry", From python-checkins at python.org Tue May 5 18:14:39 2009 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 5 May 2009 18:14:39 +0200 (CEST) Subject: [Python-checkins] r72337 - python/branches/release26-maint Message-ID: <20090505161439.E63911E4022@bag.python.org> Author: martin.v.loewis Date: Tue May 5 18:14:39 2009 New Revision: 72337 Log: Blocked revisions 72335 via svnmerge ........ r72335 | martin.v.loewis | 2009-05-05 18:10:16 +0200 (Di, 05 Mai 2009) | 2 lines Issue #5847: Remove -n switch on "Edit with IDLE" menu item. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Tue May 5 18:17:30 2009 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 5 May 2009 18:17:30 +0200 (CEST) Subject: [Python-checkins] r72338 - python/branches/release30-maint Message-ID: <20090505161730.E72E91E4018@bag.python.org> Author: martin.v.loewis Date: Tue May 5 18:17:30 2009 New Revision: 72338 Log: Blocked revisions 72336 via svnmerge ................ r72336 | martin.v.loewis | 2009-05-05 18:14:30 +0200 (Di, 05 Mai 2009) | 9 lines Merged revisions 72335 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72335 | martin.v.loewis | 2009-05-05 18:10:16 +0200 (Di, 05 Mai 2009) | 2 lines Issue #5847: Remove -n switch on "Edit with IDLE" menu item. ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Tue May 5 18:42:59 2009 From: python-checkins at python.org (eric.smith) Date: Tue, 5 May 2009 18:42:59 +0200 (CEST) Subject: [Python-checkins] r72339 - python/branches/py3k/Doc/library/string.rst Message-ID: <20090505164259.27F631E401A@bag.python.org> Author: eric.smith Date: Tue May 5 18:42:58 2009 New Revision: 72339 Log: Documentation for Issue #5920. Modified: python/branches/py3k/Doc/library/string.rst Modified: python/branches/py3k/Doc/library/string.rst ============================================================================== --- python/branches/py3k/Doc/library/string.rst (original) +++ python/branches/py3k/Doc/library/string.rst Tue May 5 18:42:58 2009 @@ -434,7 +434,10 @@ | ``'%'`` | Percentage. Multiplies the number by 100 and displays | | | in fixed (``'f'``) format, followed by a percent sign. | +---------+----------------------------------------------------------+ - | None | The same as ``'g'``. | + | None | Similar to ``'g'``, except with at least one decimal | + | | point and a default precision of 12. This is intended to | + | | match :func:`str`, except you can add the other | + | | format modifiers. | +---------+----------------------------------------------------------+ From buildbot at python.org Tue May 5 18:56:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 16:56:15 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090505165615.974861E401C@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1251 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/threading.py", line 524, in __bootstrap_inner self.run() File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/bsddb/test/test_thread.py", line 306, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/bsddb/dbutils.py", line 68, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30994, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') 1 test failed: test_os ====================================================================== FAIL: test_update2 (test.test_os.EnvironTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_os.py", line 348, in test_update2 self.assertEquals(value, "World") AssertionError: '' != 'World' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue May 5 19:17:55 2009 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 5 May 2009 19:17:55 +0200 (CEST) Subject: [Python-checkins] r72340 - python/branches/py3k/Modules/posixmodule.c Message-ID: <20090505171755.4BCFC1E401C@bag.python.org> Author: martin.v.loewis Date: Tue May 5 19:17:55 2009 New Revision: 72340 Log: Issue #5943: Fix lchflags crash. Modified: python/branches/py3k/Modules/posixmodule.c Modified: python/branches/py3k/Modules/posixmodule.c ============================================================================== --- python/branches/py3k/Modules/posixmodule.c (original) +++ python/branches/py3k/Modules/posixmodule.c Tue May 5 19:17:55 2009 @@ -1981,7 +1981,7 @@ unsigned long flags; int res; if (!PyArg_ParseTuple(args, "O&k:lchflags", - PyUnicode_FSConverter, &path, &flags)) + PyUnicode_FSConverter, &opath, &flags)) return NULL; path = bytes2str(opath, 1); Py_BEGIN_ALLOW_THREADS From python-checkins at python.org Tue May 5 19:19:46 2009 From: python-checkins at python.org (eric.smith) Date: Tue, 5 May 2009 19:19:46 +0200 (CEST) Subject: [Python-checkins] r72341 - python/branches/py3k/Doc/library/string.rst Message-ID: <20090505171946.882661E401C@bag.python.org> Author: eric.smith Date: Tue May 5 19:19:46 2009 New Revision: 72341 Log: Improved wording. Modified: python/branches/py3k/Doc/library/string.rst Modified: python/branches/py3k/Doc/library/string.rst ============================================================================== --- python/branches/py3k/Doc/library/string.rst (original) +++ python/branches/py3k/Doc/library/string.rst Tue May 5 19:19:46 2009 @@ -434,10 +434,10 @@ | ``'%'`` | Percentage. Multiplies the number by 100 and displays | | | in fixed (``'f'``) format, followed by a percent sign. | +---------+----------------------------------------------------------+ - | None | Similar to ``'g'``, except with at least one decimal | - | | point and a default precision of 12. This is intended to | - | | match :func:`str`, except you can add the other | - | | format modifiers. | + | None | Similar to ``'g'``, except with at least one digit past | + | | the decimal point and a default precision of 12. This is | + | | intended to match :func:`str`, except you can add the | + | | other format modifiers. | +---------+----------------------------------------------------------+ From python-checkins at python.org Tue May 5 19:27:33 2009 From: python-checkins at python.org (eric.smith) Date: Tue, 5 May 2009 19:27:33 +0200 (CEST) Subject: [Python-checkins] r72342 - python/branches/release30-maint Message-ID: <20090505172733.688631E401A@bag.python.org> Author: eric.smith Date: Tue May 5 19:27:32 2009 New Revision: 72342 Log: Blocked revisions 72339,72341 via svnmerge ........ r72339 | eric.smith | 2009-05-05 12:42:58 -0400 (Tue, 05 May 2009) | 1 line Documentation for Issue #5920. ........ r72341 | eric.smith | 2009-05-05 13:19:46 -0400 (Tue, 05 May 2009) | 1 line Improved wording. ........ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Tue May 5 19:34:42 2009 From: python-checkins at python.org (senthil.kumaran) Date: Tue, 5 May 2009 19:34:42 +0200 (CEST) Subject: [Python-checkins] r72343 - python/trunk/Lib/nturl2path.py Message-ID: <20090505173442.F2A711E41FA@bag.python.org> Author: senthil.kumaran Date: Tue May 5 19:34:42 2009 New Revision: 72343 Log: Fixing issue5861 - test_urllib fails on windows. Agree to comment to have ':' in pathname2url as windows recognizes it. test_urllib passes now. Modified: python/trunk/Lib/nturl2path.py Modified: python/trunk/Lib/nturl2path.py ============================================================================== --- python/trunk/Lib/nturl2path.py (original) +++ python/trunk/Lib/nturl2path.py Tue May 5 19:34:42 2009 @@ -56,7 +56,7 @@ drive = urllib.quote(comp[0].upper()) components = comp[1].split('\\') - path = '///' + drive + '|' + path = '///' + drive + ':' for comp in components: if comp: path = path + '/' + urllib.quote(comp) From python-checkins at python.org Tue May 5 19:41:47 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 5 May 2009 19:41:47 +0200 (CEST) Subject: [Python-checkins] r72344 - in python/trunk/Modules: _ctypes/cfield.c _randommodule.c Message-ID: <20090505174147.9747C1E401C@bag.python.org> Author: mark.dickinson Date: Tue May 5 19:41:47 2009 New Revision: 72344 Log: Issue #5933: Fix some gcc -Wextra warnings. Thanks Victor Stinner for the patch. Modified: python/trunk/Modules/_ctypes/cfield.c python/trunk/Modules/_randommodule.c Modified: python/trunk/Modules/_ctypes/cfield.c ============================================================================== --- python/trunk/Modules/_ctypes/cfield.c (original) +++ python/trunk/Modules/_ctypes/cfield.c Tue May 5 19:41:47 2009 @@ -372,7 +372,7 @@ return -1; } x = PyInt_AsUnsignedLongMask(v); - if (x == -1 && PyErr_Occurred()) + if (x == (unsigned long)-1 && PyErr_Occurred()) return -1; *p = x; return 0; @@ -410,7 +410,7 @@ return -1; } x = PyInt_AsUnsignedLongLongMask(v); - if (x == -1 && PyErr_Occurred()) + if (x == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred()) return -1; *p = x; return 0; Modified: python/trunk/Modules/_randommodule.c ============================================================================== --- python/trunk/Modules/_randommodule.c (original) +++ python/trunk/Modules/_randommodule.c Tue May 5 19:41:47 2009 @@ -355,7 +355,7 @@ for (i=0; istate[i] = element & 0xffffffffUL; /* Make sure we get sane state */ } From python-checkins at python.org Tue May 5 19:43:00 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 5 May 2009 19:43:00 +0200 (CEST) Subject: [Python-checkins] r72345 - in python/branches/release26-maint: Modules/_ctypes/cfield.c Modules/_randommodule.c Message-ID: <20090505174300.00B511E401C@bag.python.org> Author: mark.dickinson Date: Tue May 5 19:42:59 2009 New Revision: 72345 Log: Merged revisions 72344 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72344 | mark.dickinson | 2009-05-05 18:41:47 +0100 (Tue, 05 May 2009) | 3 lines Issue #5933: Fix some gcc -Wextra warnings. Thanks Victor Stinner for the patch. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Modules/_ctypes/cfield.c python/branches/release26-maint/Modules/_randommodule.c Modified: python/branches/release26-maint/Modules/_ctypes/cfield.c ============================================================================== --- python/branches/release26-maint/Modules/_ctypes/cfield.c (original) +++ python/branches/release26-maint/Modules/_ctypes/cfield.c Tue May 5 19:42:59 2009 @@ -372,7 +372,7 @@ return -1; } x = PyInt_AsUnsignedLongMask(v); - if (x == -1 && PyErr_Occurred()) + if (x == (unsigned long)-1 && PyErr_Occurred()) return -1; *p = x; return 0; @@ -410,7 +410,7 @@ return -1; } x = PyInt_AsUnsignedLongLongMask(v); - if (x == -1 && PyErr_Occurred()) + if (x == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred()) return -1; *p = x; return 0; Modified: python/branches/release26-maint/Modules/_randommodule.c ============================================================================== --- python/branches/release26-maint/Modules/_randommodule.c (original) +++ python/branches/release26-maint/Modules/_randommodule.c Tue May 5 19:42:59 2009 @@ -355,7 +355,7 @@ for (i=0; istate[i] = element & 0xffffffffUL; /* Make sure we get sane state */ } From python-checkins at python.org Tue May 5 19:54:36 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 5 May 2009 19:54:36 +0200 (CEST) Subject: [Python-checkins] r72346 - in python/branches/py3k: Modules/_ctypes/cfield.c Modules/_randommodule.c Message-ID: <20090505175436.87FCD1E4015@bag.python.org> Author: mark.dickinson Date: Tue May 5 19:54:36 2009 New Revision: 72346 Log: Merged revisions 72344 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72344 | mark.dickinson | 2009-05-05 18:41:47 +0100 (Tue, 05 May 2009) | 3 lines Issue #5933: Fix some gcc -Wextra warnings. Thanks Victor Stinner for the patch. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Modules/_ctypes/cfield.c python/branches/py3k/Modules/_randommodule.c Modified: python/branches/py3k/Modules/_ctypes/cfield.c ============================================================================== --- python/branches/py3k/Modules/_ctypes/cfield.c (original) +++ python/branches/py3k/Modules/_ctypes/cfield.c Tue May 5 19:54:36 2009 @@ -362,7 +362,7 @@ return -1; } x = PyLong_AsUnsignedLongMask(v); - if (x == -1 && PyErr_Occurred()) + if (x == (unsigned long)-1 && PyErr_Occurred()) return -1; *p = x; return 0; @@ -400,7 +400,7 @@ return -1; } x = PyLong_AsUnsignedLongLongMask(v); - if (x == -1 && PyErr_Occurred()) + if (x == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred()) return -1; *p = x; return 0; Modified: python/branches/py3k/Modules/_randommodule.c ============================================================================== --- python/branches/py3k/Modules/_randommodule.c (original) +++ python/branches/py3k/Modules/_randommodule.c Tue May 5 19:54:36 2009 @@ -355,7 +355,7 @@ for (i=0; istate[i] = element & 0xffffffffUL; /* Make sure we get sane state */ } From python-checkins at python.org Tue May 5 19:55:59 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 5 May 2009 19:55:59 +0200 (CEST) Subject: [Python-checkins] r72347 - in python/branches/release30-maint: Modules/_ctypes/cfield.c Modules/_randommodule.c Message-ID: <20090505175559.118CA1E4015@bag.python.org> Author: mark.dickinson Date: Tue May 5 19:55:58 2009 New Revision: 72347 Log: Merged revisions 72346 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72346 | mark.dickinson | 2009-05-05 18:54:36 +0100 (Tue, 05 May 2009) | 10 lines Merged revisions 72344 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72344 | mark.dickinson | 2009-05-05 18:41:47 +0100 (Tue, 05 May 2009) | 3 lines Issue #5933: Fix some gcc -Wextra warnings. Thanks Victor Stinner for the patch. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Modules/_ctypes/cfield.c python/branches/release30-maint/Modules/_randommodule.c Modified: python/branches/release30-maint/Modules/_ctypes/cfield.c ============================================================================== --- python/branches/release30-maint/Modules/_ctypes/cfield.c (original) +++ python/branches/release30-maint/Modules/_ctypes/cfield.c Tue May 5 19:55:58 2009 @@ -362,7 +362,7 @@ return -1; } x = PyLong_AsUnsignedLongMask(v); - if (x == -1 && PyErr_Occurred()) + if (x == (unsigned long)-1 && PyErr_Occurred()) return -1; *p = x; return 0; @@ -400,7 +400,7 @@ return -1; } x = PyLong_AsUnsignedLongLongMask(v); - if (x == -1 && PyErr_Occurred()) + if (x == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred()) return -1; *p = x; return 0; Modified: python/branches/release30-maint/Modules/_randommodule.c ============================================================================== --- python/branches/release30-maint/Modules/_randommodule.c (original) +++ python/branches/release30-maint/Modules/_randommodule.c Tue May 5 19:55:58 2009 @@ -355,7 +355,7 @@ for (i=0; istate[i] = element & 0xffffffffUL; /* Make sure we get sane state */ } From buildbot at python.org Tue May 5 20:21:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 18:21:52 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090505182153.ACD501E4015@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/636 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_importlib test_posix Traceback (most recent call last): File "./Lib/test/regrtest.py", line 620, in runtest_inner File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_importlib.py", line 6, in test_main run_unittest(importlib.test.test_suite('importlib.test')) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/__init__.py", line 22, in test_suite package_tests = getattr(sys.modules[package_name], 'test_suite')() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/source/__init__.py", line 8, in test_suite return importlib.test.test_suite('importlib.test.source', directory) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/__init__.py", line 16, in test_suite __import__(module_name, level=0) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/source/test_case_sensitivity.py", line 12, in class CaseSensitivityTest(unittest.TestCase): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/util.py", line 13, in case_insensitive_tests original_name = os.listdir('.')[0] IndexError: list index out of range ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Tue May 5 20:26:09 2009 From: python-checkins at python.org (eric.smith) Date: Tue, 5 May 2009 20:26:09 +0200 (CEST) Subject: [Python-checkins] r72348 - in python/trunk: Doc/c-api/conversion.rst Include/floatobject.h Lib/test/test_complex.py Lib/test/test_float.py Misc/NEWS Objects/complexobject.c Objects/floatobject.c Objects/stringlib/formatter.h Python/pystrtod.c Message-ID: <20090505182609.1140C1E4015@bag.python.org> Author: eric.smith Date: Tue May 5 20:26:08 2009 New Revision: 72348 Log: Issue #5920: Changed format.__float__ and complex.__float__ to use a precision of 12 when using the empty presentation type. This more closely matches str()'s behavior and reduces surprises when adding alignment flags to an empty format string. Patch by Mark Dickinson. Modified: python/trunk/Doc/c-api/conversion.rst python/trunk/Include/floatobject.h python/trunk/Lib/test/test_complex.py python/trunk/Lib/test/test_float.py python/trunk/Misc/NEWS python/trunk/Objects/complexobject.c python/trunk/Objects/floatobject.c python/trunk/Objects/stringlib/formatter.h python/trunk/Python/pystrtod.c Modified: python/trunk/Doc/c-api/conversion.rst ============================================================================== --- python/trunk/Doc/c-api/conversion.rst (original) +++ python/trunk/Doc/c-api/conversion.rst Tue May 5 20:26:08 2009 @@ -86,10 +86,10 @@ Convert a :ctype:`double` *val* to a string using supplied *format_code*, *precision*, and *flags*. - *format_code* must be one of ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, - ``'G'``, ``'s'``, or ``'r'``. For ``'s'`` and ``'r'``, the supplied - *precision* must be 0 and is ignored. These specify the standard - :func:`str` and :func:`repr` formats, respectively. + *format_code* must be one of ``'e'``, ``'E'``, ``'f'``, ``'F'``, + ``'g'``, ``'G'`` or ``'r'``. For ``'r'``, the supplied *precision* + must be 0 and is ignored. The ``'r'`` format code specifies the + standard :func:`repr` format. *flags* can be zero or more of the values *Py_DTSF_SIGN*, *Py_DTSF_ADD_DOT_0*, or *Py_DTSF_ALT*, or-ed together: Modified: python/trunk/Include/floatobject.h ============================================================================== --- python/trunk/Include/floatobject.h (original) +++ python/trunk/Include/floatobject.h Tue May 5 20:26:08 2009 @@ -21,6 +21,12 @@ #define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type) #define PyFloat_CheckExact(op) (Py_TYPE(op) == &PyFloat_Type) +/* The str() precision PyFloat_STR_PRECISION is chosen so that in most cases, + the rounding noise created by various operations is suppressed, while + giving plenty of precision for practical use. */ + +#define PyFloat_STR_PRECISION 12 + #ifdef Py_NAN #define Py_RETURN_NAN return PyFloat_FromDouble(Py_NAN) #endif Modified: python/trunk/Lib/test/test_complex.py ============================================================================== --- python/trunk/Lib/test/test_complex.py (original) +++ python/trunk/Lib/test/test_complex.py Tue May 5 20:26:08 2009 @@ -467,6 +467,16 @@ self.assertEqual(format(3+0j, ''), str(3+0j)) self.assertEqual(format(3.2+0j, ''), str(3.2+0j)) + # empty presentation type should still be analogous to str, + # even when format string is nonempty (issue #5920). + self.assertEqual(format(3.2+0j, '-'), str(3.2+0j)) + self.assertEqual(format(3.2+0j, '<'), str(3.2+0j)) + z = 4/7. - 100j/7. + self.assertEqual(format(z, ''), str(z)) + self.assertEqual(format(z, '-'), str(z)) + self.assertEqual(format(z, '<'), str(z)) + self.assertEqual(format(z, '10'), str(z)) + self.assertEqual(format(1+3j, 'g'), '1+3j') self.assertEqual(format(3j, 'g'), '0+3j') self.assertEqual(format(1.5+3.5j, 'g'), '1.5+3.5j') Modified: python/trunk/Lib/test/test_float.py ============================================================================== --- python/trunk/Lib/test/test_float.py (original) +++ python/trunk/Lib/test/test_float.py Tue May 5 20:26:08 2009 @@ -257,6 +257,53 @@ self.assertEquals(math.atan2(float('-1e-1000'), -1), math.atan2(-0.0, -1)) + def test_format(self): + # these should be rewritten to use both format(x, spec) and + # x.__format__(spec) + + self.assertEqual(format(0.0, 'f'), '0.000000') + + # the default is 'g', except for empty format spec + self.assertEqual(format(0.0, ''), '0.0') + self.assertEqual(format(0.01, ''), '0.01') + self.assertEqual(format(0.01, 'g'), '0.01') + + # empty presentation type should format in the same way as str + # (issue 5920) + x = 100/7. + self.assertEqual(format(x, ''), str(x)) + self.assertEqual(format(x, '-'), str(x)) + self.assertEqual(format(x, '>'), str(x)) + self.assertEqual(format(x, '2'), str(x)) + + self.assertEqual(format(1.0, 'f'), '1.000000') + + self.assertEqual(format(-1.0, 'f'), '-1.000000') + + self.assertEqual(format( 1.0, ' f'), ' 1.000000') + self.assertEqual(format(-1.0, ' f'), '-1.000000') + self.assertEqual(format( 1.0, '+f'), '+1.000000') + self.assertEqual(format(-1.0, '+f'), '-1.000000') + + # % formatting + self.assertEqual(format(-1.0, '%'), '-100.000000%') + + # conversion to string should fail + self.assertRaises(ValueError, format, 3.0, "s") + + # other format specifiers shouldn't work on floats, + # in particular int specifiers + for format_spec in ([chr(x) for x in range(ord('a'), ord('z')+1)] + + [chr(x) for x in range(ord('A'), ord('Z')+1)]): + if not format_spec in 'eEfFgGn%': + self.assertRaises(ValueError, format, 0.0, format_spec) + self.assertRaises(ValueError, format, 1.0, format_spec) + self.assertRaises(ValueError, format, -1.0, format_spec) + self.assertRaises(ValueError, format, 1e100, format_spec) + self.assertRaises(ValueError, format, -1e100, format_spec) + self.assertRaises(ValueError, format, 1e-100, format_spec) + self.assertRaises(ValueError, format, -1e-100, format_spec) + @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"), "test requires IEEE 754 doubles") def test_format_testfile(self): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue May 5 20:26:08 2009 @@ -12,6 +12,15 @@ Core and Builtins ----------------- +- Issue #5920: For float.__format__, change the behavior with the + empty presentation type (that is, not one of 'e', 'f', 'g', or 'n') + to be like 'g' but with at least one decimal point and with a + default precision of 12. Previously, the behavior the same but with + a default precision of 6. This more closely matches str(), and + reduces surprises when adding alignment flags to the empty + presentation type. This also affects the new complex.__format__ in + the same way. + - Issue #5890: in subclasses of 'property' the __doc__ attribute was shadowed by classtype's, even if it was None. property now inserts the __doc__ into the subclass instance __dict__. Modified: python/trunk/Objects/complexobject.c ============================================================================== --- python/trunk/Objects/complexobject.c (original) +++ python/trunk/Objects/complexobject.c Tue May 5 20:26:08 2009 @@ -354,7 +354,7 @@ static PyObject * -complex_format(PyComplexObject *v, char format_code) +complex_format(PyComplexObject *v, int precision, char format_code) { PyObject *result = NULL; Py_ssize_t len; @@ -374,7 +374,7 @@ if (v->cval.real == 0. && copysign(1.0, v->cval.real)==1.0) { re = ""; im = PyOS_double_to_string(v->cval.imag, format_code, - 0, 0, NULL); + precision, 0, NULL); if (!im) { PyErr_NoMemory(); goto done; @@ -382,7 +382,7 @@ } else { /* Format imaginary part with sign, real part without */ pre = PyOS_double_to_string(v->cval.real, format_code, - 0, 0, NULL); + precision, 0, NULL); if (!pre) { PyErr_NoMemory(); goto done; @@ -390,7 +390,7 @@ re = pre; im = PyOS_double_to_string(v->cval.imag, format_code, - 0, Py_DTSF_SIGN, NULL); + precision, Py_DTSF_SIGN, NULL); if (!im) { PyErr_NoMemory(); goto done; @@ -421,7 +421,10 @@ { PyObject *formatv; char *buf; - formatv = complex_format(v, (flags & Py_PRINT_RAW) ? 's' : 'r'); + if (flags & Py_PRINT_RAW) + formatv = complex_format(v, PyFloat_STR_PRECISION, 'g'); + else + formatv = complex_format(v, 0, 'r'); if (formatv == NULL) return -1; buf = PyString_AS_STRING(formatv); @@ -435,13 +438,13 @@ static PyObject * complex_repr(PyComplexObject *v) { - return complex_format(v, 'r'); + return complex_format(v, 0, 'r'); } static PyObject * complex_str(PyComplexObject *v) { - return complex_format(v, 's'); + return complex_format(v, PyFloat_STR_PRECISION, 'g'); } static long Modified: python/trunk/Objects/floatobject.c ============================================================================== --- python/trunk/Objects/floatobject.c (original) +++ python/trunk/Objects/floatobject.c Tue May 5 20:26:08 2009 @@ -352,7 +352,7 @@ void PyFloat_AsString(char *buf, PyFloatObject *v) { - _PyOS_double_to_string(buf, 100, v->ob_fval, 's', 0, + _PyOS_double_to_string(buf, 100, v->ob_fval, 'g', PyFloat_STR_PRECISION, Py_DTSF_ADD_DOT_0, NULL); } @@ -368,9 +368,13 @@ float_print(PyFloatObject *v, FILE *fp, int flags) { char buf[100]; - _PyOS_double_to_string(buf, sizeof(buf), v->ob_fval, - (flags & Py_PRINT_RAW) ? 's' : 'r', - 0, Py_DTSF_ADD_DOT_0, NULL); + if (flags & Py_PRINT_RAW) + _PyOS_double_to_string(buf, sizeof(buf), v->ob_fval, + 'g', PyFloat_STR_PRECISION, + Py_DTSF_ADD_DOT_0, NULL); + else + _PyOS_double_to_string(buf, sizeof(buf), v->ob_fval, + 'r', 0, Py_DTSF_ADD_DOT_0, NULL); Py_BEGIN_ALLOW_THREADS fputs(buf, fp); Py_END_ALLOW_THREADS @@ -390,7 +394,8 @@ float_str(PyFloatObject *v) { char buf[100]; - _PyOS_double_to_string(buf, sizeof(buf), v->ob_fval, 's', 0, + _PyOS_double_to_string(buf, sizeof(buf), v->ob_fval, 'g', + PyFloat_STR_PRECISION, Py_DTSF_ADD_DOT_0, NULL); return PyString_FromString(buf); } Modified: python/trunk/Objects/stringlib/formatter.h ============================================================================== --- python/trunk/Objects/stringlib/formatter.h (original) +++ python/trunk/Objects/stringlib/formatter.h Tue May 5 20:26:08 2009 @@ -881,6 +881,7 @@ int has_decimal; double val; Py_ssize_t precision = format->precision; + Py_ssize_t default_precision = 6; STRINGLIB_CHAR type = format->type; int add_pct = 0; STRINGLIB_CHAR *p; @@ -907,9 +908,10 @@ } if (type == '\0') { - /* Omitted type specifier. This is like 'g' but with at least - one digit after the decimal point. */ + /* Omitted type specifier. This is like 'g' but with at least one + digit after the decimal point, and different default precision.*/ type = 'g'; + default_precision = PyFloat_STR_PRECISION; flags |= Py_DTSF_ADD_DOT_0; } @@ -933,7 +935,7 @@ } if (precision < 0) - precision = 6; + precision = default_precision; #if PY_VERSION_HEX < 0x03010000 /* 3.1 no longer converts large 'f' to 'g'. */ @@ -1039,6 +1041,7 @@ int re_has_decimal; int im_has_decimal; Py_ssize_t precision = format->precision; + Py_ssize_t default_precision = 6; STRINGLIB_CHAR type = format->type; STRINGLIB_CHAR *p_re; STRINGLIB_CHAR *p_im; @@ -1100,6 +1103,7 @@ if (type == '\0') { /* Omitted type specifier. Should be like str(self). */ type = 'g'; + default_precision = PyFloat_STR_PRECISION; add_parens = 1; if (re == 0.0) skip_re = 1; @@ -1115,7 +1119,7 @@ type = 'f'; if (precision < 0) - precision = 6; + precision = default_precision; /* Cast "type", because if we're in unicode we need to pass a 8-bit char. This is safe, because we've restricted what "type" Modified: python/trunk/Python/pystrtod.c ============================================================================== --- python/trunk/Python/pystrtod.c (original) +++ python/trunk/Python/pystrtod.c Tue May 5 20:26:08 2009 @@ -660,16 +660,15 @@ /* Supplied precision is unused, must be 0. */ if (precision != 0) return; + /* The repr() precision (17 significant decimal digits) is the + minimal number that is guaranteed to have enough precision + so that if the number is read back in the exact same binary + value is recreated. This is true for IEEE floating point + by design, and also happens to work for all other modern + hardware. */ precision = 17; format_code = 'g'; break; - case 's': /* str format */ - /* Supplied precision is unused, must be 0. */ - if (precision != 0) - return; - precision = 12; - format_code = 'g'; - break; default: assert(0); return; From python-checkins at python.org Tue May 5 20:30:30 2009 From: python-checkins at python.org (eric.smith) Date: Tue, 5 May 2009 20:30:30 +0200 (CEST) Subject: [Python-checkins] r72349 - python/branches/release26-maint Message-ID: <20090505183030.80E9E1E4198@bag.python.org> Author: eric.smith Date: Tue May 5 20:30:30 2009 New Revision: 72349 Log: Blocked revisions 72348 via svnmerge ........ r72348 | eric.smith | 2009-05-05 14:26:08 -0400 (Tue, 05 May 2009) | 1 line Issue #5920: Changed format.__float__ and complex.__float__ to use a precision of 12 when using the empty presentation type. This more closely matches str()'s behavior and reduces surprises when adding alignment flags to an empty format string. Patch by Mark Dickinson. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Tue May 5 20:34:08 2009 From: python-checkins at python.org (eric.smith) Date: Tue, 5 May 2009 20:34:08 +0200 (CEST) Subject: [Python-checkins] r72350 - python/branches/py3k Message-ID: <20090505183408.2298E1E4015@bag.python.org> Author: eric.smith Date: Tue May 5 20:34:08 2009 New Revision: 72350 Log: Blocked revisions 72348 via svnmerge ........ r72348 | eric.smith | 2009-05-05 14:26:08 -0400 (Tue, 05 May 2009) | 1 line Issue #5920: Changed format.__float__ and complex.__float__ to use a precision of 12 when using the empty presentation type. This more closely matches str()'s behavior and reduces surprises when adding alignment flags to an empty format string. Patch by Mark Dickinson. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Tue May 5 20:41:13 2009 From: python-checkins at python.org (senthil.kumaran) Date: Tue, 5 May 2009 20:41:13 +0200 (CEST) Subject: [Python-checkins] r72351 - in python/branches/py3k/Lib: nturl2path.py test/test_urllib.py urllib/request.py Message-ID: <20090505184113.253701E401C@bag.python.org> Author: senthil.kumaran Date: Tue May 5 20:41:13 2009 New Revision: 72351 Log: Fix for issue1153027, making Py3k changes similar to fix in issue918368. This will address: a) urllib/ in py3k, b) urllib in py2x is addressed by issue918368. c) urllib2 in py2x was already addressed in Revision 43132. Modified: python/branches/py3k/Lib/nturl2path.py python/branches/py3k/Lib/test/test_urllib.py python/branches/py3k/Lib/urllib/request.py Modified: python/branches/py3k/Lib/nturl2path.py ============================================================================== --- python/branches/py3k/Lib/nturl2path.py (original) +++ python/branches/py3k/Lib/nturl2path.py Tue May 5 20:41:13 2009 @@ -56,7 +56,7 @@ drive = urllib.parse.quote(comp[0].upper()) components = comp[1].split('\\') - path = '///' + drive + '|' + path = '///' + drive + ':' for comp in components: if comp: path = path + '/' + urllib.parse.quote(comp) Modified: python/branches/py3k/Lib/test/test_urllib.py ============================================================================== --- python/branches/py3k/Lib/test/test_urllib.py (original) +++ python/branches/py3k/Lib/test/test_urllib.py Tue May 5 20:41:13 2009 @@ -837,6 +837,18 @@ self.assertEqual(('user', 'a\vb'),urllib.parse.splitpasswd('user:a\vb')) self.assertEqual(('user', 'a:b'),urllib.parse.splitpasswd('user:a:b')) + +class URLopener_Tests(unittest.TestCase): + """Testcase to test the open method of URLopener class.""" + + def test_quoted_open(self): + class DummyURLopener(urllib.request.URLopener): + def open_spam(self, url): + return url + + self.assertEqual(DummyURLopener().open( + 'spam://example/ /'),'//example/%20/') + # Just commented them out. # Can't really tell why keep failing in windows and sparc. # Everywhere else they work ok, but on those machines, someteimes @@ -928,6 +940,7 @@ urlencode_Tests, Pathname_Tests, Utility_Tests, + URLopener_Tests, #FTPWrapperTests, ) Modified: python/branches/py3k/Lib/urllib/request.py ============================================================================== --- python/branches/py3k/Lib/urllib/request.py (original) +++ python/branches/py3k/Lib/urllib/request.py Tue May 5 20:41:13 2009 @@ -1398,6 +1398,7 @@ def open(self, fullurl, data=None): """Use URLopener().open(file) instead of open(file, 'r').""" fullurl = unwrap(to_bytes(fullurl)) + fullurl = quote(fullurl, safe="%/:=&?~#+!$,;'@()*[]") if self.tempcache and fullurl in self.tempcache: filename, headers = self.tempcache[fullurl] fp = open(filename, 'rb') From python-checkins at python.org Tue May 5 20:55:47 2009 From: python-checkins at python.org (thomas.heller) Date: Tue, 5 May 2009 20:55:47 +0200 (CEST) Subject: [Python-checkins] r72352 - in python/trunk: Lib/ctypes/util.py Misc/NEWS Message-ID: <20090505185547.C8BA41E4017@bag.python.org> Author: thomas.heller Date: Tue May 5 20:55:47 2009 New Revision: 72352 Log: Fix Issue #4875: find_library can return directories instead of files (on win32) Modified: python/trunk/Lib/ctypes/util.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/ctypes/util.py ============================================================================== --- python/trunk/Lib/ctypes/util.py (original) +++ python/trunk/Lib/ctypes/util.py Tue May 5 20:55:47 2009 @@ -52,12 +52,12 @@ # See MSDN for the REAL search order. for directory in os.environ['PATH'].split(os.pathsep): fname = os.path.join(directory, name) - if os.path.exists(fname): + if os.path.isfile(fname): return fname if fname.lower().endswith(".dll"): continue fname = fname + ".dll" - if os.path.exists(fname): + if os.path.isfile(fname): return fname return None Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue May 5 20:55:47 2009 @@ -282,6 +282,9 @@ Library ------- +- Issue #4875: On win32, ctypes.util.find_library does no longer + return directories. + - Issue #5142: Add the ability to skip modules while stepping to pdb. - Issue #1309567: Fix linecache behavior of stripping subdirectories when From python-checkins at python.org Tue May 5 20:59:30 2009 From: python-checkins at python.org (thomas.heller) Date: Tue, 5 May 2009 20:59:30 +0200 (CEST) Subject: [Python-checkins] r72353 - in python/branches/release26-maint: Lib/ctypes/util.py Misc/NEWS Message-ID: <20090505185930.D36511E4017@bag.python.org> Author: thomas.heller Date: Tue May 5 20:59:30 2009 New Revision: 72353 Log: Merged revisions 72352 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72352 | thomas.heller | 2009-05-05 20:55:47 +0200 (Di, 05 Mai 2009) | 3 lines Fix Issue #4875: find_library can return directories instead of files (on win32) ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/ctypes/util.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/ctypes/util.py ============================================================================== --- python/branches/release26-maint/Lib/ctypes/util.py (original) +++ python/branches/release26-maint/Lib/ctypes/util.py Tue May 5 20:59:30 2009 @@ -52,12 +52,12 @@ # See MSDN for the REAL search order. for directory in os.environ['PATH'].split(os.pathsep): fname = os.path.join(directory, name) - if os.path.exists(fname): + if os.path.isfile(fname): return fname if fname.lower().endswith(".dll"): continue fname = fname + ".dll" - if os.path.exists(fname): + if os.path.isfile(fname): return fname return None Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Tue May 5 20:59:30 2009 @@ -40,6 +40,9 @@ Library ------- +- Issue #4875: On win32, ctypes.util.find_library does no longer + return directories. + - Issue #5692: In :class:`zipfile.Zipfile`, fix wrong path calculation when extracting a file to the root directory. From python-checkins at python.org Tue May 5 21:04:40 2009 From: python-checkins at python.org (thomas.heller) Date: Tue, 5 May 2009 21:04:40 +0200 (CEST) Subject: [Python-checkins] r72354 - in python/branches/py3k: Lib/ctypes/util.py Misc/NEWS Message-ID: <20090505190440.E30011E4017@bag.python.org> Author: thomas.heller Date: Tue May 5 21:04:40 2009 New Revision: 72354 Log: Merged revisions 72352 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72352 | thomas.heller | 2009-05-05 20:55:47 +0200 (Di, 05 Mai 2009) | 3 lines Fix Issue #4875: find_library can return directories instead of files (on win32) ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/ctypes/util.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/ctypes/util.py ============================================================================== --- python/branches/py3k/Lib/ctypes/util.py (original) +++ python/branches/py3k/Lib/ctypes/util.py Tue May 5 21:04:40 2009 @@ -49,12 +49,12 @@ # See MSDN for the REAL search order. for directory in os.environ['PATH'].split(os.pathsep): fname = os.path.join(directory, name) - if os.path.exists(fname): + if os.path.isfile(fname): return fname if fname.lower().endswith(".dll"): continue fname = fname + ".dll" - if os.path.exists(fname): + if os.path.isfile(fname): return fname return None Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue May 5 21:04:40 2009 @@ -127,6 +127,9 @@ Library ------- +- Issue #4875: On win32, ctypes.util.find_library does no longer + return directories. + - Issue #5142: Add the ability to skip modules while stepping to pdb. - Issue #1309567: Fix linecache behavior of stripping subdirectories when From buildbot at python.org Tue May 5 21:22:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 19:22:38 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090505192239.291F41E4017@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%202.6/builds/323 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Tue May 5 21:33:28 2009 From: python-checkins at python.org (thomas.heller) Date: Tue, 5 May 2009 21:33:28 +0200 (CEST) Subject: [Python-checkins] r72355 - in python/branches/release30-maint: Lib/ctypes/util.py Misc/NEWS Message-ID: <20090505193328.458631E4017@bag.python.org> Author: thomas.heller Date: Tue May 5 21:33:26 2009 New Revision: 72355 Log: Merged revisions 72354 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72354 | thomas.heller | 2009-05-05 21:04:40 +0200 (Di, 05 Mai 2009) | 10 lines Merged revisions 72352 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72352 | thomas.heller | 2009-05-05 20:55:47 +0200 (Di, 05 Mai 2009) | 3 lines Fix Issue #4875: find_library can return directories instead of files (on win32) ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/ctypes/util.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/ctypes/util.py ============================================================================== --- python/branches/release30-maint/Lib/ctypes/util.py (original) +++ python/branches/release30-maint/Lib/ctypes/util.py Tue May 5 21:33:26 2009 @@ -49,12 +49,12 @@ # See MSDN for the REAL search order. for directory in os.environ['PATH'].split(os.pathsep): fname = os.path.join(directory, name) - if os.path.exists(fname): + if os.path.isfile(fname): return fname if fname.lower().endswith(".dll"): continue fname = fname + ".dll" - if os.path.exists(fname): + if os.path.isfile(fname): return fname return None Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Tue May 5 21:33:26 2009 @@ -55,6 +55,9 @@ Library ------- +- Issue #4875: On win32, ctypes.util.find_library does no longer + return directories. + - Issue #2245: aifc now skips chunk types it doesn't recognize, per spec. - Issue #4305: ctypes should now build again on mipsel-linux-gnu From buildbot at python.org Tue May 5 21:59:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 19:59:50 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090505195950.71AEA1E4013@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/466 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: senthil.kumaran BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_time make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue May 5 22:13:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 20:13:27 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090505201327.586141E4013@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1253 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: eric.smith,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_os ====================================================================== FAIL: test_update2 (test.test_os.EnvironTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_os.py", line 348, in test_update2 self.assertEquals(value, "World") AssertionError: '' != 'World' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue May 5 22:17:42 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 20:17:42 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090505201742.B87BD1E4013@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/335 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 45, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/Include ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Tue May 5 23:01:44 2009 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 5 May 2009 23:01:44 +0200 (CEST) Subject: [Python-checkins] r72356 - peps/trunk/pep-0383.txt Message-ID: <20090505210144.767E71E4013@bag.python.org> Author: martin.v.loewis Date: Tue May 5 23:01:44 2009 New Revision: 72356 Log: Don't use "half" as an adjective to "surrogate". Modified: peps/trunk/pep-0383.txt Modified: peps/trunk/pep-0383.txt ============================================================================== --- peps/trunk/pep-0383.txt (original) +++ peps/trunk/pep-0383.txt Tue May 5 23:01:44 2009 @@ -69,14 +69,14 @@ On POSIX systems, Python currently applies the locale's encoding to convert the byte data to Unicode, failing for characters that cannot be decoded. With this PEP, non-decodable bytes >= 128 will be -represented as lone half surrogate codes U+DC80..U+DCFF. Bytes below +represented as lone surrogate codes U+DC80..U+DCFF. Bytes below 128 will produce exceptions; see the discussion below. To convert non-decodable bytes, a new error handler ([2]) "utf8b" is -introduced, which produces these half surrogates. On encoding, the -error handler converts the half surrogate back to the corresponding -byte. This error handler will be used in any API that receives or -produces file names, command line arguments, or environment variables. +introduced, which produces these surrogates. On encoding, the error +handler converts the surrogate back to the corresponding byte. This +error handler will be used in any API that receives or produces file +names, command line arguments, or environment variables. The error handler interface is extended to allow the encode error handler to return byte strings immediately, in addition to returning From python-checkins at python.org Tue May 5 23:09:21 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 5 May 2009 23:09:21 +0200 (CEST) Subject: [Python-checkins] r72357 - python/trunk/Modules/_testcapimodule.c Message-ID: <20090505210921.434EC1E4013@bag.python.org> Author: benjamin.peterson Date: Tue May 5 23:09:21 2009 New Revision: 72357 Log: fix running test_capi with -R :: Also, fix a refleak in the test that was preventing running. :) Modified: python/trunk/Modules/_testcapimodule.c Modified: python/trunk/Modules/_testcapimodule.c ============================================================================== --- python/trunk/Modules/_testcapimodule.c (original) +++ python/trunk/Modules/_testcapimodule.c Tue May 5 23:09:21 2009 @@ -226,6 +226,13 @@ long hash; type = &_HashInheritanceTester_Type; + + if (type->tp_dict != NULL) + /* The type has already been initialized. This probably means -R + is being used. */ + Py_RETURN_NONE; + + obj = PyObject_New(PyObject, type); if (obj == NULL) { PyErr_Clear(); @@ -269,6 +276,8 @@ return NULL; } + Py_DECREF(obj); + Py_RETURN_NONE; } From python-checkins at python.org Tue May 5 23:11:54 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 5 May 2009 23:11:54 +0200 (CEST) Subject: [Python-checkins] r72358 - in python/branches/py3k: Modules/_testcapimodule.c Message-ID: <20090505211154.6ECB91E4013@bag.python.org> Author: benjamin.peterson Date: Tue May 5 23:11:54 2009 New Revision: 72358 Log: Merged revisions 72357 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72357 | benjamin.peterson | 2009-05-05 16:09:21 -0500 (Tue, 05 May 2009) | 4 lines fix running test_capi with -R :: Also, fix a refleak in the test that was preventing running. :) ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Modules/_testcapimodule.c Modified: python/branches/py3k/Modules/_testcapimodule.c ============================================================================== --- python/branches/py3k/Modules/_testcapimodule.c (original) +++ python/branches/py3k/Modules/_testcapimodule.c Tue May 5 23:11:54 2009 @@ -227,6 +227,13 @@ long hash; type = &_HashInheritanceTester_Type; + + if (type->tp_dict != NULL) + /* The type has already been initialized. This probably means -R + is being used. */ + Py_RETURN_NONE; + + obj = PyObject_New(PyObject, type); if (obj == NULL) { PyErr_Clear(); @@ -270,6 +277,8 @@ return NULL; } + Py_DECREF(obj); + Py_RETURN_NONE; } From python-checkins at python.org Tue May 5 23:34:59 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 5 May 2009 23:34:59 +0200 (CEST) Subject: [Python-checkins] r72359 - python/branches/py3k/Lib/test/test_os.py Message-ID: <20090505213459.BAC771E4017@bag.python.org> Author: mark.dickinson Date: Tue May 5 23:34:59 2009 New Revision: 72359 Log: Issue #5944: Skip PEP 383 tests on OS X. Modified: python/branches/py3k/Lib/test/test_os.py Modified: python/branches/py3k/Lib/test/test_os.py ============================================================================== --- python/branches/py3k/Lib/test/test_os.py (original) +++ python/branches/py3k/Lib/test/test_os.py Tue May 5 23:34:59 2009 @@ -700,6 +700,7 @@ self.assertRaises(OverflowError, os.setregid, 1<<32, 0) self.assertRaises(OverflowError, os.setregid, 0, 1<<32) + @unittest.skipIf(sys.platform == 'darwin', "tests don't apply to OS X") class Pep383Tests(unittest.TestCase): filenames = [b'foo\xf6bar', 'foo\xf6bar'.encode("utf-8")] From python-checkins at python.org Tue May 5 23:36:17 2009 From: python-checkins at python.org (mark.dickinson) Date: Tue, 5 May 2009 23:36:17 +0200 (CEST) Subject: [Python-checkins] r72360 - python/branches/release30-maint Message-ID: <20090505213617.744431E4020@bag.python.org> Author: mark.dickinson Date: Tue May 5 23:36:17 2009 New Revision: 72360 Log: Blocked revisions 72359 via svnmerge ........ r72359 | mark.dickinson | 2009-05-05 22:34:59 +0100 (Tue, 05 May 2009) | 2 lines Issue #5944: Skip PEP 383 tests on OS X. ........ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Wed May 6 00:13:06 2009 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 6 May 2009 00:13:06 +0200 (CEST) Subject: [Python-checkins] r72361 - python/trunk/Tools/msi/msi.py Message-ID: <20090505221306.D72C41E4013@bag.python.org> Author: martin.v.loewis Date: Wed May 6 00:13:01 2009 New Revision: 72361 Log: Issue #5721: don't package Lib/test/README anymore. Modified: python/trunk/Tools/msi/msi.py Modified: python/trunk/Tools/msi/msi.py ============================================================================== --- python/trunk/Tools/msi/msi.py (original) +++ python/trunk/Tools/msi/msi.py Wed May 6 00:13:01 2009 @@ -1011,7 +1011,6 @@ lib.glob("*.uue") lib.glob("*.pem") lib.glob("*.pck") - lib.add_file("readme.txt", src="README") lib.add_file("zipdir.zip") if dir=='decimaltestdata': lib.glob("*.decTest") From python-checkins at python.org Wed May 6 00:14:50 2009 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 6 May 2009 00:14:50 +0200 (CEST) Subject: [Python-checkins] r72362 - in python/branches/py3k: Tools/msi/msi.py Message-ID: <20090505221450.C20721E4153@bag.python.org> Author: martin.v.loewis Date: Wed May 6 00:14:50 2009 New Revision: 72362 Log: Merged revisions 72361 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72361 | martin.v.loewis | 2009-05-06 00:13:01 +0200 (Mi, 06 Mai 2009) | 2 lines Issue #5721: don't package Lib/test/README anymore. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Tools/msi/msi.py Modified: python/branches/py3k/Tools/msi/msi.py ============================================================================== --- python/branches/py3k/Tools/msi/msi.py (original) +++ python/branches/py3k/Tools/msi/msi.py Wed May 6 00:14:50 2009 @@ -1012,7 +1012,6 @@ lib.glob("*.uue") lib.glob("*.pem") lib.glob("*.pck") - lib.add_file("readme.txt", src="README") lib.add_file("zipdir.zip") if dir=='decimaltestdata': lib.glob("*.decTest") From buildbot at python.org Wed May 6 00:15:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 22:15:05 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090505221505.6D03E1E4174@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1255 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_signal.py", line 165, in test_main pickle.dump(None, done_w) File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/contextlib.py", line 153, in __exit__ self.thing.close() IOError: [Errno 9] Bad file descriptor 2 tests failed: test_os test_signal make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed May 6 00:31:58 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 6 May 2009 00:31:58 +0200 (CEST) Subject: [Python-checkins] r72363 - in python/branches/py3k: Doc/c-api/capsule.rst Doc/c-api/cobject.rst Doc/c-api/concrete.rst Doc/data/refcounts.dat Doc/extending/extending.rst Include/Python.h Include/cobject.h Include/datetime.h Include/py_curses.h Include/pycapsule.h Include/pyexpat.h Include/ucnhash.h Lib/test/test_sys.py Makefile.pre.in Misc/NEWS Modules/_ctypes/callproc.c Modules/_ctypes/cfield.c Modules/_cursesmodule.c Modules/_elementtree.c Modules/_ssl.c Modules/_testcapimodule.c Modules/cjkcodecs/cjkcodecs.h Modules/cjkcodecs/multibytecodec.c Modules/cjkcodecs/multibytecodec.h Modules/datetimemodule.c Modules/pyexpat.c Modules/socketmodule.c Modules/socketmodule.h Modules/unicodedata.c Objects/capsule.c Objects/object.c Objects/unicodeobject.c PC/os2emx/python27.def PC/os2vacpp/python.def PCbuild/pythoncore.vcproj Python/compile.c Python/getargs.c Message-ID: <20090505223158.A2D041E4013@bag.python.org> Author: benjamin.peterson Date: Wed May 6 00:31:58 2009 New Revision: 72363 Log: add a replacement API for PyCObject, PyCapsule #5630 All stdlib modules with C-APIs now use this. Patch by Larry Hastings Added: python/branches/py3k/Doc/c-api/capsule.rst (contents, props changed) python/branches/py3k/Include/pycapsule.h (contents, props changed) python/branches/py3k/Objects/capsule.c (contents, props changed) Modified: python/branches/py3k/Doc/c-api/cobject.rst python/branches/py3k/Doc/c-api/concrete.rst python/branches/py3k/Doc/data/refcounts.dat python/branches/py3k/Doc/extending/extending.rst python/branches/py3k/Include/Python.h python/branches/py3k/Include/cobject.h python/branches/py3k/Include/datetime.h python/branches/py3k/Include/py_curses.h python/branches/py3k/Include/pyexpat.h python/branches/py3k/Include/ucnhash.h python/branches/py3k/Lib/test/test_sys.py python/branches/py3k/Makefile.pre.in python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_ctypes/callproc.c python/branches/py3k/Modules/_ctypes/cfield.c python/branches/py3k/Modules/_cursesmodule.c python/branches/py3k/Modules/_elementtree.c python/branches/py3k/Modules/_ssl.c python/branches/py3k/Modules/_testcapimodule.c python/branches/py3k/Modules/cjkcodecs/cjkcodecs.h python/branches/py3k/Modules/cjkcodecs/multibytecodec.c python/branches/py3k/Modules/cjkcodecs/multibytecodec.h python/branches/py3k/Modules/datetimemodule.c python/branches/py3k/Modules/pyexpat.c python/branches/py3k/Modules/socketmodule.c python/branches/py3k/Modules/socketmodule.h python/branches/py3k/Modules/unicodedata.c python/branches/py3k/Objects/object.c python/branches/py3k/Objects/unicodeobject.c python/branches/py3k/PC/os2emx/python27.def python/branches/py3k/PC/os2vacpp/python.def python/branches/py3k/PCbuild/pythoncore.vcproj python/branches/py3k/Python/compile.c python/branches/py3k/Python/getargs.c Added: python/branches/py3k/Doc/c-api/capsule.rst ============================================================================== --- (empty file) +++ python/branches/py3k/Doc/c-api/capsule.rst Wed May 6 00:31:58 2009 @@ -0,0 +1,168 @@ +.. highlightlang:: c + +.. _capsules: + +Capsules +-------- + +.. index:: object: Capsule + +Refer to :ref:`using-capsules` for more information on using these objects. + + +.. ctype:: PyCapsule + + This subtype of :ctype:`PyObject` represents an opaque value, useful for C + extension modules who need to pass an opaque value (as a :ctype:`void\*` + pointer) through Python code to other C code. It is often used to make a C + function pointer defined in one module available to other modules, so the + regular import mechanism can be used to access C APIs defined in dynamically + loaded modules. + +.. ctype:: PyCapsule_Destructor + + The type of a destructor callback for a capsule. Defined as:: + + typedef void (*PyCapsule_Destructor)(PyObject *); + + See :cfunc:`PyCapsule_New` for the semantics of PyCapsule_Destructor + callbacks. + + +.. cfunction:: int PyCapsule_CheckExact(PyObject *p) + + Return true if its argument is a :ctype:`PyCapsule`. + +.. cfunction:: PyObject* PyCapsule_New(void* pointer, const char* name, PyCapsule_Destructor destructor) + + Create a :ctype:`PyCapsule` encapsulating the *pointer*. The *pointer* + argument may not be *NULL*. + + The *name* string may either be *NULL* or a pointer to a valid + C string. If non-*NULL*, this string must outlive the capsule. + (Though it is permitted to free it inside the *destructor*.) + + If the *destructor* argument is not *NULL*, + it will be called with the capsule ``PyObject *`` when it is destroyed. + + If this capsule will be stored as an attribute of a module, it + is strongly suggested that the *name* string be specified as:: + + modulename.attributename + + This will enable other modules to import the capsule + using :cfunc:`PyCapsule_Import`. + + Return a valid capsule on success. + On failure, set an exception and return *NULL*. + + +.. cfunction:: void* PyCapsule_GetPointer(PyObject* capsule, const char* name) + + Retrieve the *pointer* stored in the capsule. + + The *name* parameter must compare exactly to the name stored in the capsule. + If the name stored in the capsule is *NULL*, the *name* passed in must + also be *NULL*. If the name stored in the capsule is non-*NULL*, + the *name* passed in must also be non-*NULL*, and must match the name + stored in the capsule. Python uses the C function *strcmp* to compare + capsule names. + + Return the internal *pointer* on success. + On failure, set an exception and return *NULL*. + + +.. cfunction:: PyCapsule_Destructor PyCapsule_GetDestructor(PyObject* capsule) + + Return the current *destructor* stored in the capsule. + On failure, set an exception and return *NULL*. + + It is legal for a capsule to have a *NULL* destructor. + This makes a *NULL* return code somewhat ambiguous; + use :cfunc:`PyCapsule_IsValid` or :cfunc:`PyErr_Occurred` to disambugate. + + +.. cfunction:: void* PyCapsule_GetContext(PyObject* capsule) + + Return the current *context* stored in the capsule. + On failure, set an exception and return *NULL*. + + It is legal for a capsule to have a *NULL* context. + This makes a *NULL* return code somewhat ambiguous; + use :cfunc:`PyCapsule_IsValid` or :cfunc:`PyErr_Occurred` to disambugate. + + +.. cfunction:: const char* PyCapsule_GetName(PyObject* capsule) + + Return the current *name* stored in the capsule. + On failure, set an exception and return *NULL*. + + It is legal for a capsule to have a *NULL* name. + This makes a *NULL* return code somewhat ambiguous; + use :cfunc:`PyCapsule_IsValid` or :cfunc:`PyErr_Occurred` to disambugate. + + +.. cfunction:: void* PyCapsule_Import(const char* name, int no_block) + + Import a pointer to a C object from a ``capsule`` attribute in a module. + The *name* parameter should specify the full name to the attribute, as + in *"module.attribute"*. + The *name* stored in the capsule must match this string exactly. + If *no_block* is true, import the module without blocking + (using :cfunc:`PyImport_ImportModuleNoBlock`). + If *no_block* is false, import the module conventionally + (using :cfunc:`PyImport_ImportModule`). + + Return the capsule's internal *pointer* on success. + On failure, set an exception and return *NULL*. + Exception: if *PyCapsule_Import* failed to import the module, + and *no_block* was true, no exception is set. + +.. cfunction:: int PyCapsule_IsValid(PyObject* capsule, const char* name) + + Determines whether or not a :ctype:`PyObject \*` is a valid capsule. + A valid capsule is non-*NULL*, passes :cfunc:`PyCapsule_CheckExact`, + has a non-NULL *pointer*, and its internal name matches the + *name* parameter. (See :cfunc:`PyCapsule_GetPointer` for + information on how capsule names are compared.) + + In other words, if :cfunc:`PyCapsule_IsValid` returns a true value, + calls to any of the accessors (any function starting + with :cfunc:`PyCapsule_Get`) are guaranteed to succeed. + + Return a nonzero value if the object is valid and matches the name + passed in. + Return 0 otherwise. + This function will not fail. + +.. cfunction:: int PyCapsule_SetContext(PyObject* capsule, void* context) + + Set the context pointer inside *capsule* to *context*. + + Return 0 on success. + Return nonzero and set an exception on failure. + +.. cfunction:: int PyCapsule_SetDestructor(PyObject* capsule, void (*)(PyObject *) destructor) + + Set the destructor inside *capsule* to *destructor*. + + Return 0 on success. + Return nonzero and set an exception on failure. + +.. cfunction:: int PyCapsule_SetName(PyObject* capsule, const char* name) + + Set the name inside *capsule* to *name*. If non-*NULL*, the name + must outlive the capsule. If the previous *name* stored in the + capsule was not *NULL*, no attempt is made to free it. + + Return 0 on success. + Return nonzero and set an exception on failure. + +.. cfunction:: int PyCapsule_SetPointer(PyObject* capsule, void* pointer) + + Set the void pointer inside *capsule* to *pointer*. The pointer + may not be *NULL*. + + Return 0 on success. + Return nonzero and set an exception on failure. + Modified: python/branches/py3k/Doc/c-api/cobject.rst ============================================================================== --- python/branches/py3k/Doc/c-api/cobject.rst (original) +++ python/branches/py3k/Doc/c-api/cobject.rst Wed May 6 00:31:58 2009 @@ -7,8 +7,11 @@ .. index:: object: CObject -Refer to :ref:`using-cobjects` for more information on using these objects. +.. warning:: + + The CObject API is deprecated as of Python 3.1. Please switch to the new + :ref:`capsules` API. .. ctype:: PyCObject Modified: python/branches/py3k/Doc/c-api/concrete.rst ============================================================================== --- python/branches/py3k/Doc/c-api/concrete.rst (original) +++ python/branches/py3k/Doc/c-api/concrete.rst Wed May 6 00:31:58 2009 @@ -101,6 +101,7 @@ descriptor.rst slice.rst weakref.rst + capsule.rst cobject.rst cell.rst gen.rst Modified: python/branches/py3k/Doc/data/refcounts.dat ============================================================================== --- python/branches/py3k/Doc/data/refcounts.dat (original) +++ python/branches/py3k/Doc/data/refcounts.dat Wed May 6 00:31:58 2009 @@ -55,6 +55,45 @@ PyBuffer_New:PyObject*::+1: PyBuffer_New:int:size:: +PyCapsule_GetContext:void *::: +PyCapsule_GetContext:PyObject*:self:0: + +PyCapsule_GetDestructor:void (*)(PyObject *)::: +PyCapsule_GetDestructor:PyObject*:self:0: + +PyCapsule_GetName:const char *::: +PyCapsule_GetName:PyObject*:self:0: + +PyCapsule_GetPointer:void*::: +PyCapsule_GetPointer:PyObject*:self:0: +PyCapsule_GetPointer:const char *:name:: + +PyCapsule_Import:void *::: +PyCapsule_Import:const char *:name:: +PyCapsule_Import:int:no_block:: + +PyCapsule_New:PyObject*::+1: +PyCapsule_New:void*:pointer:: +PyCapsule_New:const char *:name:: +PyCapsule_New::void (* destructor)(PyObject* ):: + +PyCapsule_SetContext:int::: +PyCapsule_SetContext:PyObject*:self:0: +PyCapsule_SetContext:void *:context:: + +PyCapsule_SetDestructor:int::: +PyCapsule_SetDestructor:PyObject*:self:0: +PyCapsule_SetDestructor:void (*)(PyObject *):destructor:: + +PyCapsule_SetName:int::: +PyCapsule_SetName:PyObject*:self:0: +PyCapsule_SetName:const char *:name:: + +PyCapsule_SetPointer:int::: +PyCapsule_SetPointer:PyObject*:self:0: +PyCapsule_SetPointer:void*:pointer:: + + PyCObject_AsVoidPtr:void*::: PyCObject_AsVoidPtr:PyObject*:self:0: Modified: python/branches/py3k/Doc/extending/extending.rst ============================================================================== --- python/branches/py3k/Doc/extending/extending.rst (original) +++ python/branches/py3k/Doc/extending/extending.rst Wed May 6 00:31:58 2009 @@ -1075,7 +1075,7 @@ define this symbol). -.. _using-cobjects: +.. _using-capsules: Providing a C API for an Extension Module ========================================= @@ -1111,23 +1111,40 @@ other extension modules must be exported in a different way. Python provides a special mechanism to pass C-level information (pointers) from -one extension module to another one: CObjects. A CObject is a Python data type -which stores a pointer (:ctype:`void \*`). CObjects can only be created and +one extension module to another one: Capsules. A Capsule is a Python data type +which stores a pointer (:ctype:`void \*`). Capsules can only be created and accessed via their C API, but they can be passed around like any other Python object. In particular, they can be assigned to a name in an extension module's namespace. Other extension modules can then import this module, retrieve the -value of this name, and then retrieve the pointer from the CObject. +value of this name, and then retrieve the pointer from the Capsule. -There are many ways in which CObjects can be used to export the C API of an -extension module. Each name could get its own CObject, or all C API pointers -could be stored in an array whose address is published in a CObject. And the +There are many ways in which Capsules can be used to export the C API of an +extension module. Each function could get its own Capsule, or all C API pointers +could be stored in an array whose address is published in a Capsule. And the various tasks of storing and retrieving the pointers can be distributed in different ways between the module providing the code and the client modules. +Whichever method you choose, it's important to name your Capsules properly. +The function :cfunc:`PyCapsule_New` takes a name parameter +(:ctype:`const char \*`); you're permitted to pass in a *NULL* name, but +we strongly encourage you to specify a name. Properly named Capsules provide +a degree of runtime type-safety; there is no feasible way to tell one unnamed +Capsule from another. + +In particular, Capsules used to expose C APIs should be given a name following +this convention:: + + modulename.attributename + +The convenience function :cfunc:`PyCapsule_Import` makes it easy to +load a C API provided via a Capsule, but only if the Capsule's name +matches this convention. This behavior gives C API users a high degree +of certainty that the Capsule they load contains the correct C API. + The following example demonstrates an approach that puts most of the burden on the writer of the exporting module, which is appropriate for commonly used library modules. It stores all C API pointers (just one in the example!) in an -array of :ctype:`void` pointers which becomes the value of a CObject. The header +array of :ctype:`void` pointers which becomes the value of a Capsule. The header file corresponding to the module provides a macro that takes care of importing the module and retrieving its C API pointers; client modules only have to call this macro before accessing the C API. @@ -1189,8 +1206,8 @@ /* Initialize the C API pointer array */ PySpam_API[PySpam_System_NUM] = (void *)PySpam_System; - /* Create a CObject containing the API pointer array's address */ - c_api_object = PyCObject_FromVoidPtr((void *)PySpam_API, NULL); + /* Create a Capsule containing the API pointer array's address */ + c_api_object = PyCapsule_New((void *)PySpam_API, "spam._C_API", NULL); if (c_api_object != NULL) PyModule_AddObject(m, "_C_API", c_api_object); @@ -1233,21 +1250,14 @@ #define PySpam_System \ (*(PySpam_System_RETURN (*)PySpam_System_PROTO) PySpam_API[PySpam_System_NUM]) - /* Return -1 and set exception on error, 0 on success. */ + /* Return -1 on error, 0 on success. + * PyCapsule_Import will set an exception if there's an error. + */ static int import_spam(void) { - PyObject *module = PyImport_ImportModule("spam"); - - if (module != NULL) { - PyObject *c_api_object = PyObject_GetAttrString(module, "_C_API"); - if (c_api_object == NULL) - return -1; - if (PyCObject_Check(c_api_object)) - PySpam_API = (void **)PyCObject_AsVoidPtr(c_api_object); - Py_DECREF(c_api_object); - } - return 0; + PySpam_API = (void **)PyCapsule_Import("spam._C_API", 0); + return (PySpam_API != NULL) ? 0 : -1; } #endif @@ -1280,11 +1290,11 @@ rather complicated. However, the basic structure is the same for each function that is exported, so it has to be learned only once. -Finally it should be mentioned that CObjects offer additional functionality, +Finally it should be mentioned that Capsules offer additional functionality, which is especially useful for memory allocation and deallocation of the pointer -stored in a CObject. The details are described in the Python/C API Reference -Manual in the section :ref:`cobjects` and in the implementation of CObjects (files -:file:`Include/cobject.h` and :file:`Objects/cobject.c` in the Python source +stored in a Capsule. The details are described in the Python/C API Reference +Manual in the section :ref:`capsules` and in the implementation of Capsules (files +:file:`Include/pycapsule.h` and :file:`Objects/pycapsule.c` in the Python source code distribution). .. rubric:: Footnotes Modified: python/branches/py3k/Include/Python.h ============================================================================== --- python/branches/py3k/Include/Python.h (original) +++ python/branches/py3k/Include/Python.h Wed May 6 00:31:58 2009 @@ -89,6 +89,7 @@ #include "classobject.h" #include "fileobject.h" #include "cobject.h" +#include "pycapsule.h" #include "traceback.h" #include "sliceobject.h" #include "cellobject.h" Modified: python/branches/py3k/Include/cobject.h ============================================================================== --- python/branches/py3k/Include/cobject.h (original) +++ python/branches/py3k/Include/cobject.h Wed May 6 00:31:58 2009 @@ -1,10 +1,8 @@ -/* C objects to be exported from one extension module to another. +/* - C objects are used for communication between extension modules. - They provide a way for an extension module to export a C interface - to other extension modules, so that extension modules can use the - Python import mechanism to link to one another. +The CObject module is now *deprecated* as of Python 3.1. +Please use the Capsule API instead; see "pycapsule.h". */ Modified: python/branches/py3k/Include/datetime.h ============================================================================== --- python/branches/py3k/Include/datetime.h (original) +++ python/branches/py3k/Include/datetime.h Wed May 6 00:31:58 2009 @@ -158,9 +158,8 @@ } PyDateTime_CAPI; +#define PyDateTime_CAPSULE_NAME "datetime.datetime_CAPI" -/* "magic" constant used to partially protect against developer mistakes. */ -#define DATETIME_API_MAGIC 0x414548d5 #ifdef Py_BUILD_CORE @@ -186,15 +185,7 @@ static PyDateTime_CAPI *PyDateTimeAPI; #define PyDateTime_IMPORT \ - PyDateTimeAPI = (PyDateTime_CAPI*) PyCObject_Import("datetime", \ - "datetime_CAPI") - -/* This macro would be used if PyCObject_ImportEx() was created. -#define PyDateTime_IMPORT \ - PyDateTimeAPI = (PyDateTime_CAPI*) PyCObject_ImportEx("datetime", \ - "datetime_CAPI", \ - DATETIME_API_MAGIC) -*/ + PyDateTimeAPI = (PyDateTime_CAPI *)PyCapsule_Import(PyDateTime_CAPSULE_NAME, 0) /* Macros for type checking when not building the Python core. */ #define PyDate_Check(op) PyObject_TypeCheck(op, PyDateTimeAPI->DateType) Modified: python/branches/py3k/Include/py_curses.h ============================================================================== --- python/branches/py3k/Include/py_curses.h (original) +++ python/branches/py3k/Include/py_curses.h Wed May 6 00:31:58 2009 @@ -75,6 +75,9 @@ #define PyCursesWindow_Check(v) (Py_TYPE(v) == &PyCursesWindow_Type) +#define PyCurses_CAPSULE_NAME "_curses._C_API" + + #ifdef CURSES_MODULE /* This section is used when compiling _cursesmodule.c */ @@ -89,16 +92,8 @@ #define PyCursesInitialisedColor {if (! ((int (*)(void))PyCurses_API[3]) () ) return NULL;} #define import_curses() \ -{ \ - PyObject *module = PyImport_ImportModuleNoBlock("_curses"); \ - if (module != NULL) { \ - PyObject *module_dict = PyModule_GetDict(module); \ - PyObject *c_api_object = PyDict_GetItemString(module_dict, "_C_API"); \ - if (PyCObject_Check(c_api_object)) { \ - PyCurses_API = (void **)PyCObject_AsVoidPtr(c_api_object); \ - } \ - } \ -} + PyCurses_API = (void **)PyCapsule_Import(PyCurses_CAPSULE_NAME, 1); + #endif /* general error messages */ Added: python/branches/py3k/Include/pycapsule.h ============================================================================== --- (empty file) +++ python/branches/py3k/Include/pycapsule.h Wed May 6 00:31:58 2009 @@ -0,0 +1,57 @@ + +/* Capsule objects let you wrap a C "void *" pointer in a Python + object. They're a way of passing data through the Python interpreter + without creating your own custom type. + + Capsules are used for communication between extension modules. + They provide a way for an extension module to export a C interface + to other extension modules, so that extension modules can use the + Python import mechanism to link to one another. + + For more information, please see "c-api/capsule.html" in the + documentation. +*/ + +#ifndef Py_CAPSULE_H +#define Py_CAPSULE_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_DATA(PyTypeObject) PyCapsule_Type; + +typedef void (*PyCapsule_Destructor)(PyObject *); + +#define PyCapsule_CheckExact(op) (Py_TYPE(op) == &PyCapsule_Type) + + +PyAPI_FUNC(PyObject *) PyCapsule_New( + void *pointer, + const char *name, + PyCapsule_Destructor destructor); + +PyAPI_FUNC(void *) PyCapsule_GetPointer(PyObject *capsule, const char *name); + +PyAPI_FUNC(PyCapsule_Destructor) PyCapsule_GetDestructor(PyObject *capsule); + +PyAPI_FUNC(const char *) PyCapsule_GetName(PyObject *capsule); + +PyAPI_FUNC(void *) PyCapsule_GetContext(PyObject *capsule); + +PyAPI_FUNC(int) PyCapsule_IsValid(PyObject *capsule, const char *name); + +PyAPI_FUNC(int) PyCapsule_SetPointer(PyObject *capsule, void *pointer); + +PyAPI_FUNC(int) PyCapsule_SetDestructor(PyObject *capsule, PyCapsule_Destructor destructor); + +PyAPI_FUNC(int) PyCapsule_SetName(PyObject *capsule, const char *name); + +PyAPI_FUNC(int) PyCapsule_SetContext(PyObject *capsule, void *context); + +PyAPI_FUNC(void *) PyCapsule_Import(const char *name, int no_block); + + +#ifdef __cplusplus +} +#endif +#endif /* !Py_CAPSULE_H */ Modified: python/branches/py3k/Include/pyexpat.h ============================================================================== --- python/branches/py3k/Include/pyexpat.h (original) +++ python/branches/py3k/Include/pyexpat.h Wed May 6 00:31:58 2009 @@ -4,6 +4,7 @@ /* note: you must import expat.h before importing this module! */ #define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.0" +#define PyExpat_CAPSULE_NAME "pyexpat.expat_CAPI" struct PyExpat_CAPI { Modified: python/branches/py3k/Include/ucnhash.h ============================================================================== --- python/branches/py3k/Include/ucnhash.h (original) +++ python/branches/py3k/Include/ucnhash.h Wed May 6 00:31:58 2009 @@ -6,7 +6,9 @@ extern "C" { #endif -/* revised ucnhash CAPI interface (exported through a PyCObject) */ +/* revised ucnhash CAPI interface (exported through a "wrapper") */ + +#define PyUnicodeData_CAPSULE_NAME "unicodedata.ucnhash_CAPI" typedef struct { Modified: python/branches/py3k/Lib/test/test_sys.py ============================================================================== --- python/branches/py3k/Lib/test/test_sys.py (original) +++ python/branches/py3k/Lib/test/test_sys.py Wed May 6 00:31:58 2009 @@ -644,7 +644,7 @@ def delx(self): del self.__x x = property(getx, setx, delx, "") check(x, size(h + '4Pi')) - # PyCObject + # PyCapsule # XXX # rangeiterator check(iter(range(1)), size(h + '4l')) Modified: python/branches/py3k/Makefile.pre.in ============================================================================== --- python/branches/py3k/Makefile.pre.in (original) +++ python/branches/py3k/Makefile.pre.in Wed May 6 00:31:58 2009 @@ -344,6 +344,7 @@ Objects/moduleobject.o \ Objects/object.o \ Objects/obmalloc.o \ + Objects/capsule.o \ Objects/rangeobject.o \ Objects/setobject.o \ Objects/sliceobject.o \ @@ -654,6 +655,7 @@ Include/pgen.h \ Include/pgenheaders.h \ Include/pyarena.h \ + Include/pycapsule.h \ Include/pyctype.h \ Include/pydebug.h \ Include/pyerrors.h \ Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed May 6 00:31:58 2009 @@ -226,6 +226,11 @@ support.EnvironmentVarGuard objects restored the environment variables incorrectly on __exit__. +C-API +----- + +- Issue #5630: A replacement PyCObject API, PyCapsule, has been added. + What's New in Python 3.1 alpha 2? ================================= Modified: python/branches/py3k/Modules/_ctypes/callproc.c ============================================================================== --- python/branches/py3k/Modules/_ctypes/callproc.c (original) +++ python/branches/py3k/Modules/_ctypes/callproc.c Wed May 6 00:31:58 2009 @@ -78,6 +78,16 @@ #define DONT_USE_SEH #endif +#define CTYPES_CAPSULE_NAME_PYMEM "_ctypes pymem" + +static void pymem_destructor(PyObject *ptr) +{ + void *p = PyCapsule_GetPointer(ptr, CTYPES_CAPSULE_NAME_PYMEM); + if (p) { + PyMem_Free(p); + } +} + /* ctypes maintains thread-local storage that has space for two error numbers: private copies of the system 'errno' value and, on Windows, the system error code @@ -136,7 +146,7 @@ if (space == NULL) return NULL; memset(space, 0, sizeof(int) * 2); - errobj = PyCObject_FromVoidPtr(space, PyMem_Free); + errobj = PyCapsule_New(space, CTYPES_CAPSULE_NAME_PYMEM, pymem_destructor); if (errobj == NULL) return NULL; if (-1 == PyDict_SetItem(dict, error_object_name, @@ -145,7 +155,7 @@ return NULL; } } - *pspace = (int *)PyCObject_AsVoidPtr(errobj); + *pspace = (int *)PyCapsule_GetPointer(errobj, CTYPES_CAPSULE_NAME_PYMEM); return errobj; } @@ -658,7 +668,7 @@ return -1; } memset(pa->value.p, 0, size); - pa->keep = PyCObject_FromVoidPtr(pa->value.p, PyMem_Free); + pa->keep = PyCapsule_New(pa->value.p, CTYPES_CAPSULE_NAME_PYMEM, pymem_destructor); if (!pa->keep) { PyMem_Free(pa->value.p); return -1; Modified: python/branches/py3k/Modules/_ctypes/cfield.c ============================================================================== --- python/branches/py3k/Modules/_ctypes/cfield.c (original) +++ python/branches/py3k/Modules/_ctypes/cfield.c Wed May 6 00:31:58 2009 @@ -6,6 +6,18 @@ #endif #include "ctypes.h" + +#define CTYPES_CFIELD_CAPSULE_NAME_PYMEM "_ctypes/cfield.c pymem" + +static void pymem_destructor(PyObject *ptr) +{ + void *p = PyCapsule_GetPointer(ptr, CTYPES_CFIELD_CAPSULE_NAME_PYMEM); + if (p) { + PyMem_Free(p); + } +} + + /******************************************************************/ /* PyCField_Type @@ -1477,7 +1489,7 @@ return PyErr_NoMemory(); } memset(buffer, 0, size); - keep = PyCObject_FromVoidPtr(buffer, PyMem_Free); + keep = PyCapsule_New(buffer, CTYPES_CFIELD_CAPSULE_NAME_PYMEM, pymem_destructor); if (!keep) { Py_DECREF(value); PyMem_Free(buffer); Modified: python/branches/py3k/Modules/_cursesmodule.c ============================================================================== --- python/branches/py3k/Modules/_cursesmodule.c (original) +++ python/branches/py3k/Modules/_cursesmodule.c Wed May 6 00:31:58 2009 @@ -104,6 +104,7 @@ #include "Python.h" + #ifdef __osf__ #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */ #endif @@ -174,7 +175,7 @@ /* * Check the return code from a curses function and return None * or raise an exception as appropriate. These are exported using the - * CObject API. + * capsule API. */ static PyObject * @@ -2827,8 +2828,8 @@ return NULL; ModDict = d; /* For PyCurses_InitScr to use later */ - /* Add a CObject for the C API */ - c_api_object = PyCObject_FromVoidPtr((void *)PyCurses_API, NULL); + /* Add a capsule for the C API */ + c_api_object = PyCapsule_New(PyCurses_API, PyCurses_CAPSULE_NAME, NULL); PyDict_SetItemString(d, "_C_API", c_api_object); Py_DECREF(c_api_object); Modified: python/branches/py3k/Modules/_elementtree.c ============================================================================== --- python/branches/py3k/Modules/_elementtree.c (original) +++ python/branches/py3k/Modules/_elementtree.c Wed May 6 00:31:58 2009 @@ -2809,7 +2809,7 @@ #if defined(USE_PYEXPAT_CAPI) /* link against pyexpat, if possible */ - capi = PyCObject_Import("pyexpat", "expat_CAPI"); + capi = PyCapsule_Import(PyExpat_CAPSULE_NAME, 0); if (capi && strcmp(capi->magic, PyExpat_CAPI_MAGIC) == 0 && capi->size <= sizeof(*expat_capi) && Modified: python/branches/py3k/Modules/_ssl.c ============================================================================== --- python/branches/py3k/Modules/_ssl.c (original) +++ python/branches/py3k/Modules/_ssl.c Wed May 6 00:31:58 2009 @@ -71,6 +71,8 @@ /* Include symbols from _socket module */ #include "socketmodule.h" +static PySocketModule_APIObject PySocketModule; + #if defined(HAVE_POLL_H) #include #elif defined(HAVE_SYS_POLL_H) @@ -1626,6 +1628,7 @@ PyInit__ssl(void) { PyObject *m, *d; + PySocketModule_APIObject *socket_api; if (PyType_Ready(&PySSL_Type) < 0) return NULL; @@ -1636,8 +1639,10 @@ d = PyModule_GetDict(m); /* Load _socket module and its C API */ - if (PySocketModule_ImportModuleAndAPI()) + socket_api = PySocketModule_ImportModuleAndAPI(); + if (!socket_api) return NULL; + PySocketModule = *socket_api; /* Init OpenSSL */ SSL_load_error_strings(); Modified: python/branches/py3k/Modules/_testcapimodule.c ============================================================================== --- python/branches/py3k/Modules/_testcapimodule.c (original) +++ python/branches/py3k/Modules/_testcapimodule.c Wed May 6 00:31:58 2009 @@ -1102,6 +1102,155 @@ } +/* Coverage testing of capsule objects. */ + +static const char *capsule_name = "capsule name"; +static char *capsule_pointer = "capsule pointer"; +static char *capsule_context = "capsule context"; +static const char *capsule_error = NULL; +static int +capsule_destructor_call_count = 0; + +static void +capsule_destructor(PyObject *o) { + capsule_destructor_call_count++; + if (PyCapsule_GetContext(o) != capsule_context) { + capsule_error = "context did not match in destructor!"; + } else if (PyCapsule_GetDestructor(o) != capsule_destructor) { + capsule_error = "destructor did not match in destructor! (woah!)"; + } else if (PyCapsule_GetName(o) != capsule_name) { + capsule_error = "name did not match in destructor!"; + } else if (PyCapsule_GetPointer(o, capsule_name) != capsule_pointer) { + capsule_error = "pointer did not match in destructor!"; + } +} + +typedef struct { + char *name; + char *module; + char *attribute; +} known_capsule; + +static PyObject * +test_capsule(PyObject *self, PyObject *args) +{ + PyObject *object; + const char *error = NULL; + void *pointer; + void *pointer2; + known_capsule known_capsules[] = { + #define KNOWN_CAPSULE(module, name) { module "." name, module, name } + KNOWN_CAPSULE("_socket", "CAPI"), + KNOWN_CAPSULE("_curses", "_C_API"), + KNOWN_CAPSULE("datetime", "datetime_CAPI"), + { NULL, NULL }, + }; + known_capsule *known = &known_capsules[0]; + +#define FAIL(x) { error = (x); goto exit; } + +#define CHECK_DESTRUCTOR \ + if (capsule_error) { \ + FAIL(capsule_error); \ + } \ + else if (!capsule_destructor_call_count) { \ + FAIL("destructor not called!"); \ + } \ + capsule_destructor_call_count = 0; \ + + object = PyCapsule_New(capsule_pointer, capsule_name, capsule_destructor); + PyCapsule_SetContext(object, capsule_context); + capsule_destructor(object); + CHECK_DESTRUCTOR; + Py_DECREF(object); + CHECK_DESTRUCTOR; + + object = PyCapsule_New(known, "ignored", NULL); + PyCapsule_SetPointer(object, capsule_pointer); + PyCapsule_SetName(object, capsule_name); + PyCapsule_SetDestructor(object, capsule_destructor); + PyCapsule_SetContext(object, capsule_context); + capsule_destructor(object); + CHECK_DESTRUCTOR; + /* intentionally access using the wrong name */ + pointer2 = PyCapsule_GetPointer(object, "the wrong name"); + if (!PyErr_Occurred()) { + FAIL("PyCapsule_GetPointer should have failed but did not!"); + } + PyErr_Clear(); + if (pointer2) { + if (pointer2 == capsule_pointer) { + FAIL("PyCapsule_GetPointer should not have" + " returned the internal pointer!"); + } else { + FAIL("PyCapsule_GetPointer should have " + "returned NULL pointer but did not!"); + } + } + PyCapsule_SetDestructor(object, NULL); + Py_DECREF(object); + if (capsule_destructor_call_count) { + FAIL("destructor called when it should not have been!"); + } + + for (known = &known_capsules[0]; known->module != NULL; known++) { + /* yeah, ordinarily I wouldn't do this either, + but it's fine for this test harness. + */ + static char buffer[256]; +#undef FAIL +#define FAIL(x) \ + { \ + sprintf(buffer, "%s module: \"%s\" attribute: \"%s\"", \ + x, known->module, known->attribute); \ + error = buffer; \ + goto exit; \ + } \ + + PyObject *module = PyImport_ImportModule(known->module); + if (module) { + pointer = PyCapsule_Import(known->name, 0); + if (!pointer) { + Py_DECREF(module); + FAIL("PyCapsule_GetPointer returned NULL unexpectedly!"); + } + object = PyObject_GetAttrString(module, known->attribute); + if (!object) { + Py_DECREF(module); + return NULL; + } + pointer2 = PyCapsule_GetPointer(object, + "weebles wobble but they don't fall down"); + if (!PyErr_Occurred()) { + Py_DECREF(object); + Py_DECREF(module); + FAIL("PyCapsule_GetPointer should have failed but did not!"); + } + PyErr_Clear(); + if (pointer2) { + Py_DECREF(module); + Py_DECREF(object); + if (pointer2 == pointer) { + FAIL("PyCapsule_GetPointer should not have" + " returned its internal pointer!"); + } else { + FAIL("PyCapsule_GetPointer should have" + " returned NULL pointer but did not!"); + } + } + Py_DECREF(object); + Py_DECREF(module); + } + } + + exit: + if (error) { + return raiseTestError("test_capsule", error); + } + Py_RETURN_NONE; +#undef FAIL +} + #ifdef HAVE_GETTIMEOFDAY /* Profiling of integer performance */ static void print_delta(int test, struct timeval *s, struct timeval *e) @@ -1280,9 +1429,10 @@ {"test_empty_argparse", (PyCFunction)test_empty_argparse,METH_NOARGS}, {"test_null_strings", (PyCFunction)test_null_strings, METH_NOARGS}, {"test_string_from_format", (PyCFunction)test_string_from_format, METH_NOARGS}, - {"test_string_to_double", (PyCFunction)test_string_to_double, METH_NOARGS}, {"test_with_docstring", (PyCFunction)test_with_docstring, METH_NOARGS, PyDoc_STR("This is a pretty normal docstring.")}, + {"test_string_to_double", (PyCFunction)test_string_to_double, METH_NOARGS}, + {"test_capsule", (PyCFunction)test_capsule, METH_NOARGS}, {"getargs_tuple", getargs_tuple, METH_VARARGS}, {"getargs_keywords", (PyCFunction)getargs_keywords, Modified: python/branches/py3k/Modules/cjkcodecs/cjkcodecs.h ============================================================================== --- python/branches/py3k/Modules/cjkcodecs/cjkcodecs.h (original) +++ python/branches/py3k/Modules/cjkcodecs/cjkcodecs.h Wed May 6 00:31:58 2009 @@ -239,6 +239,8 @@ static const MultibyteCodec *codec_list = \ (const MultibyteCodec *)_codec_list; + + static PyObject * getmultibytecodec(void) { @@ -284,7 +286,7 @@ return NULL; } - codecobj = PyCObject_FromVoidPtr((void *)codec, NULL); + codecobj = PyCapsule_New((void *)codec, PyMultibyteCodec_CAPSULE_NAME, NULL); if (codecobj == NULL) return NULL; @@ -309,7 +311,7 @@ int r; strcpy(mhname + sizeof("__map_") - 1, h->charset); r = PyModule_AddObject(module, mhname, - PyCObject_FromVoidPtr((void *)h, NULL)); + PyCapsule_New((void *)h, PyMultibyteCodec_CAPSULE_NAME, NULL)); if (r == -1) return -1; } @@ -364,14 +366,14 @@ o = PyObject_GetAttrString(mod, (char*)symbol); if (o == NULL) goto errorexit; - else if (!PyCObject_Check(o)) { + else if (!PyCapsule_IsValid(o, PyMultibyteCodec_CAPSULE_NAME)) { PyErr_SetString(PyExc_ValueError, - "map data must be a CObject."); + "map data must be a Capsule."); goto errorexit; } else { struct dbcs_map *map; - map = PyCObject_AsVoidPtr(o); + map = PyCapsule_GetPointer(o, PyMultibyteCodec_CAPSULE_NAME); if (encmap != NULL) *encmap = map->encmap; if (decmap != NULL) Modified: python/branches/py3k/Modules/cjkcodecs/multibytecodec.c ============================================================================== --- python/branches/py3k/Modules/cjkcodecs/multibytecodec.c (original) +++ python/branches/py3k/Modules/cjkcodecs/multibytecodec.c Wed May 6 00:31:58 2009 @@ -1793,12 +1793,12 @@ MultibyteCodecObject *self; MultibyteCodec *codec; - if (!PyCObject_Check(arg)) { + if (!PyCapsule_IsValid(arg, PyMultibyteCodec_CAPSULE_NAME)) { PyErr_SetString(PyExc_ValueError, "argument type invalid"); return NULL; } - codec = PyCObject_AsVoidPtr(arg); + codec = PyCapsule_GetPointer(arg, PyMultibyteCodec_CAPSULE_NAME); if (codec->codecinit != NULL && codec->codecinit(codec->config) != 0) return NULL; Modified: python/branches/py3k/Modules/cjkcodecs/multibytecodec.h ============================================================================== --- python/branches/py3k/Modules/cjkcodecs/multibytecodec.h (original) +++ python/branches/py3k/Modules/cjkcodecs/multibytecodec.h Wed May 6 00:31:58 2009 @@ -132,6 +132,9 @@ #define MBENC_FLUSH 0x0001 /* encode all characters encodable */ #define MBENC_MAX MBENC_FLUSH +#define PyMultibyteCodec_CAPSULE_NAME "multibytecodec.__map_*" + + #ifdef __cplusplus } #endif Modified: python/branches/py3k/Modules/datetimemodule.c ============================================================================== --- python/branches/py3k/Modules/datetimemodule.c (original) +++ python/branches/py3k/Modules/datetimemodule.c Wed May 6 00:31:58 2009 @@ -4792,11 +4792,10 @@ Py_INCREF(&PyDateTime_TZInfoType); PyModule_AddObject(m, "tzinfo", (PyObject *) &PyDateTime_TZInfoType); - x = PyCObject_FromVoidPtrAndDesc(&CAPI, (void*) DATETIME_API_MAGIC, - NULL); - if (x == NULL) - return NULL; - PyModule_AddObject(m, "datetime_CAPI", x); + x = PyCapsule_New(&CAPI, PyDateTime_CAPSULE_NAME, NULL); + if (x == NULL) + return NULL; + PyModule_AddObject(m, "datetime_CAPI", x); /* A 4-year cycle has an extra leap day over what we'd get from * pasting together 4 single years. Modified: python/branches/py3k/Modules/pyexpat.c ============================================================================== --- python/branches/py3k/Modules/pyexpat.c (original) +++ python/branches/py3k/Modules/pyexpat.c Wed May 6 00:31:58 2009 @@ -1987,8 +1987,8 @@ capi.SetUnknownEncodingHandler = XML_SetUnknownEncodingHandler; capi.SetUserData = XML_SetUserData; - /* export as cobject */ - capi_object = PyCObject_FromVoidPtr(&capi, NULL); + /* export using capsule */ + capi_object = PyCapsule_New(&capi, PyExpat_CAPSULE_NAME, NULL); if (capi_object) PyModule_AddObject(m, "expat_CAPI", capi_object); return m; Modified: python/branches/py3k/Modules/socketmodule.c ============================================================================== --- python/branches/py3k/Modules/socketmodule.c (original) +++ python/branches/py3k/Modules/socketmodule.c Wed May 6 00:31:58 2009 @@ -4146,6 +4146,14 @@ NULL }; +PySocketModule_APIObject * +PySocketModule_ImportModuleAndAPI(void) +{ + void *api; + api = PyCapsule_Import(PySocket_CAPSULE_NAME, 1);; + return (PySocketModule_APIObject *)api; +} + /* Initialize the _socket module. @@ -4231,7 +4239,7 @@ /* Export C API */ if (PyModule_AddObject(m, PySocket_CAPI_NAME, - PyCObject_FromVoidPtr((void *)&PySocketModuleAPI, NULL) + PyCapsule_New(&PySocketModuleAPI, PySocket_CAPSULE_NAME, NULL) ) != 0) return NULL; Modified: python/branches/py3k/Modules/socketmodule.h ============================================================================== --- python/branches/py3k/Modules/socketmodule.h (original) +++ python/branches/py3k/Modules/socketmodule.h Wed May 6 00:31:58 2009 @@ -78,6 +78,7 @@ /* Python module and C API name */ #define PySocket_MODULE_NAME "_socket" #define PySocket_CAPI_NAME "CAPI" +#define PySocket_CAPSULE_NAME PySocket_MODULE_NAME "." PySocket_CAPI_NAME /* Abstract the socket file descriptor type */ #ifdef MS_WINDOWS @@ -142,12 +143,12 @@ the _socket module. Since cross-DLL linking introduces a lot of problems on many platforms, the "trick" is to wrap the C API of a module in a struct which then gets exported to - other modules via a PyCObject. + other modules via a PyCapsule. The code in socketmodule.c defines this struct (which currently only contains the type object reference, but could very well also include other C APIs needed by other modules) - and exports it as PyCObject via the module dictionary + and exports it as PyCapsule via the module dictionary under the name "CAPI". Other modules can now include the socketmodule.h file @@ -212,49 +213,11 @@ ... */ -static -PySocketModule_APIObject PySocketModule; - /* You *must* call this before using any of the functions in PySocketModule and check its outcome; otherwise all accesses will result in a segfault. Returns 0 on success. */ -#ifndef DPRINTF -# define DPRINTF if (0) printf -#endif - -static -int PySocketModule_ImportModuleAndAPI(void) -{ - PyObject *mod = 0, *v = 0; - char *apimodule = PySocket_MODULE_NAME; - char *apiname = PySocket_CAPI_NAME; - void *api; - - DPRINTF("Importing the %s C API...\n", apimodule); - mod = PyImport_ImportModuleNoBlock(apimodule); - if (mod == NULL) - goto onError; - DPRINTF(" %s package found\n", apimodule); - v = PyObject_GetAttrString(mod, apiname); - if (v == NULL) - goto onError; - Py_DECREF(mod); - DPRINTF(" API object %s found\n", apiname); - api = PyCObject_AsVoidPtr(v); - if (api == NULL) - goto onError; - Py_DECREF(v); - memcpy(&PySocketModule, api, sizeof(PySocketModule)); - DPRINTF(" API object loaded and initialized.\n"); - return 0; - - onError: - DPRINTF(" not found.\n"); - Py_XDECREF(mod); - Py_XDECREF(v); - return -1; -} +PyAPI_FUNC(PySocketModule_APIObject *) PySocketModule_ImportModuleAndAPI(void); #endif /* !PySocket_BUILDING_SOCKET */ Modified: python/branches/py3k/Modules/unicodedata.c ============================================================================== --- python/branches/py3k/Modules/unicodedata.c (original) +++ python/branches/py3k/Modules/unicodedata.c Wed May 6 00:31:58 2009 @@ -1275,7 +1275,7 @@ PyModule_AddObject(m, "ucd_3_2_0", v); /* Export C API */ - v = PyCObject_FromVoidPtr((void *) &hashAPI, NULL); + v = PyCapsule_New((void *)&hashAPI, PyUnicodeData_CAPSULE_NAME, NULL); if (v != NULL) PyModule_AddObject(m, "ucnhash_CAPI", v); return m; Added: python/branches/py3k/Objects/capsule.c ============================================================================== --- (empty file) +++ python/branches/py3k/Objects/capsule.c Wed May 6 00:31:58 2009 @@ -0,0 +1,324 @@ +/* Wrap void * pointers to be passed between C modules */ + +#include "Python.h" + +/* Internal structure of PyCapsule */ +typedef struct { + PyObject_HEAD + void *pointer; + const char *name; + void *context; + PyCapsule_Destructor destructor; +} PyCapsule; + + + +static int +_is_legal_capsule(PyCapsule *capsule, const char *invalid_capsule) +{ + if (!capsule || !PyCapsule_CheckExact(capsule) || capsule->pointer == NULL) { + PyErr_SetString(PyExc_ValueError, invalid_capsule); + return 0; + } + return 1; +} + +#define is_legal_capsule(capsule, name) \ + (_is_legal_capsule(capsule, \ + name " called with invalid PyCapsule object")) + + +static int +name_matches(const char *name1, const char *name2) { + /* if either is NULL, */ + if (!name1 || !name2) { + /* they're only the same if they're both NULL. */ + return name2 == name2; + } + return !strcmp(name1, name2); +} + + + +PyObject * +PyCapsule_New(void *pointer, const char *name, PyCapsule_Destructor destructor) +{ + PyCapsule *capsule; + + if (!pointer) { + PyErr_SetString(PyExc_ValueError, "PyCapsule_New called with null pointer"); + return NULL; + } + + capsule = PyObject_NEW(PyCapsule, &PyCapsule_Type); + if (capsule == NULL) { + return NULL; + } + + capsule->pointer = pointer; + capsule->name = name; + capsule->context = NULL; + capsule->destructor = destructor; + + return (PyObject *)capsule; +} + + +int +PyCapsule_IsValid(PyObject *o, const char *name) +{ + PyCapsule *capsule = (PyCapsule *)o; + + return (capsule != NULL && + PyCapsule_CheckExact(capsule) && + capsule->pointer != NULL && + name_matches(capsule->name, name)); +} + + +void * +PyCapsule_GetPointer(PyObject *o, const char *name) +{ + PyCapsule *capsule = (PyCapsule *)o; + + if (!is_legal_capsule(capsule, "PyCapsule_GetPointer")) { + return NULL; + } + + if (!name_matches(name, capsule->name)) { + PyErr_SetString(PyExc_ValueError, "PyCapsule_GetPointer called with incorrect name"); + return NULL; + } + + return capsule->pointer; +} + + +const char * +PyCapsule_GetName(PyObject *o) +{ + PyCapsule *capsule = (PyCapsule *)o; + + if (!is_legal_capsule(capsule, "PyCapsule_GetName")) { + return NULL; + } + return capsule->name; +} + + +PyCapsule_Destructor +PyCapsule_GetDestructor(PyObject *o) +{ + PyCapsule *capsule = (PyCapsule *)o; + + if (!is_legal_capsule(capsule, "PyCapsule_GetDestructor")) { + return NULL; + } + return capsule->destructor; +} + + +void * +PyCapsule_GetContext(PyObject *o) +{ + PyCapsule *capsule = (PyCapsule *)o; + + if (!is_legal_capsule(capsule, "PyCapsule_GetContext")) { + return NULL; + } + return capsule->context; +} + + +int +PyCapsule_SetPointer(PyObject *o, void *pointer) +{ + PyCapsule *capsule = (PyCapsule *)o; + + if (!pointer) { + PyErr_SetString(PyExc_ValueError, "PyCapsule_SetPointer called with null pointer"); + return -1; + } + + if (!is_legal_capsule(capsule, "PyCapsule_SetPointer")) { + return -1; + } + + capsule->pointer = pointer; + return 0; +} + + +int +PyCapsule_SetName(PyObject *o, const char *name) +{ + PyCapsule *capsule = (PyCapsule *)o; + + if (!is_legal_capsule(capsule, "PyCapsule_SetName")) { + return -1; + } + + capsule->name = name; + return 0; +} + + +int +PyCapsule_SetDestructor(PyObject *o, PyCapsule_Destructor destructor) +{ + PyCapsule *capsule = (PyCapsule *)o; + + if (!is_legal_capsule(capsule, "PyCapsule_SetDestructor")) { + return -1; + } + + capsule->destructor = destructor; + return 0; +} + + +int +PyCapsule_SetContext(PyObject *o, void *context) +{ + PyCapsule *capsule = (PyCapsule *)o; + + if (!is_legal_capsule(capsule, "PyCapsule_SetContext")) { + return -1; + } + + capsule->context = context; + return 0; +} + + +void * +PyCapsule_Import(const char *name, int no_block) +{ + PyObject *object = NULL; + void *return_value = NULL; + char *trace; + int name_length = (strlen(name) + 1) * sizeof(char); + char *name_dup = (char *)PyMem_MALLOC(name_length); + + if (!name_dup) { + return NULL; + } + + memcpy(name_dup, name, name_length); + + trace = name_dup; + while (trace) { + char *dot = strchr(trace, '.'); + if (dot) { + *dot++ = '\0'; + } + + if (object == NULL) { + if (no_block) { + object = PyImport_ImportModuleNoBlock(trace); + } else { + object = PyImport_ImportModule(trace); + if (!object) { + PyErr_Format(PyExc_ImportError, "PyCapsule_Import could not import module \"%s\"", trace); + } + } + } else { + PyObject *object2 = PyObject_GetAttrString(object, trace); + Py_DECREF(object); + object = object2; + } + if (!object) { + goto EXIT; + } + + trace = dot; + } + + /* compare attribute name to module.name by hand */ + if (PyCapsule_IsValid(object, name)) { + PyCapsule *capsule = (PyCapsule *)object; + return_value = capsule->pointer; + } else { + PyErr_Format(PyExc_AttributeError, + "PyCapsule_Import \"%s\" is not valid", + name); + } + +EXIT: + Py_XDECREF(object); + if (name_dup) { + PyMem_FREE(name_dup); + } + return return_value; +} + + +static void +capsule_dealloc(PyObject *o) +{ + PyCapsule *capsule = (PyCapsule *)o; + if (capsule->destructor) { + capsule->destructor(o); + } + PyObject_DEL(o); +} + + +static PyObject * +capsule_repr(PyObject *o) +{ + PyCapsule *capsule = (PyCapsule *)o; + const char *name; + const char *quote; + + if (capsule->name) { + quote = "\""; + name = capsule->name; + } else { + quote = ""; + name = "NULL"; + } + + return PyUnicode_FromFormat("", + quote, name, quote, capsule); +} + + + +PyDoc_STRVAR(PyCapsule_Type__doc__, +"Capsule objects let you wrap a C \"void *\" pointer in a Python\n\ +object. They're a way of passing data through the Python interpreter\n\ +without creating your own custom type.\n\ +\n\ +Capsules are used for communication between extension modules.\n\ +They provide a way for an extension module to export a C interface\n\ +to other extension modules, so that extension modules can use the\n\ +Python import mechanism to link to one another.\n\ +"); + +PyTypeObject PyCapsule_Type = { + PyVarObject_HEAD_INIT(&PyType_Type, 0) + "PyCapsule", /*tp_name*/ + sizeof(PyCapsule), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + /* methods */ + capsule_dealloc, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_reserved*/ + capsule_repr, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash*/ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + 0, /*tp_flags*/ + PyCapsule_Type__doc__ /*tp_doc*/ +}; + + Modified: python/branches/py3k/Objects/object.c ============================================================================== --- python/branches/py3k/Objects/object.c (original) +++ python/branches/py3k/Objects/object.c Wed May 6 00:31:58 2009 @@ -1716,11 +1716,14 @@ #endif - /* Hack to force loading of cobject.o */ PyTypeObject *_Py_cobject_hack = &PyCObject_Type; +/* Hack to force loading of pycapsule.o */ +PyTypeObject *_PyCapsule_hack = &PyCapsule_Type; + + /* Hack to force loading of abstract.o */ Py_ssize_t (*_Py_abstract_hack)(PyObject *) = PyObject_Size; Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Wed May 6 00:31:58 2009 @@ -3381,16 +3381,7 @@ message = "malformed \\N character escape"; if (ucnhash_CAPI == NULL) { /* load the unicode data module */ - PyObject *m, *api; - m = PyImport_ImportModuleNoBlock("unicodedata"); - if (m == NULL) - goto ucnhashError; - api = PyObject_GetAttrString(m, "ucnhash_CAPI"); - Py_DECREF(m); - if (api == NULL) - goto ucnhashError; - ucnhash_CAPI = (_PyUnicode_Name_CAPI *)PyCObject_AsVoidPtr(api); - Py_DECREF(api); + ucnhash_CAPI = (_PyUnicode_Name_CAPI *)PyCapsule_Import(PyUnicodeData_CAPSULE_NAME, 1); if (ucnhash_CAPI == NULL) goto ucnhashError; } Modified: python/branches/py3k/PC/os2emx/python27.def ============================================================================== --- python/branches/py3k/PC/os2emx/python27.def (original) +++ python/branches/py3k/PC/os2emx/python27.def Wed May 6 00:31:58 2009 @@ -209,6 +209,19 @@ "PyInstance_Type" "PyMethod_Type" +; From python26_s.lib(capsule) + "PyCapsule_GetContext" + "PyCapsule_GetDestructor" + "PyCapsule_GetName" + "PyCapsule_GetPointer" + "PyCapsule_Import" + "PyCapsule_IsValid" + "PyCapsule_New" + "PyCapsule_SetContext" + "PyCapsule_SetDestructor" + "PyCapsule_SetName" + "PyCapsule_SetPointer" + ; From python26_s.lib(cobject) "PyCObject_FromVoidPtr" "PyCObject_FromVoidPtrAndDesc" Modified: python/branches/py3k/PC/os2vacpp/python.def ============================================================================== --- python/branches/py3k/PC/os2vacpp/python.def (original) +++ python/branches/py3k/PC/os2vacpp/python.def Wed May 6 00:31:58 2009 @@ -6,6 +6,7 @@ EXPORTS ; Data PyCFunction_Type + PyCapsule_Type PyCObject_Type PyClass_Type PyCode_Type @@ -73,7 +74,7 @@ _Py_TrueStruct _Py_ZeroStruct _Py_abstract_hack - _Py_cobject_hack + _Py_capsule_hack _Py_re_syntax _Py_re_syntax_table @@ -87,6 +88,17 @@ PyCFunction_GetFunction PyCFunction_GetSelf PyCFunction_New + PyCapsule_GetContext + PyCapsule_GetDestructor + PyCapsule_GetName + PyCapsule_GetPointer + PyCapsule_Import + PyCapsule_IsValid + PyCapsule_New + PyCapsule_SetContext + PyCapsule_SetDestructor + PyCapsule_SetName + PyCapsule_SetPointer PyCObject_AsVoidPtr PyCObject_FromVoidPtrAndDesc PyCObject_FromVoidPtr Modified: python/branches/py3k/PCbuild/pythoncore.vcproj ============================================================================== --- python/branches/py3k/PCbuild/pythoncore.vcproj (original) +++ python/branches/py3k/PCbuild/pythoncore.vcproj Wed May 6 00:31:58 2009 @@ -846,6 +846,7 @@ RelativePath="..\Include\pyarena.h" > + @@ -1374,6 +1375,10 @@ RelativePath="..\Objects\bytesobject.c" > + + Modified: python/branches/py3k/Python/compile.c ============================================================================== --- python/branches/py3k/Python/compile.c (original) +++ python/branches/py3k/Python/compile.c Wed May 6 00:31:58 2009 @@ -190,6 +190,8 @@ static PyCodeObject *assemble(struct compiler *, int addNone); static PyObject *__doc__; +#define COMPILER_CAPSULE_NAME_COMPILER_UNIT "compile.c compiler unit" + PyObject * _Py_Mangle(PyObject *privateobj, PyObject *ident) { @@ -506,13 +508,13 @@ /* Push the old compiler_unit on the stack. */ if (c->u) { - PyObject *wrapper = PyCObject_FromVoidPtr(c->u, NULL); - if (!wrapper || PyList_Append(c->c_stack, wrapper) < 0) { - Py_XDECREF(wrapper); + PyObject *capsule = PyCapsule_New(c->u, COMPILER_CAPSULE_NAME_COMPILER_UNIT, NULL); + if (!capsule || PyList_Append(c->c_stack, capsule) < 0) { + Py_XDECREF(capsule); compiler_unit_free(u); return 0; } - Py_DECREF(wrapper); + Py_DECREF(capsule); u->u_private = c->u->u_private; Py_XINCREF(u->u_private); } @@ -529,15 +531,15 @@ compiler_exit_scope(struct compiler *c) { int n; - PyObject *wrapper; + PyObject *capsule; c->c_nestlevel--; compiler_unit_free(c->u); /* Restore c->u to the parent unit. */ n = PyList_GET_SIZE(c->c_stack) - 1; if (n >= 0) { - wrapper = PyList_GET_ITEM(c->c_stack, n); - c->u = (struct compiler_unit *)PyCObject_AsVoidPtr(wrapper); + capsule = PyList_GET_ITEM(c->c_stack, n); + c->u = (struct compiler_unit *)PyCapsule_GetPointer(capsule, COMPILER_CAPSULE_NAME_COMPILER_UNIT); assert(c->u); /* we are deleting from a list so this really shouldn't fail */ if (PySequence_DelItem(c->c_stack, n) < 0) Modified: python/branches/py3k/Python/getargs.c ============================================================================== --- python/branches/py3k/Python/getargs.c (original) +++ python/branches/py3k/Python/getargs.c Wed May 6 00:31:58 2009 @@ -139,22 +139,33 @@ /* Handle cleanup of allocated memory in case of exception */ +#define GETARGS_CAPSULE_NAME_CLEANUP_PTR "getargs.cleanup_ptr" +#define GETARGS_CAPSULE_NAME_CLEANUP_BUFFER "getargs.cleanup_buffer" + static void -cleanup_ptr(void *ptr) +cleanup_ptr(PyObject *self) { - PyMem_FREE(ptr); + void *ptr = PyCapsule_GetPointer(self, GETARGS_CAPSULE_NAME_CLEANUP_PTR); + if (ptr) { + PyMem_FREE(ptr); + } } static void -cleanup_buffer(void *ptr) +cleanup_buffer(PyObject *self) { - PyBuffer_Release((Py_buffer *) ptr); + Py_buffer *ptr = (Py_buffer *)PyCapsule_GetPointer(self, GETARGS_CAPSULE_NAME_CLEANUP_BUFFER); + if (ptr) { + PyBuffer_Release(ptr); + } } static int -addcleanup(void *ptr, PyObject **freelist, void (*destr)(void *)) +addcleanup(void *ptr, PyObject **freelist, PyCapsule_Destructor destr) { PyObject *cobj; + const char *name; + if (!*freelist) { *freelist = PyList_New(0); if (!*freelist) { @@ -162,7 +173,15 @@ return -1; } } - cobj = PyCObject_FromVoidPtr(ptr, destr); + + if (destr == cleanup_ptr) { + name = GETARGS_CAPSULE_NAME_CLEANUP_PTR; + } else if (destr == cleanup_buffer) { + name = GETARGS_CAPSULE_NAME_CLEANUP_BUFFER; + } else { + return -1; + } + cobj = PyCapsule_New(ptr, name, destr); if (!cobj) { destr(ptr); return -1; @@ -183,8 +202,7 @@ don't get called. */ Py_ssize_t len = PyList_GET_SIZE(freelist), i; for (i = 0; i < len; i++) - ((PyCObject *) PyList_GET_ITEM(freelist, i)) - ->destructor = NULL; + PyCapsule_SetDestructor(PyList_GET_ITEM(freelist, i), NULL); } Py_XDECREF(freelist); return retval; From python-checkins at python.org Wed May 6 00:43:21 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 6 May 2009 00:43:21 +0200 (CEST) Subject: [Python-checkins] r72364 - python/branches/py3k/Doc/c-api/capsule.rst Message-ID: <20090505224321.B04761E4013@bag.python.org> Author: benjamin.peterson Date: Wed May 6 00:43:21 2009 New Revision: 72364 Log: edits Modified: python/branches/py3k/Doc/c-api/capsule.rst Modified: python/branches/py3k/Doc/c-api/capsule.rst ============================================================================== --- python/branches/py3k/Doc/c-api/capsule.rst (original) +++ python/branches/py3k/Doc/c-api/capsule.rst Wed May 6 00:43:21 2009 @@ -33,107 +33,94 @@ Return true if its argument is a :ctype:`PyCapsule`. + .. cfunction:: PyObject* PyCapsule_New(void* pointer, const char* name, PyCapsule_Destructor destructor) Create a :ctype:`PyCapsule` encapsulating the *pointer*. The *pointer* argument may not be *NULL*. - The *name* string may either be *NULL* or a pointer to a valid - C string. If non-*NULL*, this string must outlive the capsule. - (Though it is permitted to free it inside the *destructor*.) - - If the *destructor* argument is not *NULL*, - it will be called with the capsule ``PyObject *`` when it is destroyed. - - If this capsule will be stored as an attribute of a module, it - is strongly suggested that the *name* string be specified as:: - - modulename.attributename - - This will enable other modules to import the capsule - using :cfunc:`PyCapsule_Import`. - - Return a valid capsule on success. On failure, set an exception and return *NULL*. + The *name* string may either be *NULL* or a pointer to a valid C string. If + non-*NULL*, this string must outlive the capsule. (Though it is permitted to + free it inside the *destructor*.) + + If the *destructor* argument is not *NULL*, it will be called with the + capsule when it is destroyed. + + If this capsule will be stored as an attribute of a module, the *name* should + be specified as ``modulename.attributename``. This will enable other modules + to import the capsule using :cfunc:`PyCapsule_Import`. + .. cfunction:: void* PyCapsule_GetPointer(PyObject* capsule, const char* name) - Retrieve the *pointer* stored in the capsule. + Retrieve the *pointer* stored in the capsule. On failure, set an exception + and return *NULL*. The *name* parameter must compare exactly to the name stored in the capsule. - If the name stored in the capsule is *NULL*, the *name* passed in must - also be *NULL*. If the name stored in the capsule is non-*NULL*, - the *name* passed in must also be non-*NULL*, and must match the name - stored in the capsule. Python uses the C function *strcmp* to compare - capsule names. - - Return the internal *pointer* on success. - On failure, set an exception and return *NULL*. + If the name stored in the capsule is *NULL*, the *name* passed in must also + be *NULL*. Python uses the C function :cfunc:`strcmp` to compare capsule + names. .. cfunction:: PyCapsule_Destructor PyCapsule_GetDestructor(PyObject* capsule) - Return the current *destructor* stored in the capsule. - On failure, set an exception and return *NULL*. + Return the current destructor stored in the capsule. On failure, set an + exception and return *NULL*. - It is legal for a capsule to have a *NULL* destructor. - This makes a *NULL* return code somewhat ambiguous; - use :cfunc:`PyCapsule_IsValid` or :cfunc:`PyErr_Occurred` to disambugate. + It is legal for a capsule to have a *NULL* destructor. This makes a *NULL* + return code somewhat ambiguous; use :cfunc:`PyCapsule_IsValid` or + :cfunc:`PyErr_Occurred` to disambugate. .. cfunction:: void* PyCapsule_GetContext(PyObject* capsule) - Return the current *context* stored in the capsule. - On failure, set an exception and return *NULL*. + Return the current context stored in the capsule. On failure, set an + exception and return *NULL*. - It is legal for a capsule to have a *NULL* context. - This makes a *NULL* return code somewhat ambiguous; - use :cfunc:`PyCapsule_IsValid` or :cfunc:`PyErr_Occurred` to disambugate. + It is legal for a capsule to have a *NULL* context. This makes a *NULL* + return code somewhat ambiguous; use :cfunc:`PyCapsule_IsValid` or + :cfunc:`PyErr_Occurred` to disambugate. .. cfunction:: const char* PyCapsule_GetName(PyObject* capsule) - Return the current *name* stored in the capsule. - On failure, set an exception and return *NULL*. + Return the current name stored in the capsule. On failure, set an exception + and return *NULL*. - It is legal for a capsule to have a *NULL* name. - This makes a *NULL* return code somewhat ambiguous; - use :cfunc:`PyCapsule_IsValid` or :cfunc:`PyErr_Occurred` to disambugate. + It is legal for a capsule to have a *NULL* name. This makes a *NULL* return + code somewhat ambiguous; use :cfunc:`PyCapsule_IsValid` or + :cfunc:`PyErr_Occurred` to disambugate. .. cfunction:: void* PyCapsule_Import(const char* name, int no_block) - Import a pointer to a C object from a ``capsule`` attribute in a module. - The *name* parameter should specify the full name to the attribute, as - in *"module.attribute"*. - The *name* stored in the capsule must match this string exactly. - If *no_block* is true, import the module without blocking - (using :cfunc:`PyImport_ImportModuleNoBlock`). - If *no_block* is false, import the module conventionally - (using :cfunc:`PyImport_ImportModule`). - - Return the capsule's internal *pointer* on success. - On failure, set an exception and return *NULL*. - Exception: if *PyCapsule_Import* failed to import the module, - and *no_block* was true, no exception is set. + Import a pointer to a C object from a ``capsule`` attribute in a module. The + *name* parameter should specify the full name to the attribute, as in + ``module.attribute``. The *name* stored in the capsule must match this + string exactly. If *no_block* is true, import the module without blocking + (using :cfunc:`PyImport_ImportModuleNoBlock`). If *no_block* is false, + import the module conventionally (using :cfunc:`PyImport_ImportModule`). + + Return the capsule's internal *pointer* on success. On failure, set an + exception and return *NULL*. However, if :cfunc:`PyCapsule_Import` failed to + import the module, and *no_block* was true, no exception is set. .. cfunction:: int PyCapsule_IsValid(PyObject* capsule, const char* name) - Determines whether or not a :ctype:`PyObject \*` is a valid capsule. - A valid capsule is non-*NULL*, passes :cfunc:`PyCapsule_CheckExact`, - has a non-NULL *pointer*, and its internal name matches the - *name* parameter. (See :cfunc:`PyCapsule_GetPointer` for - information on how capsule names are compared.) - - In other words, if :cfunc:`PyCapsule_IsValid` returns a true value, - calls to any of the accessors (any function starting - with :cfunc:`PyCapsule_Get`) are guaranteed to succeed. - - Return a nonzero value if the object is valid and matches the name - passed in. - Return 0 otherwise. - This function will not fail. + Determines whether or not *capsule* is a valid capsule. A valid capsule is + non-*NULL*, passes :cfunc:`PyCapsule_CheckExact`, has a non-NULL pointer + stored in it, and its internal name matches the *name* parameter. (See + :cfunc:`PyCapsule_GetPointer` for information on how capsule names are + compared.) + + In other words, if :cfunc:`PyCapsule_IsValid` returns a true value, calls to + any of the accessors (any function starting with :cfunc:`PyCapsule_Get`) are + guaranteed to succeed. + + Return a nonzero value if the object is valid and matches the name passed in. + Return 0 otherwise. This function will not fail. .. cfunction:: int PyCapsule_SetContext(PyObject* capsule, void* context) @@ -142,27 +129,24 @@ Return 0 on success. Return nonzero and set an exception on failure. -.. cfunction:: int PyCapsule_SetDestructor(PyObject* capsule, void (*)(PyObject *) destructor) +.. cfunction:: int PyCapsule_SetDestructor(PyObject* capsule, PyCapsule_Destructor destructor) Set the destructor inside *capsule* to *destructor*. - Return 0 on success. - Return nonzero and set an exception on failure. + Return 0 on success. Return nonzero and set an exception on failure. .. cfunction:: int PyCapsule_SetName(PyObject* capsule, const char* name) - Set the name inside *capsule* to *name*. If non-*NULL*, the name - must outlive the capsule. If the previous *name* stored in the - capsule was not *NULL*, no attempt is made to free it. + Set the name inside *capsule* to *name*. If non-*NULL*, the name must + outlive the capsule. If the previous *name* stored in the capsule was not + *NULL*, no attempt is made to free it. - Return 0 on success. - Return nonzero and set an exception on failure. + Return 0 on success. Return nonzero and set an exception on failure. .. cfunction:: int PyCapsule_SetPointer(PyObject* capsule, void* pointer) - Set the void pointer inside *capsule* to *pointer*. The pointer - may not be *NULL*. + Set the void pointer inside *capsule* to *pointer*. The pointer may not be + *NULL*. - Return 0 on success. - Return nonzero and set an exception on failure. + Return 0 on success. Return nonzero and set an exception on failure. From python-checkins at python.org Wed May 6 00:49:38 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 6 May 2009 00:49:38 +0200 (CEST) Subject: [Python-checkins] r72365 - python/branches/py3k/Lib/test/test__locale.py Message-ID: <20090505224939.001F21E4013@bag.python.org> Author: benjamin.peterson Date: Wed May 6 00:49:38 2009 New Revision: 72365 Log: fix test__locale on windows #5643 Modified: python/branches/py3k/Lib/test/test__locale.py Modified: python/branches/py3k/Lib/test/test__locale.py ============================================================================== --- python/branches/py3k/Lib/test/test__locale.py (original) +++ python/branches/py3k/Lib/test/test__locale.py Wed May 6 00:49:38 2009 @@ -1,8 +1,12 @@ from test.support import verbose, run_unittest -import _locale -from _locale import (setlocale, LC_ALL, LC_CTYPE, LC_NUMERIC, nl_langinfo, - localeconv, Error) +from _locale import (setlocale, LC_ALL, LC_CTYPE, LC_NUMERIC, localeconv, Error) +try: + from _locale import (RADIXCHAR, THOUSEP, nl_langinfo) +except ImportError: + nl_langinfo = None + import unittest +import sys from platform import uname if uname()[0] == "Darwin": @@ -21,15 +25,18 @@ 'eu_ES', 'vi_VN', 'af_ZA', 'nb_NO', 'en_DK', 'tg_TJ', 'en_US', 'es_ES.ISO8859-1', 'fr_FR.ISO8859-15', 'ru_RU.KOI8-R', 'ko_KR.eucKR'] +# Workaround for MSVC6(debug) crash bug +if "MSC v.1200" in sys.version: + def accept(loc): + a = loc.split(".") + return not(len(a) == 2 and len(a[-1]) >= 9) + candidate_locales = [loc for loc in candidate_locales if accept(loc)] + # List known locale values to test against when available. # Dict formatted as `` : (, )``. If a # value is not known, use '' . known_numerics = {'fr_FR' : (',', ''), 'en_US':('.', ',')} -def needs_radix_and_thousands(func): - return unittest.skipUnless(hasattr(_locale, "RADIXCHAR"), - "needs RADIXCHAR and THOUSEP")(func) - class _LocaleTests(unittest.TestCase): def setUp(self): @@ -58,7 +65,7 @@ calc_type, data_type, set_locale, used_locale)) - @needs_radix_and_thousands + @unittest.skipUnless(nl_langinfo, "nl_langinfo is not available") def test_lc_numeric_nl_langinfo(self): # Test nl_langinfo against known values for loc in candidate_locales: @@ -67,11 +74,10 @@ setlocale(LC_CTYPE, loc) except Error: continue - for li, lc in ((_locale.RADIXCHAR, "decimal_point"), - (_locale.THOUSEP, "thousands_sep")): + for li, lc in ((RADIXCHAR, "decimal_point"), + (THOUSEP, "thousands_sep")): self.numeric_tester('nl_langinfo', nl_langinfo(li), lc, loc) - @needs_radix_and_thousands def test_lc_numeric_localeconv(self): # Test localeconv against known values for loc in candidate_locales: @@ -80,11 +86,11 @@ setlocale(LC_CTYPE, loc) except Error: continue - for li, lc in ((_locale.RADIXCHAR, "decimal_point"), - (_locale.THOUSEP, "thousands_sep")): + for lc in ("decimal_point", + "thousands_sep"): self.numeric_tester('localeconv', localeconv()[lc], lc, loc) - @needs_radix_and_thousands + @unittest.skipUnless(nl_langinfo, "nl_langinfo is not available") def test_lc_numeric_basic(self): # Test nl_langinfo against localeconv for loc in candidate_locales: @@ -93,8 +99,8 @@ setlocale(LC_CTYPE, loc) except Error: continue - for li, lc in ((_locale.RADIXCHAR, "decimal_point"), - (_locale.THOUSEP, "thousands_sep")): + for li, lc in ((RADIXCHAR, "decimal_point"), + (THOUSEP, "thousands_sep")): nl_radixchar = nl_langinfo(li) li_radixchar = localeconv()[lc] try: From nnorwitz at gmail.com Wed May 6 00:29:15 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 5 May 2009 18:29:15 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090505222915.GA29714@python.psfb.org> More important issues: ---------------------- test_warnings leaked [60, 0, 0] references, sum=60 Less important issues: ---------------------- test_asynchat leaked [128, -128, 0] references, sum=0 test_cmd_line leaked [-25, 0, 0] references, sum=-25 test_docxmlrpc leaked [-33, 0, 0] references, sum=-33 test_popen2 leaked [54, -29, 29] references, sum=54 test_smtplib leaked [95, -101, 94] references, sum=88 test_socketserver leaked [83, 1, -84] references, sum=0 test_sys leaked [42, 0, 0] references, sum=42 test_threadedtempfile leaked [-102, 0, 101] references, sum=-1 test_threading leaked [48, 44, 52] references, sum=144 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 test_xmlrpc leaked [-281, 0, 81] references, sum=-200 From python-checkins at python.org Wed May 6 00:53:19 2009 From: python-checkins at python.org (georg.brandl) Date: Wed, 6 May 2009 00:53:19 +0200 (CEST) Subject: [Python-checkins] r72366 - python/branches/py3k/Doc/c-api/capsule.rst Message-ID: <20090505225319.C39751E4013@bag.python.org> Author: georg.brandl Date: Wed May 6 00:53:19 2009 New Revision: 72366 Log: Small style edits. Modified: python/branches/py3k/Doc/c-api/capsule.rst Modified: python/branches/py3k/Doc/c-api/capsule.rst ============================================================================== --- python/branches/py3k/Doc/c-api/capsule.rst (original) +++ python/branches/py3k/Doc/c-api/capsule.rst Wed May 6 00:53:19 2009 @@ -34,7 +34,7 @@ Return true if its argument is a :ctype:`PyCapsule`. -.. cfunction:: PyObject* PyCapsule_New(void* pointer, const char* name, PyCapsule_Destructor destructor) +.. cfunction:: PyObject* PyCapsule_New(void *pointer, const char *name, PyCapsule_Destructor destructor) Create a :ctype:`PyCapsule` encapsulating the *pointer*. The *pointer* argument may not be *NULL*. @@ -46,16 +46,16 @@ free it inside the *destructor*.) If the *destructor* argument is not *NULL*, it will be called with the - capsule when it is destroyed. + capsule as its argument when it is destroyed. If this capsule will be stored as an attribute of a module, the *name* should be specified as ``modulename.attributename``. This will enable other modules to import the capsule using :cfunc:`PyCapsule_Import`. -.. cfunction:: void* PyCapsule_GetPointer(PyObject* capsule, const char* name) +.. cfunction:: void* PyCapsule_GetPointer(PyObject *capsule, const char *name) - Retrieve the *pointer* stored in the capsule. On failure, set an exception + Retrieve the *pointer* stored in the capsule. On failure, set an exception and return *NULL*. The *name* parameter must compare exactly to the name stored in the capsule. @@ -64,7 +64,7 @@ names. -.. cfunction:: PyCapsule_Destructor PyCapsule_GetDestructor(PyObject* capsule) +.. cfunction:: PyCapsule_Destructor PyCapsule_GetDestructor(PyObject *capsule) Return the current destructor stored in the capsule. On failure, set an exception and return *NULL*. @@ -74,7 +74,7 @@ :cfunc:`PyErr_Occurred` to disambugate. -.. cfunction:: void* PyCapsule_GetContext(PyObject* capsule) +.. cfunction:: void* PyCapsule_GetContext(PyObject *capsule) Return the current context stored in the capsule. On failure, set an exception and return *NULL*. @@ -84,7 +84,7 @@ :cfunc:`PyErr_Occurred` to disambugate. -.. cfunction:: const char* PyCapsule_GetName(PyObject* capsule) +.. cfunction:: const char* PyCapsule_GetName(PyObject *capsule) Return the current name stored in the capsule. On failure, set an exception and return *NULL*. @@ -94,9 +94,9 @@ :cfunc:`PyErr_Occurred` to disambugate. -.. cfunction:: void* PyCapsule_Import(const char* name, int no_block) +.. cfunction:: void* PyCapsule_Import(const char *name, int no_block) - Import a pointer to a C object from a ``capsule`` attribute in a module. The + Import a pointer to a C object from a capsule attribute in a module. The *name* parameter should specify the full name to the attribute, as in ``module.attribute``. The *name* stored in the capsule must match this string exactly. If *no_block* is true, import the module without blocking @@ -107,10 +107,10 @@ exception and return *NULL*. However, if :cfunc:`PyCapsule_Import` failed to import the module, and *no_block* was true, no exception is set. -.. cfunction:: int PyCapsule_IsValid(PyObject* capsule, const char* name) +.. cfunction:: int PyCapsule_IsValid(PyObject *capsule, const char *name) Determines whether or not *capsule* is a valid capsule. A valid capsule is - non-*NULL*, passes :cfunc:`PyCapsule_CheckExact`, has a non-NULL pointer + non-*NULL*, passes :cfunc:`PyCapsule_CheckExact`, has a non-*NULL* pointer stored in it, and its internal name matches the *name* parameter. (See :cfunc:`PyCapsule_GetPointer` for information on how capsule names are compared.) @@ -122,20 +122,19 @@ Return a nonzero value if the object is valid and matches the name passed in. Return 0 otherwise. This function will not fail. -.. cfunction:: int PyCapsule_SetContext(PyObject* capsule, void* context) +.. cfunction:: int PyCapsule_SetContext(PyObject *capsule, void *context) Set the context pointer inside *capsule* to *context*. - Return 0 on success. - Return nonzero and set an exception on failure. + Return 0 on success. Return nonzero and set an exception on failure. -.. cfunction:: int PyCapsule_SetDestructor(PyObject* capsule, PyCapsule_Destructor destructor) +.. cfunction:: int PyCapsule_SetDestructor(PyObject *capsule, PyCapsule_Destructor destructor) Set the destructor inside *capsule* to *destructor*. Return 0 on success. Return nonzero and set an exception on failure. -.. cfunction:: int PyCapsule_SetName(PyObject* capsule, const char* name) +.. cfunction:: int PyCapsule_SetName(PyObject *capsule, const char *name) Set the name inside *capsule* to *name*. If non-*NULL*, the name must outlive the capsule. If the previous *name* stored in the capsule was not @@ -143,10 +142,9 @@ Return 0 on success. Return nonzero and set an exception on failure. -.. cfunction:: int PyCapsule_SetPointer(PyObject* capsule, void* pointer) +.. cfunction:: int PyCapsule_SetPointer(PyObject *capsule, void *pointer) Set the void pointer inside *capsule* to *pointer*. The pointer may not be *NULL*. Return 0 on success. Return nonzero and set an exception on failure. - From g.brandl at gmx.net Wed May 6 00:54:54 2009 From: g.brandl at gmx.net (Georg Brandl) Date: Wed, 06 May 2009 00:54:54 +0200 Subject: [Python-checkins] r72357 - python/trunk/Modules/_testcapimodule.c In-Reply-To: <20090505210921.434EC1E4013@bag.python.org> References: <20090505210921.434EC1E4013@bag.python.org> Message-ID: benjamin.peterson schrieb: > Author: benjamin.peterson > Date: Tue May 5 23:09:21 2009 > New Revision: 72357 > > Log: > fix running test_capi with -R :: > > Also, fix a refleak in the test that was preventing running. :) These are all introducing spaces into tab-indented files, so you may want to adjust your indentation-style detection :) Georg From python-checkins at python.org Wed May 6 01:00:48 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 6 May 2009 01:00:48 +0200 (CEST) Subject: [Python-checkins] r72367 - python/trunk/Modules/_testcapimodule.c Message-ID: <20090505230048.27C5D1E4013@bag.python.org> Author: benjamin.peterson Date: Wed May 6 01:00:48 2009 New Revision: 72367 Log: tabify :( Modified: python/trunk/Modules/_testcapimodule.c Modified: python/trunk/Modules/_testcapimodule.c ============================================================================== --- python/trunk/Modules/_testcapimodule.c (original) +++ python/trunk/Modules/_testcapimodule.c Wed May 6 01:00:48 2009 @@ -227,10 +227,10 @@ type = &_HashInheritanceTester_Type; - if (type->tp_dict != NULL) - /* The type has already been initialized. This probably means -R - is being used. */ - Py_RETURN_NONE; + if (type->tp_dict != NULL) + /* The type has already been initialized. This probably means + -R is being used. */ + Py_RETURN_NONE; obj = PyObject_New(PyObject, type); @@ -276,7 +276,7 @@ return NULL; } - Py_DECREF(obj); + Py_DECREF(obj); Py_RETURN_NONE; } From python-checkins at python.org Wed May 6 01:13:59 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 6 May 2009 01:13:59 +0200 (CEST) Subject: [Python-checkins] r72368 - in python/trunk/Lib/lib2to3: fixer_util.py fixes/fix_except.py fixes/fix_imports.py fixes/fix_itertools_imports.py fixes/fix_set_literal.py fixes/fix_urllib.py main.py patcomp.py pytree.py refactor.py tests/test_fixers.py tests/test_pytree.py Message-ID: <20090505231359.513781E4013@bag.python.org> Author: benjamin.peterson Date: Wed May 6 01:13:58 2009 New Revision: 72368 Log: Merged revisions 68503,68507,68694,69054,69673,69679-69681,70991,70999,71003,71695 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r68503 | benjamin.peterson | 2009-01-10 14:14:49 -0600 (Sat, 10 Jan 2009) | 1 line use variable ........ r68507 | benjamin.peterson | 2009-01-10 15:13:16 -0600 (Sat, 10 Jan 2009) | 1 line rewrap ........ r68694 | benjamin.peterson | 2009-01-17 17:55:59 -0600 (Sat, 17 Jan 2009) | 1 line test for specific node type ........ r69054 | guilherme.polo | 2009-01-28 10:01:54 -0600 (Wed, 28 Jan 2009) | 2 lines Added mapping for the ttk module. ........ r69673 | benjamin.peterson | 2009-02-16 09:38:22 -0600 (Mon, 16 Feb 2009) | 1 line fix handling of as imports #5279 ........ r69679 | benjamin.peterson | 2009-02-16 11:36:06 -0600 (Mon, 16 Feb 2009) | 1 line make Base.get_next_sibling() and Base.get_prev_sibling() properties ........ r69680 | benjamin.peterson | 2009-02-16 11:41:48 -0600 (Mon, 16 Feb 2009) | 1 line normalize docstrings in pytree according to PEP 11 ........ r69681 | benjamin.peterson | 2009-02-16 11:43:09 -0600 (Mon, 16 Feb 2009) | 1 line use a set ........ r70991 | benjamin.peterson | 2009-04-01 15:54:50 -0500 (Wed, 01 Apr 2009) | 1 line map urllib.urlopen to urllib.request.open #5637 ........ r70999 | benjamin.peterson | 2009-04-01 17:36:47 -0500 (Wed, 01 Apr 2009) | 1 line add very alpha support to 2to3 for running concurrently with multiprocessing ........ r71003 | benjamin.peterson | 2009-04-01 18:10:43 -0500 (Wed, 01 Apr 2009) | 1 line fix when multiprocessing is not available or used ........ r71695 | benjamin.peterson | 2009-04-17 22:21:29 -0500 (Fri, 17 Apr 2009) | 1 line refactor multiprocessing support, so it's less hacky to employ and only loads mp when needed ........ Modified: python/trunk/Lib/lib2to3/ (props changed) python/trunk/Lib/lib2to3/fixer_util.py python/trunk/Lib/lib2to3/fixes/fix_except.py python/trunk/Lib/lib2to3/fixes/fix_imports.py python/trunk/Lib/lib2to3/fixes/fix_itertools_imports.py python/trunk/Lib/lib2to3/fixes/fix_set_literal.py python/trunk/Lib/lib2to3/fixes/fix_urllib.py python/trunk/Lib/lib2to3/main.py python/trunk/Lib/lib2to3/patcomp.py python/trunk/Lib/lib2to3/pytree.py python/trunk/Lib/lib2to3/refactor.py python/trunk/Lib/lib2to3/tests/test_fixers.py python/trunk/Lib/lib2to3/tests/test_pytree.py Modified: python/trunk/Lib/lib2to3/fixer_util.py ============================================================================== --- python/trunk/Lib/lib2to3/fixer_util.py (original) +++ python/trunk/Lib/lib2to3/fixer_util.py Wed May 6 01:13:58 2009 @@ -226,7 +226,7 @@ """ Check that something isn't an attribute or function name etc. """ - prev = node.get_prev_sibling() + prev = node.prev_sibling if prev is not None and prev.type == token.DOT: # Attribute lookup. return False Modified: python/trunk/Lib/lib2to3/fixes/fix_except.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_except.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_except.py Wed May 6 01:13:58 2009 @@ -25,11 +25,11 @@ from .. import pytree from ..pgen2 import token from .. import fixer_base -from ..fixer_util import Assign, Attr, Name, is_tuple, is_list +from ..fixer_util import Assign, Attr, Name, is_tuple, is_list, syms def find_excepts(nodes): for i, n in enumerate(nodes): - if isinstance(n, pytree.Node): + if n.type == syms.except_clause: if n.children[0].value == 'except': yield (n, nodes[i+2]) Modified: python/trunk/Lib/lib2to3/fixes/fix_imports.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_imports.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_imports.py Wed May 6 01:13:58 2009 @@ -27,6 +27,7 @@ 'ScrolledText': 'tkinter.scrolledtext', 'Tkconstants': 'tkinter.constants', 'Tix': 'tkinter.tix', + 'ttk': 'tkinter.ttk', 'Tkinter': 'tkinter', 'markupbase': '_markupbase', '_winreg': 'winreg', @@ -121,17 +122,18 @@ def transform(self, node, results): import_mod = results.get("module_name") if import_mod: - new_name = self.mapping[import_mod.value] + mod_name = import_mod.value + new_name = self.mapping[mod_name] import_mod.replace(Name(new_name, prefix=import_mod.get_prefix())) if "name_import" in results: # If it's not a "from x import x, y" or "import x as y" import, # marked its usage to be replaced. - self.replace[import_mod.value] = new_name + self.replace[mod_name] = new_name if "multiple_imports" in results: - # This is a nasty hack to fix multiple imports on a - # line (e.g., "import StringIO, urlparse"). The problem is that I - # can't figure out an easy way to make a pattern recognize the - # keys of MAPPING randomly sprinkled in an import statement. + # This is a nasty hack to fix multiple imports on a line (e.g., + # "import StringIO, urlparse"). The problem is that I can't + # figure out an easy way to make a pattern recognize the keys of + # MAPPING randomly sprinkled in an import statement. results = self.match(node) if results: self.transform(node, results) Modified: python/trunk/Lib/lib2to3/fixes/fix_itertools_imports.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_itertools_imports.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_itertools_imports.py Wed May 6 01:13:58 2009 @@ -1,8 +1,9 @@ """ Fixer for imports of itertools.(imap|ifilter|izip|ifilterfalse) """ # Local imports -from .. import fixer_base -from ..fixer_util import BlankLine +from lib2to3 import fixer_base +from lib2to3.fixer_util import BlankLine, syms, token + class FixItertoolsImports(fixer_base.BaseFix): PATTERN = """ @@ -11,34 +12,40 @@ def transform(self, node, results): imports = results['imports'] - children = imports.children[:] or [imports] - for child in children: - if not hasattr(child, 'value'): - # Handle 'import ... as ...' - continue - if child.value in ('imap', 'izip', 'ifilter'): - # The value must be set to none in case child == import, - # so that the test for empty imports will work out + if imports.type == syms.import_as_name or not imports.children: + children = [imports] + else: + children = imports.children + for child in children[::2]: + if child.type == token.NAME: + member = child.value + name_node = child + else: + assert child.type == syms.import_as_name + name_node = child.children[0] + member_name = name_node.value + if member_name in ('imap', 'izip', 'ifilter'): child.value = None child.remove() - elif child.value == 'ifilterfalse': + elif member_name == 'ifilterfalse': node.changed() - child.value = 'filterfalse' + name_node.value = 'filterfalse' # Make sure the import statement is still sane children = imports.children[:] or [imports] remove_comma = True for child in children: - if remove_comma and getattr(child, 'value', None) == ',': + if remove_comma and child.type == token.COMMA: child.remove() else: remove_comma ^= True - if unicode(children[-1]) == ',': + if children[-1].type == token.COMMA: children[-1].remove() # If there are no imports left, just get rid of the entire statement - if not (imports.children or getattr(imports, 'value', None)): + if not (imports.children or getattr(imports, 'value', None)) or \ + imports.parent is None: p = node.get_prefix() node = BlankLine() node.prefix = p Modified: python/trunk/Lib/lib2to3/fixes/fix_set_literal.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_set_literal.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_set_literal.py Wed May 6 01:13:58 2009 @@ -38,7 +38,7 @@ literal.extend(n.clone() for n in items.children) literal.append(pytree.Leaf(token.RBRACE, "}")) # Set the prefix of the right brace to that of the ')' or ']' - literal[-1].set_prefix(items.get_next_sibling().get_prefix()) + literal[-1].set_prefix(items.next_sibling.get_prefix()) maker = pytree.Node(syms.dictsetmaker, literal) maker.set_prefix(node.get_prefix()) Modified: python/trunk/Lib/lib2to3/fixes/fix_urllib.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_urllib.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_urllib.py Wed May 6 01:13:58 2009 @@ -12,7 +12,7 @@ MAPPING = {'urllib': [ ('urllib.request', ['URLOpener', 'FancyURLOpener', 'urlretrieve', - '_urlopener', 'urlcleanup']), + '_urlopener', 'urlopen', 'urlcleanup']), ('urllib.parse', ['quote', 'quote_plus', 'unquote', 'unquote_plus', 'urlencode', 'pathname2url', 'url2pathname', 'splitattr', Modified: python/trunk/Lib/lib2to3/main.py ============================================================================== --- python/trunk/Lib/lib2to3/main.py (original) +++ python/trunk/Lib/lib2to3/main.py Wed May 6 01:13:58 2009 @@ -10,8 +10,7 @@ from . import refactor - -class StdoutRefactoringTool(refactor.RefactoringTool): +class StdoutRefactoringTool(refactor.MultiprocessRefactoringTool): """ Prints output to stdout. """ @@ -64,6 +63,8 @@ help="Fix up doctests only") parser.add_option("-f", "--fix", action="append", default=[], help="Each FIX specifies a transformation; default: all") + parser.add_option("-j", "--processes", action="store", default=1, + type="int", help="Run 2to3 concurrently") parser.add_option("-x", "--nofix", action="append", default=[], help="Prevent a fixer from being run.") parser.add_option("-l", "--list-fixes", action="store_true", @@ -126,7 +127,14 @@ if refactor_stdin: rt.refactor_stdin() else: - rt.refactor(args, options.write, options.doctests_only) + try: + rt.refactor(args, options.write, options.doctests_only, + options.processes) + except refactor.MultiprocessingUnsupported: + assert options.processes > 1 + print >> sys.stderr, "Sorry, -j isn't " \ + "supported on this platform." + return 1 rt.summarize() # Return error status (0 if rt.errors is zero) Modified: python/trunk/Lib/lib2to3/patcomp.py ============================================================================== --- python/trunk/Lib/lib2to3/patcomp.py (original) +++ python/trunk/Lib/lib2to3/patcomp.py Wed May 6 01:13:58 2009 @@ -30,7 +30,7 @@ def tokenize_wrapper(input): """Tokenizes a string suppressing significant whitespace.""" - skip = (token.NEWLINE, token.INDENT, token.DEDENT) + skip = set((token.NEWLINE, token.INDENT, token.DEDENT)) tokens = tokenize.generate_tokens(driver.generate_lines(input).next) for quintuple in tokens: type, value, start, end, line_text = quintuple Modified: python/trunk/Lib/lib2to3/pytree.py ============================================================================== --- python/trunk/Lib/lib2to3/pytree.py (original) +++ python/trunk/Lib/lib2to3/pytree.py Wed May 6 01:13:58 2009 @@ -1,7 +1,8 @@ # Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. -"""Python parse tree definitions. +""" +Python parse tree definitions. This is a very concrete parse tree; we need to keep every token and even the comments and whitespace between tokens. @@ -31,7 +32,8 @@ class Base(object): - """Abstract base class for Node and Leaf. + """ + Abstract base class for Node and Leaf. This provides some default functionality and boilerplate using the template pattern. @@ -51,7 +53,8 @@ return object.__new__(cls) def __eq__(self, other): - """Compares two nodes for equality. + """ + Compare two nodes for equality. This calls the method _eq(). """ @@ -60,7 +63,8 @@ return self._eq(other) def __ne__(self, other): - """Compares two nodes for inequality. + """ + Compare two nodes for inequality. This calls the method _eq(). """ @@ -69,53 +73,58 @@ return not self._eq(other) def _eq(self, other): - """Compares two nodes for equality. + """ + Compare two nodes for equality. - This is called by __eq__ and __ne__. It is only called if the - two nodes have the same type. This must be implemented by the - concrete subclass. Nodes should be considered equal if they - have the same structure, ignoring the prefix string and other - context information. + This is called by __eq__ and __ne__. It is only called if the two nodes + have the same type. This must be implemented by the concrete subclass. + Nodes should be considered equal if they have the same structure, + ignoring the prefix string and other context information. """ raise NotImplementedError def clone(self): - """Returns a cloned (deep) copy of self. + """ + Return a cloned (deep) copy of self. This must be implemented by the concrete subclass. """ raise NotImplementedError def post_order(self): - """Returns a post-order iterator for the tree. + """ + Return a post-order iterator for the tree. This must be implemented by the concrete subclass. """ raise NotImplementedError def pre_order(self): - """Returns a pre-order iterator for the tree. + """ + Return a pre-order iterator for the tree. This must be implemented by the concrete subclass. """ raise NotImplementedError def set_prefix(self, prefix): - """Sets the prefix for the node (see Leaf class). + """ + Set the prefix for the node (see Leaf class). This must be implemented by the concrete subclass. """ raise NotImplementedError def get_prefix(self): - """Returns the prefix for the node (see Leaf class). + """ + Return the prefix for the node (see Leaf class). This must be implemented by the concrete subclass. """ raise NotImplementedError def replace(self, new): - """Replaces this node with a new one in the parent.""" + """Replace this node with a new one in the parent.""" assert self.parent is not None, str(self) assert new is not None if not isinstance(new, list): @@ -138,7 +147,7 @@ self.parent = None def get_lineno(self): - """Returns the line number which generated the invocant node.""" + """Return the line number which generated the invocant node.""" node = self while not isinstance(node, Leaf): if not node.children: @@ -152,8 +161,10 @@ self.was_changed = True def remove(self): - """Remove the node from the tree. Returns the position of the node - in its parent's children before it was removed.""" + """ + Remove the node from the tree. Returns the position of the node in its + parent's children before it was removed. + """ if self.parent: for i, node in enumerate(self.parent.children): if node is self: @@ -162,10 +173,12 @@ self.parent = None return i - def get_next_sibling(self): - """Return the node immediately following the invocant in their - parent's children list. If the invocant does not have a next - sibling, return None.""" + @property + def next_sibling(self): + """ + The node immediately following the invocant in their parent's children + list. If the invocant does not have a next sibling, it is None + """ if self.parent is None: return None @@ -177,10 +190,12 @@ except IndexError: return None - def get_prev_sibling(self): - """Return the node immediately preceding the invocant in their - parent's children list. If the invocant does not have a previous - sibling, return None.""" + @property + def prev_sibling(self): + """ + The node immediately preceding the invocant in their parent's children + list. If the invocant does not have a previous sibling, it is None. + """ if self.parent is None: return None @@ -192,9 +207,11 @@ return self.parent.children[i-1] def get_suffix(self): - """Return the string immediately following the invocant node. This - is effectively equivalent to node.get_next_sibling().get_prefix()""" - next_sib = self.get_next_sibling() + """ + Return the string immediately following the invocant node. This is + effectively equivalent to node.next_sibling.get_prefix() + """ + next_sib = self.next_sibling if next_sib is None: return "" return next_sib.get_prefix() @@ -205,7 +222,8 @@ """Concrete implementation for interior nodes.""" def __init__(self, type, children, context=None, prefix=None): - """Initializer. + """ + Initializer. Takes a type constant (a symbol number >= 256), a sequence of child nodes, and an optional context keyword argument. @@ -222,42 +240,44 @@ self.set_prefix(prefix) def __repr__(self): - """Returns a canonical string representation.""" + """Return a canonical string representation.""" return "%s(%s, %r)" % (self.__class__.__name__, type_repr(self.type), self.children) def __str__(self): - """Returns a pretty string representation. + """ + Return a pretty string representation. This reproduces the input source exactly. """ return "".join(map(str, self.children)) def _eq(self, other): - """Compares two nodes for equality.""" + """Compare two nodes for equality.""" return (self.type, self.children) == (other.type, other.children) def clone(self): - """Returns a cloned (deep) copy of self.""" + """Return a cloned (deep) copy of self.""" return Node(self.type, [ch.clone() for ch in self.children]) def post_order(self): - """Returns a post-order iterator for the tree.""" + """Return a post-order iterator for the tree.""" for child in self.children: for node in child.post_order(): yield node yield self def pre_order(self): - """Returns a pre-order iterator for the tree.""" + """Return a pre-order iterator for the tree.""" yield self for child in self.children: for node in child.post_order(): yield node def set_prefix(self, prefix): - """Sets the prefix for the node. + """ + Set the prefix for the node. This passes the responsibility on to the first child. """ @@ -265,7 +285,8 @@ self.children[0].set_prefix(prefix) def get_prefix(self): - """Returns the prefix for the node. + """ + Return the prefix for the node. This passes the call on to the first child. """ @@ -274,23 +295,29 @@ return self.children[0].get_prefix() def set_child(self, i, child): - """Equivalent to 'node.children[i] = child'. This method also sets the - child's parent attribute appropriately.""" + """ + Equivalent to 'node.children[i] = child'. This method also sets the + child's parent attribute appropriately. + """ child.parent = self self.children[i].parent = None self.children[i] = child self.changed() def insert_child(self, i, child): - """Equivalent to 'node.children.insert(i, child)'. This method also - sets the child's parent attribute appropriately.""" + """ + Equivalent to 'node.children.insert(i, child)'. This method also sets + the child's parent attribute appropriately. + """ child.parent = self self.children.insert(i, child) self.changed() def append_child(self, child): - """Equivalent to 'node.children.append(child)'. This method also - sets the child's parent attribute appropriately.""" + """ + Equivalent to 'node.children.append(child)'. This method also sets the + child's parent attribute appropriately. + """ child.parent = self self.children.append(child) self.changed() @@ -306,10 +333,11 @@ column = 0 # Column where this token tarts in the input def __init__(self, type, value, context=None, prefix=None): - """Initializer. + """ + Initializer. - Takes a type constant (a token number < 256), a string value, - and an optional context keyword argument. + Takes a type constant (a token number < 256), a string value, and an + optional context keyword argument. """ assert 0 <= type < 256, type if context is not None: @@ -320,51 +348,53 @@ self.prefix = prefix def __repr__(self): - """Returns a canonical string representation.""" + """Return a canonical string representation.""" return "%s(%r, %r)" % (self.__class__.__name__, self.type, self.value) def __str__(self): - """Returns a pretty string representation. + """ + Return a pretty string representation. This reproduces the input source exactly. """ return self.prefix + str(self.value) def _eq(self, other): - """Compares two nodes for equality.""" + """Compare two nodes for equality.""" return (self.type, self.value) == (other.type, other.value) def clone(self): - """Returns a cloned (deep) copy of self.""" + """Return a cloned (deep) copy of self.""" return Leaf(self.type, self.value, (self.prefix, (self.lineno, self.column))) def post_order(self): - """Returns a post-order iterator for the tree.""" + """Return a post-order iterator for the tree.""" yield self def pre_order(self): - """Returns a pre-order iterator for the tree.""" + """Return a pre-order iterator for the tree.""" yield self def set_prefix(self, prefix): - """Sets the prefix for the node.""" + """Set the prefix for the node.""" self.changed() self.prefix = prefix def get_prefix(self): - """Returns the prefix for the node.""" + """Return the prefix for the node.""" return self.prefix def convert(gr, raw_node): - """Converts raw node information to a Node or Leaf instance. + """ + Convert raw node information to a Node or Leaf instance. - This is passed to the parser driver which calls it whenever a - reduction of a grammar rule produces a new complete node, so that - the tree is build strictly bottom-up. + This is passed to the parser driver which calls it whenever a reduction of a + grammar rule produces a new complete node, so that the tree is build + strictly bottom-up. """ type, value, context, children = raw_node if children or type in gr.number2symbol: @@ -379,7 +409,8 @@ class BasePattern(object): - """A pattern is a tree matching pattern. + """ + A pattern is a tree matching pattern. It looks for a specific node type (token or symbol), and optionally for a specific content. @@ -409,14 +440,16 @@ return "%s(%s)" % (self.__class__.__name__, ", ".join(map(repr, args))) def optimize(self): - """A subclass can define this as a hook for optimizations. + """ + A subclass can define this as a hook for optimizations. Returns either self or another node with the same effect. """ return self def match(self, node, results=None): - """Does this pattern exactly match a node? + """ + Does this pattern exactly match a node? Returns True if it matches, False if not. @@ -440,7 +473,8 @@ return True def match_seq(self, nodes, results=None): - """Does this pattern exactly match a sequence of nodes? + """ + Does this pattern exactly match a sequence of nodes? Default implementation for non-wildcard patterns. """ @@ -449,7 +483,8 @@ return self.match(nodes[0], results) def generate_matches(self, nodes): - """Generator yielding all matches for this pattern. + """ + Generator yielding all matches for this pattern. Default implementation for non-wildcard patterns. """ @@ -461,7 +496,8 @@ class LeafPattern(BasePattern): def __init__(self, type=None, content=None, name=None): - """Initializer. Takes optional type, content, and name. + """ + Initializer. Takes optional type, content, and name. The type, if given must be a token type (< 256). If not given, this matches any *leaf* node; the content may still be required. @@ -486,7 +522,8 @@ return BasePattern.match(self, node, results) def _submatch(self, node, results=None): - """Match the pattern's content to the node's children. + """ + Match the pattern's content to the node's children. This assumes the node type matches and self.content is not None. @@ -505,7 +542,8 @@ wildcards = False def __init__(self, type=None, content=None, name=None): - """Initializer. Takes optional type, content, and name. + """ + Initializer. Takes optional type, content, and name. The type, if given, must be a symbol type (>= 256). If the type is None this matches *any* single node (leaf or not), @@ -533,7 +571,8 @@ self.name = name def _submatch(self, node, results=None): - """Match the pattern's content to the node's children. + """ + Match the pattern's content to the node's children. This assumes the node type matches and self.content is not None. @@ -561,7 +600,8 @@ class WildcardPattern(BasePattern): - """A wildcard pattern can match zero or more nodes. + """ + A wildcard pattern can match zero or more nodes. This has all the flexibility needed to implement patterns like: @@ -573,7 +613,8 @@ """ def __init__(self, content=None, min=0, max=HUGE, name=None): - """Initializer. + """ + Initializer. Args: content: optional sequence of subsequences of patterns; @@ -641,7 +682,8 @@ return False def generate_matches(self, nodes): - """Generator yielding matches for a sequence of nodes. + """ + Generator yielding matches for a sequence of nodes. Args: nodes: sequence of nodes @@ -744,7 +786,8 @@ class NegatedPattern(BasePattern): def __init__(self, content=None): - """Initializer. + """ + Initializer. The argument is either a pattern or None. If it is None, this only matches an empty sequence (effectively '$' in regex @@ -776,7 +819,8 @@ def generate_matches(patterns, nodes): - """Generator yielding matches for a sequence of patterns and nodes. + """ + Generator yielding matches for a sequence of patterns and nodes. Args: patterns: a sequence of patterns Modified: python/trunk/Lib/lib2to3/refactor.py ============================================================================== --- python/trunk/Lib/lib2to3/refactor.py (original) +++ python/trunk/Lib/lib2to3/refactor.py Wed May 6 01:13:58 2009 @@ -506,6 +506,63 @@ yield "" +class MultiprocessingUnsupported(Exception): + pass + + +class MultiprocessRefactoringTool(RefactoringTool): + + def __init__(self, *args, **kwargs): + super(MultiprocessRefactoringTool, self).__init__(*args, **kwargs) + self.queue = None + + def refactor(self, items, write=False, doctests_only=False, + num_processes=1): + if num_processes == 1: + return super(MultiprocessRefactoringTool, self).refactor( + items, write, doctests_only) + try: + import multiprocessing + except ImportError: + raise MultiprocessingUnsupported + if self.queue is not None: + raise RuntimeError("already doing multiple processes") + self.queue = multiprocessing.JoinableQueue() + processes = [multiprocessing.Process(target=self._child) + for i in xrange(num_processes)] + try: + for p in processes: + p.start() + super(MultiprocessRefactoringTool, self).refactor(items, write, + doctests_only) + finally: + self.queue.join() + for i in xrange(num_processes): + self.queue.put(None) + for p in processes: + if p.is_alive(): + p.join() + self.queue = None + + def _child(self): + task = self.queue.get() + while task is not None: + args, kwargs = task + try: + super(MultiprocessRefactoringTool, self).refactor_file( + *args, **kwargs) + finally: + self.queue.task_done() + task = self.queue.get() + + def refactor_file(self, *args, **kwargs): + if self.queue is not None: + self.queue.put((args, kwargs)) + else: + return super(MultiprocessRefactoringTool, self).refactor_file( + *args, **kwargs) + + def diff_texts(a, b, filename): """Return a unified diff of two strings.""" a = a.splitlines() Modified: python/trunk/Lib/lib2to3/tests/test_fixers.py ============================================================================== --- python/trunk/Lib/lib2to3/tests/test_fixers.py (original) +++ python/trunk/Lib/lib2to3/tests/test_fixers.py Wed May 6 01:13:58 2009 @@ -3404,6 +3404,18 @@ a = "from itertools import bar as bang" self.check(b, a) + b = "from itertools import izip as _zip, imap, bar" + a = "from itertools import bar" + self.check(b, a) + + b = "from itertools import imap as _map" + a = "" + self.check(b, a) + + b = "from itertools import imap as _map, izip as _zip" + a = "" + self.check(b, a) + s = "from itertools import bar as bang" self.unchanged(s) Modified: python/trunk/Lib/lib2to3/tests/test_pytree.py ============================================================================== --- python/trunk/Lib/lib2to3/tests/test_pytree.py (original) +++ python/trunk/Lib/lib2to3/tests/test_pytree.py Wed May 6 01:13:58 2009 @@ -306,36 +306,36 @@ n2 = pytree.Node(1000, []) p1 = pytree.Node(1000, [n1, n2]) - self.failUnless(n1.get_next_sibling() is n2) - self.assertEqual(n2.get_next_sibling(), None) - self.assertEqual(p1.get_next_sibling(), None) + self.failUnless(n1.next_sibling is n2) + self.assertEqual(n2.next_sibling, None) + self.assertEqual(p1.next_sibling, None) def testLeafNextSibling(self): l1 = pytree.Leaf(100, "a") l2 = pytree.Leaf(100, "b") p1 = pytree.Node(1000, [l1, l2]) - self.failUnless(l1.get_next_sibling() is l2) - self.assertEqual(l2.get_next_sibling(), None) - self.assertEqual(p1.get_next_sibling(), None) + self.failUnless(l1.next_sibling is l2) + self.assertEqual(l2.next_sibling, None) + self.assertEqual(p1.next_sibling, None) def testNodePrevSibling(self): n1 = pytree.Node(1000, []) n2 = pytree.Node(1000, []) p1 = pytree.Node(1000, [n1, n2]) - self.failUnless(n2.get_prev_sibling() is n1) - self.assertEqual(n1.get_prev_sibling(), None) - self.assertEqual(p1.get_prev_sibling(), None) + self.failUnless(n2.prev_sibling is n1) + self.assertEqual(n1.prev_sibling, None) + self.assertEqual(p1.prev_sibling, None) def testLeafPrevSibling(self): l1 = pytree.Leaf(100, "a") l2 = pytree.Leaf(100, "b") p1 = pytree.Node(1000, [l1, l2]) - self.failUnless(l2.get_prev_sibling() is l1) - self.assertEqual(l1.get_prev_sibling(), None) - self.assertEqual(p1.get_prev_sibling(), None) + self.failUnless(l2.prev_sibling is l1) + self.assertEqual(l1.prev_sibling, None) + self.assertEqual(p1.prev_sibling, None) class TestPatterns(support.TestCase): From python-checkins at python.org Wed May 6 01:14:15 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 6 May 2009 01:14:15 +0200 (CEST) Subject: [Python-checkins] r72369 - in python/branches/py3k: Modules/_testcapimodule.c Message-ID: <20090505231415.ECAF91E4013@bag.python.org> Author: benjamin.peterson Date: Wed May 6 01:14:15 2009 New Revision: 72369 Log: Merged revisions 72367 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72367 | benjamin.peterson | 2009-05-05 18:00:48 -0500 (Tue, 05 May 2009) | 1 line tabify :( ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Modules/_testcapimodule.c Modified: python/branches/py3k/Modules/_testcapimodule.c ============================================================================== --- python/branches/py3k/Modules/_testcapimodule.c (original) +++ python/branches/py3k/Modules/_testcapimodule.c Wed May 6 01:14:15 2009 @@ -228,10 +228,10 @@ type = &_HashInheritanceTester_Type; - if (type->tp_dict != NULL) - /* The type has already been initialized. This probably means -R - is being used. */ - Py_RETURN_NONE; + if (type->tp_dict != NULL) + /* The type has already been initialized. This probably means + -R is being used. */ + Py_RETURN_NONE; obj = PyObject_New(PyObject, type); @@ -277,7 +277,7 @@ return NULL; } - Py_DECREF(obj); + Py_DECREF(obj); Py_RETURN_NONE; } From buildbot at python.org Wed May 6 01:18:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 05 May 2009 23:18:25 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 3.0 Message-ID: <20090505231826.2CCFC1E4013@bag.python.org> The Buildbot has detected a new failure of x86 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%203.0/builds/365 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Unknown signal 32 sincerely, -The Buildbot From python-checkins at python.org Wed May 6 01:23:32 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 6 May 2009 01:23:32 +0200 (CEST) Subject: [Python-checkins] r72370 - in python/branches/py3k: Lib/lib2to3/fixer_util.py Lib/lib2to3/fixes/fix_except.py Lib/lib2to3/fixes/fix_imports.py Lib/lib2to3/fixes/fix_itertools_imports.py Lib/lib2to3/fixes/fix_set_literal.py Lib/lib2to3/fixes/fix_urllib.py Lib/lib2to3/main.py Lib/lib2to3/patcomp.py Lib/lib2to3/pytree.py Lib/lib2to3/refactor.py Lib/lib2to3/tests/test_fixers.py Lib/lib2to3/tests/test_pytree.py Message-ID: <20090505232332.312CF1E4013@bag.python.org> Author: benjamin.peterson Date: Wed May 6 01:23:31 2009 New Revision: 72370 Log: Merged revisions 72368 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r72368 | benjamin.peterson | 2009-05-05 18:13:58 -0500 (Tue, 05 May 2009) | 53 lines Merged revisions 68503,68507,68694,69054,69673,69679-69681,70991,70999,71003,71695 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r68503 | benjamin.peterson | 2009-01-10 14:14:49 -0600 (Sat, 10 Jan 2009) | 1 line use variable ........ r68507 | benjamin.peterson | 2009-01-10 15:13:16 -0600 (Sat, 10 Jan 2009) | 1 line rewrap ........ r68694 | benjamin.peterson | 2009-01-17 17:55:59 -0600 (Sat, 17 Jan 2009) | 1 line test for specific node type ........ r69054 | guilherme.polo | 2009-01-28 10:01:54 -0600 (Wed, 28 Jan 2009) | 2 lines Added mapping for the ttk module. ........ r69673 | benjamin.peterson | 2009-02-16 09:38:22 -0600 (Mon, 16 Feb 2009) | 1 line fix handling of as imports #5279 ........ r69679 | benjamin.peterson | 2009-02-16 11:36:06 -0600 (Mon, 16 Feb 2009) | 1 line make Base.get_next_sibling() and Base.get_prev_sibling() properties ........ r69680 | benjamin.peterson | 2009-02-16 11:41:48 -0600 (Mon, 16 Feb 2009) | 1 line normalize docstrings in pytree according to PEP 11 ........ r69681 | benjamin.peterson | 2009-02-16 11:43:09 -0600 (Mon, 16 Feb 2009) | 1 line use a set ........ r70991 | benjamin.peterson | 2009-04-01 15:54:50 -0500 (Wed, 01 Apr 2009) | 1 line map urllib.urlopen to urllib.request.open #5637 ........ r70999 | benjamin.peterson | 2009-04-01 17:36:47 -0500 (Wed, 01 Apr 2009) | 1 line add very alpha support to 2to3 for running concurrently with multiprocessing ........ r71003 | benjamin.peterson | 2009-04-01 18:10:43 -0500 (Wed, 01 Apr 2009) | 1 line fix when multiprocessing is not available or used ........ r71695 | benjamin.peterson | 2009-04-17 22:21:29 -0500 (Fri, 17 Apr 2009) | 1 line refactor multiprocessing support, so it's less hacky to employ and only loads mp when needed ........ ................ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/lib2to3/fixer_util.py python/branches/py3k/Lib/lib2to3/fixes/fix_except.py python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py python/branches/py3k/Lib/lib2to3/fixes/fix_itertools_imports.py python/branches/py3k/Lib/lib2to3/fixes/fix_set_literal.py python/branches/py3k/Lib/lib2to3/fixes/fix_urllib.py python/branches/py3k/Lib/lib2to3/main.py python/branches/py3k/Lib/lib2to3/patcomp.py python/branches/py3k/Lib/lib2to3/pytree.py python/branches/py3k/Lib/lib2to3/refactor.py python/branches/py3k/Lib/lib2to3/tests/test_fixers.py python/branches/py3k/Lib/lib2to3/tests/test_pytree.py Modified: python/branches/py3k/Lib/lib2to3/fixer_util.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixer_util.py (original) +++ python/branches/py3k/Lib/lib2to3/fixer_util.py Wed May 6 01:23:31 2009 @@ -226,7 +226,7 @@ """ Check that something isn't an attribute or function name etc. """ - prev = node.get_prev_sibling() + prev = node.prev_sibling if prev is not None and prev.type == token.DOT: # Attribute lookup. return False Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_except.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_except.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_except.py Wed May 6 01:23:31 2009 @@ -25,11 +25,11 @@ from .. import pytree from ..pgen2 import token from .. import fixer_base -from ..fixer_util import Assign, Attr, Name, is_tuple, is_list +from ..fixer_util import Assign, Attr, Name, is_tuple, is_list, syms def find_excepts(nodes): for i, n in enumerate(nodes): - if isinstance(n, pytree.Node): + if n.type == syms.except_clause: if n.children[0].value == 'except': yield (n, nodes[i+2]) Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py Wed May 6 01:23:31 2009 @@ -27,6 +27,7 @@ 'ScrolledText': 'tkinter.scrolledtext', 'Tkconstants': 'tkinter.constants', 'Tix': 'tkinter.tix', + 'ttk': 'tkinter.ttk', 'Tkinter': 'tkinter', 'markupbase': '_markupbase', '_winreg': 'winreg', @@ -121,17 +122,18 @@ def transform(self, node, results): import_mod = results.get("module_name") if import_mod: - new_name = self.mapping[import_mod.value] + mod_name = import_mod.value + new_name = self.mapping[mod_name] import_mod.replace(Name(new_name, prefix=import_mod.get_prefix())) if "name_import" in results: # If it's not a "from x import x, y" or "import x as y" import, # marked its usage to be replaced. - self.replace[import_mod.value] = new_name + self.replace[mod_name] = new_name if "multiple_imports" in results: - # This is a nasty hack to fix multiple imports on a - # line (e.g., "import StringIO, urlparse"). The problem is that I - # can't figure out an easy way to make a pattern recognize the - # keys of MAPPING randomly sprinkled in an import statement. + # This is a nasty hack to fix multiple imports on a line (e.g., + # "import StringIO, urlparse"). The problem is that I can't + # figure out an easy way to make a pattern recognize the keys of + # MAPPING randomly sprinkled in an import statement. results = self.match(node) if results: self.transform(node, results) Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_itertools_imports.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_itertools_imports.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_itertools_imports.py Wed May 6 01:23:31 2009 @@ -1,8 +1,9 @@ """ Fixer for imports of itertools.(imap|ifilter|izip|ifilterfalse) """ # Local imports -from .. import fixer_base -from ..fixer_util import BlankLine +from lib2to3 import fixer_base +from lib2to3.fixer_util import BlankLine, syms, token + class FixItertoolsImports(fixer_base.BaseFix): PATTERN = """ @@ -11,34 +12,40 @@ def transform(self, node, results): imports = results['imports'] - children = imports.children[:] or [imports] - for child in children: - if not hasattr(child, 'value'): - # Handle 'import ... as ...' - continue - if child.value in ('imap', 'izip', 'ifilter'): - # The value must be set to none in case child == import, - # so that the test for empty imports will work out + if imports.type == syms.import_as_name or not imports.children: + children = [imports] + else: + children = imports.children + for child in children[::2]: + if child.type == token.NAME: + member = child.value + name_node = child + else: + assert child.type == syms.import_as_name + name_node = child.children[0] + member_name = name_node.value + if member_name in ('imap', 'izip', 'ifilter'): child.value = None child.remove() - elif child.value == 'ifilterfalse': + elif member_name == 'ifilterfalse': node.changed() - child.value = 'filterfalse' + name_node.value = 'filterfalse' # Make sure the import statement is still sane children = imports.children[:] or [imports] remove_comma = True for child in children: - if remove_comma and getattr(child, 'value', None) == ',': + if remove_comma and child.type == token.COMMA: child.remove() else: remove_comma ^= True - if str(children[-1]) == ',': + if children[-1].type == token.COMMA: children[-1].remove() # If there are no imports left, just get rid of the entire statement - if not (imports.children or getattr(imports, 'value', None)): + if not (imports.children or getattr(imports, 'value', None)) or \ + imports.parent is None: p = node.get_prefix() node = BlankLine() node.prefix = p Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_set_literal.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_set_literal.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_set_literal.py Wed May 6 01:23:31 2009 @@ -38,7 +38,7 @@ literal.extend(n.clone() for n in items.children) literal.append(pytree.Leaf(token.RBRACE, "}")) # Set the prefix of the right brace to that of the ')' or ']' - literal[-1].set_prefix(items.get_next_sibling().get_prefix()) + literal[-1].set_prefix(items.next_sibling.get_prefix()) maker = pytree.Node(syms.dictsetmaker, literal) maker.set_prefix(node.get_prefix()) Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_urllib.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_urllib.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_urllib.py Wed May 6 01:23:31 2009 @@ -12,7 +12,7 @@ MAPPING = {'urllib': [ ('urllib.request', ['URLOpener', 'FancyURLOpener', 'urlretrieve', - '_urlopener', 'urlcleanup']), + '_urlopener', 'urlopen', 'urlcleanup']), ('urllib.parse', ['quote', 'quote_plus', 'unquote', 'unquote_plus', 'urlencode', 'pathname2url', 'url2pathname', 'splitattr', Modified: python/branches/py3k/Lib/lib2to3/main.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/main.py (original) +++ python/branches/py3k/Lib/lib2to3/main.py Wed May 6 01:23:31 2009 @@ -10,8 +10,7 @@ from . import refactor - -class StdoutRefactoringTool(refactor.RefactoringTool): +class StdoutRefactoringTool(refactor.MultiprocessRefactoringTool): """ Prints output to stdout. """ @@ -64,6 +63,8 @@ help="Fix up doctests only") parser.add_option("-f", "--fix", action="append", default=[], help="Each FIX specifies a transformation; default: all") + parser.add_option("-j", "--processes", action="store", default=1, + type="int", help="Run 2to3 concurrently") parser.add_option("-x", "--nofix", action="append", default=[], help="Prevent a fixer from being run.") parser.add_option("-l", "--list-fixes", action="store_true", @@ -126,7 +127,14 @@ if refactor_stdin: rt.refactor_stdin() else: - rt.refactor(args, options.write, options.doctests_only) + try: + rt.refactor(args, options.write, options.doctests_only, + options.processes) + except refactor.MultiprocessingUnsupported: + assert options.processes > 1 + print >> sys.stderr, "Sorry, -j isn't " \ + "supported on this platform." + return 1 rt.summarize() # Return error status (0 if rt.errors is zero) Modified: python/branches/py3k/Lib/lib2to3/patcomp.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/patcomp.py (original) +++ python/branches/py3k/Lib/lib2to3/patcomp.py Wed May 6 01:23:31 2009 @@ -30,7 +30,7 @@ def tokenize_wrapper(input): """Tokenizes a string suppressing significant whitespace.""" - skip = (token.NEWLINE, token.INDENT, token.DEDENT) + skip = set((token.NEWLINE, token.INDENT, token.DEDENT)) tokens = tokenize.generate_tokens(driver.generate_lines(input).__next__) for quintuple in tokens: type, value, start, end, line_text = quintuple Modified: python/branches/py3k/Lib/lib2to3/pytree.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/pytree.py (original) +++ python/branches/py3k/Lib/lib2to3/pytree.py Wed May 6 01:23:31 2009 @@ -1,7 +1,8 @@ # Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. -"""Python parse tree definitions. +""" +Python parse tree definitions. This is a very concrete parse tree; we need to keep every token and even the comments and whitespace between tokens. @@ -31,7 +32,8 @@ class Base(object): - """Abstract base class for Node and Leaf. + """ + Abstract base class for Node and Leaf. This provides some default functionality and boilerplate using the template pattern. @@ -51,7 +53,8 @@ return object.__new__(cls) def __eq__(self, other): - """Compares two nodes for equality. + """ + Compare two nodes for equality. This calls the method _eq(). """ @@ -60,7 +63,8 @@ return self._eq(other) def __ne__(self, other): - """Compares two nodes for inequality. + """ + Compare two nodes for inequality. This calls the method _eq(). """ @@ -69,53 +73,58 @@ return not self._eq(other) def _eq(self, other): - """Compares two nodes for equality. + """ + Compare two nodes for equality. - This is called by __eq__ and __ne__. It is only called if the - two nodes have the same type. This must be implemented by the - concrete subclass. Nodes should be considered equal if they - have the same structure, ignoring the prefix string and other - context information. + This is called by __eq__ and __ne__. It is only called if the two nodes + have the same type. This must be implemented by the concrete subclass. + Nodes should be considered equal if they have the same structure, + ignoring the prefix string and other context information. """ raise NotImplementedError def clone(self): - """Returns a cloned (deep) copy of self. + """ + Return a cloned (deep) copy of self. This must be implemented by the concrete subclass. """ raise NotImplementedError def post_order(self): - """Returns a post-order iterator for the tree. + """ + Return a post-order iterator for the tree. This must be implemented by the concrete subclass. """ raise NotImplementedError def pre_order(self): - """Returns a pre-order iterator for the tree. + """ + Return a pre-order iterator for the tree. This must be implemented by the concrete subclass. """ raise NotImplementedError def set_prefix(self, prefix): - """Sets the prefix for the node (see Leaf class). + """ + Set the prefix for the node (see Leaf class). This must be implemented by the concrete subclass. """ raise NotImplementedError def get_prefix(self): - """Returns the prefix for the node (see Leaf class). + """ + Return the prefix for the node (see Leaf class). This must be implemented by the concrete subclass. """ raise NotImplementedError def replace(self, new): - """Replaces this node with a new one in the parent.""" + """Replace this node with a new one in the parent.""" assert self.parent is not None, str(self) assert new is not None if not isinstance(new, list): @@ -138,7 +147,7 @@ self.parent = None def get_lineno(self): - """Returns the line number which generated the invocant node.""" + """Return the line number which generated the invocant node.""" node = self while not isinstance(node, Leaf): if not node.children: @@ -152,8 +161,10 @@ self.was_changed = True def remove(self): - """Remove the node from the tree. Returns the position of the node - in its parent's children before it was removed.""" + """ + Remove the node from the tree. Returns the position of the node in its + parent's children before it was removed. + """ if self.parent: for i, node in enumerate(self.parent.children): if node is self: @@ -162,10 +173,12 @@ self.parent = None return i - def get_next_sibling(self): - """Return the node immediately following the invocant in their - parent's children list. If the invocant does not have a next - sibling, return None.""" + @property + def next_sibling(self): + """ + The node immediately following the invocant in their parent's children + list. If the invocant does not have a next sibling, it is None + """ if self.parent is None: return None @@ -177,10 +190,12 @@ except IndexError: return None - def get_prev_sibling(self): - """Return the node immediately preceding the invocant in their - parent's children list. If the invocant does not have a previous - sibling, return None.""" + @property + def prev_sibling(self): + """ + The node immediately preceding the invocant in their parent's children + list. If the invocant does not have a previous sibling, it is None. + """ if self.parent is None: return None @@ -192,9 +207,11 @@ return self.parent.children[i-1] def get_suffix(self): - """Return the string immediately following the invocant node. This - is effectively equivalent to node.get_next_sibling().get_prefix()""" - next_sib = self.get_next_sibling() + """ + Return the string immediately following the invocant node. This is + effectively equivalent to node.next_sibling.get_prefix() + """ + next_sib = self.next_sibling if next_sib is None: return "" return next_sib.get_prefix() @@ -205,7 +222,8 @@ """Concrete implementation for interior nodes.""" def __init__(self, type, children, context=None, prefix=None): - """Initializer. + """ + Initializer. Takes a type constant (a symbol number >= 256), a sequence of child nodes, and an optional context keyword argument. @@ -222,42 +240,44 @@ self.set_prefix(prefix) def __repr__(self): - """Returns a canonical string representation.""" + """Return a canonical string representation.""" return "%s(%s, %r)" % (self.__class__.__name__, type_repr(self.type), self.children) def __str__(self): - """Returns a pretty string representation. + """ + Return a pretty string representation. This reproduces the input source exactly. """ return "".join(map(str, self.children)) def _eq(self, other): - """Compares two nodes for equality.""" + """Compare two nodes for equality.""" return (self.type, self.children) == (other.type, other.children) def clone(self): - """Returns a cloned (deep) copy of self.""" + """Return a cloned (deep) copy of self.""" return Node(self.type, [ch.clone() for ch in self.children]) def post_order(self): - """Returns a post-order iterator for the tree.""" + """Return a post-order iterator for the tree.""" for child in self.children: for node in child.post_order(): yield node yield self def pre_order(self): - """Returns a pre-order iterator for the tree.""" + """Return a pre-order iterator for the tree.""" yield self for child in self.children: for node in child.post_order(): yield node def set_prefix(self, prefix): - """Sets the prefix for the node. + """ + Set the prefix for the node. This passes the responsibility on to the first child. """ @@ -265,7 +285,8 @@ self.children[0].set_prefix(prefix) def get_prefix(self): - """Returns the prefix for the node. + """ + Return the prefix for the node. This passes the call on to the first child. """ @@ -274,23 +295,29 @@ return self.children[0].get_prefix() def set_child(self, i, child): - """Equivalent to 'node.children[i] = child'. This method also sets the - child's parent attribute appropriately.""" + """ + Equivalent to 'node.children[i] = child'. This method also sets the + child's parent attribute appropriately. + """ child.parent = self self.children[i].parent = None self.children[i] = child self.changed() def insert_child(self, i, child): - """Equivalent to 'node.children.insert(i, child)'. This method also - sets the child's parent attribute appropriately.""" + """ + Equivalent to 'node.children.insert(i, child)'. This method also sets + the child's parent attribute appropriately. + """ child.parent = self self.children.insert(i, child) self.changed() def append_child(self, child): - """Equivalent to 'node.children.append(child)'. This method also - sets the child's parent attribute appropriately.""" + """ + Equivalent to 'node.children.append(child)'. This method also sets the + child's parent attribute appropriately. + """ child.parent = self self.children.append(child) self.changed() @@ -306,10 +333,11 @@ column = 0 # Column where this token tarts in the input def __init__(self, type, value, context=None, prefix=None): - """Initializer. + """ + Initializer. - Takes a type constant (a token number < 256), a string value, - and an optional context keyword argument. + Takes a type constant (a token number < 256), a string value, and an + optional context keyword argument. """ assert 0 <= type < 256, type if context is not None: @@ -320,51 +348,53 @@ self.prefix = prefix def __repr__(self): - """Returns a canonical string representation.""" + """Return a canonical string representation.""" return "%s(%r, %r)" % (self.__class__.__name__, self.type, self.value) def __str__(self): - """Returns a pretty string representation. + """ + Return a pretty string representation. This reproduces the input source exactly. """ return self.prefix + str(self.value) def _eq(self, other): - """Compares two nodes for equality.""" + """Compare two nodes for equality.""" return (self.type, self.value) == (other.type, other.value) def clone(self): - """Returns a cloned (deep) copy of self.""" + """Return a cloned (deep) copy of self.""" return Leaf(self.type, self.value, (self.prefix, (self.lineno, self.column))) def post_order(self): - """Returns a post-order iterator for the tree.""" + """Return a post-order iterator for the tree.""" yield self def pre_order(self): - """Returns a pre-order iterator for the tree.""" + """Return a pre-order iterator for the tree.""" yield self def set_prefix(self, prefix): - """Sets the prefix for the node.""" + """Set the prefix for the node.""" self.changed() self.prefix = prefix def get_prefix(self): - """Returns the prefix for the node.""" + """Return the prefix for the node.""" return self.prefix def convert(gr, raw_node): - """Converts raw node information to a Node or Leaf instance. + """ + Convert raw node information to a Node or Leaf instance. - This is passed to the parser driver which calls it whenever a - reduction of a grammar rule produces a new complete node, so that - the tree is build strictly bottom-up. + This is passed to the parser driver which calls it whenever a reduction of a + grammar rule produces a new complete node, so that the tree is build + strictly bottom-up. """ type, value, context, children = raw_node if children or type in gr.number2symbol: @@ -379,7 +409,8 @@ class BasePattern(object): - """A pattern is a tree matching pattern. + """ + A pattern is a tree matching pattern. It looks for a specific node type (token or symbol), and optionally for a specific content. @@ -409,14 +440,16 @@ return "%s(%s)" % (self.__class__.__name__, ", ".join(map(repr, args))) def optimize(self): - """A subclass can define this as a hook for optimizations. + """ + A subclass can define this as a hook for optimizations. Returns either self or another node with the same effect. """ return self def match(self, node, results=None): - """Does this pattern exactly match a node? + """ + Does this pattern exactly match a node? Returns True if it matches, False if not. @@ -440,7 +473,8 @@ return True def match_seq(self, nodes, results=None): - """Does this pattern exactly match a sequence of nodes? + """ + Does this pattern exactly match a sequence of nodes? Default implementation for non-wildcard patterns. """ @@ -449,7 +483,8 @@ return self.match(nodes[0], results) def generate_matches(self, nodes): - """Generator yielding all matches for this pattern. + """ + Generator yielding all matches for this pattern. Default implementation for non-wildcard patterns. """ @@ -461,7 +496,8 @@ class LeafPattern(BasePattern): def __init__(self, type=None, content=None, name=None): - """Initializer. Takes optional type, content, and name. + """ + Initializer. Takes optional type, content, and name. The type, if given must be a token type (< 256). If not given, this matches any *leaf* node; the content may still be required. @@ -486,7 +522,8 @@ return BasePattern.match(self, node, results) def _submatch(self, node, results=None): - """Match the pattern's content to the node's children. + """ + Match the pattern's content to the node's children. This assumes the node type matches and self.content is not None. @@ -505,7 +542,8 @@ wildcards = False def __init__(self, type=None, content=None, name=None): - """Initializer. Takes optional type, content, and name. + """ + Initializer. Takes optional type, content, and name. The type, if given, must be a symbol type (>= 256). If the type is None this matches *any* single node (leaf or not), @@ -533,7 +571,8 @@ self.name = name def _submatch(self, node, results=None): - """Match the pattern's content to the node's children. + """ + Match the pattern's content to the node's children. This assumes the node type matches and self.content is not None. @@ -561,7 +600,8 @@ class WildcardPattern(BasePattern): - """A wildcard pattern can match zero or more nodes. + """ + A wildcard pattern can match zero or more nodes. This has all the flexibility needed to implement patterns like: @@ -573,7 +613,8 @@ """ def __init__(self, content=None, min=0, max=HUGE, name=None): - """Initializer. + """ + Initializer. Args: content: optional sequence of subsequences of patterns; @@ -641,7 +682,8 @@ return False def generate_matches(self, nodes): - """Generator yielding matches for a sequence of nodes. + """ + Generator yielding matches for a sequence of nodes. Args: nodes: sequence of nodes @@ -744,7 +786,8 @@ class NegatedPattern(BasePattern): def __init__(self, content=None): - """Initializer. + """ + Initializer. The argument is either a pattern or None. If it is None, this only matches an empty sequence (effectively '$' in regex @@ -776,7 +819,8 @@ def generate_matches(patterns, nodes): - """Generator yielding matches for a sequence of patterns and nodes. + """ + Generator yielding matches for a sequence of patterns and nodes. Args: patterns: a sequence of patterns Modified: python/branches/py3k/Lib/lib2to3/refactor.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/refactor.py (original) +++ python/branches/py3k/Lib/lib2to3/refactor.py Wed May 6 01:23:31 2009 @@ -506,6 +506,63 @@ yield "" +class MultiprocessingUnsupported(Exception): + pass + + +class MultiprocessRefactoringTool(RefactoringTool): + + def __init__(self, *args, **kwargs): + super(MultiprocessRefactoringTool, self).__init__(*args, **kwargs) + self.queue = None + + def refactor(self, items, write=False, doctests_only=False, + num_processes=1): + if num_processes == 1: + return super(MultiprocessRefactoringTool, self).refactor( + items, write, doctests_only) + try: + import multiprocessing + except ImportError: + raise MultiprocessingUnsupported + if self.queue is not None: + raise RuntimeError("already doing multiple processes") + self.queue = multiprocessing.JoinableQueue() + processes = [multiprocessing.Process(target=self._child) + for i in xrange(num_processes)] + try: + for p in processes: + p.start() + super(MultiprocessRefactoringTool, self).refactor(items, write, + doctests_only) + finally: + self.queue.join() + for i in xrange(num_processes): + self.queue.put(None) + for p in processes: + if p.is_alive(): + p.join() + self.queue = None + + def _child(self): + task = self.queue.get() + while task is not None: + args, kwargs = task + try: + super(MultiprocessRefactoringTool, self).refactor_file( + *args, **kwargs) + finally: + self.queue.task_done() + task = self.queue.get() + + def refactor_file(self, *args, **kwargs): + if self.queue is not None: + self.queue.put((args, kwargs)) + else: + return super(MultiprocessRefactoringTool, self).refactor_file( + *args, **kwargs) + + def diff_texts(a, b, filename): """Return a unified diff of two strings.""" a = a.splitlines() Modified: python/branches/py3k/Lib/lib2to3/tests/test_fixers.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/tests/test_fixers.py (original) +++ python/branches/py3k/Lib/lib2to3/tests/test_fixers.py Wed May 6 01:23:31 2009 @@ -3404,6 +3404,18 @@ a = "from itertools import bar as bang" self.check(b, a) + b = "from itertools import izip as _zip, imap, bar" + a = "from itertools import bar" + self.check(b, a) + + b = "from itertools import imap as _map" + a = "" + self.check(b, a) + + b = "from itertools import imap as _map, izip as _zip" + a = "" + self.check(b, a) + s = "from itertools import bar as bang" self.unchanged(s) Modified: python/branches/py3k/Lib/lib2to3/tests/test_pytree.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/tests/test_pytree.py (original) +++ python/branches/py3k/Lib/lib2to3/tests/test_pytree.py Wed May 6 01:23:31 2009 @@ -306,36 +306,36 @@ n2 = pytree.Node(1000, []) p1 = pytree.Node(1000, [n1, n2]) - self.failUnless(n1.get_next_sibling() is n2) - self.assertEqual(n2.get_next_sibling(), None) - self.assertEqual(p1.get_next_sibling(), None) + self.failUnless(n1.next_sibling is n2) + self.assertEqual(n2.next_sibling, None) + self.assertEqual(p1.next_sibling, None) def testLeafNextSibling(self): l1 = pytree.Leaf(100, "a") l2 = pytree.Leaf(100, "b") p1 = pytree.Node(1000, [l1, l2]) - self.failUnless(l1.get_next_sibling() is l2) - self.assertEqual(l2.get_next_sibling(), None) - self.assertEqual(p1.get_next_sibling(), None) + self.failUnless(l1.next_sibling is l2) + self.assertEqual(l2.next_sibling, None) + self.assertEqual(p1.next_sibling, None) def testNodePrevSibling(self): n1 = pytree.Node(1000, []) n2 = pytree.Node(1000, []) p1 = pytree.Node(1000, [n1, n2]) - self.failUnless(n2.get_prev_sibling() is n1) - self.assertEqual(n1.get_prev_sibling(), None) - self.assertEqual(p1.get_prev_sibling(), None) + self.failUnless(n2.prev_sibling is n1) + self.assertEqual(n1.prev_sibling, None) + self.assertEqual(p1.prev_sibling, None) def testLeafPrevSibling(self): l1 = pytree.Leaf(100, "a") l2 = pytree.Leaf(100, "b") p1 = pytree.Node(1000, [l1, l2]) - self.failUnless(l2.get_prev_sibling() is l1) - self.assertEqual(l1.get_prev_sibling(), None) - self.assertEqual(p1.get_prev_sibling(), None) + self.failUnless(l2.prev_sibling is l1) + self.assertEqual(l1.prev_sibling, None) + self.assertEqual(p1.prev_sibling, None) class TestPatterns(support.TestCase): From buildbot at python.org Wed May 6 02:07:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 06 May 2009 00:07:26 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090506000726.60BDF1E4013@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1257 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_time make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed May 6 02:20:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 06 May 2009 00:20:39 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090506002039.38D171E4017@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/902 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_os make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed May 6 04:43:58 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 6 May 2009 04:43:58 +0200 (CEST) Subject: [Python-checkins] r72371 - in python/branches/py3k/Modules: socketmodule.c socketmodule.h Message-ID: <20090506024358.5EBEE1E4002@bag.python.org> Author: benjamin.peterson Date: Wed May 6 04:43:58 2009 New Revision: 72371 Log: turn this into a macro Modified: python/branches/py3k/Modules/socketmodule.c python/branches/py3k/Modules/socketmodule.h Modified: python/branches/py3k/Modules/socketmodule.c ============================================================================== --- python/branches/py3k/Modules/socketmodule.c (original) +++ python/branches/py3k/Modules/socketmodule.c Wed May 6 04:43:58 2009 @@ -4146,14 +4146,6 @@ NULL }; -PySocketModule_APIObject * -PySocketModule_ImportModuleAndAPI(void) -{ - void *api; - api = PyCapsule_Import(PySocket_CAPSULE_NAME, 1);; - return (PySocketModule_APIObject *)api; -} - /* Initialize the _socket module. Modified: python/branches/py3k/Modules/socketmodule.h ============================================================================== --- python/branches/py3k/Modules/socketmodule.h (original) +++ python/branches/py3k/Modules/socketmodule.h Wed May 6 04:43:58 2009 @@ -190,38 +190,9 @@ PyObject *error; } PySocketModule_APIObject; -/* XXX The net effect of the following appears to be to define a function - XXX named PySocketModule_APIObject in _ssl.c. It's unclear why it isn't - XXX defined there directly. +#define PySocketModule_ImportModuleAndAPI() PyCapsule_Import(PySocket_CAPSULE_NAME, 1) - >>> It's defined here because other modules might also want to use - >>> the C API. - -*/ -#ifndef PySocket_BUILDING_SOCKET - -/* --- C API ----------------------------------------------------*/ - -/* Interfacestructure to C API for other modules. - Call PySocketModule_ImportModuleAndAPI() to initialize this - structure. After that usage is simple: - - if (!PyArg_ParseTuple(args, "O!|zz:ssl", - &PySocketModule.Sock_Type, (PyObject*)&Sock, - &key_file, &cert_file)) - return NULL; - ... -*/ - -/* You *must* call this before using any of the functions in - PySocketModule and check its outcome; otherwise all accesses will - result in a segfault. Returns 0 on success. */ - -PyAPI_FUNC(PySocketModule_APIObject *) PySocketModule_ImportModuleAndAPI(void); - -#endif /* !PySocket_BUILDING_SOCKET */ - -#ifdef __cplusplus +#ifdef __cpluplus } #endif #endif /* !Py__SOCKET_H */ From python-checkins at python.org Wed May 6 05:23:38 2009 From: python-checkins at python.org (kurt.kaiser) Date: Wed, 6 May 2009 05:23:38 +0200 (CEST) Subject: [Python-checkins] r72372 - in python/branches/py3k: Lib/idlelib/OutputWindow.py Message-ID: <20090506032338.2923F1E4002@bag.python.org> Author: kurt.kaiser Date: Wed May 6 05:23:37 2009 New Revision: 72372 Log: Merged revisions 72227 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72227 | kurt.kaiser | 2009-05-02 22:05:22 -0400 (Sat, 02 May 2009) | 2 lines Further development of issue5559, handle Windows files which not only have embedded spaces, but leading spaces. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/idlelib/OutputWindow.py Modified: python/branches/py3k/Lib/idlelib/OutputWindow.py ============================================================================== --- python/branches/py3k/Lib/idlelib/OutputWindow.py (original) +++ python/branches/py3k/Lib/idlelib/OutputWindow.py Wed May 6 05:23:37 2009 @@ -55,10 +55,12 @@ ] file_line_pats = [ + # order of patterns matters r'file "([^"]*)", line (\d+)', r'([^\s]+)\((\d+)\)', - r'([^\s]+):\s*(\d+):', - r'^\s*(\S+.*?):\s*(\d+):', # Win path with spaces, trim leading spaces + r'^(\s*\S.*?):\s*(\d+):', # Win filename, maybe starting with spaces + r'([^\s]+):\s*(\d+):', # filename or path, ltrim + r'^\s*(\S.*?):\s*(\d+):', # Win abs path with embedded spaces, ltrim ] file_line_progs = None From python-checkins at python.org Wed May 6 05:38:31 2009 From: python-checkins at python.org (kurt.kaiser) Date: Wed, 6 May 2009 05:38:31 +0200 (CEST) Subject: [Python-checkins] r72373 - in python/branches/py3k: Lib/idlelib/NEWS.txt Lib/idlelib/idle.py Message-ID: <20090506033831.91E231E4002@bag.python.org> Author: kurt.kaiser Date: Wed May 6 05:38:31 2009 New Revision: 72373 Log: Merged revisions 72226 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72226 | kurt.kaiser | 2009-05-02 21:03:44 -0400 (Sat, 02 May 2009) | 3 lines idle.py modified and simplified to better support developing experimental versions of IDLE which are not installed in the standard location. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/idlelib/NEWS.txt python/branches/py3k/Lib/idlelib/idle.py Modified: python/branches/py3k/Lib/idlelib/NEWS.txt ============================================================================== --- python/branches/py3k/Lib/idlelib/NEWS.txt (original) +++ python/branches/py3k/Lib/idlelib/NEWS.txt Wed May 6 05:38:31 2009 @@ -30,6 +30,9 @@ *Release date: XX-XXX-2009* +- idle.py modified and simplified to better support developing experimental + versions of IDLE which are not installed in the standard location. + - OutputWindow/PyShell right click menu "Go to file/line" wasn't working with file paths containing spaces. Bug 5559. Modified: python/branches/py3k/Lib/idlelib/idle.py ============================================================================== --- python/branches/py3k/Lib/idlelib/idle.py (original) +++ python/branches/py3k/Lib/idlelib/idle.py Wed May 6 05:38:31 2009 @@ -1,22 +1,11 @@ -try: - import idlelib, idlelib.PyShell -except ImportError: - # IDLE is not installed, but maybe PyShell is on sys.path: - print("*** idle.py import error! Trying alternate approach....") - try: - import PyShell - except ImportError: - raise - else: - import os - idledir = os.path.dirname(os.path.abspath(PyShell.__file__)) - if idledir != os.getcwd(): - # We're not in the IDLE directory, help the subprocess find run.py - pypath = os.environ.get('PYTHONPATH', '') - if pypath: - os.environ['PYTHONPATH'] = pypath + ':' + idledir - else: - os.environ['PYTHONPATH'] = idledir - PyShell.main() -else: - idlelib.PyShell.main() +import os.path +import sys + +# If we are working on a development version of IDLE, we need to prepend the +# parent of this idlelib dir to sys.path. Otherwise, importing idlelib gets +# the version installed with the Python used to call this module: +idlelib_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +sys.path.insert(0, idlelib_dir) + +import idlelib.PyShell +idlelib.PyShell.main() From python-checkins at python.org Wed May 6 06:02:40 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Wed, 6 May 2009 06:02:40 +0200 (CEST) Subject: [Python-checkins] r72374 - in python/branches/py3k/PC: VC6/pythoncore.dsp VS7.1/pythoncore.vcproj VS8.0/pythoncore.vcproj Message-ID: <20090506040240.042BF1E4002@bag.python.org> Author: hirokazu.yamamoto Date: Wed May 6 06:02:39 2009 New Revision: 72374 Log: Added Objects/capsule.c to project files. Modified: python/branches/py3k/PC/VC6/pythoncore.dsp python/branches/py3k/PC/VS7.1/pythoncore.vcproj python/branches/py3k/PC/VS8.0/pythoncore.vcproj Modified: python/branches/py3k/PC/VC6/pythoncore.dsp ============================================================================== --- python/branches/py3k/PC/VC6/pythoncore.dsp (original) +++ python/branches/py3k/PC/VC6/pythoncore.dsp Wed May 6 06:02:39 2009 @@ -273,6 +273,10 @@ # End Source File # Begin Source File +SOURCE=..\..\Objects\capsule.c +# End Source File +# Begin Source File + SOURCE=..\..\Objects\cellobject.c # End Source File # Begin Source File Modified: python/branches/py3k/PC/VS7.1/pythoncore.vcproj ============================================================================== --- python/branches/py3k/PC/VS7.1/pythoncore.vcproj (original) +++ python/branches/py3k/PC/VS7.1/pythoncore.vcproj Wed May 6 06:02:39 2009 @@ -472,6 +472,9 @@ RelativePath="..\..\Objects\bytesobject.c"> + + + + From buildbot at python.org Wed May 6 06:08:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 06 May 2009 04:08:18 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090506040818.4EC6D1E4002@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/469 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed May 6 07:25:43 2009 From: python-checkins at python.org (jeroen.ruigrok) Date: Wed, 6 May 2009 07:25:43 +0200 (CEST) Subject: [Python-checkins] r72375 - python/trunk/Lib/locale.py Message-ID: <20090506052543.1772A1E4012@bag.python.org> Author: jeroen.ruigrok Date: Wed May 6 07:25:42 2009 New Revision: 72375 Log: Wrap getpreferredencoding()'s use of setlocale in a try/except to prevent us from raising an exception when the locale is invalid. Issue #1443504 Modified: python/trunk/Lib/locale.py Modified: python/trunk/Lib/locale.py ============================================================================== --- python/trunk/Lib/locale.py (original) +++ python/trunk/Lib/locale.py Wed May 6 07:25:42 2009 @@ -553,7 +553,10 @@ according to the system configuration.""" if do_setlocale: oldloc = setlocale(LC_CTYPE) - setlocale(LC_CTYPE, "") + try: + setlocale(LC_CTYPE, "") + except: + pass result = nl_langinfo(CODESET) setlocale(LC_CTYPE, oldloc) return result From python-checkins at python.org Wed May 6 07:33:24 2009 From: python-checkins at python.org (jeroen.ruigrok) Date: Wed, 6 May 2009 07:33:24 +0200 (CEST) Subject: [Python-checkins] r72376 - in python/branches/py3k: Lib/locale.py Message-ID: <20090506053324.C7D551E4012@bag.python.org> Author: jeroen.ruigrok Date: Wed May 6 07:33:24 2009 New Revision: 72376 Log: Merged revisions 72375 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72375 | jeroen.ruigrok | 2009-05-06 07:25:42 +0200 (wo, 06 mei 2009) | 5 lines Wrap getpreferredencoding()'s use of setlocale in a try/except to prevent us from raising an exception when the locale is invalid. Issue #1443504 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/locale.py Modified: python/branches/py3k/Lib/locale.py ============================================================================== --- python/branches/py3k/Lib/locale.py (original) +++ python/branches/py3k/Lib/locale.py Wed May 6 07:33:24 2009 @@ -564,7 +564,10 @@ according to the system configuration.""" if do_setlocale: oldloc = setlocale(LC_CTYPE) - setlocale(LC_CTYPE, "") + try: + setlocale(LC_CTYPE, "") + except: + pass result = nl_langinfo(CODESET) setlocale(LC_CTYPE, oldloc) return result From python-checkins at python.org Wed May 6 09:17:53 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 6 May 2009 09:17:53 +0200 (CEST) Subject: [Python-checkins] r72377 - in python/trunk/Lib/distutils: command/build_clib.py tests/test_build_clib.py Message-ID: <20090506071753.7350B1E4012@bag.python.org> Author: tarek.ziade Date: Wed May 6 09:17:52 2009 New Revision: 72377 Log: Added a test and cleaned check_library_list to be ready to fix #5940 Added: python/trunk/Lib/distutils/tests/test_build_clib.py (contents, props changed) Modified: python/trunk/Lib/distutils/command/build_clib.py Modified: python/trunk/Lib/distutils/command/build_clib.py ============================================================================== --- python/trunk/Lib/distutils/command/build_clib.py (original) +++ python/trunk/Lib/distutils/command/build_clib.py Wed May 6 09:17:52 2009 @@ -127,43 +127,41 @@ # run() - def check_library_list (self, libraries): - """Ensure that the list of libraries (presumably provided as a - command option 'libraries') is valid, i.e. it is a list of - 2-tuples, where the tuples are (library_name, build_info_dict). - Raise DistutilsSetupError if the structure is invalid anywhere; - just returns otherwise.""" + def check_library_list(self, libraries): + """Ensure that the list of libraries is valid. - # Yechh, blecch, ackk: this is ripped straight out of build_ext.py, - # with only names changed to protect the innocent! - - if type(libraries) is not ListType: + `library` is presumably provided as a command option 'libraries'. + This method checks that it is a list of 2-tuples, where the tuples + are (library_name, build_info_dict). + + Raise DistutilsSetupError if the structure is invalid anywhere; + just returns otherwise. + """ + if not isinstance(libraries, list): raise DistutilsSetupError, \ "'libraries' option must be a list of tuples" for lib in libraries: - if type(lib) is not TupleType and len(lib) != 2: + if not isinstance(lib, tuple) and len(lib) != 2: raise DistutilsSetupError, \ "each element of 'libraries' must a 2-tuple" - if type(lib[0]) is not StringType: + name, build_info = lib + + if not isinstance(name, str): raise DistutilsSetupError, \ "first element of each tuple in 'libraries' " + \ "must be a string (the library name)" - if '/' in lib[0] or (os.sep != '/' and os.sep in lib[0]): + if '/' in name or (os.sep != '/' and os.sep in name): raise DistutilsSetupError, \ ("bad library name '%s': " + "may not contain directory separators") % \ lib[0] - if type(lib[1]) is not DictionaryType: + if not isinstance(build_info, dict): raise DistutilsSetupError, \ "second element of each tuple in 'libraries' " + \ "must be a dictionary (build info)" - # for lib - - # check_library_list () - def get_library_names (self): # Assume the library list is valid -- 'check_library_list()' is Added: python/trunk/Lib/distutils/tests/test_build_clib.py ============================================================================== --- (empty file) +++ python/trunk/Lib/distutils/tests/test_build_clib.py Wed May 6 09:17:52 2009 @@ -0,0 +1,47 @@ +"""Tests for distutils.command.build_clib.""" +import unittest + +from distutils.command.build_clib import build_clib +from distutils.errors import DistutilsSetupError +from distutils.tests import support + +class BuildCLibTestCase(support.TempdirManager, + support.LoggingSilencer, + unittest.TestCase): + + def test_check_library_dist(self): + pkg_dir, dist = self.create_dist() + cmd = build_clib(dist) + + # 'libraries' option must be a list + self.assertRaises(DistutilsSetupError, cmd.check_library_list, 'foo') + + # each element of 'libraries' must a 2-tuple + self.assertRaises(DistutilsSetupError, cmd.check_library_list, + ['foo1', 'foo2']) + + # first element of each tuple in 'libraries' + # must be a string (the library name) + self.assertRaises(DistutilsSetupError, cmd.check_library_list, + [(1, 'foo1'), ('name', 'foo2')]) + + # library name may not contain directory separators + self.assertRaises(DistutilsSetupError, cmd.check_library_list, + [('name', 'foo1'), + ('another/name', 'foo2')]) + + # second element of each tuple must be a dictionary (build info) + self.assertRaises(DistutilsSetupError, cmd.check_library_list, + [('name', {}), + ('another', 'foo2')]) + + # those work + libs = [('name', {}), ('name', {'ok': 'good'})] + cmd.check_library_list(libs) + + +def test_suite(): + return unittest.makeSuite(BuildCLibTestCase) + +if __name__ == "__main__": + unittest.main(defaultTest="test_suite") From python-checkins at python.org Wed May 6 09:19:10 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 6 May 2009 09:19:10 +0200 (CEST) Subject: [Python-checkins] r72378 - python/branches/release26-maint Message-ID: <20090506071910.D1E801E4012@bag.python.org> Author: tarek.ziade Date: Wed May 6 09:19:10 2009 New Revision: 72378 Log: Blocked revisions 72377 via svnmerge ........ r72377 | tarek.ziade | 2009-05-06 09:17:52 +0200 (Wed, 06 May 2009) | 1 line Added a test and cleaned check_library_list to be ready to fix #5940 ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Wed May 6 09:26:24 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 6 May 2009 09:26:24 +0200 (CEST) Subject: [Python-checkins] r72379 - in python/branches/py3k: Lib/distutils/command/build_clib.py Lib/distutils/tests/test_build_clib.py Misc/NEWS Message-ID: <20090506072624.700FF1E404C@bag.python.org> Author: tarek.ziade Date: Wed May 6 09:26:24 2009 New Revision: 72379 Log: Fixed #5940: distutils.command.build_clib.check_library_list is doing the right checkings again Added: python/branches/py3k/Lib/distutils/tests/test_build_clib.py - copied unchanged from r72377, /python/trunk/Lib/distutils/tests/test_build_clib.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/command/build_clib.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/distutils/command/build_clib.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/build_clib.py (original) +++ python/branches/py3k/Lib/distutils/command/build_clib.py Wed May 6 09:26:24 2009 @@ -118,13 +118,15 @@ def check_library_list(self, libraries): - """Ensure that the list of libraries (presumably provided as a - command option 'libraries') is valid, i.e. it is a list of - 2-tuples, where the tuples are (library_name, build_info_dict). - Raise DistutilsSetupError if the structure is invalid anywhere; - just returns otherwise.""" - # Yechh, blecch, ackk: this is ripped straight out of build_ext.py, - # with only names changed to protect the innocent! + """Ensure that the list of libraries is valid. + + `library` is presumably provided as a command option 'libraries'. + This method checks that it is a list of 2-tuples, where the tuples + are (library_name, build_info_dict). + + Raise DistutilsSetupError if the structure is invalid anywhere; + just returns otherwise. + """ if not isinstance(libraries, list): raise DistutilsSetupError( "'libraries' option must be a list of tuples") @@ -134,15 +136,18 @@ raise DistutilsSetupError( "each element of 'libraries' must a 2-tuple") - if isinstance(lib[0], str): + name, build_info = lib + + if not isinstance(name, str): raise DistutilsSetupError( "first element of each tuple in 'libraries' " "must be a string (the library name)") - if '/' in lib[0] or (os.sep != '/' and os.sep in lib[0]): + + if '/' in name or (os.sep != '/' and os.sep in name): raise DistutilsSetupError("bad library name '%s': " "may not contain directory separators" % lib[0]) - if not isinstance(lib[1], dict): + if not isinstance(build_info, dict): raise DistutilsSetupError( "second element of each tuple in 'libraries' " "must be a dictionary (build info)") Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed May 6 09:26:24 2009 @@ -127,6 +127,9 @@ Library ------- +- Issue #5940: distutils.command.build_clib.check_library_list was not doing + the right type checkings anymore. + - Issue #4875: On win32, ctypes.util.find_library does no longer return directories. From python-checkins at python.org Wed May 6 09:30:48 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 6 May 2009 09:30:48 +0200 (CEST) Subject: [Python-checkins] r72380 - in python/branches/release30-maint: Lib/distutils/command/build_clib.py Lib/distutils/tests/test_build_clib.py Misc/NEWS Message-ID: <20090506073048.4834F1E401D@bag.python.org> Author: tarek.ziade Date: Wed May 6 09:30:47 2009 New Revision: 72380 Log: Merged revisions 72379 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r72379 | tarek.ziade | 2009-05-06 09:26:24 +0200 (Wed, 06 May 2009) | 1 line Fixed #5940: distutils.command.build_clib.check_library_list is doing the right checkings again ........ Added: python/branches/release30-maint/Lib/distutils/tests/test_build_clib.py - copied, changed from r72379, /python/branches/py3k/Lib/distutils/tests/test_build_clib.py Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/command/build_clib.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/distutils/command/build_clib.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/command/build_clib.py (original) +++ python/branches/release30-maint/Lib/distutils/command/build_clib.py Wed May 6 09:30:47 2009 @@ -118,13 +118,15 @@ def check_library_list(self, libraries): - """Ensure that the list of libraries (presumably provided as a - command option 'libraries') is valid, i.e. it is a list of - 2-tuples, where the tuples are (library_name, build_info_dict). - Raise DistutilsSetupError if the structure is invalid anywhere; - just returns otherwise.""" - # Yechh, blecch, ackk: this is ripped straight out of build_ext.py, - # with only names changed to protect the innocent! + """Ensure that the list of libraries is valid. + + `library` is presumably provided as a command option 'libraries'. + This method checks that it is a list of 2-tuples, where the tuples + are (library_name, build_info_dict). + + Raise DistutilsSetupError if the structure is invalid anywhere; + just returns otherwise. + """ if not isinstance(libraries, list): raise DistutilsSetupError( "'libraries' option must be a list of tuples") @@ -134,15 +136,18 @@ raise DistutilsSetupError( "each element of 'libraries' must a 2-tuple") - if isinstance(lib[0], str): + name, build_info = lib + + if not isinstance(name, str): raise DistutilsSetupError( "first element of each tuple in 'libraries' " "must be a string (the library name)") - if '/' in lib[0] or (os.sep != '/' and os.sep in lib[0]): + + if '/' in name or (os.sep != '/' and os.sep in name): raise DistutilsSetupError("bad library name '%s': " "may not contain directory separators" % lib[0]) - if not isinstance(lib[1], dict): + if not isinstance(build_info, dict): raise DistutilsSetupError( "second element of each tuple in 'libraries' " "must be a dictionary (build info)") Copied: python/branches/release30-maint/Lib/distutils/tests/test_build_clib.py (from r72379, /python/branches/py3k/Lib/distutils/tests/test_build_clib.py) ============================================================================== --- /python/branches/py3k/Lib/distutils/tests/test_build_clib.py (original) +++ python/branches/release30-maint/Lib/distutils/tests/test_build_clib.py Wed May 6 09:30:47 2009 @@ -1,6 +1,8 @@ """Tests for distutils.command.build_clib.""" import unittest +import os +from distutils.dist import Distribution from distutils.command.build_clib import build_clib from distutils.errors import DistutilsSetupError from distutils.tests import support @@ -10,7 +12,10 @@ unittest.TestCase): def test_check_library_dist(self): - pkg_dir, dist = self.create_dist() + tmp_dir = self.mkdtemp() + pkg_dir = os.path.join(tmp_dir, 'foo') + os.mkdir(pkg_dir) + dist = Distribution() cmd = build_clib(dist) # 'libraries' option must be a list Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Wed May 6 09:30:47 2009 @@ -55,6 +55,9 @@ Library ------- +- Issue #5940: distutils.command.build_clib.check_library_list was not doing + the right type checkings anymore. + - Issue #4875: On win32, ctypes.util.find_library does no longer return directories. From python-checkins at python.org Wed May 6 09:41:27 2009 From: python-checkins at python.org (jeroen.ruigrok) Date: Wed, 6 May 2009 09:41:27 +0200 (CEST) Subject: [Python-checkins] r72381 - in python/branches/release26-maint: Lib/locale.py Message-ID: <20090506074127.6A4E31E4051@bag.python.org> Author: jeroen.ruigrok Date: Wed May 6 09:41:26 2009 New Revision: 72381 Log: Merged revisions 72375 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72375 | jeroen.ruigrok | 2009-05-06 07:25:42 +0200 (wo, 06 mei 2009) | 5 lines Wrap getpreferredencoding()'s use of setlocale in a try/except to prevent us from raising an exception when the locale is invalid. Issue #1443504 ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/locale.py Modified: python/branches/release26-maint/Lib/locale.py ============================================================================== --- python/branches/release26-maint/Lib/locale.py (original) +++ python/branches/release26-maint/Lib/locale.py Wed May 6 09:41:26 2009 @@ -546,7 +546,10 @@ according to the system configuration.""" if do_setlocale: oldloc = setlocale(LC_CTYPE) - setlocale(LC_CTYPE, "") + try: + setlocale(LC_CTYPE, "") + except: + pass result = nl_langinfo(CODESET) setlocale(LC_CTYPE, oldloc) return result From python-checkins at python.org Wed May 6 09:41:54 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 6 May 2009 09:41:54 +0200 (CEST) Subject: [Python-checkins] r72382 - python/trunk/Lib/distutils/command/build_clib.py Message-ID: <20090506074154.1B16B1E40E2@bag.python.org> Author: tarek.ziade Date: Wed May 6 09:41:53 2009 New Revision: 72382 Log: pep8-fied build_clib module : it is now similar to the one in 3.x Modified: python/trunk/Lib/distutils/command/build_clib.py Modified: python/trunk/Lib/distutils/command/build_clib.py ============================================================================== --- python/trunk/Lib/distutils/command/build_clib.py (original) +++ python/trunk/Lib/distutils/command/build_clib.py Wed May 6 09:41:53 2009 @@ -17,7 +17,6 @@ # cut 'n paste. Sigh. import os, string -from types import * from distutils.core import Command from distutils.errors import * from distutils.sysconfig import customize_compiler @@ -52,7 +51,7 @@ "list available compilers", show_compilers), ] - def initialize_options (self): + def initialize_options(self): self.build_clib = None self.build_temp = None @@ -67,11 +66,8 @@ self.force = 0 self.compiler = None - # initialize_options() - - - def finalize_options (self): + def finalize_options(self): # This might be confusing: both build-clib and build-temp default # to build-temp as defined by the "build" command. This is because # I think that C libraries are really just temporary build @@ -97,11 +93,7 @@ # XXX same as for build_ext -- what about 'self.define' and # 'self.undef' ? - # finalize_options() - - - def run (self): - + def run(self): if not self.libraries: return @@ -124,8 +116,6 @@ self.build_libraries(self.libraries) - # run() - def check_library_list(self, libraries): """Ensure that the list of libraries is valid. @@ -163,10 +153,9 @@ "second element of each tuple in 'libraries' " + \ "must be a dictionary (build info)" - def get_library_names (self): + def get_library_names(self): # Assume the library list is valid -- 'check_library_list()' is # called from 'finalize_options()', so it should be! - if not self.libraries: return None @@ -175,10 +164,8 @@ lib_names.append(lib_name) return lib_names - # get_library_names () - - def get_source_files (self): + def get_source_files(self): self.check_library_list(self.libraries) filenames = [] for (lib_name, build_info) in self.libraries: @@ -191,13 +178,9 @@ "a list of source filenames") % lib_name filenames.extend(sources) - return filenames - # get_source_files () - def build_libraries (self, libraries): - for (lib_name, build_info) in libraries: sources = build_info.get('sources') if sources is None or type(sources) not in (ListType, TupleType): @@ -226,9 +209,3 @@ self.compiler.create_static_lib(objects, lib_name, output_dir=self.build_clib, debug=self.debug) - - # for libraries - - # build_libraries () - -# class build_lib From python-checkins at python.org Wed May 6 09:42:34 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 6 May 2009 09:42:34 +0200 (CEST) Subject: [Python-checkins] r72383 - python/branches/release26-maint Message-ID: <20090506074234.252381E4012@bag.python.org> Author: tarek.ziade Date: Wed May 6 09:42:33 2009 New Revision: 72383 Log: Blocked revisions 72382 via svnmerge ........ r72382 | tarek.ziade | 2009-05-06 09:41:53 +0200 (Wed, 06 May 2009) | 1 line pep8-fied build_clib module : it is now similar to the one in 3.x ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Wed May 6 09:42:39 2009 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 6 May 2009 09:42:39 +0200 (CEST) Subject: [Python-checkins] r72384 - peps/trunk/pep-0383.txt Message-ID: <20090506074239.137D71E4013@bag.python.org> Author: martin.v.loewis Date: Wed May 6 09:42:38 2009 New Revision: 72384 Log: Replace remaining python-escape occurrences. Modified: peps/trunk/pep-0383.txt Modified: peps/trunk/pep-0383.txt ============================================================================== --- peps/trunk/pep-0383.txt (original) +++ peps/trunk/pep-0383.txt Wed May 6 09:42:38 2009 @@ -95,7 +95,7 @@ While providing a uniform API to non-decodable bytes, this interface has the limitation that chosen representation only "works" if the data -get converted back to bytes with the python-escape error handler +get converted back to bytes with the utf8b error handler also. Encoding the data with the locale's encoding and the (default) strict error handler will raise an exception, encoding them with UTF-8 will produce non-sensical data. @@ -115,25 +115,25 @@ open(), which then encodes them back into their original byte representation. Applications that need to process the original byte strings can obtain them by encoding the character strings with the -file system encoding, passing "python-escape" as the error handler -name. For example, a function that works like os.listdir, except -for accepting and returning bytes, would be written as:: +file system encoding, passing "utf8b" as the error handler name. For +example, a function that works like os.listdir, except for accepting +and returning bytes, would be written as:: def listdir_b(dirname): fse = sys.getfilesystemencoding() - dirname = dirname.decode(fse, "python-escape") + dirname = dirname.decode(fse, "utf8b") for fn in os.listdir(dirname): # fn is now a str object - yield fn.encode(fse, "python-escape") + yield fn.encode(fse, "utf8b") The encode error handler interface presently requires replacement Unicode to be provide in lieu of the non-encodable Unicode from the source string. It promptly encodes that replacement Unicode. In some -error handlers, such as the python-escape proposed here, it is simpler +error handlers, such as the utf8 proposed here, it is simpler and more efficient for the error handler to provide a pre-encoded replacement byte string, rather than forcing it to calculating Unicode from which the encoder would create the desired bytes. In fact, with -python-escape, there are required byte sequences which cannot be +utf8b, there are required byte sequences which cannot be generated from replacement Unicode. A few alternative approaches have been proposed: From python-checkins at python.org Wed May 6 09:43:09 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 6 May 2009 09:43:09 +0200 (CEST) Subject: [Python-checkins] r72385 - python/branches/py3k Message-ID: <20090506074309.4265D1E4012@bag.python.org> Author: tarek.ziade Date: Wed May 6 09:43:09 2009 New Revision: 72385 Log: Blocked revisions 72382 via svnmerge ........ r72382 | tarek.ziade | 2009-05-06 09:41:53 +0200 (Wed, 06 May 2009) | 1 line pep8-fied build_clib module : it is now similar to the one in 3.x ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Wed May 6 09:53:21 2009 From: python-checkins at python.org (martin.v.loewis) Date: Wed, 6 May 2009 09:53:21 +0200 (CEST) Subject: [Python-checkins] r72386 - peps/trunk/pep-0383.txt Message-ID: <20090506075321.5D9841E4012@bag.python.org> Author: martin.v.loewis Date: Wed May 6 09:53:21 2009 New Revision: 72386 Log: Replace error handler discussion with text from Stephen Turnbull. Modified: peps/trunk/pep-0383.txt Modified: peps/trunk/pep-0383.txt ============================================================================== --- peps/trunk/pep-0383.txt (original) +++ peps/trunk/pep-0383.txt Wed May 6 09:53:21 2009 @@ -126,15 +126,17 @@ # fn is now a str object yield fn.encode(fse, "utf8b") -The encode error handler interface presently requires replacement -Unicode to be provide in lieu of the non-encodable Unicode from the -source string. It promptly encodes that replacement Unicode. In some -error handlers, such as the utf8 proposed here, it is simpler -and more efficient for the error handler to provide a pre-encoded -replacement byte string, rather than forcing it to calculating Unicode -from which the encoder would create the desired bytes. In fact, with -utf8b, there are required byte sequences which cannot be -generated from replacement Unicode. +The extension to the encode error handler interface proposed by this +PEP is necessary to implement the 'utf8b' error handler, because there +are required byte sequences which cannot be generated from replacement +Unicode. However, the encode error handler interface presently +requires replacement Unicode to be provided in lieu of the +non-encodable Unicode from the source string. Then it promptly +encodes that replacement Unicode. In some error handlers, such as the +'utf8b' proposed here, it is also simpler and more efficient for the +error handler to provide a pre-encoded replacement byte string, rather +than forcing it to calculating Unicode from which the encoder would +create the desired bytes. A few alternative approaches have been proposed: From python-checkins at python.org Wed May 6 10:04:55 2009 From: python-checkins at python.org (mark.hammond) Date: Wed, 6 May 2009 10:04:55 +0200 (CEST) Subject: [Python-checkins] r72387 - in python/branches/py3k: Doc/library/os.path.rst Lib/ntpath.py Lib/test/test_ntpath.py Misc/NEWS Message-ID: <20090506080455.42EBE1E4013@bag.python.org> Author: mark.hammond Date: Wed May 6 10:04:54 2009 New Revision: 72387 Log: Issue #5799: ntpath (ie, os.path on Windows) fully supports UNC pathnames. By Larry Hastings, reviewed eric.smith and mark.hammond. Modified: python/branches/py3k/Doc/library/os.path.rst python/branches/py3k/Lib/ntpath.py python/branches/py3k/Lib/test/test_ntpath.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Doc/library/os.path.rst ============================================================================== --- python/branches/py3k/Doc/library/os.path.rst (original) +++ python/branches/py3k/Doc/library/os.path.rst Wed May 6 10:04:54 2009 @@ -23,10 +23,6 @@ their parameters. The result is an object of the same type, if a path or file name is returned. -.. note:: - - On Windows, many of these functions do not properly support UNC pathnames. - :func:`splitunc` and :func:`ismount` do handle them correctly. .. note:: @@ -266,10 +262,20 @@ .. function:: splitdrive(path) Split the pathname *path* into a pair ``(drive, tail)`` where *drive* is either - a drive specification or the empty string. On systems which do not use drive + a mount point or the empty string. On systems which do not use drive specifications, *drive* will always be the empty string. In all cases, ``drive + tail`` will be the same as *path*. + On Windows, splits a pathname into drive/UNC sharepoint and relative path. + + If the path contains a drive letter, drive will contain everything + up to and including the colon. + e.g. ``splitdrive("c:/dir")`` returns ``("c:", "/dir")`` + + If the path contains a UNC path, drive will contain the host name + and share, up to but not including the fourth separator. + e.g. ``splitdrive("//host/computer/dir")`` returns ``("//host/computer", "/dir")`` + .. function:: splitext(path) @@ -281,6 +287,9 @@ .. function:: splitunc(path) + .. deprecated:: 3.1 + Use *splitdrive* instead. + Split the pathname *path* into a pair ``(unc, rest)`` so that *unc* is the UNC mount point (such as ``r'\\host\mount'``), if present, and *rest* the rest of the path (such as ``r'\path\file.ext'``). For paths containing drive letters, Modified: python/branches/py3k/Lib/ntpath.py ============================================================================== --- python/branches/py3k/Lib/ntpath.py (original) +++ python/branches/py3k/Lib/ntpath.py Wed May 6 10:04:54 2009 @@ -34,6 +34,12 @@ altsep = '/' devnull = 'nul' +def _get_empty(path): + if isinstance(path, bytes): + return b'' + else: + return '' + def _get_sep(path): if isinstance(path, bytes): return b'\\' @@ -76,9 +82,9 @@ # Return whether a path is absolute. -# Trivial in Posix, harder on the Mac or MS-DOS. -# For DOS it is absolute if it starts with a slash or backslash (current -# volume), or if a pathname after the volume letter and colon / UNC resource +# Trivial in Posix, harder on Windows. +# For Windows it is absolute if it starts with a slash or backslash (current +# volume), or if a pathname after the volume-letter-and-colon or UNC-resource # starts with a slash or backslash. def isabs(s): @@ -104,22 +110,40 @@ elif isabs(b): # This probably wipes out path so far. However, it's more - # complicated if path begins with a drive letter: + # complicated if path begins with a drive letter. You get a+b + # (minus redundant slashes) in these four cases: # 1. join('c:', '/a') == 'c:/a' - # 2. join('c:/', '/a') == 'c:/a' - # But - # 3. join('c:/a', '/b') == '/b' - # 4. join('c:', 'd:/') = 'd:/' - # 5. join('c:/', 'd:/') = 'd:/' - if path[1:2] != colon or b[1:2] == colon: - # Path doesn't start with a drive letter, or cases 4 and 5. - b_wins = 1 + # 2. join('//computer/share', '/a') == '//computer/share/a' + # 3. join('c:/', '/a') == 'c:/a' + # 4. join('//computer/share/', '/a') == '//computer/share/a' + # But b wins in all of these cases: + # 5. join('c:/a', '/b') == '/b' + # 6. join('//computer/share/a', '/b') == '/b' + # 7. join('c:', 'd:/') == 'd:/' + # 8. join('c:', '//computer/share/') == '//computer/share/' + # 9. join('//computer/share', 'd:/') == 'd:/' + # 10. join('//computer/share', '//computer/share/') == '//computer/share/' + # 11. join('c:/', 'd:/') == 'd:/' + # 12. join('c:/', '//computer/share/') == '//computer/share/' + # 13. join('//computer/share/', 'd:/') == 'd:/' + # 14. join('//computer/share/', '//computer/share/') == '//computer/share/' + b_prefix, b_rest = splitdrive(b) - # Else path has a drive letter, and b doesn't but is absolute. - elif len(path) > 3 or (len(path) == 3 and - path[-1:] not in seps): - # case 3 + # if b has a prefix, it always wins. + if b_prefix: b_wins = 1 + else: + # b doesn't have a prefix. + # but isabs(b) returned true. + # and therefore b_rest[0] must be a slash. + # (but let's check that.) + assert(b_rest and b_rest[0] in seps) + + # so, b still wins if path has a rest that's more than a sep. + # you get a+b if path_rest is empty or only has a sep. + # (see cases 1-4 for times when b loses.) + path_rest = splitdrive(path)[1] + b_wins = path_rest and path_rest not in seps if b_wins: path = b @@ -152,22 +176,64 @@ # colon) and the path specification. # It is always true that drivespec + pathspec == p def splitdrive(p): - """Split a pathname into drive and path specifiers. Returns a 2-tuple -"(drive,path)"; either part may be empty""" - if p[1:2] == _get_colon(p): - return p[0:2], p[2:] - return p[:0], p + """Split a pathname into drive/UNC sharepoint and relative path specifiers. + Returns a 2-tuple (drive_or_unc, path); either part may be empty. + + If you assign + result = splitdrive(p) + It is always true that: + result[0] + result[1] == p + + If the path contained a drive letter, drive_or_unc will contain everything + up to and including the colon. e.g. splitdrive("c:/dir") returns ("c:", "/dir") + + If the path contained a UNC path, the drive_or_unc will contain the host name + and share up to but not including the fourth directory separator character. + e.g. splitdrive("//host/computer/dir") returns ("//host/computer", "/dir") + + Paths cannot contain both a drive letter and a UNC path. + + """ + empty = _get_empty(p) + if len(p) > 1: + sep = _get_sep(p) + normp = normcase(p) + if (normp[0:2] == sep*2) and (normp[2:3] != sep): + # is a UNC path: + # vvvvvvvvvvvvvvvvvvvv drive letter or UNC path + # \\machine\mountpoint\directory\etc\... + # directory ^^^^^^^^^^^^^^^ + index = normp.find(sep, 2) + if index == -1: + return empty, p + index2 = normp.find(sep, index + 1) + # a UNC path can't have two slashes in a row + # (after the initial two) + if index2 == index + 1: + return empty, p + if index2 == -1: + index2 = len(p) + return p[:index2], p[index2:] + if normp[1:2] == _get_colon(p): + return p[:2], p[2:] + return empty, p # Parse UNC paths def splitunc(p): - """Split a pathname into UNC mount point and relative path specifiers. + """Deprecated since Python 3.1. Please use splitdrive() instead; + it now handles UNC paths. + + Split a pathname into UNC mount point and relative path specifiers. Return a 2-tuple (unc, rest); either part may be empty. If unc is not empty, it has the form '//host/mount' (or similar using backslashes). unc+rest is always the input path. Paths containing drive letters never have an UNC part. """ + import warnings + warnings.warn("ntpath.splitunc is deprecated, use ntpath.splitdrive instead", + PendingDeprecationWarning) sep = _get_sep(p) if not p[1:2]: return p[:0], p # Drive letter present @@ -256,12 +322,11 @@ def ismount(path): """Test whether a path is a mount point (defined as root of drive)""" - unc, rest = splitunc(path) seps = _get_bothseps(path) - if unc: - return rest in p[:0] + seps - p = splitdrive(path)[1] - return len(p) == 1 and p[0] in seps + root, rest = splitdrive(path) + if root and root[0] in seps: + return (not rest) or (rest in seps) + return rest in seps # Expand paths beginning with '~' or '~user'. @@ -445,25 +510,12 @@ dotdot = _get_dot(path) * 2 path = path.replace(_get_altsep(path), sep) prefix, path = splitdrive(path) - # We need to be careful here. If the prefix is empty, and the path starts - # with a backslash, it could either be an absolute path on the current - # drive (\dir1\dir2\file) or a UNC filename (\\server\mount\dir1\file). It - # is therefore imperative NOT to collapse multiple backslashes blindly in - # that case. - # The code below preserves multiple backslashes when there is no drive - # letter. This means that the invalid filename \\\a\b is preserved - # unchanged, where a\\\b is normalised to a\b. It's not clear that there - # is any better behaviour for such edge cases. - if not prefix: - # No drive letter - preserve initial backslashes - while path[:1] == sep: - prefix = prefix + sep - path = path[1:] - else: - # We have a drive letter - collapse initial backslashes - if path.startswith(sep): - prefix = prefix + sep - path = path.lstrip(sep) + + # collapse initial backslashes + if path.startswith(sep): + prefix = prefix + sep + path = path.lstrip(sep) + comps = path.split(sep) i = 0 while i < len(comps): @@ -528,22 +580,23 @@ if not path: raise ValueError("no path specified") - start_list = abspath(start).split(sep) - path_list = abspath(path).split(sep) - if start_list[0].lower() != path_list[0].lower(): - unc_path, rest = splitunc(path) - unc_start, rest = splitunc(start) - if bool(unc_path) ^ bool(unc_start): - raise ValueError("Cannot mix UNC and non-UNC paths (%s and %s)" - % (path, start)) - else: - raise ValueError("path is on drive %s, start on drive %s" - % (path_list[0], start_list[0])) + + start_abs = abspath(normpath(start)) + path_abs = abspath(normpath(path)) + start_drive, start_rest = splitdrive(start_abs) + path_drive, path_rest = splitdrive(path_abs) + if start_drive != path_drive: + error = "path is on mount '{0}', start on mount '{1}'".format( + path_drive, start_drive) + raise ValueError(error) + + start_list = [x for x in start_rest.split(sep) if x] + path_list = [x for x in path_rest.split(sep) if x] # Work out how much of the filepath is shared by start and path. - for i in range(min(len(start_list), len(path_list))): - if start_list[i].lower() != path_list[i].lower(): + i = 0 + for e1, e2 in zip(start_list, path_list): + if e1 != e2: break - else: i += 1 if isinstance(path, bytes): Modified: python/branches/py3k/Lib/test/test_ntpath.py ============================================================================== --- python/branches/py3k/Lib/test/test_ntpath.py (original) +++ python/branches/py3k/Lib/test/test_ntpath.py Wed May 6 10:04:54 2009 @@ -30,6 +30,7 @@ raise TestFailed("%s should return: %s but returned: %s" \ %(str(fn), str(wantResult), repr(gotResult))) + class TestNtpath(unittest.TestCase): def test_splitext(self): tester('ntpath.splitext("foo.ext")', ('foo', '.ext')) @@ -48,12 +49,18 @@ ('c:', '\\foo\\bar')) tester('ntpath.splitdrive("c:/foo/bar")', ('c:', '/foo/bar')) - - def test_splitunc(self): - tester('ntpath.splitunc("\\\\conky\\mountpoint\\foo\\bar")', + tester('ntpath.splitdrive("\\\\conky\\mountpoint\\foo\\bar")', ('\\\\conky\\mountpoint', '\\foo\\bar')) - tester('ntpath.splitunc("//conky/mountpoint/foo/bar")', + tester('ntpath.splitdrive("//conky/mountpoint/foo/bar")', ('//conky/mountpoint', '/foo/bar')) + tester('ntpath.splitdrive("\\\\\\conky\\mountpoint\\foo\\bar")', + ('', '\\\\\\conky\\mountpoint\\foo\\bar')) + tester('ntpath.splitdrive("///conky/mountpoint/foo/bar")', + ('', '///conky/mountpoint/foo/bar')) + tester('ntpath.splitdrive("\\\\conky\\\\mountpoint\\foo\\bar")', + ('', '\\\\conky\\\\mountpoint\\foo\\bar')) + tester('ntpath.splitdrive("//conky//mountpoint/foo/bar")', + ('', '//conky//mountpoint/foo/bar')) def test_split(self): tester('ntpath.split("c:\\foo\\bar")', ('c:\\foo', 'bar')) @@ -62,10 +69,10 @@ tester('ntpath.split("c:\\")', ('c:\\', '')) tester('ntpath.split("\\\\conky\\mountpoint\\")', - ('\\\\conky\\mountpoint', '')) + ('\\\\conky\\mountpoint\\', '')) tester('ntpath.split("c:/")', ('c:/', '')) - tester('ntpath.split("//conky/mountpoint/")', ('//conky/mountpoint', '')) + tester('ntpath.split("//conky/mountpoint/")', ('//conky/mountpoint/', '')) def test_isabs(self): tester('ntpath.isabs("c:\\")', 1) @@ -116,6 +123,33 @@ tester("ntpath.join('a\\', '')", 'a\\') tester("ntpath.join('a\\', '', '', '', '')", 'a\\') + # from comment in ntpath.join + tester("ntpath.join('c:', '/a')", 'c:/a') + tester("ntpath.join('//computer/share', '/a')", '//computer/share/a') + tester("ntpath.join('c:/', '/a')", 'c:/a') + tester("ntpath.join('//computer/share/', '/a')", '//computer/share/a') + tester("ntpath.join('c:/a', '/b')", '/b') + tester("ntpath.join('//computer/share/a', '/b')", '/b') + tester("ntpath.join('c:', 'd:/')", 'd:/') + tester("ntpath.join('c:', '//computer/share/')", '//computer/share/') + tester("ntpath.join('//computer/share', 'd:/')", 'd:/') + tester("ntpath.join('//computer/share', '//computer/share/')", '//computer/share/') + tester("ntpath.join('c:/', 'd:/')", 'd:/') + tester("ntpath.join('c:/', '//computer/share/')", '//computer/share/') + tester("ntpath.join('//computer/share/', 'd:/')", 'd:/') + tester("ntpath.join('//computer/share/', '//computer/share/')", '//computer/share/') + + tester("ntpath.join('c:', '//computer/share/')", '//computer/share/') + tester("ntpath.join('c:/', '//computer/share/')", '//computer/share/') + tester("ntpath.join('c:/', '//computer/share/a/b')", '//computer/share/a/b') + + tester("ntpath.join('\\\\computer\\share\\', 'a', 'b')", '\\\\computer\\share\\a\\b') + tester("ntpath.join('\\\\computer\\share', 'a', 'b')", '\\\\computer\\share\\a\\b') + tester("ntpath.join('\\\\computer\\share', 'a\\b')", '\\\\computer\\share\\a\\b') + tester("ntpath.join('//computer/share/', 'a', 'b')", '//computer/share/a\\b') + tester("ntpath.join('//computer/share', 'a', 'b')", '//computer/share\\a\\b') + tester("ntpath.join('//computer/share', 'a/b')", '//computer/share\\a/b') + def test_normpath(self): tester("ntpath.normpath('A//////././//.//B')", r'A\B') tester("ntpath.normpath('A/./B')", r'A\B') @@ -174,10 +208,9 @@ # from any platform. try: import nt + tester('ntpath.abspath("C:\\")', "C:\\") except ImportError: pass - else: - tester('ntpath.abspath("C:\\")', "C:\\") def test_relpath(self): currentdir = os.path.split(os.getcwd())[-1] @@ -188,8 +221,18 @@ tester('ntpath.relpath("a", "../b")', '..\\'+currentdir+'\\a') tester('ntpath.relpath("a/b", "../c")', '..\\'+currentdir+'\\a\\b') tester('ntpath.relpath("a", "b/c")', '..\\..\\a') + tester('ntpath.relpath("c:/foo/bar/bat", "c:/x/y")', '..\\..\\foo\\bar\\bat') tester('ntpath.relpath("//conky/mountpoint/a", "//conky/mountpoint/b/c")', '..\\..\\a') tester('ntpath.relpath("a", "a")', '.') + tester('ntpath.relpath("/foo/bar/bat", "/x/y/z")', '..\\..\\..\\foo\\bar\\bat') + tester('ntpath.relpath("/foo/bar/bat", "/foo/bar")', 'bat') + tester('ntpath.relpath("/foo/bar/bat", "/")', 'foo\\bar\\bat') + tester('ntpath.relpath("/", "/foo/bar/bat")', '..\\..\\..') + tester('ntpath.relpath("/foo/bar/bat", "/x")', '..\\foo\\bar\\bat') + tester('ntpath.relpath("/x", "/foo/bar/bat")', '..\\..\\..\\x') + tester('ntpath.relpath("/", "/")', '.') + tester('ntpath.relpath("/a", "/a")', '.') + tester('ntpath.relpath("/a/b", "/a/b")', '.') def test_main(): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed May 6 10:04:54 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #5799: ntpath (ie, os.path on Windows) fully supports UNC pathnames + in all operations, including splitdrive, split, etc. splitunc() now issues + a PendingDeprecation warning. + - Issue #5920: For float.__format__, change the behavior with the empty presentation type (that is, not one of 'e', 'f', 'g', or 'n') to be like 'g' but with at least one decimal point and with a From python-checkins at python.org Wed May 6 10:05:47 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 6 May 2009 10:05:47 +0200 (CEST) Subject: [Python-checkins] r72388 - in python/trunk/Lib/distutils: command/build_clib.py tests/test_build_clib.py Message-ID: <20090506080547.51BF51E4013@bag.python.org> Author: tarek.ziade Date: Wed May 6 10:05:47 2009 New Revision: 72388 Log: more build_clib cleanup + test coverage Modified: python/trunk/Lib/distutils/command/build_clib.py python/trunk/Lib/distutils/tests/test_build_clib.py Modified: python/trunk/Lib/distutils/command/build_clib.py ============================================================================== --- python/trunk/Lib/distutils/command/build_clib.py (original) +++ python/trunk/Lib/distutils/command/build_clib.py Wed May 6 10:05:47 2009 @@ -86,7 +86,7 @@ if self.include_dirs is None: self.include_dirs = self.distribution.include_dirs or [] - if type(self.include_dirs) is StringType: + if isinstance(self.include_dirs, str): self.include_dirs = string.split(self.include_dirs, os.pathsep) @@ -170,8 +170,7 @@ filenames = [] for (lib_name, build_info) in self.libraries: sources = build_info.get('sources') - if (sources is None or - type(sources) not in (ListType, TupleType) ): + if sources is None or not isinstance(sources, (list, tuple)): raise DistutilsSetupError, \ ("in 'libraries' option (library '%s'), " "'sources' must be present and must be " @@ -183,7 +182,7 @@ def build_libraries (self, libraries): for (lib_name, build_info) in libraries: sources = build_info.get('sources') - if sources is None or type(sources) not in (ListType, TupleType): + if sources is None or not isinstance(sources, (list, tuple)): raise DistutilsSetupError, \ ("in 'libraries' option (library '%s'), " + "'sources' must be present and must be " + Modified: python/trunk/Lib/distutils/tests/test_build_clib.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_build_clib.py (original) +++ python/trunk/Lib/distutils/tests/test_build_clib.py Wed May 6 10:05:47 2009 @@ -39,6 +39,63 @@ libs = [('name', {}), ('name', {'ok': 'good'})] cmd.check_library_list(libs) + def test_get_source_files(self): + pkg_dir, dist = self.create_dist() + cmd = build_clib(dist) + + # "in 'libraries' option 'sources' must be present and must be + # a list of source filenames + cmd.libraries = [('name', {})] + self.assertRaises(DistutilsSetupError, cmd.get_source_files) + + cmd.libraries = [('name', {'sources': 1})] + self.assertRaises(DistutilsSetupError, cmd.get_source_files) + + cmd.libraries = [('name', {'sources': ['a', 'b']})] + self.assertEquals(cmd.get_source_files(), ['a', 'b']) + + cmd.libraries = [('name', {'sources': ('a', 'b')})] + self.assertEquals(cmd.get_source_files(), ['a', 'b']) + + cmd.libraries = [('name', {'sources': ('a', 'b')}), + ('name2', {'sources': ['c', 'd']})] + self.assertEquals(cmd.get_source_files(), ['a', 'b', 'c', 'd']) + + def test_build_libraries(self): + + pkg_dir, dist = self.create_dist() + cmd = build_clib(dist) + class FakeCompiler: + def compile(*args, **kw): + pass + create_static_lib = compile + + cmd.compiler = FakeCompiler() + + # build_libraries is also doing a bit of typoe checking + lib = [('name', {'sources': 'notvalid'})] + self.assertRaises(DistutilsSetupError, cmd.build_libraries, lib) + + lib = [('name', {'sources': list()})] + cmd.build_libraries(lib) + + lib = [('name', {'sources': tuple()})] + cmd.build_libraries(lib) + + def test_finalize_options(self): + pkg_dir, dist = self.create_dist() + cmd = build_clib(dist) + + cmd.include_dirs = 'one-dir' + cmd.finalize_options() + self.assertEquals(cmd.include_dirs, ['one-dir']) + + cmd.include_dirs = None + cmd.finalize_options() + self.assertEquals(cmd.include_dirs, []) + + cmd.distribution.libraries = 'WONTWORK' + self.assertRaises(DistutilsSetupError, cmd.finalize_options) def test_suite(): return unittest.makeSuite(BuildCLibTestCase) From buildbot at python.org Wed May 6 10:06:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 06 May 2009 08:06:29 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090506080629.BA17A1E4013@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/471 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed May 6 10:06:36 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 6 May 2009 10:06:36 +0200 (CEST) Subject: [Python-checkins] r72389 - python/branches/release26-maint Message-ID: <20090506080636.EAC131E4013@bag.python.org> Author: tarek.ziade Date: Wed May 6 10:06:36 2009 New Revision: 72389 Log: Blocked revisions 72388 via svnmerge ........ r72388 | tarek.ziade | 2009-05-06 10:05:47 +0200 (Wed, 06 May 2009) | 1 line more build_clib cleanup + test coverage ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Wed May 6 10:08:26 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 6 May 2009 10:08:26 +0200 (CEST) Subject: [Python-checkins] r72390 - in python/branches/py3k: Lib/distutils/tests/test_build_clib.py Message-ID: <20090506080826.4DEF71E4013@bag.python.org> Author: tarek.ziade Date: Wed May 6 10:08:26 2009 New Revision: 72390 Log: Merged revisions 72388 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72388 | tarek.ziade | 2009-05-06 10:05:47 +0200 (Wed, 06 May 2009) | 1 line more build_clib cleanup + test coverage ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_build_clib.py Modified: python/branches/py3k/Lib/distutils/tests/test_build_clib.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_build_clib.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_build_clib.py Wed May 6 10:08:26 2009 @@ -39,6 +39,63 @@ libs = [('name', {}), ('name', {'ok': 'good'})] cmd.check_library_list(libs) + def test_get_source_files(self): + pkg_dir, dist = self.create_dist() + cmd = build_clib(dist) + + # "in 'libraries' option 'sources' must be present and must be + # a list of source filenames + cmd.libraries = [('name', {})] + self.assertRaises(DistutilsSetupError, cmd.get_source_files) + + cmd.libraries = [('name', {'sources': 1})] + self.assertRaises(DistutilsSetupError, cmd.get_source_files) + + cmd.libraries = [('name', {'sources': ['a', 'b']})] + self.assertEquals(cmd.get_source_files(), ['a', 'b']) + + cmd.libraries = [('name', {'sources': ('a', 'b')})] + self.assertEquals(cmd.get_source_files(), ['a', 'b']) + + cmd.libraries = [('name', {'sources': ('a', 'b')}), + ('name2', {'sources': ['c', 'd']})] + self.assertEquals(cmd.get_source_files(), ['a', 'b', 'c', 'd']) + + def test_build_libraries(self): + + pkg_dir, dist = self.create_dist() + cmd = build_clib(dist) + class FakeCompiler: + def compile(*args, **kw): + pass + create_static_lib = compile + + cmd.compiler = FakeCompiler() + + # build_libraries is also doing a bit of typoe checking + lib = [('name', {'sources': 'notvalid'})] + self.assertRaises(DistutilsSetupError, cmd.build_libraries, lib) + + lib = [('name', {'sources': list()})] + cmd.build_libraries(lib) + + lib = [('name', {'sources': tuple()})] + cmd.build_libraries(lib) + + def test_finalize_options(self): + pkg_dir, dist = self.create_dist() + cmd = build_clib(dist) + + cmd.include_dirs = 'one-dir' + cmd.finalize_options() + self.assertEquals(cmd.include_dirs, ['one-dir']) + + cmd.include_dirs = None + cmd.finalize_options() + self.assertEquals(cmd.include_dirs, []) + + cmd.distribution.libraries = 'WONTWORK' + self.assertRaises(DistutilsSetupError, cmd.finalize_options) def test_suite(): return unittest.makeSuite(BuildCLibTestCase) From python-checkins at python.org Wed May 6 10:09:02 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 6 May 2009 10:09:02 +0200 (CEST) Subject: [Python-checkins] r72391 - python/branches/release30-maint Message-ID: <20090506080902.4C3CE1E4013@bag.python.org> Author: tarek.ziade Date: Wed May 6 10:09:02 2009 New Revision: 72391 Log: Blocked revisions 72390 via svnmerge ................ r72390 | tarek.ziade | 2009-05-06 10:08:26 +0200 (Wed, 06 May 2009) | 9 lines Merged revisions 72388 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72388 | tarek.ziade | 2009-05-06 10:05:47 +0200 (Wed, 06 May 2009) | 1 line more build_clib cleanup + test coverage ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Wed May 6 10:10:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 06 May 2009 08:10:18 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090506081018.CF0D71E4013@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%202.6/builds/325 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Wed May 6 10:11:00 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 6 May 2009 10:11:00 +0200 (CEST) Subject: [Python-checkins] r72392 - python/trunk/Lib/distutils/command/build_clib.py Message-ID: <20090506081100.41BD71E4013@bag.python.org> Author: tarek.ziade Date: Wed May 6 10:11:00 2009 New Revision: 72392 Log: removed string.split usage Modified: python/trunk/Lib/distutils/command/build_clib.py Modified: python/trunk/Lib/distutils/command/build_clib.py ============================================================================== --- python/trunk/Lib/distutils/command/build_clib.py (original) +++ python/trunk/Lib/distutils/command/build_clib.py Wed May 6 10:11:00 2009 @@ -16,7 +16,7 @@ # two modules, mainly because a number of subtle details changed in the # cut 'n paste. Sigh. -import os, string +import os from distutils.core import Command from distutils.errors import * from distutils.sysconfig import customize_compiler @@ -87,8 +87,7 @@ if self.include_dirs is None: self.include_dirs = self.distribution.include_dirs or [] if isinstance(self.include_dirs, str): - self.include_dirs = string.split(self.include_dirs, - os.pathsep) + self.include_dirs = self.include_dirs.split(os.pathsep) # XXX same as for build_ext -- what about 'self.define' and # 'self.undef' ? From python-checkins at python.org Wed May 6 10:11:32 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 6 May 2009 10:11:32 +0200 (CEST) Subject: [Python-checkins] r72393 - python/branches/release26-maint Message-ID: <20090506081132.3E0DE1E4013@bag.python.org> Author: tarek.ziade Date: Wed May 6 10:11:32 2009 New Revision: 72393 Log: Blocked revisions 72392 via svnmerge ........ r72392 | tarek.ziade | 2009-05-06 10:11:00 +0200 (Wed, 06 May 2009) | 1 line removed string.split usage ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Wed May 6 10:12:20 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 6 May 2009 10:12:20 +0200 (CEST) Subject: [Python-checkins] r72394 - python/branches/py3k Message-ID: <20090506081220.C64AF1E4013@bag.python.org> Author: tarek.ziade Date: Wed May 6 10:12:20 2009 New Revision: 72394 Log: Blocked revisions 72392 via svnmerge ........ r72392 | tarek.ziade | 2009-05-06 10:11:00 +0200 (Wed, 06 May 2009) | 1 line removed string.split usage ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Wed May 6 10:25:53 2009 From: python-checkins at python.org (jeroen.ruigrok) Date: Wed, 6 May 2009 10:25:53 +0200 (CEST) Subject: [Python-checkins] r72395 - in python/branches/release30-maint: Lib/locale.py Message-ID: <20090506082553.77D821E4013@bag.python.org> Author: jeroen.ruigrok Date: Wed May 6 10:25:53 2009 New Revision: 72395 Log: Merged revisions 72376 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72376 | jeroen.ruigrok | 2009-05-06 07:33:24 +0200 (wo, 06 mei 2009) | 12 lines Merged revisions 72375 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72375 | jeroen.ruigrok | 2009-05-06 07:25:42 +0200 (wo, 06 mei 2009) | 5 lines Wrap getpreferredencoding()'s use of setlocale in a try/except to prevent us from raising an exception when the locale is invalid. Issue #1443504 ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/locale.py Modified: python/branches/release30-maint/Lib/locale.py ============================================================================== --- python/branches/release30-maint/Lib/locale.py (original) +++ python/branches/release30-maint/Lib/locale.py Wed May 6 10:25:53 2009 @@ -557,7 +557,10 @@ according to the system configuration.""" if do_setlocale: oldloc = setlocale(LC_CTYPE) - setlocale(LC_CTYPE, "") + try: + setlocale(LC_CTYPE, "") + except: + pass result = nl_langinfo(CODESET) setlocale(LC_CTYPE, oldloc) return result From python-checkins at python.org Wed May 6 10:32:17 2009 From: python-checkins at python.org (georg.brandl) Date: Wed, 6 May 2009 10:32:17 +0200 (CEST) Subject: [Python-checkins] r72396 - python/branches/py3k/Doc/c-api/capsule.rst Message-ID: <20090506083217.8E2D21E4013@bag.python.org> Author: georg.brandl Date: Wed May 6 10:32:17 2009 New Revision: 72396 Log: #5946: fix speling. Modified: python/branches/py3k/Doc/c-api/capsule.rst Modified: python/branches/py3k/Doc/c-api/capsule.rst ============================================================================== --- python/branches/py3k/Doc/c-api/capsule.rst (original) +++ python/branches/py3k/Doc/c-api/capsule.rst Wed May 6 10:32:17 2009 @@ -71,7 +71,7 @@ It is legal for a capsule to have a *NULL* destructor. This makes a *NULL* return code somewhat ambiguous; use :cfunc:`PyCapsule_IsValid` or - :cfunc:`PyErr_Occurred` to disambugate. + :cfunc:`PyErr_Occurred` to disambiguate. .. cfunction:: void* PyCapsule_GetContext(PyObject *capsule) @@ -81,7 +81,7 @@ It is legal for a capsule to have a *NULL* context. This makes a *NULL* return code somewhat ambiguous; use :cfunc:`PyCapsule_IsValid` or - :cfunc:`PyErr_Occurred` to disambugate. + :cfunc:`PyErr_Occurred` to disambiguate. .. cfunction:: const char* PyCapsule_GetName(PyObject *capsule) @@ -91,7 +91,7 @@ It is legal for a capsule to have a *NULL* name. This makes a *NULL* return code somewhat ambiguous; use :cfunc:`PyCapsule_IsValid` or - :cfunc:`PyErr_Occurred` to disambugate. + :cfunc:`PyErr_Occurred` to disambiguate. .. cfunction:: void* PyCapsule_Import(const char *name, int no_block) From buildbot at python.org Wed May 6 10:43:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 06 May 2009 08:43:37 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090506084337.520B11E4013@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/910 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_time make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed May 6 10:47:57 2009 From: python-checkins at python.org (georg.brandl) Date: Wed, 6 May 2009 10:47:57 +0200 (CEST) Subject: [Python-checkins] r72397 - python/branches/py3k/Objects/cobject.c Message-ID: <20090506084757.0F1291E401D@bag.python.org> Author: georg.brandl Date: Wed May 6 10:47:56 2009 New Revision: 72397 Log: #5947: add PendingDeprecationWarning to PyCObject functions. Modified: python/branches/py3k/Objects/cobject.c Modified: python/branches/py3k/Objects/cobject.c ============================================================================== --- python/branches/py3k/Objects/cobject.c (original) +++ python/branches/py3k/Objects/cobject.c Wed May 6 10:47:56 2009 @@ -9,11 +9,23 @@ typedef void (*destructor1)(void *); typedef void (*destructor2)(void *, void*); + +static int deprecation_exception(void) +{ + return PyErr_WarnEx(PyExc_PendingDeprecationWarning, + "The CObject API is deprecated as of Python 3.1. " + "Please convert to using the Capsule API.", 1); +} + PyObject * PyCObject_FromVoidPtr(void *cobj, void (*destr)(void *)) { PyCObject *self; + if (deprecation_exception()) { + return NULL; + } + self = PyObject_NEW(PyCObject, &PyCObject_Type); if (self == NULL) return NULL; @@ -30,6 +42,10 @@ { PyCObject *self; + if (deprecation_exception()) { + return NULL; + } + if (!desc) { PyErr_SetString(PyExc_TypeError, "PyCObject_FromVoidPtrAndDesc called with null" From buildbot at python.org Wed May 6 10:58:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 06 May 2009 08:58:31 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090506085831.97E151E4013@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%202.6/builds/312 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: jeroen.ruigrok,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_sax Traceback (most recent call last): File "./Lib/test/regrtest.py", line 549, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/test_sax.py", line 7, in make_parser() File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/xml/sax/__init__.py", line 81, in make_parser return _create_parser(parser_name) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/xml/sax/__init__.py", line 105, in _create_parser drv_module = __import__(parser_name,{},{},['create_parser']) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/xml/sax/expatreader.py", line 28, in from xml.sax import xmlreader, saxutils, handler File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/xml/sax/saxutils.py", line 84, in class XMLGenerator(handler.ContentHandler): File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/xml/sax/saxutils.py", line 129, in XMLGenerator def startElement(self, name, attrs): NameError: name 'de' is not defined make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Wed May 6 12:22:18 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 6 May 2009 06:22:18 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090506102218.GA9174@python.psfb.org> More important issues: ---------------------- test_hashlib leaked [44, -43, 0] references, sum=1 Less important issues: ---------------------- test_cmd_line leaked [-25, 0, 0] references, sum=-25 test_docxmlrpc leaked [0, 0, -3] references, sum=-3 test_popen2 leaked [-29, 0, 0] references, sum=-29 test_smtplib leaked [21, -109, 88] references, sum=0 test_socketserver leaked [0, 0, 80] references, sum=80 test_threading leaked [48, 46, 50] references, sum=144 test_urllib2_localnet leaked [3, 286, -280] references, sum=9 test_xmlrpc leaked [-3, 3, 0] references, sum=0 From buildbot at python.org Wed May 6 12:27:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 06 May 2009 10:27:52 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090506102752.E19051E4020@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1262 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_time make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed May 6 14:06:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 06 May 2009 12:06:29 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090506120630.16ECB1E401D@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/707 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl,mark.hammond,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_userlist make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed May 6 15:08:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 06 May 2009 13:08:05 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090506130806.49B2C1E401D@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/473 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed May 6 15:08:16 2009 From: python-checkins at python.org (eric.smith) Date: Wed, 6 May 2009 15:08:16 +0200 (CEST) Subject: [Python-checkins] r72398 - in python/branches/py3k: Doc/library/string.rst Lib/test/test_complex.py Lib/test/test_float.py Lib/test/test_unicode.py Misc/NEWS Objects/stringlib/formatter.h Message-ID: <20090506130816.426BF1E4021@bag.python.org> Author: eric.smith Date: Wed May 6 15:08:15 2009 New Revision: 72398 Log: Issue #3382. float 'F' formatting no longer maps to 'f'. This only affects nan and inf. Modified: python/branches/py3k/Doc/library/string.rst python/branches/py3k/Lib/test/test_complex.py python/branches/py3k/Lib/test/test_float.py python/branches/py3k/Lib/test/test_unicode.py python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/stringlib/formatter.h Modified: python/branches/py3k/Doc/library/string.rst ============================================================================== --- python/branches/py3k/Doc/library/string.rst (original) +++ python/branches/py3k/Doc/library/string.rst Wed May 6 15:08:15 2009 @@ -415,7 +415,8 @@ | ``'f'`` | Fixed point. Displays the number as a fixed-point | | | number. | +---------+----------------------------------------------------------+ - | ``'F'`` | Fixed point. Same as ``'f'``. | + | ``'F'`` | Fixed point. Same as ``'f'``, but converts ``nan`` to | + | | ``NAN`` and ``inf`` to ``INF``. | +---------+----------------------------------------------------------+ | ``'g'`` | General format. This prints the number as a fixed-point | | | number, unless the number is too large, in which case | Modified: python/branches/py3k/Lib/test/test_complex.py ============================================================================== --- python/branches/py3k/Lib/test/test_complex.py (original) +++ python/branches/py3k/Lib/test/test_complex.py Wed May 6 15:08:15 2009 @@ -507,6 +507,24 @@ # make sure everything works in ''.format() self.assertEqual('*{0:.3f}*'.format(3.14159+2.71828j), '*3.142+2.718j*') + # issue 3382 + self.assertEqual(format(complex(NAN, NAN), 'f'), 'nan+nanj') + self.assertEqual(format(complex(1, NAN), 'f'), '1.000000+nanj') + self.assertEqual(format(complex(NAN, 1), 'f'), 'nan+1.000000j') + self.assertEqual(format(complex(NAN, -1), 'f'), 'nan-1.000000j') + self.assertEqual(format(complex(NAN, NAN), 'F'), 'NAN+NANj') + self.assertEqual(format(complex(1, NAN), 'F'), '1.000000+NANj') + self.assertEqual(format(complex(NAN, 1), 'F'), 'NAN+1.000000j') + self.assertEqual(format(complex(NAN, -1), 'F'), 'NAN-1.000000j') + self.assertEqual(format(complex(INF, INF), 'f'), 'inf+infj') + self.assertEqual(format(complex(1, INF), 'f'), '1.000000+infj') + self.assertEqual(format(complex(INF, 1), 'f'), 'inf+1.000000j') + self.assertEqual(format(complex(INF, -1), 'f'), 'inf-1.000000j') + self.assertEqual(format(complex(INF, INF), 'F'), 'INF+INFj') + self.assertEqual(format(complex(1, INF), 'F'), '1.000000+INFj') + self.assertEqual(format(complex(INF, 1), 'F'), 'INF+1.000000j') + self.assertEqual(format(complex(INF, -1), 'F'), 'INF-1.000000j') + def test_main(): support.run_unittest(ComplexTest) Modified: python/branches/py3k/Lib/test/test_float.py ============================================================================== --- python/branches/py3k/Lib/test/test_float.py (original) +++ python/branches/py3k/Lib/test/test_float.py Wed May 6 15:08:15 2009 @@ -320,6 +320,12 @@ self.assertRaises(ValueError, format, 1e-100, format_spec) self.assertRaises(ValueError, format, -1e-100, format_spec) + # issue 3382 + self.assertEqual(format(NAN, 'f'), 'nan') + self.assertEqual(format(NAN, 'F'), 'NAN') + self.assertEqual(format(INF, 'f'), 'inf') + self.assertEqual(format(INF, 'F'), 'INF') + @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"), "test requires IEEE 754 doubles") def test_format_testfile(self): Modified: python/branches/py3k/Lib/test/test_unicode.py ============================================================================== --- python/branches/py3k/Lib/test/test_unicode.py (original) +++ python/branches/py3k/Lib/test/test_unicode.py Wed May 6 15:08:15 2009 @@ -779,6 +779,14 @@ return '\u1234' self.assertEqual('%s' % Wrapper(), '\u1234') + # issue 3382 + NAN = float('nan') + INF = float('inf') + self.assertEqual('%f' % NAN, 'nan') + self.assertEqual('%F' % NAN, 'NAN') + self.assertEqual('%f' % INF, 'inf') + self.assertEqual('%F' % INF, 'INF') + @support.run_with_locale('LC_ALL', 'de_DE', 'fr_FR') def test_format_float(self): # should not format with a comma, but always with C locale Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed May 6 15:08:15 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #3382: float.__format__, complex.__format__, and %-formatting + no longer map 'F' to 'f'. Because of issue #5859 (below), this only + affects nan -> NAN and inf -> INF. + - Issue #5799: ntpath (ie, os.path on Windows) fully supports UNC pathnames in all operations, including splitdrive, split, etc. splitunc() now issues a PendingDeprecation warning. @@ -45,7 +49,7 @@ restrictions for float formatting: '%.67f' % 12.34 and '%.120e' % 12.34 no longer raise an exception. -- Issue #1588: Add complex.__format__. For example, +- Issue #1588: Add complex.__format__. For example, format(complex(1, 2./3), '.5') now produces a sensible result. - Issue #5864: Fix empty format code formatting for floats so that it Modified: python/branches/py3k/Objects/stringlib/formatter.h ============================================================================== --- python/branches/py3k/Objects/stringlib/formatter.h (original) +++ python/branches/py3k/Objects/stringlib/formatter.h Wed May 6 15:08:15 2009 @@ -920,10 +920,6 @@ format the result. We take care of that later. */ type = 'g'; - /* 'F' is the same as 'f', per the PEP */ - if (type == 'F') - type = 'f'; - val = PyFloat_AsDouble(value); if (val == -1.0 && PyErr_Occurred()) goto done; @@ -939,8 +935,15 @@ #if PY_VERSION_HEX < 0x03010000 /* 3.1 no longer converts large 'f' to 'g'. */ - if ((type == 'f' || type == 'F') && fabs(val) >= 1e50) - type = 'g'; + if (fabs(val) >= 1e50) + switch (type) { + case 'f': + type = 'g'; + break; + case 'F': + type = 'G'; + break; + } #endif /* Cast "type", because if we're in unicode we need to pass a @@ -1114,10 +1117,6 @@ format the result. We take care of that later. */ type = 'g'; - /* 'F' is the same as 'f', per the PEP */ - if (type == 'F') - type = 'f'; - if (precision < 0) precision = default_precision; From python-checkins at python.org Wed May 6 15:16:36 2009 From: python-checkins at python.org (jeroen.ruigrok) Date: Wed, 6 May 2009 15:16:36 +0200 (CEST) Subject: [Python-checkins] r72399 - python/trunk/Lib/locale.py Message-ID: <20090506131636.B48101E411F@bag.python.org> Author: jeroen.ruigrok Date: Wed May 6 15:16:36 2009 New Revision: 72399 Log: Be more explicit about the error we are catching. Requested by: Antoine Pitrou Modified: python/trunk/Lib/locale.py Modified: python/trunk/Lib/locale.py ============================================================================== --- python/trunk/Lib/locale.py (original) +++ python/trunk/Lib/locale.py Wed May 6 15:16:36 2009 @@ -555,7 +555,7 @@ oldloc = setlocale(LC_CTYPE) try: setlocale(LC_CTYPE, "") - except: + except Error: pass result = nl_langinfo(CODESET) setlocale(LC_CTYPE, oldloc) From python-checkins at python.org Wed May 6 15:18:35 2009 From: python-checkins at python.org (jeroen.ruigrok) Date: Wed, 6 May 2009 15:18:35 +0200 (CEST) Subject: [Python-checkins] r72400 - in python/branches/py3k: Lib/locale.py Message-ID: <20090506131835.59E6D1E401D@bag.python.org> Author: jeroen.ruigrok Date: Wed May 6 15:18:35 2009 New Revision: 72400 Log: Merged revisions 72399 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72399 | jeroen.ruigrok | 2009-05-06 15:16:36 +0200 (wo, 06 mei 2009) | 4 lines Be more explicit about the error we are catching. Requested by: Antoine Pitrou ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/locale.py Modified: python/branches/py3k/Lib/locale.py ============================================================================== --- python/branches/py3k/Lib/locale.py (original) +++ python/branches/py3k/Lib/locale.py Wed May 6 15:18:35 2009 @@ -566,7 +566,7 @@ oldloc = setlocale(LC_CTYPE) try: setlocale(LC_CTYPE, "") - except: + except Error: pass result = nl_langinfo(CODESET) setlocale(LC_CTYPE, oldloc) From python-checkins at python.org Wed May 6 15:21:18 2009 From: python-checkins at python.org (jeroen.ruigrok) Date: Wed, 6 May 2009 15:21:18 +0200 (CEST) Subject: [Python-checkins] r72401 - in python/branches/release26-maint: Lib/locale.py Message-ID: <20090506132118.1C1511E4020@bag.python.org> Author: jeroen.ruigrok Date: Wed May 6 15:21:17 2009 New Revision: 72401 Log: Merged revisions 72399 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72399 | jeroen.ruigrok | 2009-05-06 15:16:36 +0200 (wo, 06 mei 2009) | 4 lines Be more explicit about the error we are catching. Requested by: Antoine Pitrou ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/locale.py Modified: python/branches/release26-maint/Lib/locale.py ============================================================================== --- python/branches/release26-maint/Lib/locale.py (original) +++ python/branches/release26-maint/Lib/locale.py Wed May 6 15:21:17 2009 @@ -548,7 +548,7 @@ oldloc = setlocale(LC_CTYPE) try: setlocale(LC_CTYPE, "") - except: + except Error: pass result = nl_langinfo(CODESET) setlocale(LC_CTYPE, oldloc) From python-checkins at python.org Wed May 6 15:22:35 2009 From: python-checkins at python.org (jeroen.ruigrok) Date: Wed, 6 May 2009 15:22:35 +0200 (CEST) Subject: [Python-checkins] r72402 - in python/branches/release30-maint: Lib/locale.py Message-ID: <20090506132235.E62731E4019@bag.python.org> Author: jeroen.ruigrok Date: Wed May 6 15:22:35 2009 New Revision: 72402 Log: Merged revisions 72400 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72400 | jeroen.ruigrok | 2009-05-06 15:18:35 +0200 (wo, 06 mei 2009) | 11 lines Merged revisions 72399 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72399 | jeroen.ruigrok | 2009-05-06 15:16:36 +0200 (wo, 06 mei 2009) | 4 lines Be more explicit about the error we are catching. Requested by: Antoine Pitrou ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/locale.py Modified: python/branches/release30-maint/Lib/locale.py ============================================================================== --- python/branches/release30-maint/Lib/locale.py (original) +++ python/branches/release30-maint/Lib/locale.py Wed May 6 15:22:35 2009 @@ -559,7 +559,7 @@ oldloc = setlocale(LC_CTYPE) try: setlocale(LC_CTYPE, "") - except: + except Error: pass result = nl_langinfo(CODESET) setlocale(LC_CTYPE, oldloc) From python-checkins at python.org Wed May 6 15:29:14 2009 From: python-checkins at python.org (eric.smith) Date: Wed, 6 May 2009 15:29:14 +0200 (CEST) Subject: [Python-checkins] r72403 - python/branches/release30-maint Message-ID: <20090506132914.44F881E4021@bag.python.org> Author: eric.smith Date: Wed May 6 15:29:13 2009 New Revision: 72403 Log: Blocked revisions 72398 via svnmerge ........ r72398 | eric.smith | 2009-05-06 09:08:15 -0400 (Wed, 06 May 2009) | 1 line Issue #3382. float 'F' formatting no longer maps to 'f'. This only affects nan and inf. ........ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Wed May 6 16:04:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 06 May 2009 14:04:34 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090506140434.9E9BF1E4019@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/4948 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: jeroen.ruigrok BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed May 6 16:15:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 06 May 2009 14:15:56 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090506141556.CB19F1E4011@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/914 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: jeroen.ruigrok BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_os make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed May 6 16:28:25 2009 From: python-checkins at python.org (walter.doerwald) Date: Wed, 6 May 2009 16:28:25 +0200 (CEST) Subject: [Python-checkins] r72404 - in python/trunk: Lib/test/test_codecs.py Modules/_codecsmodule.c Message-ID: <20090506142825.59CAE1E4011@bag.python.org> Author: walter.doerwald Date: Wed May 6 16:28:24 2009 New Revision: 72404 Log: Issue 3739: The unicode-internal encoder now reports the number of *characters* consumed like any other encoder (instead of the number of bytes). Modified: python/trunk/Lib/test/test_codecs.py python/trunk/Modules/_codecsmodule.c Modified: python/trunk/Lib/test/test_codecs.py ============================================================================== --- python/trunk/Lib/test/test_codecs.py (original) +++ python/trunk/Lib/test/test_codecs.py Wed May 6 16:28:24 2009 @@ -802,6 +802,12 @@ "UnicodeInternalTest") self.assertEquals((u"ab", 12), ignored) + def test_encode_length(self): + # Issue 3739 + encoder = codecs.getencoder("unicode_internal") + self.assertEquals(encoder(u"a")[1], 1) + self.assertEquals(encoder(u"\xe9\u0142")[1], 2) + # From http://www.gnu.org/software/libidn/draft-josefsson-idn-test-vectors.html nameprep_tests = [ # 3.1 Map to nothing. @@ -1292,8 +1298,7 @@ name = "latin_1" self.assertEqual(encoding.replace("_", "-"), name.replace("_", "-")) (bytes, size) = codecs.getencoder(encoding)(s) - if encoding != "unicode_internal": - self.assertEqual(size, len(s), "%r != %r (encoding=%r)" % (size, len(s), encoding)) + self.assertEqual(size, len(s), "%r != %r (encoding=%r)" % (size, len(s), encoding)) (chars, size) = codecs.getdecoder(encoding)(bytes) self.assertEqual(chars, s, "%r != %r (encoding=%r)" % (chars, s, encoding)) Modified: python/trunk/Modules/_codecsmodule.c ============================================================================== --- python/trunk/Modules/_codecsmodule.c (original) +++ python/trunk/Modules/_codecsmodule.c Wed May 6 16:28:24 2009 @@ -646,7 +646,7 @@ data = PyUnicode_AS_DATA(obj); size = PyUnicode_GET_DATA_SIZE(obj); return codec_tuple(PyString_FromStringAndSize(data, size), - size); + PyUnicode_GET_SIZE(obj)); } else { if (PyObject_AsReadBuffer(obj, (const void **)&data, &size)) From python-checkins at python.org Wed May 6 16:30:31 2009 From: python-checkins at python.org (walter.doerwald) Date: Wed, 6 May 2009 16:30:31 +0200 (CEST) Subject: [Python-checkins] r72405 - python/branches/release26-maint Message-ID: <20090506143031.7105B1E4011@bag.python.org> Author: walter.doerwald Date: Wed May 6 16:30:31 2009 New Revision: 72405 Log: Blocked revisions 72404 via svnmerge ........ r72404 | walter.doerwald | 2009-05-06 16:28:24 +0200 (Mi, 06 Mai 2009) | 3 lines Issue 3739: The unicode-internal encoder now reports the number of *characters* consumed like any other encoder (instead of the number of bytes). ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Wed May 6 16:32:35 2009 From: python-checkins at python.org (walter.doerwald) Date: Wed, 6 May 2009 16:32:35 +0200 (CEST) Subject: [Python-checkins] r72406 - python/trunk/Misc/NEWS Message-ID: <20090506143235.23D501E4011@bag.python.org> Author: walter.doerwald Date: Wed May 6 16:32:35 2009 New Revision: 72406 Log: Add NEWS entry about issue #3739. Modified: python/trunk/Misc/NEWS Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed May 6 16:32:35 2009 @@ -279,6 +279,9 @@ step. This avoids problems with counting UTF-8 bytes that ignores the effect of using the replace error handler in PyUnicode_DecodeUTF8(). +- Issue #3739: The unicode-internal encoder now reports the number of characters + consumed like any other encoder (instead of the number of bytes). + Library ------- From python-checkins at python.org Wed May 6 16:32:56 2009 From: python-checkins at python.org (walter.doerwald) Date: Wed, 6 May 2009 16:32:56 +0200 (CEST) Subject: [Python-checkins] r72407 - python/branches/release26-maint Message-ID: <20090506143256.D3ACD1E4011@bag.python.org> Author: walter.doerwald Date: Wed May 6 16:32:56 2009 New Revision: 72407 Log: Blocked revisions 72406 via svnmerge ........ r72406 | walter.doerwald | 2009-05-06 16:32:35 +0200 (Mi, 06 Mai 2009) | 2 lines Add NEWS entry about issue #3739. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Wed May 6 16:41:26 2009 From: python-checkins at python.org (walter.doerwald) Date: Wed, 6 May 2009 16:41:26 +0200 (CEST) Subject: [Python-checkins] r72408 - in python/branches/py3k: Lib/test/test_codecs.py Misc/NEWS Modules/_codecsmodule.c Message-ID: <20090506144126.C8F1D1E4011@bag.python.org> Author: walter.doerwald Date: Wed May 6 16:41:26 2009 New Revision: 72408 Log: Merged revisions 72404-72406 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72404 | walter.doerwald | 2009-05-06 16:28:24 +0200 (Mi, 06 Mai 2009) | 3 lines Issue 3739: The unicode-internal encoder now reports the number of *characters* consumed like any other encoder (instead of the number of bytes). ........ r72406 | walter.doerwald | 2009-05-06 16:32:35 +0200 (Mi, 06 Mai 2009) | 2 lines Add NEWS entry about issue #3739. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_codecs.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_codecsmodule.c Modified: python/branches/py3k/Lib/test/test_codecs.py ============================================================================== --- python/branches/py3k/Lib/test/test_codecs.py (original) +++ python/branches/py3k/Lib/test/test_codecs.py Wed May 6 16:41:26 2009 @@ -872,6 +872,12 @@ "UnicodeInternalTest") self.assertEquals(("ab", 12), ignored) + def test_encode_length(self): + # Issue 3739 + encoder = codecs.getencoder("unicode_internal") + self.assertEquals(encoder("a")[1], 1) + self.assertEquals(encoder("\xe9\u0142")[1], 2) + # From http://www.gnu.org/software/libidn/draft-josefsson-idn-test-vectors.html nameprep_tests = [ # 3.1 Map to nothing. @@ -1317,8 +1323,7 @@ name = "latin_1" self.assertEqual(encoding.replace("_", "-"), name.replace("_", "-")) (b, size) = codecs.getencoder(encoding)(s) - if encoding != "unicode_internal": - self.assertEqual(size, len(s), "%r != %r (encoding=%r)" % (size, len(s), encoding)) + self.assertEqual(size, len(s), "%r != %r (encoding=%r)" % (size, len(s), encoding)) (chars, size) = codecs.getdecoder(encoding)(b) self.assertEqual(chars, s, "%r != %r (encoding=%r)" % (chars, s, encoding)) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed May 6 16:41:26 2009 @@ -127,6 +127,9 @@ - Issue #1113244: Py_XINCREF, Py_DECREF, Py_XDECREF: Add `do { ... } while (0)' to avoid compiler warnings. +- Issue #3739: The unicode-internal encoder now reports the number of characters + consumed like any other encoder (instead of the number of bytes). + Installation ------------ Modified: python/branches/py3k/Modules/_codecsmodule.c ============================================================================== --- python/branches/py3k/Modules/_codecsmodule.c (original) +++ python/branches/py3k/Modules/_codecsmodule.c Wed May 6 16:41:26 2009 @@ -669,7 +669,8 @@ if (PyUnicode_Check(obj)) { data = PyUnicode_AS_DATA(obj); size = PyUnicode_GET_DATA_SIZE(obj); - return codec_tuple(PyBytes_FromStringAndSize(data, size), size); + return codec_tuple(PyBytes_FromStringAndSize(data, size), + PyUnicode_GET_SIZE(obj)); } else { if (PyObject_AsReadBuffer(obj, (const void **)&data, &size)) From buildbot at python.org Wed May 6 19:39:05 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 06 May 2009 17:39:05 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090506173905.2D7111E4019@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%202.6/builds/313 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: walter.doerwald BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed May 6 20:44:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 06 May 2009 18:44:54 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090506184454.CAD9F1E4019@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/761 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: walter.doerwald BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed May 6 21:57:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 06 May 2009 19:57:34 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090506195734.3551A1E4011@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/540 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl,hirokazu.yamamoto,jeroen.ruigrok,kurt.kaiser,mark.hammond,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 486, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' 1 test failed: test_import ====================================================================== ERROR: testImport (test.test_import.ImportTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 61, in test_with_extension mod = __import__(TESTFN) ImportError: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 486, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 486, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' sincerely, -The Buildbot From python-checkins at python.org Wed May 6 22:39:51 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 6 May 2009 22:39:51 +0200 (CEST) Subject: [Python-checkins] r72410 - python/branches/py3k/Lib/pydoc_data/topics.py Message-ID: <20090506203951.913781E4011@bag.python.org> Author: benjamin.peterson Date: Wed May 6 22:39:50 2009 New Revision: 72410 Log: update pydoc_topics Modified: python/branches/py3k/Lib/pydoc_data/topics.py Modified: python/branches/py3k/Lib/pydoc_data/topics.py ============================================================================== --- python/branches/py3k/Lib/pydoc_data/topics.py (original) +++ python/branches/py3k/Lib/pydoc_data/topics.py Wed May 6 22:39:50 2009 @@ -1,4 +1,4 @@ -# Autogenerated by Sphinx on Mon Apr 27 18:34:24 2009 +# Autogenerated by Sphinx on Wed May 6 15:36:49 2009 topics = {'assert': '\nThe ``assert`` statement\n************************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form, ``assert expression``, is equivalent to\n\n if __debug__:\n if not expression: raise AssertionError\n\nThe extended form, ``assert expression1, expression2``, is equivalent\nto\n\n if __debug__:\n if not expression1: raise AssertionError(expression2)\n\nThese equivalences assume that ``__debug__`` and ``AssertionError``\nrefer to the built-in variables with those names. In the current\nimplementation, the built-in variable ``__debug__`` is ``True`` under\nnormal circumstances, ``False`` when optimization is requested\n(command line option -O). The current code generator emits no code\nfor an assert statement when optimization is requested at compile\ntime. Note that it is unnecessary to include the source code for the\nexpression that failed in the error message; it will be displayed as\npart of the stack trace.\n\nAssignments to ``__debug__`` are illegal. The value for the built-in\nvariable is determined when the interpreter starts.\n', 'assignment': '\nAssignment statements\n*********************\n\nAssignment statements are used to (re)bind names to values and to\nmodify attributes or items of mutable objects:\n\n assignment_stmt ::= (target_list "=")+ (expression_list | yield_expression)\n target_list ::= target ("," target)* [","]\n target ::= identifier\n | "(" target_list ")"\n | "[" target_list "]"\n | attributeref\n | subscription\n | slicing\n | "*" target\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn assignment statement evaluates the expression list (remember that\nthis can be a single expression or a comma-separated list, the latter\nyielding a tuple) and assigns the single resulting object to each of\nthe target lists, from left to right.\n\nAssignment is defined recursively depending on the form of the target\n(list). When a target is part of a mutable object (an attribute\nreference, subscription or slicing), the mutable object must\nultimately perform the assignment and decide about its validity, and\nmay raise an exception if the assignment is unacceptable. The rules\nobserved by various types and the exceptions raised are given with the\ndefinition of the object types (see section *The standard type\nhierarchy*).\n\nAssignment of an object to a target list, optionally enclosed in\nparentheses or square brackets, is recursively defined as follows.\n\n* If the target list is a single target: The object is assigned to\n that target.\n\n* If the target list is a comma-separated list of targets: The object\n must be an iterable with the same number of items as there are\n targets in the target list, and the items are assigned, from left to\n right, to the corresponding targets. (This rule is relaxed as of\n Python 1.5; in earlier versions, the object had to be a tuple.\n Since strings are sequences, an assignment like ``a, b = "xy"`` is\n now legal as long as the string has the right length.)\n\n * If the target list contains one target prefixed with an asterisk,\n called a "starred" target: The object must be a sequence with at\n least as many items as there are targets in the target list, minus\n one. The first items of the sequence are assigned, from left to\n right, to the targets before the starred target. The final items\n of the sequence are assigned to the targets after the starred\n target. A list of the remaining items in the sequence is then\n assigned to the starred target (the list can be empty).\n\n * Else: The object must be a sequence with the same number of items\n as there are targets in the target list, and the items are\n assigned, from left to right, to the corresponding targets.\n\nAssignment of an object to a single target is recursively defined as\nfollows.\n\n* If the target is an identifier (name):\n\n * If the name does not occur in a ``global`` or ``nonlocal``\n statement in the current code block: the name is bound to the\n object in the current local namespace.\n\n * Otherwise: the name is bound to the object in the global namespace\n or the outer namespace determined by ``nonlocal``, respectively.\n\n The name is rebound if it was already bound. This may cause the\n reference count for the object previously bound to the name to reach\n zero, causing the object to be deallocated and its destructor (if it\n has one) to be called.\n\n The name is rebound if it was already bound. This may cause the\n reference count for the object previously bound to the name to reach\n zero, causing the object to be deallocated and its destructor (if it\n has one) to be called.\n\n* If the target is a target list enclosed in parentheses or in square\n brackets: The object must be an iterable with the same number of\n items as there are targets in the target list, and its items are\n assigned, from left to right, to the corresponding targets.\n\n* If the target is an attribute reference: The primary expression in\n the reference is evaluated. It should yield an object with\n assignable attributes; if this is not the case, ``TypeError`` is\n raised. That object is then asked to assign the assigned object to\n the given attribute; if it cannot perform the assignment, it raises\n an exception (usually but not necessarily ``AttributeError``).\n\n* If the target is a subscription: The primary expression in the\n reference is evaluated. It should yield either a mutable sequence\n object (such as a list) or a mapping object (such as a dictionary).\n Next, the subscript expression is evaluated.\n\n If the primary is a mutable sequence object (such as a list), the\n subscript must yield an integer. If it is negative, the sequence\'s\n length is added to it. The resulting value must be a nonnegative\n integer less than the sequence\'s length, and the sequence is asked\n to assign the assigned object to its item with that index. If the\n index is out of range, ``IndexError`` is raised (assignment to a\n subscripted sequence cannot add new items to a list).\n\n If the primary is a mapping object (such as a dictionary), the\n subscript must have a type compatible with the mapping\'s key type,\n and the mapping is then asked to create a key/datum pair which maps\n the subscript to the assigned object. This can either replace an\n existing key/value pair with the same key value, or insert a new\n key/value pair (if no key with the same value existed).\n\n For user-defined objects, the ``__setitem__()`` method is called\n with appropriate arguments.\n\n* If the target is a slicing: The primary expression in the reference\n is evaluated. It should yield a mutable sequence object (such as a\n list). The assigned object should be a sequence object of the same\n type. Next, the lower and upper bound expressions are evaluated,\n insofar they are present; defaults are zero and the sequence\'s\n length. The bounds should evaluate to integers. If either bound is\n negative, the sequence\'s length is added to it. The resulting\n bounds are clipped to lie between zero and the sequence\'s length,\n inclusive. Finally, the sequence object is asked to replace the\n slice with the items of the assigned sequence. The length of the\n slice may be different from the length of the assigned sequence,\n thus changing the length of the target sequence, if the object\n allows it.\n\n(In the current implementation, the syntax for targets is taken to be\nthe same as for expressions, and invalid syntax is rejected during the\ncode generation phase, causing less detailed error messages.)\n\nWARNING: Although the definition of assignment implies that overlaps\nbetween the left-hand side and the right-hand side are \'safe\' (for\nexample ``a, b = b, a`` swaps two variables), overlaps *within* the\ncollection of assigned-to variables are not safe! For instance, the\nfollowing program prints ``[0, 2]``:\n\n x = [0, 1]\n i = 0\n i, x[i] = 1, 2\n print(x)\n\nSee also:\n\n **PEP 3132** - Extended Iterable Unpacking\n The specification for the ``*target`` feature.\n\n\nAugmented assignment statements\n===============================\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)\n augtarget ::= identifier | attributeref | subscription | slicing\n augop ::= "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the initial value is\nretrieved with a ``getattr()`` and the result is assigned with a\n``setattr()``. Notice that the two methods do not necessarily refer\nto the same variable. When ``getattr()`` refers to a class variable,\n``setattr()`` still writes to an instance variable. For example:\n\n class A:\n x = 3 # class variable\n a = A()\n a.x += 1 # writes a.x as 4 leaving A.x as 3\n', 'atom-identifiers': '\nIdentifiers (Names)\n*******************\n\nAn identifier occurring as an atom is a name. See section\n*Identifiers and keywords* for lexical definition and section *Naming\nand binding* for documentation of naming and binding.\n\nWhen the name is bound to an object, evaluation of the atom yields\nthat object. When a name is not bound, an attempt to evaluate it\nraises a ``NameError`` exception.\n\n**Private name mangling:** When an identifier that textually occurs in\na class definition begins with two or more underscore characters and\ndoes not end in two or more underscores, it is considered a *private\nname* of that class. Private names are transformed to a longer form\nbefore code is generated for them. The transformation inserts the\nclass name in front of the name, with leading underscores removed, and\na single underscore inserted in front of the class name. For example,\nthe identifier ``__spam`` occurring in a class named ``Ham`` will be\ntransformed to ``_Ham__spam``. This transformation is independent of\nthe syntactical context in which the identifier is used. If the\ntransformed name is extremely long (longer than 255 characters),\nimplementation defined truncation may happen. If the class name\nconsists only of underscores, no transformation is done.\n', @@ -10,7 +10,7 @@ 'bitwise': '\nBinary bitwise operations\n*************************\n\nEach of the three bitwise operations has a different priority level:\n\n and_expr ::= shift_expr | and_expr "&" shift_expr\n xor_expr ::= and_expr | xor_expr "^" and_expr\n or_expr ::= xor_expr | or_expr "|" xor_expr\n\nThe ``&`` operator yields the bitwise AND of its arguments, which must\nbe integers.\n\nThe ``^`` operator yields the bitwise XOR (exclusive OR) of its\narguments, which must be integers.\n\nThe ``|`` operator yields the bitwise (inclusive) OR of its arguments,\nwhich must be integers.\n', 'bltin-code-objects': '\nCode Objects\n************\n\nCode objects are used by the implementation to represent "pseudo-\ncompiled" executable Python code such as a function body. They differ\nfrom function objects because they don\'t contain a reference to their\nglobal execution environment. Code objects are returned by the built-\nin ``compile()`` function and can be extracted from function objects\nthrough their ``__code__`` attribute. See also the ``code`` module.\n\nA code object can be executed or evaluated by passing it (instead of a\nsource string) to the ``exec()`` or ``eval()`` built-in functions.\n\nSee *The standard type hierarchy* for more information.\n', 'bltin-ellipsis-object': '\nThe Ellipsis Object\n*******************\n\nThis object is commonly used by slicing (see *Slicings*). It supports\nno special operations. There is exactly one ellipsis object, named\n``Ellipsis`` (a built-in name).\n\nIt is written as ``Ellipsis`` or ``...``.\n', - 'bltin-file-objects': '\nFile Objects\n************\n\nFile objects are implemented using C\'s ``stdio`` package and can be\ncreated with the built-in ``open()`` function. File objects are also\nreturned by some other built-in functions and methods, such as\n``os.popen()`` and ``os.fdopen()`` and the ``makefile()`` method of\nsocket objects. Temporary files can be created using the ``tempfile``\nmodule, and high-level file operations such as copying, moving, and\ndeleting files and directories can be achieved with the ``shutil``\nmodule.\n\nWhen a file operation fails for an I/O-related reason, the exception\n``IOError`` is raised. This includes situations where the operation\nis not defined for some reason, like ``seek()`` on a tty device or\nwriting a file opened for reading.\n\nFiles have the following methods:\n\nfile.close()\n\n Close the file. A closed file cannot be read or written any more.\n Any operation which requires that the file be open will raise a\n ``ValueError`` after the file has been closed. Calling ``close()``\n more than once is allowed.\n\n You can avoid having to call this method explicitly if you use the\n ``with`` statement. For example, the following code will\n automatically close *f* when the ``with`` block is exited:\n\n from __future__ import with_statement # This isn\'t required in Python 2.6\n\n with open("hello.txt") as f:\n for line in f:\n print(line)\n\n In older versions of Python, you would have needed to do this to\n get the same effect:\n\n f = open("hello.txt")\n try:\n for line in f:\n print(line)\n finally:\n f.close()\n\n Note: Not all "file-like" types in Python support use as a context\n manager for the ``with`` statement. If your code is intended to\n work with any file-like object, you can use the function\n ``contextlib.closing()`` instead of using the object directly.\n\nfile.flush()\n\n Flush the internal buffer, like ``stdio``\'s ``fflush``. This may\n be a no-op on some file-like objects.\n\n Note: ``flush()`` does not necessarily write the file\'s data to disk.\n Use ``flush()`` followed by ``os.fsync()`` to ensure this\n behavior.\n\nfile.fileno()\n\n Return the integer "file descriptor" that is used by the underlying\n implementation to request I/O operations from the operating system.\n This can be useful for other, lower level interfaces that use file\n descriptors, such as the ``fcntl`` module or ``os.read()`` and\n friends.\n\n Note: File-like objects which do not have a real file descriptor should\n *not* provide this method!\n\nfile.isatty()\n\n Return ``True`` if the file is connected to a tty(-like) device,\n else ``False``.\n\n Note: If a file-like object is not associated with a real file, this\n method should *not* be implemented.\n\nfile.__next__()\n\n A file object is its own iterator, for example ``iter(f)`` returns\n *f* (unless *f* is closed). When a file is used as an iterator,\n typically in a ``for`` loop (for example, ``for line in f:\n print(line)``), the ``__next__()`` method is called repeatedly.\n This method returns the next input line, or raises\n ``StopIteration`` when EOF is hit when the file is open for reading\n (behavior is undefined when the file is open for writing). In\n order to make a ``for`` loop the most efficient way of looping over\n the lines of a file (a very common operation), the ``__next__()``\n method uses a hidden read-ahead buffer. As a consequence of using\n a read-ahead buffer, combining ``__next__()`` with other file\n methods (like ``readline()``) does not work right. However, using\n ``seek()`` to reposition the file to an absolute position will\n flush the read-ahead buffer.\n\nfile.read([size])\n\n Read at most *size* bytes from the file (less if the read hits EOF\n before obtaining *size* bytes). If the *size* argument is negative\n or omitted, read all data until EOF is reached. The bytes are\n returned as a string object. An empty string is returned when EOF\n is encountered immediately. (For certain files, like ttys, it\n makes sense to continue reading after an EOF is hit.) Note that\n this method may call the underlying C function ``fread`` more than\n once in an effort to acquire as close to *size* bytes as possible.\n Also note that when in non-blocking mode, less data than was\n requested may be returned, even if no *size* parameter was given.\n\nfile.readline([size])\n\n Read one entire line from the file. A trailing newline character\n is kept in the string (but may be absent when a file ends with an\n incomplete line). [6] If the *size* argument is present and non-\n negative, it is a maximum byte count (including the trailing\n newline) and an incomplete line may be returned. An empty string is\n returned *only* when EOF is encountered immediately.\n\n Note: Unlike ``stdio``\'s ``fgets``, the returned string contains null\n characters (``\'\\0\'``) if they occurred in the input.\n\nfile.readlines([sizehint])\n\n Read until EOF using ``readline()`` and return a list containing\n the lines thus read. If the optional *sizehint* argument is\n present, instead of reading up to EOF, whole lines totalling\n approximately *sizehint* bytes (possibly after rounding up to an\n internal buffer size) are read. Objects implementing a file-like\n interface may choose to ignore *sizehint* if it cannot be\n implemented, or cannot be implemented efficiently.\n\nfile.seek(offset[, whence])\n\n Set the file\'s current position, like ``stdio``\'s ``fseek``. The\n *whence* argument is optional and defaults to ``os.SEEK_SET`` or\n ``0`` (absolute file positioning); other values are ``os.SEEK_CUR``\n or ``1`` (seek relative to the current position) and\n ``os.SEEK_END`` or ``2`` (seek relative to the file\'s end). There\n is no return value.\n\n For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by\n two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third\n to last.\n\n Note that if the file is opened for appending (mode ``\'a\'`` or\n ``\'a+\'``), any ``seek()`` operations will be undone at the next\n write. If the file is only opened for writing in append mode (mode\n ``\'a\'``), this method is essentially a no-op, but it remains useful\n for files opened in append mode with reading enabled (mode\n ``\'a+\'``). If the file is opened in text mode (without ``\'b\'``),\n only offsets returned by ``tell()`` are legal. Use of other\n offsets causes undefined behavior.\n\n Note that not all file objects are seekable.\n\nfile.tell()\n\n Return the file\'s current position, like ``stdio``\'s ``ftell``.\n\n Note: On Windows, ``tell()`` can return illegal values (after an\n ``fgets``) when reading files with Unix-style line-endings. Use\n binary mode (``\'rb\'``) to circumvent this problem.\n\nfile.truncate([size])\n\n Truncate the file\'s size. If the optional *size* argument is\n present, the file is truncated to (at most) that size. The size\n defaults to the current position. The current file position is not\n changed. Note that if a specified size exceeds the file\'s current\n size, the result is platform-dependent: possibilities include that\n the file may remain unchanged, increase to the specified size as if\n zero-filled, or increase to the specified size with undefined new\n content. Availability: Windows, many Unix variants.\n\nfile.write(str)\n\n Write a string to the file. Due to buffering, the string may not\n actually show up in the file until the ``flush()`` or ``close()``\n method is called.\n\n The meaning of the return value is not defined for every file-like\n object. Some (mostly low-level) file-like objects may return the\n number of bytes actually written, others return ``None``.\n\nfile.writelines(sequence)\n\n Write a sequence of strings to the file. The sequence can be any\n iterable object producing strings, typically a list of strings.\n There is no return value. (The name is intended to match\n ``readlines()``; ``writelines()`` does not add line separators.)\n\nFiles support the iterator protocol. Each iteration returns the same\nresult as ``file.readline()``, and iteration ends when the\n``readline()`` method returns an empty string.\n\nFile objects also offer a number of other interesting attributes.\nThese are not required for file-like objects, but should be\nimplemented if they make sense for the particular object.\n\nfile.closed\n\n bool indicating the current state of the file object. This is a\n read-only attribute; the ``close()`` method changes the value. It\n may not be available on all file-like objects.\n\nfile.encoding\n\n The encoding that this file uses. When strings are written to a\n file, they will be converted to byte strings using this encoding.\n In addition, when the file is connected to a terminal, the\n attribute gives the encoding that the terminal is likely to use\n (that information might be incorrect if the user has misconfigured\n the terminal). The attribute is read-only and may not be present\n on all file-like objects. It may also be ``None``, in which case\n the file uses the system default encoding for converting strings.\n\nfile.errors\n\n The Unicode error handler used along with the encoding.\n\nfile.mode\n\n The I/O mode for the file. If the file was created using the\n ``open()`` built-in function, this will be the value of the *mode*\n parameter. This is a read-only attribute and may not be present on\n all file-like objects.\n\nfile.name\n\n If the file object was created using ``open()``, the name of the\n file. Otherwise, some string that indicates the source of the file\n object, of the form ``<...>``. This is a read-only attribute and\n may not be present on all file-like objects.\n\nfile.newlines\n\n If Python was built with the *--with-universal-newlines* option to\n **configure** (the default) this read-only attribute exists, and\n for files opened in universal newline read mode it keeps track of\n the types of newlines encountered while reading the file. The\n values it can take are ``\'\\r\'``, ``\'\\n\'``, ``\'\\r\\n\'``, ``None``\n (unknown, no newlines read yet) or a tuple containing all the\n newline types seen, to indicate that multiple newline conventions\n were encountered. For files not opened in universal newline read\n mode the value of this attribute will be ``None``.\n', + 'bltin-file-objects': '\nFile Objects\n************\n\nFile objects are implemented using C\'s ``stdio`` package and can be\ncreated with the built-in ``open()`` function. File objects are also\nreturned by some other built-in functions and methods, such as\n``os.popen()`` and ``os.fdopen()`` and the ``makefile()`` method of\nsocket objects. Temporary files can be created using the ``tempfile``\nmodule, and high-level file operations such as copying, moving, and\ndeleting files and directories can be achieved with the ``shutil``\nmodule.\n\nWhen a file operation fails for an I/O-related reason, the exception\n``IOError`` is raised. This includes situations where the operation\nis not defined for some reason, like ``seek()`` on a tty device or\nwriting a file opened for reading.\n\nFiles have the following methods:\n\nfile.close()\n\n Close the file. A closed file cannot be read or written any more.\n Any operation which requires that the file be open will raise a\n ``ValueError`` after the file has been closed. Calling ``close()``\n more than once is allowed.\n\n You can avoid having to call this method explicitly if you use the\n ``with`` statement. For example, the following code will\n automatically close *f* when the ``with`` block is exited:\n\n from __future__ import with_statement # This isn\'t required in Python 2.6\n\n with open("hello.txt") as f:\n for line in f:\n print(line)\n\n In older versions of Python, you would have needed to do this to\n get the same effect:\n\n f = open("hello.txt")\n try:\n for line in f:\n print(line)\n finally:\n f.close()\n\n Note: Not all "file-like" types in Python support use as a context\n manager for the ``with`` statement. If your code is intended to\n work with any file-like object, you can use the function\n ``contextlib.closing()`` instead of using the object directly.\n\nfile.flush()\n\n Flush the internal buffer, like ``stdio``\'s ``fflush``. This may\n be a no-op on some file-like objects.\n\n Note: ``flush()`` does not necessarily write the file\'s data to disk.\n Use ``flush()`` followed by ``os.fsync()`` to ensure this\n behavior.\n\nfile.fileno()\n\n Return the integer "file descriptor" that is used by the underlying\n implementation to request I/O operations from the operating system.\n This can be useful for other, lower level interfaces that use file\n descriptors, such as the ``fcntl`` module or ``os.read()`` and\n friends.\n\n Note: File-like objects which do not have a real file descriptor should\n *not* provide this method!\n\nfile.isatty()\n\n Return ``True`` if the file is connected to a tty(-like) device,\n else ``False``.\n\n Note: If a file-like object is not associated with a real file, this\n method should *not* be implemented.\n\nfile.__next__()\n\n A file object is its own iterator, for example ``iter(f)`` returns\n *f* (unless *f* is closed). When a file is used as an iterator,\n typically in a ``for`` loop (for example, ``for line in f:\n print(line)``), the ``__next__()`` method is called repeatedly.\n This method returns the next input line, or raises\n ``StopIteration`` when EOF is hit when the file is open for reading\n (behavior is undefined when the file is open for writing). In\n order to make a ``for`` loop the most efficient way of looping over\n the lines of a file (a very common operation), the ``__next__()``\n method uses a hidden read-ahead buffer. As a consequence of using\n a read-ahead buffer, combining ``__next__()`` with other file\n methods (like ``readline()``) does not work right. However, using\n ``seek()`` to reposition the file to an absolute position will\n flush the read-ahead buffer.\n\nfile.read([size])\n\n Read at most *size* bytes from the file (less if the read hits EOF\n before obtaining *size* bytes). If the *size* argument is negative\n or omitted, read all data until EOF is reached. The bytes are\n returned as a string object. An empty string is returned when EOF\n is encountered immediately. (For certain files, like ttys, it\n makes sense to continue reading after an EOF is hit.) Note that\n this method may call the underlying C function ``fread`` more than\n once in an effort to acquire as close to *size* bytes as possible.\n Also note that when in non-blocking mode, less data than was\n requested may be returned, even if no *size* parameter was given.\n\nfile.readline([size])\n\n Read one entire line from the file. A trailing newline character\n is kept in the string (but may be absent when a file ends with an\n incomplete line). [5] If the *size* argument is present and non-\n negative, it is a maximum byte count (including the trailing\n newline) and an incomplete line may be returned. An empty string is\n returned *only* when EOF is encountered immediately.\n\n Note: Unlike ``stdio``\'s ``fgets``, the returned string contains null\n characters (``\'\\0\'``) if they occurred in the input.\n\nfile.readlines([sizehint])\n\n Read until EOF using ``readline()`` and return a list containing\n the lines thus read. If the optional *sizehint* argument is\n present, instead of reading up to EOF, whole lines totalling\n approximately *sizehint* bytes (possibly after rounding up to an\n internal buffer size) are read. Objects implementing a file-like\n interface may choose to ignore *sizehint* if it cannot be\n implemented, or cannot be implemented efficiently.\n\nfile.seek(offset[, whence])\n\n Set the file\'s current position, like ``stdio``\'s ``fseek``. The\n *whence* argument is optional and defaults to ``os.SEEK_SET`` or\n ``0`` (absolute file positioning); other values are ``os.SEEK_CUR``\n or ``1`` (seek relative to the current position) and\n ``os.SEEK_END`` or ``2`` (seek relative to the file\'s end). There\n is no return value.\n\n For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by\n two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third\n to last.\n\n Note that if the file is opened for appending (mode ``\'a\'`` or\n ``\'a+\'``), any ``seek()`` operations will be undone at the next\n write. If the file is only opened for writing in append mode (mode\n ``\'a\'``), this method is essentially a no-op, but it remains useful\n for files opened in append mode with reading enabled (mode\n ``\'a+\'``). If the file is opened in text mode (without ``\'b\'``),\n only offsets returned by ``tell()`` are legal. Use of other\n offsets causes undefined behavior.\n\n Note that not all file objects are seekable.\n\nfile.tell()\n\n Return the file\'s current position, like ``stdio``\'s ``ftell``.\n\n Note: On Windows, ``tell()`` can return illegal values (after an\n ``fgets``) when reading files with Unix-style line-endings. Use\n binary mode (``\'rb\'``) to circumvent this problem.\n\nfile.truncate([size])\n\n Truncate the file\'s size. If the optional *size* argument is\n present, the file is truncated to (at most) that size. The size\n defaults to the current position. The current file position is not\n changed. Note that if a specified size exceeds the file\'s current\n size, the result is platform-dependent: possibilities include that\n the file may remain unchanged, increase to the specified size as if\n zero-filled, or increase to the specified size with undefined new\n content. Availability: Windows, many Unix variants.\n\nfile.write(str)\n\n Write a string to the file. Due to buffering, the string may not\n actually show up in the file until the ``flush()`` or ``close()``\n method is called.\n\n The meaning of the return value is not defined for every file-like\n object. Some (mostly low-level) file-like objects may return the\n number of bytes actually written, others return ``None``.\n\nfile.writelines(sequence)\n\n Write a sequence of strings to the file. The sequence can be any\n iterable object producing strings, typically a list of strings.\n There is no return value. (The name is intended to match\n ``readlines()``; ``writelines()`` does not add line separators.)\n\nFiles support the iterator protocol. Each iteration returns the same\nresult as ``file.readline()``, and iteration ends when the\n``readline()`` method returns an empty string.\n\nFile objects also offer a number of other interesting attributes.\nThese are not required for file-like objects, but should be\nimplemented if they make sense for the particular object.\n\nfile.closed\n\n bool indicating the current state of the file object. This is a\n read-only attribute; the ``close()`` method changes the value. It\n may not be available on all file-like objects.\n\nfile.encoding\n\n The encoding that this file uses. When strings are written to a\n file, they will be converted to byte strings using this encoding.\n In addition, when the file is connected to a terminal, the\n attribute gives the encoding that the terminal is likely to use\n (that information might be incorrect if the user has misconfigured\n the terminal). The attribute is read-only and may not be present\n on all file-like objects. It may also be ``None``, in which case\n the file uses the system default encoding for converting strings.\n\nfile.errors\n\n The Unicode error handler used along with the encoding.\n\nfile.mode\n\n The I/O mode for the file. If the file was created using the\n ``open()`` built-in function, this will be the value of the *mode*\n parameter. This is a read-only attribute and may not be present on\n all file-like objects.\n\nfile.name\n\n If the file object was created using ``open()``, the name of the\n file. Otherwise, some string that indicates the source of the file\n object, of the form ``<...>``. This is a read-only attribute and\n may not be present on all file-like objects.\n\nfile.newlines\n\n If Python was built with the *--with-universal-newlines* option to\n **configure** (the default) this read-only attribute exists, and\n for files opened in universal newline read mode it keeps track of\n the types of newlines encountered while reading the file. The\n values it can take are ``\'\\r\'``, ``\'\\n\'``, ``\'\\r\\n\'``, ``None``\n (unknown, no newlines read yet) or a tuple containing all the\n newline types seen, to indicate that multiple newline conventions\n were encountered. For files not opened in universal newline read\n mode the value of this attribute will be ``None``.\n', 'bltin-null-object': "\nThe Null Object\n***************\n\nThis object is returned by functions that don't explicitly return a\nvalue. It supports no special operations. There is exactly one null\nobject, named ``None`` (a built-in name).\n\nIt is written as ``None``.\n", 'bltin-type-objects': "\nType Objects\n************\n\nType objects represent the various object types. An object's type is\naccessed by the built-in function ``type()``. There are no special\noperations on types. The standard module ``types`` defines names for\nall standard built-in types.\n\nTypes are written like this: ````.\n", 'booleans': '\nBoolean operations\n******************\n\nBoolean operations have the lowest priority of all Python operations:\n\n expression ::= conditional_expression | lambda_form\n expression_nocond ::= or_test | lambda_form_nocond\n conditional_expression ::= or_test ["if" or_test "else" expression]\n or_test ::= and_test | or_test "or" and_test\n and_test ::= not_test | and_test "and" not_test\n not_test ::= comparison | "not" not_test\n\nIn the context of Boolean operations, and also when expressions are\nused by control flow statements, the following values are interpreted\nas false: ``False``, ``None``, numeric zero of all types, and empty\nstrings and containers (including strings, tuples, lists,\ndictionaries, sets and frozensets). All other values are interpreted\nas true. User-defined objects can customize their truth value by\nproviding a ``__bool__()`` method.\n\nThe operator ``not`` yields ``True`` if its argument is false,\n``False`` otherwise.\n\nThe expression ``x if C else y`` first evaluates *C* (*not* *x*); if\n*C* is true, *x* is evaluated and its value is returned; otherwise,\n*y* is evaluated and its value is returned.\n\nThe expression ``x and y`` first evaluates *x*; if *x* is false, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\nThe expression ``x or y`` first evaluates *x*; if *x* is true, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\n(Note that neither ``and`` nor ``or`` restrict the value and type they\nreturn to ``False`` and ``True``, but rather return the last evaluated\nargument. This is sometimes useful, e.g., if ``s`` is a string that\nshould be replaced by a default value if it is empty, the expression\n``s or \'foo\'`` yields the desired value. Because ``not`` has to\ninvent a value anyway, it does not bother to return a value of the\nsame type as its argument, so e.g., ``not \'foo\'`` yields ``False``,\nnot ``\'\'``.)\n', @@ -24,7 +24,7 @@ 'continue': '\nThe ``continue`` statement\n**************************\n\n continue_stmt ::= "continue"\n\n``continue`` may only occur syntactically nested in a ``for`` or\n``while`` loop, but not nested in a function or class definition or\n``finally`` clause within that loop. It continues with the next cycle\nof the nearest enclosing loop.\n\nWhen ``continue`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nstarting the next loop cycle.\n', 'conversions': '\nArithmetic conversions\n**********************\n\nWhen a description of an arithmetic operator below uses the phrase\n"the numeric arguments are converted to a common type," this means\nthat the operator implementation for built-in types works that way:\n\n* If either argument is a complex number, the other is converted to\n complex;\n\n* otherwise, if either argument is a floating point number, the other\n is converted to floating point;\n\n* otherwise, both must be integers and no conversion is necessary.\n\nSome additional rules apply for certain operators (e.g., a string left\nargument to the \'%\' operator). Extensions must define their own\nconversion behavior.\n', 'customization': '\nBasic customization\n*******************\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_info()[2]`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.last_traceback``. Circular references which are garbage are\n detected when the option cycle detector is enabled (it\'s on by\n default), but can only be cleaned up if there are no Python-\n level ``__del__()`` methods involved. Refer to the documentation\n for the ``gc`` module for more information about how\n ``__del__()`` methods are handled by the cycle detector,\n particularly the description of the ``garbage`` value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted or in the process of being torn down (e.g. the\n import machinery shutting down). For this reason, ``__del__()``\n methods should do the absolute minimum needed to maintain\n external invariants. Starting with version 1.5, Python\n guarantees that globals whose name begins with a single\n underscore are deleted from their module before other globals are\n deleted; if no other references to such globals exist, this may\n help in assuring that imported modules are still available at the\n time when the ``__del__()`` method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function to compute the\n "official" string representation of an object. If at all possible,\n this should look like a valid Python expression that could be used\n to recreate an object with the same value (given an appropriate\n environment). If this is not possible, a string of the form\n ``<...some useful description...>`` should be returned. The return\n value must be a string object. If a class defines ``__repr__()``\n but not ``__str__()``, then ``__repr__()`` is also used when an\n "informal" string representation of instances of that class is\n required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print()``\n function to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__format__(self, format_spec)\n\n Called by the ``format()`` built-in function (and by extension, the\n ``format()`` method of class ``str``) to produce a "formatted"\n string representation of an object. The ``format_spec`` argument is\n a string that contains a description of the formatting options\n desired. The interpretation of the ``format_spec`` argument is up\n to the type implementing ``__format__()``, however most classes\n will either delegate formatting to one of the built-in types, or\n use a similar formatting option syntax.\n\n See *Format Specification Mini-Language* for a description of the\n standard formatting syntax.\n\n The return value must be a string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n These are the so-called "rich comparison" methods. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` calls ``x.__gt__(y)``, and ``x>=y`` calls\n ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\n To automatically generate ordering operations from a single root\n operation, see the Total Ordering recipe in the ASPN cookbook.\n\nobject.__hash__(self)\n\n Called by built-in function ``hash()`` and for operations on\n members of hashed collections including ``set``, ``frozenset``, and\n ``dict``. ``__hash__()`` should return an integer. The only\n required property is that objects which compare equal have the same\n hash value; it is advised to somehow mix together (e.g. using\n exclusive or) the hash values for the components of the object that\n also play a part in comparison of objects.\n\n If a class does not define an ``__eq__()`` method it should not\n define a ``__hash__()`` operation either; if it defines\n ``__eq__()`` but not ``__hash__()``, its instances will not be\n usable as items in hashable collections. If a class defines\n mutable objects and implements an ``__eq__()`` method, it should\n not implement ``__hash__()``, since the implementation of hashable\n collections requires that a key\'s hash value is immutable (if the\n object\'s hash value changes, it will be in the wrong hash bucket).\n\n User-defined classes have ``__eq__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal (except with\n themselves) and ``x.__hash__()`` returns ``id(x)``.\n\n Classes which inherit a ``__hash__()`` method from a parent class\n but change the meaning of ``__eq__()`` such that the hash value\n returned is no longer appropriate (e.g. by switching to a value-\n based concept of equality instead of the default identity based\n equality) can explicitly flag themselves as being unhashable by\n setting ``__hash__ = None`` in the class definition. Doing so means\n that not only will instances of the class raise an appropriate\n ``TypeError`` when a program attempts to retrieve their hash value,\n but they will also be correctly identified as unhashable when\n checking ``isinstance(obj, collections.Hashable)`` (unlike classes\n which define their own ``__hash__()`` to explicitly raise\n ``TypeError``).\n\n If a class that overrides ``__eq__()`` needs to retain the\n implementation of ``__hash__()`` from a parent class, the\n interpreter must be told this explicitly by setting ``__hash__ =\n .__hash__``. Otherwise the inheritance of\n ``__hash__()`` will be blocked, just as if ``__hash__`` had been\n explicitly set to ``None``.\n\nobject.__bool__(self)\n\n Called to implement truth value testing and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined, and the object is\n considered true if its result is nonzero. If a class defines\n neither ``__len__()`` nor ``__bool__()``, all its instances are\n considered true.\n', - 'debugger': '\n``pdb`` --- The Python Debugger\n*******************************\n\nThe module ``pdb`` defines an interactive source code debugger for\nPython programs. It supports setting (conditional) breakpoints and\nsingle stepping at the source line level, inspection of stack frames,\nsource code listing, and evaluation of arbitrary Python code in the\ncontext of any stack frame. It also supports post-mortem debugging\nand can be called under program control.\n\nThe debugger is extensible --- it is actually defined as the class\n``Pdb``. This is currently undocumented but easily understood by\nreading the source. The extension interface uses the modules ``bdb``\n(undocumented) and ``cmd``.\n\nThe debugger\'s prompt is ``(Pdb)``. Typical usage to run a program\nunder control of the debugger is:\n\n >>> import pdb\n >>> import mymodule\n >>> pdb.run(\'mymodule.test()\')\n > (0)?()\n (Pdb) continue\n > (1)?()\n (Pdb) continue\n NameError: \'spam\'\n > (1)?()\n (Pdb)\n\n``pdb.py`` can also be invoked as a script to debug other scripts.\nFor example:\n\n python -m pdb myscript.py\n\nWhen invoked as a script, pdb will automatically enter post-mortem\ndebugging if the program being debugged exits abnormally. After post-\nmortem debugging (or after normal exit of the program), pdb will\nrestart the program. Automatic restarting preserves pdb\'s state (such\nas breakpoints) and in most cases is more useful than quitting the\ndebugger upon program\'s exit.\n\nTypical usage to inspect a crashed program is:\n\n >>> import pdb\n >>> import mymodule\n >>> mymodule.test()\n Traceback (most recent call last):\n File "", line 1, in ?\n File "./mymodule.py", line 4, in test\n test2()\n File "./mymodule.py", line 3, in test2\n print(spam)\n NameError: spam\n >>> pdb.pm()\n > ./mymodule.py(3)test2()\n -> print(spam)\n (Pdb)\n\nThe module defines the following functions; each enters the debugger\nin a slightly different way:\n\npdb.run(statement[, globals[, locals]])\n\n Execute the *statement* (given as a string) under debugger control.\n The debugger prompt appears before any code is executed; you can\n set breakpoints and type ``continue``, or you can step through the\n statement using ``step`` or ``next`` (all these commands are\n explained below). The optional *globals* and *locals* arguments\n specify the environment in which the code is executed; by default\n the dictionary of the module ``__main__`` is used. (See the\n explanation of the built-in ``exec()`` or ``eval()`` functions.)\n\npdb.runeval(expression[, globals[, locals]])\n\n Evaluate the *expression* (given as a string) under debugger\n control. When ``runeval()`` returns, it returns the value of the\n expression. Otherwise this function is similar to ``run()``.\n\npdb.runcall(function[, argument, ...])\n\n Call the *function* (a function or method object, not a string)\n with the given arguments. When ``runcall()`` returns, it returns\n whatever the function call returned. The debugger prompt appears\n as soon as the function is entered.\n\npdb.set_trace()\n\n Enter the debugger at the calling stack frame. This is useful to\n hard-code a breakpoint at a given point in a program, even if the\n code is not otherwise being debugged (e.g. when an assertion\n fails).\n\npdb.post_mortem([traceback])\n\n Enter post-mortem debugging of the given *traceback* object. If no\n *traceback* is given, it uses the one of the exception that is\n currently being handled (an exception must be being handled if the\n default is to be used).\n\npdb.pm()\n\n Enter post-mortem debugging of the traceback found in\n ``sys.last_traceback``.\n', + 'debugger': '\n``pdb`` --- The Python Debugger\n*******************************\n\nThe module ``pdb`` defines an interactive source code debugger for\nPython programs. It supports setting (conditional) breakpoints and\nsingle stepping at the source line level, inspection of stack frames,\nsource code listing, and evaluation of arbitrary Python code in the\ncontext of any stack frame. It also supports post-mortem debugging\nand can be called under program control.\n\nThe debugger is extensible --- it is actually defined as the class\n``Pdb``. This is currently undocumented but easily understood by\nreading the source. The extension interface uses the modules ``bdb``\n(undocumented) and ``cmd``.\n\nThe debugger\'s prompt is ``(Pdb)``. Typical usage to run a program\nunder control of the debugger is:\n\n >>> import pdb\n >>> import mymodule\n >>> pdb.run(\'mymodule.test()\')\n > (0)?()\n (Pdb) continue\n > (1)?()\n (Pdb) continue\n NameError: \'spam\'\n > (1)?()\n (Pdb)\n\n``pdb.py`` can also be invoked as a script to debug other scripts.\nFor example:\n\n python -m pdb myscript.py\n\nWhen invoked as a script, pdb will automatically enter post-mortem\ndebugging if the program being debugged exits abnormally. After post-\nmortem debugging (or after normal exit of the program), pdb will\nrestart the program. Automatic restarting preserves pdb\'s state (such\nas breakpoints) and in most cases is more useful than quitting the\ndebugger upon program\'s exit.\n\nThe typical usage to break into the debugger from a running program is\nto insert\n\n import pdb; pdb.set_trace()\n\nat the location you want to break into the debugger. You can then\nstep through the code following this statement, and continue running\nwithout debugger using the ``c`` command.\n\nThe typical usage to inspect a crashed program is:\n\n >>> import pdb\n >>> import mymodule\n >>> mymodule.test()\n Traceback (most recent call last):\n File "", line 1, in ?\n File "./mymodule.py", line 4, in test\n test2()\n File "./mymodule.py", line 3, in test2\n print(spam)\n NameError: spam\n >>> pdb.pm()\n > ./mymodule.py(3)test2()\n -> print(spam)\n (Pdb)\n\nThe module defines the following functions; each enters the debugger\nin a slightly different way:\n\npdb.run(statement[, globals[, locals]])\n\n Execute the *statement* (given as a string) under debugger control.\n The debugger prompt appears before any code is executed; you can\n set breakpoints and type ``continue``, or you can step through the\n statement using ``step`` or ``next`` (all these commands are\n explained below). The optional *globals* and *locals* arguments\n specify the environment in which the code is executed; by default\n the dictionary of the module ``__main__`` is used. (See the\n explanation of the built-in ``exec()`` or ``eval()`` functions.)\n\npdb.runeval(expression[, globals[, locals]])\n\n Evaluate the *expression* (given as a string) under debugger\n control. When ``runeval()`` returns, it returns the value of the\n expression. Otherwise this function is similar to ``run()``.\n\npdb.runcall(function[, argument, ...])\n\n Call the *function* (a function or method object, not a string)\n with the given arguments. When ``runcall()`` returns, it returns\n whatever the function call returned. The debugger prompt appears\n as soon as the function is entered.\n\npdb.set_trace()\n\n Enter the debugger at the calling stack frame. This is useful to\n hard-code a breakpoint at a given point in a program, even if the\n code is not otherwise being debugged (e.g. when an assertion\n fails).\n\npdb.post_mortem([traceback])\n\n Enter post-mortem debugging of the given *traceback* object. If no\n *traceback* is given, it uses the one of the exception that is\n currently being handled (an exception must be being handled if the\n default is to be used).\n\npdb.pm()\n\n Enter post-mortem debugging of the traceback found in\n ``sys.last_traceback``.\n\nThe ``run_*`` functions and ``set_trace()`` are aliases for\ninstantiating the ``Pdb`` class and calling the method of the same\nname. If you want to access further features, you have to do this\nyourself:\n\nclass class pdb.Pdb(completekey=\'tab\', stdin=None, stdout=None, skip=None)\n\n ``Pdb`` is the debugger class.\n\n The *completekey*, *stdin* and *stdout* arguments are passed to the\n underlying ``cmd.Cmd`` class; see the description there.\n\n The *skip* argument, if given, must be an iterable of glob-style\n module name patterns. The debugger will not step into frames that\n originate in a module that matches one of these patterns. [1]\n\n Example call to enable tracing with *skip*:\n\n import pdb; pdb.Pdb(skip=[\'django.*\']).set_trace()\n\n New in version 3.1: The *skip* argument.\n\n run(statement[, globals[, locals]])\n runeval(expression[, globals[, locals]])\n runcall(function[, argument, ...])\n set_trace()\n\n See the documentation for the functions explained above.\n', 'del': '\nThe ``del`` statement\n*********************\n\n del_stmt ::= "del" target_list\n\nDeletion is recursively defined very similar to the way assignment is\ndefined. Rather that spelling it out in full details, here are some\nhints.\n\nDeletion of a target list recursively deletes each target, from left\nto right.\n\nDeletion of a name removes the binding of that name from the local or\nglobal namespace, depending on whether the name occurs in a ``global``\nstatement in the same code block. If the name is unbound, a\n``NameError`` exception will be raised.\n\nIt is illegal to delete a name from the local namespace if it occurs\nas a free variable in a nested block.\n\nDeletion of attribute references, subscriptions and slicings is passed\nto the primary object involved; deletion of a slicing is in general\nequivalent to assignment of an empty slice of the right type (but even\nthis is determined by the sliced object).\n', 'dict': '\nDictionary displays\n*******************\n\nA dictionary display is a possibly empty series of key/datum pairs\nenclosed in curly braces:\n\n dict_display ::= "{" [key_datum_list | dict_comprehension] "}"\n key_datum_list ::= key_datum ("," key_datum)* [","]\n key_datum ::= expression ":" expression\n dict_comprehension ::= expression ":" expression comp_for\n\nA dictionary display yields a new dictionary object.\n\nIf a comma-separated sequence of key/datum pairs is given, they are\nevaluated from left to right to define the entries of the dictionary:\neach key object is used as a key into the dictionary to store the\ncorresponding datum. This means that you can specify the same key\nmultiple times in the key/datum list, and the final dictionary\'s value\nfor that key will be the last one given.\n\nA dict comprehension, in contrast to list and set comprehensions,\nneeds two expressions separated with a colon followed by the usual\n"for" and "if" clauses. When the comprehension is run, the resulting\nkey and value elements are inserted in the new dictionary in the order\nthey are produced.\n\nRestrictions on the types of the key values are listed earlier in\nsection *The standard type hierarchy*. (To summarize, the key type\nshould be *hashable*, which excludes all mutable objects.) Clashes\nbetween duplicate keys are not detected; the last datum (textually\nrightmost in the display) stored for a given key value prevails.\n', 'dynamic-features': '\nInteraction with dynamic features\n*********************************\n\nThere are several cases where Python statements are illegal when used\nin conjunction with nested scopes that contain free variables.\n\nIf a variable is referenced in an enclosing scope, it is illegal to\ndelete the name. An error will be reported at compile time.\n\nIf the wild card form of import --- ``import *`` --- is used in a\nfunction and the function contains or is a nested block with free\nvariables, the compiler will raise a ``SyntaxError``.\n\nThe ``eval()`` and ``exec()`` functions do not have access to the full\nenvironment for resolving names. Names may be resolved in the local\nand global namespaces of the caller. Free variables are not resolved\nin the nearest enclosing namespace, but in the global namespace. [1]\nThe ``exec()`` and ``eval()`` functions have optional arguments to\noverride the global and local namespace. If only one namespace is\nspecified, it is used for both.\n', @@ -34,14 +34,14 @@ 'exprlists': '\nExpression lists\n****************\n\n expression_list ::= expression ( "," expression )* [","]\n\nAn expression list containing at least one comma yields a tuple. The\nlength of the tuple is the number of expressions in the list. The\nexpressions are evaluated from left to right.\n\nThe trailing comma is required only to create a single tuple (a.k.a. a\n*singleton*); it is optional in all other cases. A single expression\nwithout a trailing comma doesn\'t create a tuple, but rather yields the\nvalue of that expression. (To create an empty tuple, use an empty pair\nof parentheses: ``()``.)\n', 'floating': '\nFloating point literals\n***********************\n\nFloating point literals are described by the following lexical\ndefinitions:\n\n floatnumber ::= pointfloat | exponentfloat\n pointfloat ::= [intpart] fraction | intpart "."\n exponentfloat ::= (intpart | pointfloat) exponent\n intpart ::= digit+\n fraction ::= "." digit+\n exponent ::= ("e" | "E") ["+" | "-"] digit+\n\nNote that the integer and exponent parts are always interpreted using\nradix 10. For example, ``077e010`` is legal, and denotes the same\nnumber as ``77e10``. The allowed range of floating point literals is\nimplementation-dependent. Some examples of floating point literals:\n\n 3.14 10. .001 1e100 3.14e-10 0e0\n\nNote that numeric literals do not include a sign; a phrase like ``-1``\nis actually an expression composed of the unary operator ``-`` and the\nliteral ``1``.\n', 'for': '\nThe ``for`` statement\n*********************\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments (see *Assignment statements*), and then the suite is\nexecuted. When the items are exhausted (which is immediately when the\nsequence is empty or an iterator raises a ``StopIteration``\nexception), the suite in the ``else`` clause, if present, is executed,\nand the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nNames in the target list are not deleted when the loop is finished,\nbut if the sequence is empty, it will not have been assigned to at all\nby the loop. Hint: the built-in function ``range()`` returns an\niterator of integers suitable to emulate the effect of Pascal\'s ``for\ni := a to b do``; e.g., ``range(3)`` returns the list ``[0, 1, 2]``.\n\nNote: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An\n internal counter is used to keep track of which item is used next,\n and this is incremented on each iteration. When this counter has\n reached the length of the sequence the loop terminates. This means\n that if the suite deletes the current (or a previous) item from the\n sequence, the next item will be skipped (since it gets the index of\n the current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n', - 'formatstrings': '\nFormat String Syntax\n********************\n\nThe ``str.format()`` method and the ``Formatter`` class share the same\nsyntax for format strings (although in the case of ``Formatter``,\nsubclasses can define their own format string syntax.)\n\nFormat strings contain "replacement fields" surrounded by curly braces\n``{}``. Anything that is not contained in braces is considered literal\ntext, which is copied unchanged to the output. If you need to include\na brace character in the literal text, it can be escaped by doubling:\n``{{`` and ``}}``.\n\nThe grammar for a replacement field is as follows:\n\n replacement_field ::= "{" field_name ["!" conversion] [":" format_spec] "}"\n field_name ::= arg_name ("." attribute_name | "[" element_index "]")*\n arg_name ::= (identifier | integer)?\n attribute_name ::= identifier\n element_index ::= integer\n conversion ::= "r" | "s" | "a"\n format_spec ::= \n\nIn less formal terms, the replacement field starts with a *field_name*\nthat specifies the object whose value is to be formatted and inserted\ninto the output instead of the replacement field. The *field_name* is\noptionally followed by a *conversion* field, which is preceded by an\nexclamation point ``\'!\'``, and a *format_spec*, which is preceded by a\ncolon ``\':\'``. These specify a non-default format for the replacement\nvalue.\n\nThe *field_name* itself begins with an *arg_name* that is either\neither a number or a keyword. If it\'s a number, it refers to a\npositional argument, and if it\'s a keyword, it refers to a named\nkeyword argument. If the numerical arg_names in a format string are\n0, 1, 2, ... in sequence, they can all be omitted (not just some) and\nthe numbers 0, 1, 2, ... will be automatically inserted in that order.\nThe *arg_name* can be followed by any number of index or attribute\nexpressions. An expression of the form ``\'.name\'`` selects the named\nattribute using ``getattr()``, while an expression of the form\n``\'[index]\'`` does an index lookup using ``__getitem__()``.\n\nSome simple format string examples:\n\n "First, thou shalt count to {0}" # References first positional argument\n "Bring me a {}" # Implicitly references the first positional argument\n "From {} to {}" # Same as "From {0] to {1}"\n "My quest is {name}" # References keyword argument \'name\'\n "Weight in tons {0.weight}" # \'weight\' attribute of first positional arg\n "Units destroyed: {players[0]}" # First element of keyword argument \'players\'.\n\nThe *conversion* field causes a type coercion before formatting.\nNormally, the job of formatting a value is done by the\n``__format__()`` method of the value itself. However, in some cases\nit is desirable to force a type to be formatted as a string,\noverriding its own definition of formatting. By converting the value\nto a string before calling ``__format__()``, the normal formatting\nlogic is bypassed.\n\nThree conversion flags are currently supported: ``\'!s\'`` which calls\n``str()`` on the value, ``\'!r\'`` which calls ``repr()`` and ``\'!a\'``\nwhich calls ``ascii()``.\n\nSome examples:\n\n "Harold\'s a clever {0!s}" # Calls str() on the argument first\n "Bring out the holy {name!r}" # Calls repr() on the argument first\n\nThe *format_spec* field contains a specification of how the value\nshould be presented, including such details as field width, alignment,\npadding, decimal precision and so on. Each value type can define it\'s\nown "formatting mini-language" or interpretation of the *format_spec*.\n\nMost built-in types support a common formatting mini-language, which\nis described in the next section.\n\nA *format_spec* field can also include nested replacement fields\nwithin it. These nested replacement fields can contain only a field\nname; conversion flags and format specifications are not allowed. The\nreplacement fields within the format_spec are substituted before the\n*format_spec* string is interpreted. This allows the formatting of a\nvalue to be dynamically specified.\n\nFor example, suppose you wanted to have a replacement field whose\nfield width is determined by another variable:\n\n "A man with two {0:{1}}".format("noses", 10)\n\nThis would first evaluate the inner replacement field, making the\nformat string effectively:\n\n "A man with two {0:10}"\n\nThen the outer replacement field would be evaluated, producing:\n\n "noses "\n\nWhich is substituted into the string, yielding:\n\n "A man with two noses "\n\n(The extra space is because we specified a field width of 10, and\nbecause left alignment is the default for strings.)\n\n\nFormat Specification Mini-Language\n==================================\n\n"Format specifications" are used within replacement fields contained\nwithin a format string to define how individual values are presented\n(see *Format String Syntax*.) They can also be passed directly to the\nbuiltin ``format()`` function. Each formattable type may define how\nthe format specification is to be interpreted.\n\nMost built-in types implement the following options for format\nspecifications, although some of the formatting options are only\nsupported by the numeric types.\n\nA general convention is that an empty format string (``""``) produces\nthe same result as if you had called ``str()`` on the value.\n\nThe general form of a *standard format specifier* is:\n\n format_spec ::= [[fill]align][sign][#][0][width][.precision][type]\n fill ::= \n align ::= "<" | ">" | "=" | "^"\n sign ::= "+" | "-" | " "\n width ::= integer\n precision ::= integer\n type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%"\n\nThe *fill* character can be any character other than \'}\' (which\nsignifies the end of the field). The presence of a fill character is\nsignaled by the *next* character, which must be one of the alignment\noptions. If the second character of *format_spec* is not a valid\nalignment option, then it is assumed that both the fill character and\nthe alignment option are absent.\n\nThe meaning of the various alignment options is as follows:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'<\'`` | Forces the field to be left-aligned within the available |\n | | space (This is the default.) |\n +-----------+------------------------------------------------------------+\n | ``\'>\'`` | Forces the field to be right-aligned within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n | ``\'=\'`` | Forces the padding to be placed after the sign (if any) |\n | | but before the digits. This is used for printing fields |\n | | in the form \'+000000120\'. This alignment option is only |\n | | valid for numeric types. |\n +-----------+------------------------------------------------------------+\n | ``\'^\'`` | Forces the field to be centered within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n\nNote that unless a minimum field width is defined, the field width\nwill always be the same size as the data to fill it, so that the\nalignment option has no meaning in this case.\n\nThe *sign* option is only valid for number types, and can be one of\nthe following:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'+\'`` | indicates that a sign should be used for both positive as |\n | | well as negative numbers. |\n +-----------+------------------------------------------------------------+\n | ``\'-\'`` | indicates that a sign should be used only for negative |\n | | numbers (this is the default behavior). |\n +-----------+------------------------------------------------------------+\n | space | indicates that a leading space should be used on positive |\n | | numbers, and a minus sign on negative numbers. |\n +-----------+------------------------------------------------------------+\n\nThe ``\'#\'`` option is only valid for integers, and only for binary,\noctal, or hexadecimal output. If present, it specifies that the\noutput will be prefixed by ``\'0b\'``, ``\'0o\'``, or ``\'0x\'``,\nrespectively.\n\n*width* is a decimal integer defining the minimum field width. If not\nspecified, then the field width will be determined by the content.\n\nIf the *width* field is preceded by a zero (``\'0\'``) character, this\nenables zero-padding. This is equivalent to an *alignment* type of\n``\'=\'`` and a *fill* character of ``\'0\'``.\n\nThe *precision* is a decimal number indicating how many digits should\nbe displayed after the decimal point for a floating point value\nformatted with ``\'f\'`` and ``\'F\'``, or before and after the decimal\npoint for a floating point value formatted with ``\'g\'`` or ``\'G\'``.\nFor non-number types the field indicates the maximum field size - in\nother words, how many characters will be used from the field content.\nThe *precision* is ignored for integer values.\n\nFinally, the *type* determines how the data should be presented.\n\nThe available integer presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'b\'`` | Binary format. Outputs the number in base 2. |\n +-----------+------------------------------------------------------------+\n | ``\'c\'`` | Character. Converts the integer to the corresponding |\n | | unicode character before printing. |\n +-----------+------------------------------------------------------------+\n | ``\'d\'`` | Decimal Integer. Outputs the number in base 10. |\n +-----------+------------------------------------------------------------+\n | ``\'o\'`` | Octal format. Outputs the number in base 8. |\n +-----------+------------------------------------------------------------+\n | ``\'x\'`` | Hex format. Outputs the number in base 16, using lower- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'X\'`` | Hex format. Outputs the number in base 16, using upper- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'d\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'d\'``. |\n +-----------+------------------------------------------------------------+\n\nThe available presentation types for floating point and decimal values\nare:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'e\'`` | Exponent notation. Prints the number in scientific |\n | | notation using the letter \'e\' to indicate the exponent. |\n +-----------+------------------------------------------------------------+\n | ``\'E\'`` | Exponent notation. Same as ``\'e\'`` except it uses an upper |\n | | case \'E\' as the separator character. |\n +-----------+------------------------------------------------------------+\n | ``\'f\'`` | Fixed point. Displays the number as a fixed-point number. |\n +-----------+------------------------------------------------------------+\n | ``\'F\'`` | Fixed point. Same as ``\'f\'``. |\n +-----------+------------------------------------------------------------+\n | ``\'g\'`` | General format. This prints the number as a fixed-point |\n | | number, unless the number is too large, in which case it |\n | | switches to ``\'e\'`` exponent notation. Infinity and NaN |\n | | values are formatted as ``inf``, ``-inf`` and ``nan``, |\n | | respectively. |\n +-----------+------------------------------------------------------------+\n | ``\'G\'`` | General format. Same as ``\'g\'`` except switches to ``\'E\'`` |\n | | if the number gets to large. The representations of |\n | | infinity and NaN are uppercased, too. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'g\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | ``\'%\'`` | Percentage. Multiplies the number by 100 and displays in |\n | | fixed (``\'f\'``) format, followed by a percent sign. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'g\'``. |\n +-----------+------------------------------------------------------------+\n', + 'formatstrings': '\nFormat String Syntax\n********************\n\nThe ``str.format()`` method and the ``Formatter`` class share the same\nsyntax for format strings (although in the case of ``Formatter``,\nsubclasses can define their own format string syntax.)\n\nFormat strings contain "replacement fields" surrounded by curly braces\n``{}``. Anything that is not contained in braces is considered literal\ntext, which is copied unchanged to the output. If you need to include\na brace character in the literal text, it can be escaped by doubling:\n``{{`` and ``}}``.\n\nThe grammar for a replacement field is as follows:\n\n replacement_field ::= "{" field_name ["!" conversion] [":" format_spec] "}"\n field_name ::= arg_name ("." attribute_name | "[" element_index "]")*\n arg_name ::= (identifier | integer)?\n attribute_name ::= identifier\n element_index ::= integer\n conversion ::= "r" | "s" | "a"\n format_spec ::= \n\nIn less formal terms, the replacement field starts with a *field_name*\nthat specifies the object whose value is to be formatted and inserted\ninto the output instead of the replacement field. The *field_name* is\noptionally followed by a *conversion* field, which is preceded by an\nexclamation point ``\'!\'``, and a *format_spec*, which is preceded by a\ncolon ``\':\'``. These specify a non-default format for the replacement\nvalue.\n\nThe *field_name* itself begins with an *arg_name* that is either\neither a number or a keyword. If it\'s a number, it refers to a\npositional argument, and if it\'s a keyword, it refers to a named\nkeyword argument. If the numerical arg_names in a format string are\n0, 1, 2, ... in sequence, they can all be omitted (not just some) and\nthe numbers 0, 1, 2, ... will be automatically inserted in that order.\nThe *arg_name* can be followed by any number of index or attribute\nexpressions. An expression of the form ``\'.name\'`` selects the named\nattribute using ``getattr()``, while an expression of the form\n``\'[index]\'`` does an index lookup using ``__getitem__()``.\n\nSome simple format string examples:\n\n "First, thou shalt count to {0}" # References first positional argument\n "Bring me a {}" # Implicitly references the first positional argument\n "From {} to {}" # Same as "From {0] to {1}"\n "My quest is {name}" # References keyword argument \'name\'\n "Weight in tons {0.weight}" # \'weight\' attribute of first positional arg\n "Units destroyed: {players[0]}" # First element of keyword argument \'players\'.\n\nThe *conversion* field causes a type coercion before formatting.\nNormally, the job of formatting a value is done by the\n``__format__()`` method of the value itself. However, in some cases\nit is desirable to force a type to be formatted as a string,\noverriding its own definition of formatting. By converting the value\nto a string before calling ``__format__()``, the normal formatting\nlogic is bypassed.\n\nThree conversion flags are currently supported: ``\'!s\'`` which calls\n``str()`` on the value, ``\'!r\'`` which calls ``repr()`` and ``\'!a\'``\nwhich calls ``ascii()``.\n\nSome examples:\n\n "Harold\'s a clever {0!s}" # Calls str() on the argument first\n "Bring out the holy {name!r}" # Calls repr() on the argument first\n\nThe *format_spec* field contains a specification of how the value\nshould be presented, including such details as field width, alignment,\npadding, decimal precision and so on. Each value type can define it\'s\nown "formatting mini-language" or interpretation of the *format_spec*.\n\nMost built-in types support a common formatting mini-language, which\nis described in the next section.\n\nA *format_spec* field can also include nested replacement fields\nwithin it. These nested replacement fields can contain only a field\nname; conversion flags and format specifications are not allowed. The\nreplacement fields within the format_spec are substituted before the\n*format_spec* string is interpreted. This allows the formatting of a\nvalue to be dynamically specified.\n\nFor example, suppose you wanted to have a replacement field whose\nfield width is determined by another variable:\n\n "A man with two {0:{1}}".format("noses", 10)\n\nThis would first evaluate the inner replacement field, making the\nformat string effectively:\n\n "A man with two {0:10}"\n\nThen the outer replacement field would be evaluated, producing:\n\n "noses "\n\nWhich is substituted into the string, yielding:\n\n "A man with two noses "\n\n(The extra space is because we specified a field width of 10, and\nbecause left alignment is the default for strings.)\n\n\nFormat Specification Mini-Language\n==================================\n\n"Format specifications" are used within replacement fields contained\nwithin a format string to define how individual values are presented\n(see *Format String Syntax*.) They can also be passed directly to the\nbuiltin ``format()`` function. Each formattable type may define how\nthe format specification is to be interpreted.\n\nMost built-in types implement the following options for format\nspecifications, although some of the formatting options are only\nsupported by the numeric types.\n\nA general convention is that an empty format string (``""``) produces\nthe same result as if you had called ``str()`` on the value.\n\nThe general form of a *standard format specifier* is:\n\n format_spec ::= [[fill]align][sign][#][0][width][.precision][type]\n fill ::= \n align ::= "<" | ">" | "=" | "^"\n sign ::= "+" | "-" | " "\n width ::= integer\n precision ::= integer\n type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%"\n\nThe *fill* character can be any character other than \'}\' (which\nsignifies the end of the field). The presence of a fill character is\nsignaled by the *next* character, which must be one of the alignment\noptions. If the second character of *format_spec* is not a valid\nalignment option, then it is assumed that both the fill character and\nthe alignment option are absent.\n\nThe meaning of the various alignment options is as follows:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'<\'`` | Forces the field to be left-aligned within the available |\n | | space (This is the default.) |\n +-----------+------------------------------------------------------------+\n | ``\'>\'`` | Forces the field to be right-aligned within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n | ``\'=\'`` | Forces the padding to be placed after the sign (if any) |\n | | but before the digits. This is used for printing fields |\n | | in the form \'+000000120\'. This alignment option is only |\n | | valid for numeric types. |\n +-----------+------------------------------------------------------------+\n | ``\'^\'`` | Forces the field to be centered within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n\nNote that unless a minimum field width is defined, the field width\nwill always be the same size as the data to fill it, so that the\nalignment option has no meaning in this case.\n\nThe *sign* option is only valid for number types, and can be one of\nthe following:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'+\'`` | indicates that a sign should be used for both positive as |\n | | well as negative numbers. |\n +-----------+------------------------------------------------------------+\n | ``\'-\'`` | indicates that a sign should be used only for negative |\n | | numbers (this is the default behavior). |\n +-----------+------------------------------------------------------------+\n | space | indicates that a leading space should be used on positive |\n | | numbers, and a minus sign on negative numbers. |\n +-----------+------------------------------------------------------------+\n\nThe ``\'#\'`` option is only valid for integers, and only for binary,\noctal, or hexadecimal output. If present, it specifies that the\noutput will be prefixed by ``\'0b\'``, ``\'0o\'``, or ``\'0x\'``,\nrespectively.\n\n*width* is a decimal integer defining the minimum field width. If not\nspecified, then the field width will be determined by the content.\n\nIf the *width* field is preceded by a zero (``\'0\'``) character, this\nenables zero-padding. This is equivalent to an *alignment* type of\n``\'=\'`` and a *fill* character of ``\'0\'``.\n\nThe *precision* is a decimal number indicating how many digits should\nbe displayed after the decimal point for a floating point value\nformatted with ``\'f\'`` and ``\'F\'``, or before and after the decimal\npoint for a floating point value formatted with ``\'g\'`` or ``\'G\'``.\nFor non-number types the field indicates the maximum field size - in\nother words, how many characters will be used from the field content.\nThe *precision* is ignored for integer values.\n\nFinally, the *type* determines how the data should be presented.\n\nThe available integer presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'b\'`` | Binary format. Outputs the number in base 2. |\n +-----------+------------------------------------------------------------+\n | ``\'c\'`` | Character. Converts the integer to the corresponding |\n | | unicode character before printing. |\n +-----------+------------------------------------------------------------+\n | ``\'d\'`` | Decimal Integer. Outputs the number in base 10. |\n +-----------+------------------------------------------------------------+\n | ``\'o\'`` | Octal format. Outputs the number in base 8. |\n +-----------+------------------------------------------------------------+\n | ``\'x\'`` | Hex format. Outputs the number in base 16, using lower- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'X\'`` | Hex format. Outputs the number in base 16, using upper- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'d\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'d\'``. |\n +-----------+------------------------------------------------------------+\n\nThe available presentation types for floating point and decimal values\nare:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'e\'`` | Exponent notation. Prints the number in scientific |\n | | notation using the letter \'e\' to indicate the exponent. |\n +-----------+------------------------------------------------------------+\n | ``\'E\'`` | Exponent notation. Same as ``\'e\'`` except it uses an upper |\n | | case \'E\' as the separator character. |\n +-----------+------------------------------------------------------------+\n | ``\'f\'`` | Fixed point. Displays the number as a fixed-point number. |\n +-----------+------------------------------------------------------------+\n | ``\'F\'`` | Fixed point. Same as ``\'f\'``, but converts ``nan`` to |\n | | ``NAN`` and ``inf`` to ``INF``. |\n +-----------+------------------------------------------------------------+\n | ``\'g\'`` | General format. This prints the number as a fixed-point |\n | | number, unless the number is too large, in which case it |\n | | switches to ``\'e\'`` exponent notation. Infinity and NaN |\n | | values are formatted as ``inf``, ``-inf`` and ``nan``, |\n | | respectively. |\n +-----------+------------------------------------------------------------+\n | ``\'G\'`` | General format. Same as ``\'g\'`` except switches to ``\'E\'`` |\n | | if the number gets to large. The representations of |\n | | infinity and NaN are uppercased, too. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'g\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | ``\'%\'`` | Percentage. Multiplies the number by 100 and displays in |\n | | fixed (``\'f\'``) format, followed by a percent sign. |\n +-----------+------------------------------------------------------------+\n | None | Similar to ``\'g\'``, except with at least one digit past |\n | | the decimal point and a default precision of 12. This is |\n | | intended to match ``str()``, except you can add the other |\n | | format modifiers. |\n +-----------+------------------------------------------------------------+\n', 'function': '\nFunction definitions\n********************\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n funcdef ::= [decorators] "def" funcname "(" [parameter_list] ")" ["->" expression] ":" suite\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" [parameter] ("," defparameter)*\n [, "**" parameter]\n | "**" parameter\n | defparameter [","] )\n parameter ::= identifier [":" expression]\n defparameter ::= parameter ["=" expression]\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters up until the "``*``" must also have a default value ---\nthis is a syntactic restriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary. Parameters after "``*``" or "``*identifier``" are\nkeyword-only parameters and may only be passed used keyword arguments.\n\nParameters may have annotations of the form "``: expression``"\nfollowing the parameter name. Any parameter may have an annotation\neven those of the form ``*identifier`` or ``**identifier``. Functions\nmay have "return" annotation of the form "``-> expression``" after the\nparameter list. These annotations can be any valid Python expression\nand are evaluated when the function definition is executed.\nAnnotations may be evaluated in a different order than they appear in\nthe source code. The presence of annotations does not change the\nsemantics of a function. The annotation values are available as\nvalues of a dictionary keyed by the parameters\' names in the\n``__annotations__`` attribute of the function object.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Lambdas*. Note that the lambda form is merely a\nshorthand for a simplified function definition; a function defined in\na "``def``" statement can be passed around or assigned to another name\njust like a function defined by a lambda form. The "``def``" form is\nactually more powerful since it allows the execution of multiple\nstatements and annotations.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n', 'global': '\nThe ``global`` statement\n************************\n\n global_stmt ::= "global" identifier ("," identifier)*\n\nThe ``global`` statement is a declaration which holds for the entire\ncurrent code block. It means that the listed identifiers are to be\ninterpreted as globals. It would be impossible to assign to a global\nvariable without ``global``, although free variables may refer to\nglobals without being declared global.\n\nNames listed in a ``global`` statement must not be used in the same\ncode block textually preceding that ``global`` statement.\n\nNames listed in a ``global`` statement must not be defined as formal\nparameters or in a ``for`` loop control target, ``class`` definition,\nfunction definition, or ``import`` statement.\n\n(The current implementation does not enforce the latter two\nrestrictions, but programs should not abuse this freedom, as future\nimplementations may enforce them or silently change the meaning of the\nprogram.)\n\n**Programmer\'s note:** the ``global`` is a directive to the parser.\nIt applies only to code parsed at the same time as the ``global``\nstatement. In particular, a ``global`` statement contained in a string\nor code object supplied to the builtin ``exec()`` function does not\naffect the code block *containing* the function call, and code\ncontained in such a string is unaffected by ``global`` statements in\nthe code containing the function call. The same applies to the\n``eval()`` and ``compile()`` functions.\n', 'id-classes': '\nReserved classes of identifiers\n*******************************\n\nCertain classes of identifiers (besides keywords) have special\nmeanings. These classes are identified by the patterns of leading and\ntrailing underscore characters:\n\n``_*``\n Not imported by ``from module import *``. The special identifier\n ``_`` is used in the interactive interpreter to store the result of\n the last evaluation; it is stored in the ``builtins`` module. When\n not in interactive mode, ``_`` has no special meaning and is not\n defined. See section *The import statement*.\n\n Note: The name ``_`` is often used in conjunction with\n internationalization; refer to the documentation for the\n ``gettext`` module for more information on this convention.\n\n``__*__``\n System-defined names. These names are defined by the interpreter\n and its implementation (including the standard library);\n applications should not expect to define additional names using\n this convention. The set of names of this class defined by Python\n may be extended in future versions. See section *Special method\n names*.\n\n``__*``\n Class-private names. Names in this category, when used within the\n context of a class definition, are re-written to use a mangled form\n to help avoid name clashes between "private" attributes of base and\n derived classes. See section *Identifiers (Names)*.\n', 'identifiers': '\nIdentifiers and keywords\n************************\n\nIdentifiers (also referred to as *names*) are described by the\nfollowing lexical definitions.\n\nThe syntax of identifiers in Python is based on the Unicode standard\nannex UAX-31, with elaboration and changes as defined below; see also\n**PEP 3131** for further details.\n\nWithin the ASCII range (U+0001..U+007F), the valid characters for\nidentifiers are the same as in Python 2.x: the uppercase and lowercase\nletters ``A`` through ``Z``, the underscore ``_`` and, except for the\nfirst character, the digits ``0`` through ``9``.\n\nPython 3.0 introduces additional characters from outside the ASCII\nrange (see **PEP 3131**). For these characters, the classification\nuses the version of the Unicode Character Database as included in the\n``unicodedata`` module.\n\nIdentifiers are unlimited in length. Case is significant.\n\n identifier ::= id_start id_continue*\n id_start ::= \n id_continue ::= \n\nThe Unicode category codes mentioned above stand for:\n\n* *Lu* - uppercase letters\n\n* *Ll* - lowercase letters\n\n* *Lt* - titlecase letters\n\n* *Lm* - modifier letters\n\n* *Lo* - other letters\n\n* *Nl* - letter numbers\n\n* *Mn* - nonspacing marks\n\n* *Mc* - spacing combining marks\n\n* *Nd* - decimal numbers\n\n* *Pc* - connector punctuations\n\nAll identifiers are converted into the normal form NFC while parsing;\ncomparison of identifiers is based on NFC.\n\nA non-normative HTML file listing all valid identifier characters for\nUnicode 4.1 can be found at http://www.dcl.hpi.uni-\npotsdam.de/home/loewis/table-3131.html.\n\n\nKeywords\n========\n\nThe following identifiers are used as reserved words, or *keywords* of\nthe language, and cannot be used as ordinary identifiers. They must\nbe spelled exactly as written here:\n\n False class finally is return\n None continue for lambda try\n True def from nonlocal while\n and del global not with\n as elif if or yield\n assert else import pass\n break except in raise\n\n\nReserved classes of identifiers\n===============================\n\nCertain classes of identifiers (besides keywords) have special\nmeanings. These classes are identified by the patterns of leading and\ntrailing underscore characters:\n\n``_*``\n Not imported by ``from module import *``. The special identifier\n ``_`` is used in the interactive interpreter to store the result of\n the last evaluation; it is stored in the ``builtins`` module. When\n not in interactive mode, ``_`` has no special meaning and is not\n defined. See section *The import statement*.\n\n Note: The name ``_`` is often used in conjunction with\n internationalization; refer to the documentation for the\n ``gettext`` module for more information on this convention.\n\n``__*__``\n System-defined names. These names are defined by the interpreter\n and its implementation (including the standard library);\n applications should not expect to define additional names using\n this convention. The set of names of this class defined by Python\n may be extended in future versions. See section *Special method\n names*.\n\n``__*``\n Class-private names. Names in this category, when used within the\n context of a class definition, are re-written to use a mangled form\n to help avoid name clashes between "private" attributes of base and\n derived classes. See section *Identifiers (Names)*.\n', 'if': '\nThe ``if`` statement\n********************\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n', 'imaginary': '\nImaginary literals\n******************\n\nImaginary literals are described by the following lexical definitions:\n\n imagnumber ::= (floatnumber | intpart) ("j" | "J")\n\nAn imaginary literal yields a complex number with a real part of 0.0.\nComplex numbers are represented as a pair of floating point numbers\nand have the same restrictions on their range. To create a complex\nnumber with a nonzero real part, add a floating point number to it,\ne.g., ``(3+4j)``. Some examples of imaginary literals:\n\n 3.14j 10.j 10j .001j 1e100j 3.14e-10j\n', - 'import': '\nThe ``import`` statement\n************************\n\n import_stmt ::= "import" module ["as" name] ( "," module ["as" name] )*\n | "from" relative_module "import" identifier ["as" name]\n ( "," identifier ["as" name] )*\n | "from" relative_module "import" "(" identifier ["as" name]\n ( "," identifier ["as" name] )* [","] ")"\n | "from" module "import" "*"\n module ::= (identifier ".")* identifier\n relative_module ::= "."* module | "."+\n name ::= identifier\n\nImport statements are executed in two steps: (1) find a module, and\ninitialize it if necessary; (2) define a name or names in the local\nnamespace (of the scope where the ``import`` statement occurs). The\nstatement comes in two forms differing on whether it uses the ``from``\nkeyword. The first form (without ``from``) repeats these steps for\neach identifier in the list. The form with ``from`` performs step (1)\nonce, and then performs step (2) repeatedly. For a reference\nimplementation of step (1), see the ``importlib`` module.\n\nTo understand how step (1) occurs, one must first understand how\nPython handles hierarchical naming of modules. To help organize\nmodules and provide a hierarchy in naming, Python has a concept of\npackages. A package can contain other packages and modules while\nmodules cannot contain other modules or packages. From a file system\nperspective, packages are directories and modules are files. The\noriginal specification for packages is still available to read,\nalthough minor details have changed since the writing of that\ndocument.\n\nOnce the name of the module is known (unless otherwise specified, the\nterm "module" will refer to both packages and modules), searching for\nthe module or package can begin. The first place checked is\n``sys.modules``, the cache of all modules that have been imported\npreviously. If the module is found there then it is used in step (2)\nof import.\n\nIf the module is not found in the cache, then ``sys.meta_path`` is\nsearched (the specification for ``sys.meta_path`` can be found in\n**PEP 302**). The object is a list of *finder* objects which are\nqueried in order as to whether they know how to load the module by\ncalling their ``find_module()`` method with the name of the module. If\nthe module happens to be contained within a package (as denoted by the\nexistence of a dot in the name), then a second argument to\n``find_module()`` is given as the value of the ``__path__`` attribute\nfrom the parent package (everything up to the last dot in the name of\nthe module being imported). If a finder can find the module it returns\na *loader* (discussed later) or returns ``None``.\n\nIf none of the finders on ``sys.meta_path`` are able to find the\nmodule then some implicitly defined finders are queried.\nImplementations of Python vary in what implicit meta path finders are\ndefined. The one they all do define, though, is one that handles\n``sys.path_hooks``, ``sys.path_importer_cache``, and ``sys.path``.\n\nThe implicit finder searches for the requested module in the "paths"\nspecified in one of two places ("paths" do not have to be file system\npaths). If the module being imported is supposed to be contained\nwithin a package then the second argument passed to ``find_module()``,\n``__path__`` on the parent package, is used as the source of paths. If\nthe module is not contained in a package then ``sys.path`` is used as\nthe source of paths.\n\nOnce the source of paths is chosen it is iterated over to find a\nfinder that can handle that path. The dict at\n``sys.path_importer_cache`` caches finders for paths and is checked\nfor a finder. If the path does not have a finder cached then\n``sys.path_hooks`` is searched by calling each object in the list with\na single argument of the path, returning a finder or raises\n``ImportError``. If a finder is returned then it is cached in\n``sys.path_importer_cache`` and then used for that path entry. If no\nfinder can be found but the path exists then a value of ``None`` is\nstored in ``sys.path_importer_cache`` to signify that an implicit,\nfile-based finder that handles modules stored as individual files\nshould be used for that path. If the path does not exist then a finder\nwhich always returns ``None`` is placed in the cache for the path.\n\nIf no finder can find the module then ``ImportError`` is raised.\nOtherwise some finder returned a loader whose ``load_module()`` method\nis called with the name of the module to load (see **PEP 302** for the\noriginal definition of loaders). A loader has several responsibilities\nto perform on a module it loads. First, if the module already exists\nin ``sys.modules`` (a possibility if the loader is called outside of\nthe import machinery) then it is to use that module for initialization\nand not a new module. But if the module does not exist in\n``sys.modules`` then it is to be added to that dict before\ninitialization begins. If an error occurs during loading of the module\nand it was added to ``sys.modules`` it is to be removed from the dict.\nIf an error occurs but the module was already in ``sys.modules`` it is\nleft in the dict.\n\nThe loader must set several attributes on the module. ``__name__`` is\nto be set to the name of the module. ``__file__`` is to be the "path"\nto the file unless the module is built-in (and thus listed in\n``sys.builtin_module_names``) in which case the attribute is not set.\nIf what is being imported is a package then ``__path__`` is to be set\nto a list of paths to be searched when looking for modules and\npackages contained within the package being imported. ``__package__``\nis optional but should be set to the name of package that contains the\nmodule or package (the empty string is used for module not contained\nin a package). ``__loader__`` is also optional but should be set to\nthe loader object that is loading the module.\n\nIf an error occurs during loading then the loader raises\n``ImportError`` if some other exception is not already being\npropagated. Otherwise the loader returns the module that was loaded\nand initialized.\n\nWhen step (1) finishes without raising an exception, step (2) can\nbegin.\n\nThe first form of ``import`` statement binds the module name in the\nlocal namespace to the module object, and then goes on to import the\nnext identifier, if any. If the module name is followed by ``as``,\nthe name following ``as`` is used as the local name for the module.\n\nThe ``from`` form does not bind the module name: it goes through the\nlist of identifiers, looks each one of them up in the module found in\nstep (1), and binds the name in the local namespace to the object thus\nfound. As with the first form of ``import``, an alternate local name\ncan be supplied by specifying "``as`` localname". If a name is not\nfound, ``ImportError`` is raised. If the list of identifiers is\nreplaced by a star (``\'*\'``), all public names defined in the module\nare bound in the local namespace of the ``import`` statement..\n\nThe *public names* defined by a module are determined by checking the\nmodule\'s namespace for a variable named ``__all__``; if defined, it\nmust be a sequence of strings which are names defined or imported by\nthat module. The names given in ``__all__`` are all considered public\nand are required to exist. If ``__all__`` is not defined, the set of\npublic names includes all names found in the module\'s namespace which\ndo not begin with an underscore character (``\'_\'``). ``__all__``\nshould contain the entire public API. It is intended to avoid\naccidentally exporting items that are not part of the API (such as\nlibrary modules which were imported and used within the module).\n\nThe ``from`` form with ``*`` may only occur in a module scope. The\nwild card form of import --- ``import *`` --- is only allowed at the\nmodule level. Attempting to use it in class for function definitions\nwill raise a ``SyntaxError``.\n\nWhen specifying what module to import you do not have to specify the\nabsolute name of the module. When a module or package is contained\nwithin another package it is possible to make a relative import within\nthe same top package without having to mention the package name. By\nusing leading dots in the specified module or package after ``from``\nyou can specify how high to traverse up the current package hierarchy\nwithout specifying exact names. One leading dot means the current\npackage where the module making the import exists. Two dots means up\none package level. Three dots is up two levels, etc. So if you execute\n``from . import mod`` from a module in the ``pkg`` package then you\nwill end up importing ``pkg.mod``. If you execute ``from ..subpkg2\nimprt mod`` from within ``pkg.subpkg1`` you will import\n``pkg.subpkg2.mod``. The specification for relative imports is\ncontained within **PEP 328**.\n\nThe built-in function ``__import__()`` is provided to support\napplications that determine which modules need to be loaded\ndynamically; refer to *Built-in Functions* for additional information.\n\n\nFuture statements\n=================\n\nA *future statement* is a directive to the compiler that a particular\nmodule should be compiled using syntax or semantics that will be\navailable in a specified future release of Python. The future\nstatement is intended to ease migration to future versions of Python\nthat introduce incompatible changes to the language. It allows use of\nthe new features on a per-module basis before the release in which the\nfeature becomes standard.\n\n future_statement ::= "from" "__future__" "import" feature ["as" name]\n ("," feature ["as" name])*\n | "from" "__future__" "import" "(" feature ["as" name]\n ("," feature ["as" name])* [","] ")"\n feature ::= identifier\n name ::= identifier\n\nA future statement must appear near the top of the module. The only\nlines that can appear before a future statement are:\n\n* the module docstring (if any),\n\n* comments,\n\n* blank lines, and\n\n* other future statements.\n\nThe features recognized by Python 3.0 are ``absolute_import``,\n``division``, ``generators``, ``unicode_literals``,\n``print_function``, ``nested_scopes`` and ``with_statement``. They\nare all redundant because they are always enabled, and only kept for\nbackwards compatibility.\n\nA future statement is recognized and treated specially at compile\ntime: Changes to the semantics of core constructs are often\nimplemented by generating different code. It may even be the case\nthat a new feature introduces new incompatible syntax (such as a new\nreserved word), in which case the compiler may need to parse the\nmodule differently. Such decisions cannot be pushed off until\nruntime.\n\nFor any given release, the compiler knows which feature names have\nbeen defined, and raises a compile-time error if a future statement\ncontains a feature not known to it.\n\nThe direct runtime semantics are the same as for any import statement:\nthere is a standard module ``__future__``, described later, and it\nwill be imported in the usual way at the time the future statement is\nexecuted.\n\nThe interesting runtime semantics depend on the specific feature\nenabled by the future statement.\n\nNote that there is nothing special about the statement:\n\n import __future__ [as name]\n\nThat is not a future statement; it\'s an ordinary import statement with\nno special semantics or syntax restrictions.\n\nCode compiled by calls to the builtin functions ``exec()`` and\n``compile()`` that occur in a module ``M`` containing a future\nstatement will, by default, use the new syntax or semantics associated\nwith the future statement. This can be controlled by optional\narguments to ``compile()`` --- see the documentation of that function\nfor details.\n\nA future statement typed at an interactive interpreter prompt will\ntake effect for the rest of the interpreter session. If an\ninterpreter is started with the *-i* option, is passed a script name\nto execute, and the script includes a future statement, it will be in\neffect in the interactive session started after the script is\nexecuted.\n', + 'import': '\nThe ``import`` statement\n************************\n\n import_stmt ::= "import" module ["as" name] ( "," module ["as" name] )*\n | "from" relative_module "import" identifier ["as" name]\n ( "," identifier ["as" name] )*\n | "from" relative_module "import" "(" identifier ["as" name]\n ( "," identifier ["as" name] )* [","] ")"\n | "from" module "import" "*"\n module ::= (identifier ".")* identifier\n relative_module ::= "."* module | "."+\n name ::= identifier\n\nImport statements are executed in two steps: (1) find a module, and\ninitialize it if necessary; (2) define a name or names in the local\nnamespace (of the scope where the ``import`` statement occurs). The\nstatement comes in two forms differing on whether it uses the ``from``\nkeyword. The first form (without ``from``) repeats these steps for\neach identifier in the list. The form with ``from`` performs step (1)\nonce, and then performs step (2) repeatedly. For a reference\nimplementation of step (1), see the ``importlib`` module.\n\nTo understand how step (1) occurs, one must first understand how\nPython handles hierarchical naming of modules. To help organize\nmodules and provide a hierarchy in naming, Python has a concept of\npackages. A package can contain other packages and modules while\nmodules cannot contain other modules or packages. From a file system\nperspective, packages are directories and modules are files. The\noriginal specification for packages is still available to read,\nalthough minor details have changed since the writing of that\ndocument.\n\nOnce the name of the module is known (unless otherwise specified, the\nterm "module" will refer to both packages and modules), searching for\nthe module or package can begin. The first place checked is\n``sys.modules``, the cache of all modules that have been imported\npreviously. If the module is found there then it is used in step (2)\nof import.\n\nIf the module is not found in the cache, then ``sys.meta_path`` is\nsearched (the specification for ``sys.meta_path`` can be found in\n**PEP 302**). The object is a list of *finder* objects which are\nqueried in order as to whether they know how to load the module by\ncalling their ``find_module()`` method with the name of the module. If\nthe module happens to be contained within a package (as denoted by the\nexistence of a dot in the name), then a second argument to\n``find_module()`` is given as the value of the ``__path__`` attribute\nfrom the parent package (everything up to the last dot in the name of\nthe module being imported). If a finder can find the module it returns\na *loader* (discussed later) or returns ``None``.\n\nIf none of the finders on ``sys.meta_path`` are able to find the\nmodule then some implicitly defined finders are queried.\nImplementations of Python vary in what implicit meta path finders are\ndefined. The one they all do define, though, is one that handles\n``sys.path_hooks``, ``sys.path_importer_cache``, and ``sys.path``.\n\nThe implicit finder searches for the requested module in the "paths"\nspecified in one of two places ("paths" do not have to be file system\npaths). If the module being imported is supposed to be contained\nwithin a package then the second argument passed to ``find_module()``,\n``__path__`` on the parent package, is used as the source of paths. If\nthe module is not contained in a package then ``sys.path`` is used as\nthe source of paths.\n\nOnce the source of paths is chosen it is iterated over to find a\nfinder that can handle that path. The dict at\n``sys.path_importer_cache`` caches finders for paths and is checked\nfor a finder. If the path does not have a finder cached then\n``sys.path_hooks`` is searched by calling each object in the list with\na single argument of the path, returning a finder or raises\n``ImportError``. If a finder is returned then it is cached in\n``sys.path_importer_cache`` and then used for that path entry. If no\nfinder can be found but the path exists then a value of ``None`` is\nstored in ``sys.path_importer_cache`` to signify that an implicit,\nfile-based finder that handles modules stored as individual files\nshould be used for that path. If the path does not exist then a finder\nwhich always returns ``None`` is placed in the cache for the path.\n\nIf no finder can find the module then ``ImportError`` is raised.\nOtherwise some finder returned a loader whose ``load_module()`` method\nis called with the name of the module to load (see **PEP 302** for the\noriginal definition of loaders). A loader has several responsibilities\nto perform on a module it loads. First, if the module already exists\nin ``sys.modules`` (a possibility if the loader is called outside of\nthe import machinery) then it is to use that module for initialization\nand not a new module. But if the module does not exist in\n``sys.modules`` then it is to be added to that dict before\ninitialization begins. If an error occurs during loading of the module\nand it was added to ``sys.modules`` it is to be removed from the dict.\nIf an error occurs but the module was already in ``sys.modules`` it is\nleft in the dict.\n\nThe loader must set several attributes on the module. ``__name__`` is\nto be set to the name of the module. ``__file__`` is to be the "path"\nto the file unless the module is built-in (and thus listed in\n``sys.builtin_module_names``) in which case the attribute is not set.\nIf what is being imported is a package then ``__path__`` is to be set\nto a list of paths to be searched when looking for modules and\npackages contained within the package being imported. ``__package__``\nis optional but should be set to the name of package that contains the\nmodule or package (the empty string is used for module not contained\nin a package). ``__loader__`` is also optional but should be set to\nthe loader object that is loading the module.\n\nIf an error occurs during loading then the loader raises\n``ImportError`` if some other exception is not already being\npropagated. Otherwise the loader returns the module that was loaded\nand initialized.\n\nWhen step (1) finishes without raising an exception, step (2) can\nbegin.\n\nThe first form of ``import`` statement binds the module name in the\nlocal namespace to the module object, and then goes on to import the\nnext identifier, if any. If the module name is followed by ``as``,\nthe name following ``as`` is used as the local name for the module.\n\nThe ``from`` form does not bind the module name: it goes through the\nlist of identifiers, looks each one of them up in the module found in\nstep (1), and binds the name in the local namespace to the object thus\nfound. As with the first form of ``import``, an alternate local name\ncan be supplied by specifying "``as`` localname". If a name is not\nfound, ``ImportError`` is raised. If the list of identifiers is\nreplaced by a star (``\'*\'``), all public names defined in the module\nare bound in the local namespace of the ``import`` statement..\n\nThe *public names* defined by a module are determined by checking the\nmodule\'s namespace for a variable named ``__all__``; if defined, it\nmust be a sequence of strings which are names defined or imported by\nthat module. The names given in ``__all__`` are all considered public\nand are required to exist. If ``__all__`` is not defined, the set of\npublic names includes all names found in the module\'s namespace which\ndo not begin with an underscore character (``\'_\'``). ``__all__``\nshould contain the entire public API. It is intended to avoid\naccidentally exporting items that are not part of the API (such as\nlibrary modules which were imported and used within the module).\n\nThe ``from`` form with ``*`` may only occur in a module scope. The\nwild card form of import --- ``import *`` --- is only allowed at the\nmodule level. Attempting to use it in class for function definitions\nwill raise a ``SyntaxError``.\n\nWhen specifying what module to import you do not have to specify the\nabsolute name of the module. When a module or package is contained\nwithin another package it is possible to make a relative import within\nthe same top package without having to mention the package name. By\nusing leading dots in the specified module or package after ``from``\nyou can specify how high to traverse up the current package hierarchy\nwithout specifying exact names. One leading dot means the current\npackage where the module making the import exists. Two dots means up\none package level. Three dots is up two levels, etc. So if you execute\n``from . import mod`` from a module in the ``pkg`` package then you\nwill end up importing ``pkg.mod``. If you execute ``from ..subpkg2\nimprt mod`` from within ``pkg.subpkg1`` you will import\n``pkg.subpkg2.mod``. The specification for relative imports is\ncontained within **PEP 328**.\n\nThe built-in function ``__import__()`` is provided to support\napplications that determine which modules need to be loaded\ndynamically; refer to *Built-in Functions* for additional information.\n\n\nFuture statements\n=================\n\nA *future statement* is a directive to the compiler that a particular\nmodule should be compiled using syntax or semantics that will be\navailable in a specified future release of Python. The future\nstatement is intended to ease migration to future versions of Python\nthat introduce incompatible changes to the language. It allows use of\nthe new features on a per-module basis before the release in which the\nfeature becomes standard.\n\n future_statement ::= "from" "__future__" "import" feature ["as" name]\n ("," feature ["as" name])*\n | "from" "__future__" "import" "(" feature ["as" name]\n ("," feature ["as" name])* [","] ")"\n feature ::= identifier\n name ::= identifier\n\nA future statement must appear near the top of the module. The only\nlines that can appear before a future statement are:\n\n* the module docstring (if any),\n\n* comments,\n\n* blank lines, and\n\n* other future statements.\n\nThe features recognized by Python 3.0 are ``absolute_import``,\n``division``, ``generators``, ``unicode_literals``,\n``print_function``, ``nested_scopes`` and ``with_statement``. They\nare all redundant because they are always enabled, and only kept for\nbackwards compatibility.\n\nA future statement is recognized and treated specially at compile\ntime: Changes to the semantics of core constructs are often\nimplemented by generating different code. It may even be the case\nthat a new feature introduces new incompatible syntax (such as a new\nreserved word), in which case the compiler may need to parse the\nmodule differently. Such decisions cannot be pushed off until\nruntime.\n\nFor any given release, the compiler knows which feature names have\nbeen defined, and raises a compile-time error if a future statement\ncontains a feature not known to it.\n\nThe direct runtime semantics are the same as for any import statement:\nthere is a standard module ``__future__``, described later, and it\nwill be imported in the usual way at the time the future statement is\nexecuted.\n\nThe interesting runtime semantics depend on the specific feature\nenabled by the future statement.\n\nNote that there is nothing special about the statement:\n\n import __future__ [as name]\n\nThat is not a future statement; it\'s an ordinary import statement with\nno special semantics or syntax restrictions.\n\nCode compiled by calls to the builtin functions ``exec()`` and\n``compile()`` that occur in a module ``M`` containing a future\nstatement will, by default, use the new syntax or semantics associated\nwith the future statement. This can be controlled by optional\narguments to ``compile()`` --- see the documentation of that function\nfor details.\n\nA future statement typed at an interactive interpreter prompt will\ntake effect for the rest of the interpreter session. If an\ninterpreter is started with the *-i* option, is passed a script name\nto execute, and the script includes a future statement, it will be in\neffect in the interactive session started after the script is\nexecuted.\n\nSee also:\n\n **PEP 236** - Back to the __future__\n The original proposal for the __future__ mechanism.\n', 'in': '\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nthe ``==`` and ``!=`` operators *always* consider objects of different\ntypes to be unequal, while the ``<``, ``>``, ``>=`` and ``<=``\noperators raise a ``TypeError`` when comparing objects of different\ntypes that do not implement these operators for the given pair of\ntypes. You can control comparison behavior of objects of non-builtin\ntypes by defining rich comparison methods like ``__gt__()``, described\nin section *Basic customization*.\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* The values ``float(\'NaN\')`` and ``Decimal(\'NaN\')`` are special. The\n are identical to themselves, ``x is x`` but are not equal to\n themselves, ``x != x``. Additionally, comparing any value to a\n not-a-number value will return ``False``. For example, both ``3 <\n float(\'NaN\')`` and ``float(\'NaN\') < 3`` will return ``False``.\n\n* Bytes objects are compared lexicographically using the numeric\n values of their elements.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n [3] String and bytes object can\'t be compared!\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``[1,2,x] <= [1,2,y]`` has the\n same value as ``x <= y``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n ``(key, value)`` lists compare equal. [4] Outcomes other than\n equality are resolved consistently, but are not otherwise defined.\n [5]\n\n* Sets and frozensets define comparison operators to mean subset and\n superset tests. Those relations do not define total orderings (the\n two sets ``{1,2}`` and {2,3} are not equal, nor subsets of one\n another, nor supersets of one another). Accordingly, sets are not\n appropriate arguments for functions which depend on total ordering.\n For example, ``min()``, ``max()``, and ``sorted()`` produce\n undefined results given a list of sets as inputs.\n\n* Most other objects of builtin types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nComparison of objects of the differing types depends on whether either\nof the types provide explicit support for the comparison. Most\nnumeric types can be compared with one another, but comparisons of\n``float`` and ``Decimal`` are not supported to avoid the inevitable\nconfusion arising from representation issues such as ``float(\'1.1\')``\nbeing inexactly represented and therefore not exactly equal to\n``Decimal(\'1.1\')`` which is. When cross-type comparison is not\nsupported, the comparison method returns ``NotImplemented``. This can\ncreate the illusion of non-transitivity between supported cross-type\ncomparisons and unsupported comparisons. For example, ``Decimal(2) ==\n2`` and *2 == float(2)`* but ``Decimal(2) != float(2)``.\n\nThe operators ``in`` and ``not in`` test for membership. ``x in s``\nevaluates to true if *x* is a member of *s*, and false otherwise. ``x\nnot in s`` returns the negation of ``x in s``. All built-in sequences\nand set types support this as well as dictionary, for which ``in``\ntests whether a the dictionary has a given key. For container types\nsuch as list, tuple, set, frozenset, dict, or collections.deque, the\nexpression ``x in y`` is equivalent to ``any(x is e or x == e for val\ne in y)``.\n\nFor the string and bytes types, ``x in y`` is true if and only if *x*\nis a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nEmpty strings are always considered to be a substring of any other\nstring, so ``"" in "abc"`` will return ``True``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` and do\ndefine ``__getitem__()``, ``x in y`` is true if and only if there is a\nnon-negative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value. [6]\n', 'integers': '\nInteger literals\n****************\n\nInteger literals are described by the following lexical definitions:\n\n integer ::= decimalinteger | octinteger | hexinteger | bininteger\n decimalinteger ::= nonzerodigit digit* | "0"+\n nonzerodigit ::= "1"..."9"\n digit ::= "0"..."9"\n octinteger ::= "0" ("o" | "O") octdigit+\n hexinteger ::= "0" ("x" | "X") hexdigit+\n bininteger ::= "0" ("b" | "B") bindigit+\n octdigit ::= "0"..."7"\n hexdigit ::= digit | "a"..."f" | "A"..."F"\n bindigit ::= "0" | "1"\n\nThere is no limit for the length of integer literals apart from what\ncan be stored in available memory.\n\nNote that leading zeros in a non-zero decimal number are not allowed.\nThis is for disambiguation with C-style octal literals, which Python\nused before version 3.0.\n\nSome examples of integer literals:\n\n 7 2147483647 0o177 0b100110111\n 3 79228162514264337593543950336 0o377 0x100000000\n 79228162514264337593543950336 0xdeadbeef\n', 'lambda': '\nLambdas\n*******\n\n lambda_form ::= "lambda" [parameter_list]: expression\n lambda_form_nocond ::= "lambda" [parameter_list]: expression_nocond\n\nLambda forms (lambda expressions) have the same syntactic position as\nexpressions. They are a shorthand to create anonymous functions; the\nexpression ``lambda arguments: expression`` yields a function object.\nThe unnamed object behaves like a function object defined with\n\n def (arguments):\n return expression\n\nSee section *Function definitions* for the syntax of parameter lists.\nNote that functions created with lambda forms cannot contain\nstatements or annotations.\n', @@ -58,9 +58,9 @@ 'sequence-types': "\nEmulating container types\n*************************\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``get()``,\n``clear()``, ``setdefault()``, ``pop()``, ``popitem()``, ``copy()``,\nand ``update()`` behaving similar to those for Python's standard\ndictionary objects. The ``collections`` module provides a\n``MutableMapping`` abstract base class to help create those methods\nfrom a base set of ``__getitem__()``, ``__setitem__()``,\n``__delitem__()``, and ``keys()``. Mutable sequences should provide\nmethods ``append()``, ``count()``, ``index()``, ``extend()``,\n``insert()``, ``pop()``, ``remove()``, ``reverse()`` and ``sort()``,\nlike Python standard list objects. Finally, sequence types should\nimplement addition (meaning concatenation) and multiplication (meaning\nrepetition) by defining the methods ``__add__()``, ``__radd__()``,\n``__iadd__()``, ``__mul__()``, ``__rmul__()`` and ``__imul__()``\ndescribed below; they should not define other numerical operators. It\nis recommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should search the mapping's keys; for\nsequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``keys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn't define a ``__bool__()`` method and whose ``__len__()``\n method returns zero is considered to be false in a Boolean context.\n\nNote: Slicing is done exclusively with the following three methods. A\n call like\n\n a[1:2] = b\n\n is translated to\n\n a[slice(1, 2, None)] = b\n\n and so forth. Missing slice items are always filled in with\n ``None``.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``keys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n", 'shifting': '\nShifting operations\n*******************\n\nThe shifting operations have lower priority than the arithmetic\noperations:\n\n shift_expr ::= a_expr | shift_expr ( "<<" | ">>" ) a_expr\n\nThese operators accept integers as arguments. They shift the first\nargument to the left or right by the number of bits given by the\nsecond argument.\n\nA right shift by *n* bits is defined as division by ``pow(2,n)``. A\nleft shift by *n* bits is defined as multiplication with ``pow(2,n)``.\n', 'slicings': '\nSlicings\n********\n\nA slicing selects a range of items in a sequence object (e.g., a\nstring, tuple or list). Slicings may be used as expressions or as\ntargets in assignment or ``del`` statements. The syntax for a\nslicing:\n\n slicing ::= primary "[" slice_list "]"\n slice_list ::= slice_item ("," slice_item)* [","]\n slice_item ::= expression | proper_slice\n proper_slice ::= [lower_bound] ":" [upper_bound] [ ":" [stride] ]\n lower_bound ::= expression\n upper_bound ::= expression\n stride ::= expression\n\nThere is ambiguity in the formal syntax here: anything that looks like\nan expression list also looks like a slice list, so any subscription\ncan be interpreted as a slicing. Rather than further complicating the\nsyntax, this is disambiguated by defining that in this case the\ninterpretation as a subscription takes priority over the\ninterpretation as a slicing (this is the case if the slice list\ncontains no proper slice).\n\nThe semantics for a slicing are as follows. The primary must evaluate\nto a mapping object, and it is indexed (using the same\n``__getitem__()`` method as normal subscription) with a key that is\nconstructed from the slice list, as follows. If the slice list\ncontains at least one comma, the key is a tuple containing the\nconversion of the slice items; otherwise, the conversion of the lone\nslice item is the key. The conversion of a slice item that is an\nexpression is that expression. The conversion of a proper slice is a\nslice object (see section *The standard type hierarchy*) whose\n``start``, ``stop`` and ``step`` attributes are the values of the\nexpressions given as lower bound, upper bound and stride,\nrespectively, substituting ``None`` for missing expressions.\n', - 'specialattrs': "\nSpecial Attributes\n******************\n\nThe implementation adds a few special read-only attributes to several\nobject types, where they are relevant. Some of these are not reported\nby the ``dir()`` built-in function.\n\nobject.__dict__\n\n A dictionary or other mapping object used to store an object's\n (writable) attributes.\n\ninstance.__class__\n\n The class to which a class instance belongs.\n\nclass.__bases__\n\n The tuple of base classes of a class object. If there are no base\n classes, this will be an empty tuple.\n\nclass.__name__\n\n The name of the class or type.\n\nThe following attributes are only supported by *new-style class*es.\n\nclass.__mro__\n\n This attribute is a tuple of classes that are considered when\n looking for base classes during method resolution.\n\nclass.mro()\n\n This method can be overridden by a metaclass to customize the\n method resolution order for its instances. It is called at class\n instantiation, and its result is stored in ``__mro__``.\n\nclass.__subclasses__()\n\n Each new-style class keeps a list of weak references to its\n immediate subclasses. This method returns a list of all those\n references still alive. Example:\n\n >>> int.__subclasses__()\n []\n\n-[ Footnotes ]-\n\n[1] Additional information on these special methods may be found in\n the Python Reference Manual (*Basic customization*).\n\n[2] As a consequence, the list ``[1, 2]`` is considered equal to\n ``[1.0, 2.0]``, and similarly for tuples.\n\n[3] They must have since the parser can't tell the type of the\n operands.\n\n[4] To format only a tuple you should therefore provide a singleton\n tuple whose only element is the tuple to be formatted.\n\n[5] These numbers are fairly arbitrary. They are intended to avoid\n printing endless strings of meaningless digits without hampering\n correct use and without having to know the exact precision of\n floating point values on a particular machine.\n\n[6] The advantage of leaving the newline on is that returning an empty\n string is then an unambiguous EOF indication. It is also possible\n (in cases where it might matter, for example, if you want to make\n an exact copy of a file while scanning its lines) to tell whether\n the last line of a file ended in a newline or not (yes this\n happens!).\n", + 'specialattrs': "\nSpecial Attributes\n******************\n\nThe implementation adds a few special read-only attributes to several\nobject types, where they are relevant. Some of these are not reported\nby the ``dir()`` built-in function.\n\nobject.__dict__\n\n A dictionary or other mapping object used to store an object's\n (writable) attributes.\n\ninstance.__class__\n\n The class to which a class instance belongs.\n\nclass.__bases__\n\n The tuple of base classes of a class object. If there are no base\n classes, this will be an empty tuple.\n\nclass.__name__\n\n The name of the class or type.\n\nThe following attributes are only supported by *new-style class*es.\n\nclass.__mro__\n\n This attribute is a tuple of classes that are considered when\n looking for base classes during method resolution.\n\nclass.mro()\n\n This method can be overridden by a metaclass to customize the\n method resolution order for its instances. It is called at class\n instantiation, and its result is stored in ``__mro__``.\n\nclass.__subclasses__()\n\n Each new-style class keeps a list of weak references to its\n immediate subclasses. This method returns a list of all those\n references still alive. Example:\n\n >>> int.__subclasses__()\n []\n\n-[ Footnotes ]-\n\n[1] Additional information on these special methods may be found in\n the Python Reference Manual (*Basic customization*).\n\n[2] As a consequence, the list ``[1, 2]`` is considered equal to\n ``[1.0, 2.0]``, and similarly for tuples.\n\n[3] They must have since the parser can't tell the type of the\n operands.\n\n[4] To format only a tuple you should therefore provide a singleton\n tuple whose only element is the tuple to be formatted.\n\n[5] The advantage of leaving the newline on is that returning an empty\n string is then an unambiguous EOF indication. It is also possible\n (in cases where it might matter, for example, if you want to make\n an exact copy of a file while scanning its lines) to tell whether\n the last line of a file ended in a newline or not (yes this\n happens!).\n", 'specialnames': '\nSpecial method names\n********************\n\nA class can implement certain operations that are invoked by special\nsyntax (such as arithmetic operations or subscripting and slicing) by\ndefining methods with special names. This is Python\'s approach to\n*operator overloading*, allowing classes to define their own behavior\nwith respect to language operators. For instance, if a class defines\na method named ``__getitem__()``, and ``x`` is an instance of this\nclass, then ``x[i]`` is roughly equivalent to ``type(x).__getitem__(x,\ni)``. Except where mentioned, attempts to execute an operation raise\nan exception when no appropriate method is defined (typically\n``AttributeError`` or ``TypeError``).\n\nWhen implementing a class that emulates any built-in type, it is\nimportant that the emulation only be implemented to the degree that it\nmakes sense for the object being modelled. For example, some\nsequences may work well with retrieval of individual elements, but\nextracting a slice may not make sense. (One example of this is the\n``NodeList`` interface in the W3C\'s Document Object Model.)\n\n\nBasic customization\n===================\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_info()[2]`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.last_traceback``. Circular references which are garbage are\n detected when the option cycle detector is enabled (it\'s on by\n default), but can only be cleaned up if there are no Python-\n level ``__del__()`` methods involved. Refer to the documentation\n for the ``gc`` module for more information about how\n ``__del__()`` methods are handled by the cycle detector,\n particularly the description of the ``garbage`` value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted or in the process of being torn down (e.g. the\n import machinery shutting down). For this reason, ``__del__()``\n methods should do the absolute minimum needed to maintain\n external invariants. Starting with version 1.5, Python\n guarantees that globals whose name begins with a single\n underscore are deleted from their module before other globals are\n deleted; if no other references to such globals exist, this may\n help in assuring that imported modules are still available at the\n time when the ``__del__()`` method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function to compute the\n "official" string representation of an object. If at all possible,\n this should look like a valid Python expression that could be used\n to recreate an object with the same value (given an appropriate\n environment). If this is not possible, a string of the form\n ``<...some useful description...>`` should be returned. The return\n value must be a string object. If a class defines ``__repr__()``\n but not ``__str__()``, then ``__repr__()`` is also used when an\n "informal" string representation of instances of that class is\n required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print()``\n function to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__format__(self, format_spec)\n\n Called by the ``format()`` built-in function (and by extension, the\n ``format()`` method of class ``str``) to produce a "formatted"\n string representation of an object. The ``format_spec`` argument is\n a string that contains a description of the formatting options\n desired. The interpretation of the ``format_spec`` argument is up\n to the type implementing ``__format__()``, however most classes\n will either delegate formatting to one of the built-in types, or\n use a similar formatting option syntax.\n\n See *Format Specification Mini-Language* for a description of the\n standard formatting syntax.\n\n The return value must be a string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n These are the so-called "rich comparison" methods. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` calls ``x.__gt__(y)``, and ``x>=y`` calls\n ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\n To automatically generate ordering operations from a single root\n operation, see the Total Ordering recipe in the ASPN cookbook.\n\nobject.__hash__(self)\n\n Called by built-in function ``hash()`` and for operations on\n members of hashed collections including ``set``, ``frozenset``, and\n ``dict``. ``__hash__()`` should return an integer. The only\n required property is that objects which compare equal have the same\n hash value; it is advised to somehow mix together (e.g. using\n exclusive or) the hash values for the components of the object that\n also play a part in comparison of objects.\n\n If a class does not define an ``__eq__()`` method it should not\n define a ``__hash__()`` operation either; if it defines\n ``__eq__()`` but not ``__hash__()``, its instances will not be\n usable as items in hashable collections. If a class defines\n mutable objects and implements an ``__eq__()`` method, it should\n not implement ``__hash__()``, since the implementation of hashable\n collections requires that a key\'s hash value is immutable (if the\n object\'s hash value changes, it will be in the wrong hash bucket).\n\n User-defined classes have ``__eq__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal (except with\n themselves) and ``x.__hash__()`` returns ``id(x)``.\n\n Classes which inherit a ``__hash__()`` method from a parent class\n but change the meaning of ``__eq__()`` such that the hash value\n returned is no longer appropriate (e.g. by switching to a value-\n based concept of equality instead of the default identity based\n equality) can explicitly flag themselves as being unhashable by\n setting ``__hash__ = None`` in the class definition. Doing so means\n that not only will instances of the class raise an appropriate\n ``TypeError`` when a program attempts to retrieve their hash value,\n but they will also be correctly identified as unhashable when\n checking ``isinstance(obj, collections.Hashable)`` (unlike classes\n which define their own ``__hash__()`` to explicitly raise\n ``TypeError``).\n\n If a class that overrides ``__eq__()`` needs to retain the\n implementation of ``__hash__()`` from a parent class, the\n interpreter must be told this explicitly by setting ``__hash__ =\n .__hash__``. Otherwise the inheritance of\n ``__hash__()`` will be blocked, just as if ``__hash__`` had been\n explicitly set to ``None``.\n\nobject.__bool__(self)\n\n Called to implement truth value testing and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined, and the object is\n considered true if its result is nonzero. If a class defines\n neither ``__len__()`` nor ``__bool__()``, all its instances are\n considered true.\n\n\nCustomizing attribute access\n============================\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__getattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control over attribute access.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n Note: This method may still be bypassed when looking up special methods\n as the result of implicit invocation via language syntax or\n builtin functions. See *Special method lookup*.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should call the base class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\nobject.__dir__(self)\n\n Called when ``dir()`` is called on the object. A list must be\n returned.\n\n\nImplementing Descriptors\n------------------------\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another class, known as the *owner* class. In the\nexamples below, "the attribute" refers to the attribute whose name is\nthe key of the property in the owner class\' ``__dict__``.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n--------------------\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called.\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to an object instance, ``a.x`` is transformed into the\n call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a class, ``A.x`` is transformed into the call:\n ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [2]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n---------\n\nBy default, instances of classes have a dictionary for attribute\nstorage. This wastes space for objects having very few instance\nvariables. The space consumption can become acute when creating large\nnumbers of instances.\n\nThe default can be overridden by defining *__slots__* in a class\ndefinition. The *__slots__* declaration takes a sequence of instance\nvariables and reserves just enough space in each instance to hold a\nvalue for each variable. Space is saved because *__dict__* is not\ncreated for each instance.\n\nobject.__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n class, *__slots__* reserves space for the declared variables and\n prevents the automatic creation of *__dict__* and *__weakref__* for\n each instance.\n\n\nNotes on using *__slots__*\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n* When inheriting from a class without *__slots__*, the *__dict__*\n attribute of that class will always be accessible, so a *__slots__*\n definition in the subclass is meaningless.\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* Nonempty *__slots__* does not work for classes derived from\n "variable-length" built-in types such as ``int``, ``str`` and\n ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n\nCustomizing class creation\n==========================\n\nBy default, classes are constructed using ``type()``. A class\ndefinition is read into a separate namespace and the value of class\nname is bound to the result of ``type(name, bases, dict)``.\n\nWhen the class definition is read, if a callable ``metaclass`` keyword\nargument is passed after the bases in the class definition, the\ncallable given will be called instead of ``type()``. If other keyword\narguments are passed, they will also be passed to the metaclass. This\nallows classes or functions to be written which monitor or alter the\nclass creation process:\n\n* Modifying the class dictionary prior to the class being created.\n\n* Returning an instance of another class -- essentially performing the\n role of a factory function.\n\nThese steps will have to be performed in the metaclass\'s ``__new__()``\nmethod -- ``type.__new__()`` can then be called from this method to\ncreate a class with different properties. This example adds a new\nelement to the class dictionary before creating the class:\n\n class metacls(type):\n def __new__(mcs, name, bases, dict):\n dict[\'foo\'] = \'metacls was here\'\n return type.__new__(mcs, name, bases, dict)\n\nYou can of course also override other class methods (or add new\nmethods); for example defining a custom ``__call__()`` method in the\nmetaclass allows custom behavior when the class is called, e.g. not\nalways creating a new instance.\n\nIf the metaclass has a ``__prepare__()`` attribute (usually\nimplemented as a class or static method), it is called before the\nclass body is evaluated with the name of the class and a tuple of its\nbases for arguments. It should return an object that supports the\nmapping interface that will be used to store the namespace of the\nclass. The default is a plain dictionary. This could be used, for\nexample, to keep track of the order that class attributes are declared\nin by returning an ordered dictionary.\n\nThe appropriate metaclass is determined by the following precedence\nrules:\n\n* If the ``metaclass`` keyword argument is based with the bases, it is\n used.\n\n* Otherwise, if there is at least one base class, its metaclass is\n used.\n\n* Otherwise, the default metaclass (``type``) is used.\n\nThe potential uses for metaclasses are boundless. Some ideas that have\nbeen explored including logging, interface checking, automatic\ndelegation, automatic property creation, proxies, frameworks, and\nautomatic resource locking/synchronization.\n\nHere is an example of a metaclass that uses an\n``collections.OrderedDict`` to remember the order that class members\nwere defined:\n\n class OrderedClass(type):\n\n @classmethod\n def __prepare__(metacls, name, bases, **kwds):\n return collections.OrderedDict()\n\n def __new__(cls, name, bases, classdict):\n result = type.__new__(cls, name, bases, dict(classdict))\n result.members = tuple(classdict)\n return result\n\n class A(metaclass=OrderedClass):\n def one(self): pass\n def two(self): pass\n def three(self): pass\n def four(self): pass\n\n >>> A.members\n (\'__module__\', \'one\', \'two\', \'three\', \'four\')\n\nWhen the class definition for *A* gets executed, the process begins\nwith calling the metaclass\'s ``__prepare__()`` method which returns an\nempty ``collections.OrderedDict``. That mapping records the methods\nand attributes of *A* as they are defined within the body of the class\nstatement. Once those definitions are executed, the ordered dictionary\nis fully populated and the metaclass\'s ``__new__()`` method gets\ninvoked. That method builds the new type and it saves the ordered\ndictionary keys in an attribute called *members*.\n\n\nEmulating callable objects\n==========================\n\nobject.__call__(self[, args...])\n\n Called when the instance is "called" as a function; if this method\n is defined, ``x(arg1, arg2, ...)`` is a shorthand for\n ``x.__call__(arg1, arg2, ...)``.\n\n\nEmulating container types\n=========================\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``get()``,\n``clear()``, ``setdefault()``, ``pop()``, ``popitem()``, ``copy()``,\nand ``update()`` behaving similar to those for Python\'s standard\ndictionary objects. The ``collections`` module provides a\n``MutableMapping`` abstract base class to help create those methods\nfrom a base set of ``__getitem__()``, ``__setitem__()``,\n``__delitem__()``, and ``keys()``. Mutable sequences should provide\nmethods ``append()``, ``count()``, ``index()``, ``extend()``,\n``insert()``, ``pop()``, ``remove()``, ``reverse()`` and ``sort()``,\nlike Python standard list objects. Finally, sequence types should\nimplement addition (meaning concatenation) and multiplication (meaning\nrepetition) by defining the methods ``__add__()``, ``__radd__()``,\n``__iadd__()``, ``__mul__()``, ``__rmul__()`` and ``__imul__()``\ndescribed below; they should not define other numerical operators. It\nis recommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should search the mapping\'s keys; for\nsequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``keys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn\'t define a ``__bool__()`` method and whose ``__len__()``\n method returns zero is considered to be false in a Boolean context.\n\nNote: Slicing is done exclusively with the following three methods. A\n call like\n\n a[1:2] = b\n\n is translated to\n\n a[slice(1, 2, None)] = b\n\n and so forth. Missing slice items are always filled in with\n ``None``.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``keys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n\n\nEmulating numeric types\n=======================\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__truediv__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``//``, ``%``,\n ``divmod()``, ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``,\n ``|``). For instance, to evaluate the expression ``x + y``, where\n *x* is an instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()``. Note that\n ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``//``, ``%``,\n ``divmod()``, ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``,\n ``|``) with reflected (swapped) operands. These functions are only\n called if the left operand does not support the corresponding\n operation and the operands are of different types. [3] For\n instance, to evaluate the expression ``x - y``, where *y* is an\n instance of a class that has an ``__rsub__()`` method,\n ``y.__rsub__(x)`` is called if ``x.__sub__(y)`` returns\n *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n assignments (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n assignment falls back to the normal methods. For instance, to\n execute the statement ``x += y``, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of ``x + y``.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__float__(self)\nobject.__round__(self[, n])\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``float()`` and ``round()``. Should return a value of\n the appropriate type.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing, or in the\n built-in ``bin()``, ``hex()`` and ``oct()`` functions). Must return\n an integer.\n\n\nWith Statement Context Managers\n===============================\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nSpecial method lookup\n=====================\n\nFor custom classes, implicit invocations of special methods are only\nguaranteed to work correctly if defined on an object\'s type, not in\nthe object\'s instance dictionary. That behaviour is the reason why\nthe following code raises an exception:\n\n >>> class C(object):\n ... pass\n ...\n >>> c = C()\n >>> c.__len__ = lambda: 5\n >>> len(c)\n Traceback (most recent call last):\n File "", line 1, in \n TypeError: object of type \'C\' has no len()\n\nThe rationale behind this behaviour lies with a number of special\nmethods such as ``__hash__()`` and ``__repr__()`` that are implemented\nby all objects, including type objects. If the implicit lookup of\nthese methods used the conventional lookup process, they would fail\nwhen invoked on the type object itself:\n\n >>> 1 .__hash__() == hash(1)\n True\n >>> int.__hash__() == hash(int)\n Traceback (most recent call last):\n File "", line 1, in \n TypeError: descriptor \'__hash__\' of \'int\' object needs an argument\n\nIncorrectly attempting to invoke an unbound method of a class in this\nway is sometimes referred to as \'metaclass confusion\', and is avoided\nby bypassing the instance when looking up special methods:\n\n >>> type(1).__hash__(1) == hash(1)\n True\n >>> type(int).__hash__(int) == hash(int)\n True\n\nIn addition to bypassing any instance attributes in the interest of\ncorrectness, implicit special method lookup generally also bypasses\nthe ``__getattribute__()`` method even of the object\'s metaclass:\n\n >>> class Meta(type):\n ... def __getattribute__(*args):\n ... print("Metaclass getattribute invoked")\n ... return type.__getattribute__(*args)\n ...\n >>> class C(object, metaclass=Meta):\n ... def __len__(self):\n ... return 10\n ... def __getattribute__(*args):\n ... print("Class getattribute invoked")\n ... return object.__getattribute__(*args)\n ...\n >>> c = C()\n >>> c.__len__() # Explicit lookup via instance\n Class getattribute invoked\n 10\n >>> type(c).__len__(c) # Explicit lookup via type\n Metaclass getattribute invoked\n 10\n >>> len(c) # Implicit lookup\n 10\n\nBypassing the ``__getattribute__()`` machinery in this fashion\nprovides significant scope for speed optimisations within the\ninterpreter, at the cost of some flexibility in the handling of\nspecial methods (the special method *must* be set on the class object\nitself in order to be consistently invoked by the interpreter).\n\n-[ Footnotes ]-\n\n[1] It *is* possible in some cases to change an object\'s type, under\n certain controlled conditions. It generally isn\'t a good idea\n though, since it can lead to some very strange behaviour if it is\n handled incorrectly.\n\n[2] A descriptor can define any combination of ``__get__()``,\n ``__set__()`` and ``__delete__()``. If it does not define\n ``__get__()``, then accessing the attribute even on an instance\n will return the descriptor object itself. If the descriptor\n defines ``__set__()`` and/or ``__delete__()``, it is a data\n descriptor; if it defines neither, it is a non-data descriptor.\n\n[3] For operands of the same type, it is assumed that if the non-\n reflected method (such as ``__add__()``) fails the operation is\n not supported, which is why the reflected method is not called.\n', - 'string-methods': '\nString Methods\n**************\n\nString objects support the methods listed below. Note that none of\nthese methods take keyword arguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, bytes, bytearray, list,\ntuple, range* section. To output formatted strings, see the *String\nFormatting* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\nstr.count(sub[, start[, end]])\n\n Return the number of non-overlapping occurrences of substring *sub*\n in the range [*start*, *end*]. Optional arguments *start* and\n *end* are interpreted as in slice notation.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string. Default encoding is the\n current default string encoding. *errors* may be given to set a\n different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(*args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\nstr.isdecimal()\n\n Return true if all characters in the string are decimal characters\n and there is at least one character, false otherwise. Decimal\n characters include digit characters, and all characters that that\n can be used to form decimal-radix numbers, e.g. U+0660, ARABIC-\n INDIC DIGIT ZERO.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\nstr.isidentifier()\n\n Return true if the string is a valid identifier according to the\n language definition, section *Identifiers and keywords*.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\nstr.isnumeric()\n\n Return true if all characters in the string are numeric characters,\n and there is at least one character, false otherwise. Numeric\n characters include digit characters, and all characters that have\n the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION\n ONE FIFTH.\n\nstr.isprintable()\n\n Return true if all characters in the string are printable or the\n string is empty, false otherwise. Nonprintable characters are\n those characters defined in the Unicode character database as\n "Other" or "Separator", excepting the ASCII space (0x20) which is\n considered printable. (Note that printable characters in this\n context are those which should not be escaped when ``repr()`` is\n invoked on a string. It has no bearing on the handling of strings\n written to ``sys.stdout`` or ``sys.stderr``.)\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. A ``TypeError`` will be raised if there are any\n non-string values in *seq*, including ``bytes`` objects. The\n separator between elements is the string providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\nstatic str.maketrans(x[, y[, z]])\n\n This static method returns a translation table usable for\n ``str.translate()``.\n\n If there is only one argument, it must be a dictionary mapping\n Unicode ordinals (integers) or characters (strings of length 1) to\n Unicode ordinals, strings (of arbitrary lengths) or None.\n Character keys will then be converted to ordinals.\n\n If there are two arguments, they must be strings of equal length,\n and in the resulting dictionary, each character in x will be mapped\n to the character at the same position in y. If there is a third\n argument, it must be a string, whose characters will be mapped to\n None in the result.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\nstr.translate(map)\n\n Return a copy of the *s* where all characters have been mapped\n through the *map* which must be a dictionary of Unicode ordinals\n (integers) to Unicode ordinals, strings or ``None``. Unmapped\n characters are left untouched. Characters mapped to ``None`` are\n deleted.\n\n You can use ``str.maketrans()`` to create a translation map from\n character-to-character mappings in different formats.\n\n Note: An even more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see\n ``encodings.cp1251`` for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n', + 'string-methods': '\nString Methods\n**************\n\nString objects support the methods listed below. Note that none of\nthese methods take keyword arguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, bytes, bytearray, list,\ntuple, range* section. To output formatted strings, see the *String\nFormatting* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\nstr.count(sub[, start[, end]])\n\n Return the number of non-overlapping occurrences of substring *sub*\n in the range [*start*, *end*]. Optional arguments *start* and\n *end* are interpreted as in slice notation.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string as a bytes object. Default\n encoding is the current default string encoding. *errors* may be\n given to set a different error handling scheme. The default for\n *errors* is ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(*args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\nstr.isdecimal()\n\n Return true if all characters in the string are decimal characters\n and there is at least one character, false otherwise. Decimal\n characters include digit characters, and all characters that that\n can be used to form decimal-radix numbers, e.g. U+0660, ARABIC-\n INDIC DIGIT ZERO.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\nstr.isidentifier()\n\n Return true if the string is a valid identifier according to the\n language definition, section *Identifiers and keywords*.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\nstr.isnumeric()\n\n Return true if all characters in the string are numeric characters,\n and there is at least one character, false otherwise. Numeric\n characters include digit characters, and all characters that have\n the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION\n ONE FIFTH.\n\nstr.isprintable()\n\n Return true if all characters in the string are printable or the\n string is empty, false otherwise. Nonprintable characters are\n those characters defined in the Unicode character database as\n "Other" or "Separator", excepting the ASCII space (0x20) which is\n considered printable. (Note that printable characters in this\n context are those which should not be escaped when ``repr()`` is\n invoked on a string. It has no bearing on the handling of strings\n written to ``sys.stdout`` or ``sys.stderr``.)\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. A ``TypeError`` will be raised if there are any\n non-string values in *seq*, including ``bytes`` objects. The\n separator between elements is the string providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\nstatic str.maketrans(x[, y[, z]])\n\n This static method returns a translation table usable for\n ``str.translate()``.\n\n If there is only one argument, it must be a dictionary mapping\n Unicode ordinals (integers) or characters (strings of length 1) to\n Unicode ordinals, strings (of arbitrary lengths) or None.\n Character keys will then be converted to ordinals.\n\n If there are two arguments, they must be strings of equal length,\n and in the resulting dictionary, each character in x will be mapped\n to the character at the same position in y. If there is a third\n argument, it must be a string, whose characters will be mapped to\n None in the result.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\nstr.translate(map)\n\n Return a copy of the *s* where all characters have been mapped\n through the *map* which must be a dictionary of Unicode ordinals\n (integers) to Unicode ordinals, strings or ``None``. Unmapped\n characters are left untouched. Characters mapped to ``None`` are\n deleted.\n\n You can use ``str.maketrans()`` to create a translation map from\n character-to-character mappings in different formats.\n\n Note: An even more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see\n ``encodings.cp1251`` for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n', 'strings': '\nString and Bytes literals\n*************************\n\nString literals are described by the following lexical definitions:\n\n stringliteral ::= [stringprefix](shortstring | longstring)\n stringprefix ::= "r" | "R"\n shortstring ::= "\'" shortstringitem* "\'" | \'"\' shortstringitem* \'"\'\n longstring ::= "\'\'\'" longstringitem* "\'\'\'" | \'"""\' longstringitem* \'"""\'\n shortstringitem ::= shortstringchar | stringescapeseq\n longstringitem ::= longstringchar | stringescapeseq\n shortstringchar ::= \n longstringchar ::= \n stringescapeseq ::= "\\" \n\n bytesliteral ::= bytesprefix(shortbytes | longbytes)\n bytesprefix ::= "b" | "B"\n shortbytes ::= "\'" shortbytesitem* "\'" | \'"\' shortbytesitem* \'"\'\n longbytes ::= "\'\'\'" longbytesitem* "\'\'\'" | \'"""\' longbytesitem* \'"""\'\n shortbytesitem ::= shortbyteschar | bytesescapeseq\n longbytesitem ::= longbyteschar | bytesescapeseq\n shortbyteschar ::= \n longbyteschar ::= \n bytesescapeseq ::= "\\" \n\nOne syntactic restriction not indicated by these productions is that\nwhitespace is not allowed between the **stringprefix** or\n**bytesprefix** and the rest of the literal. The source character set\nis defined by the encoding declaration; it is UTF-8 if no encoding\ndeclaration is given in the source file; see section *Encoding\ndeclarations*.\n\nIn plain English: Both types of literals can be enclosed in matching\nsingle quotes (``\'``) or double quotes (``"``). They can also be\nenclosed in matching groups of three single or double quotes (these\nare generally referred to as *triple-quoted strings*). The backslash\n(``\\``) character is used to escape characters that otherwise have a\nspecial meaning, such as newline, backslash itself, or the quote\ncharacter.\n\nString literals may optionally be prefixed with a letter ``\'r\'`` or\n``\'R\'``; such strings are called *raw strings* and treat backslashes\nas literal characters. As a result, ``\'\\U\'`` and ``\'\\u\'`` escapes in\nraw strings are not treated specially.\n\nBytes literals are always prefixed with ``\'b\'`` or ``\'B\'``; they\nproduce an instance of the ``bytes`` type instead of the ``str`` type.\nThey may only contain ASCII characters; bytes with a numeric value of\n128 or greater must be expressed with escapes.\n\nIn triple-quoted strings, unescaped newlines and quotes are allowed\n(and are retained), except that three unescaped quotes in a row\nterminate the string. (A "quote" is the character used to open the\nstring, i.e. either ``\'`` or ``"``.)\n\nUnless an ``\'r\'`` or ``\'R\'`` prefix is present, escape sequences in\nstrings are interpreted according to rules similar to those used by\nStandard C. The recognized escape sequences are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence | Meaning | Notes |\n+===================+===================================+=========+\n| ``\\newline`` | Backslash and newline ignored | |\n+-------------------+-----------------------------------+---------+\n| ``\\\\`` | Backslash (``\\``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\\'`` | Single quote (``\'``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\"`` | Double quote (``"``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\a`` | ASCII Bell (BEL) | |\n+-------------------+-----------------------------------+---------+\n| ``\\b`` | ASCII Backspace (BS) | |\n+-------------------+-----------------------------------+---------+\n| ``\\f`` | ASCII Formfeed (FF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\n`` | ASCII Linefeed (LF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\r`` | ASCII Carriage Return (CR) | |\n+-------------------+-----------------------------------+---------+\n| ``\\t`` | ASCII Horizontal Tab (TAB) | |\n+-------------------+-----------------------------------+---------+\n| ``\\v`` | ASCII Vertical Tab (VT) | |\n+-------------------+-----------------------------------+---------+\n| ``\\ooo`` | Character with octal value *ooo* | (1,3) |\n+-------------------+-----------------------------------+---------+\n| ``\\xhh`` | Character with hex value *hh* | (2,3) |\n+-------------------+-----------------------------------+---------+\n\nEscape sequences only recognized in string literals are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence | Meaning | Notes |\n+===================+===================================+=========+\n| ``\\N{name}`` | Character named *name* in the | |\n| | Unicode database | |\n+-------------------+-----------------------------------+---------+\n| ``\\uxxxx`` | Character with 16-bit hex value | (4) |\n| | *xxxx* | |\n+-------------------+-----------------------------------+---------+\n| ``\\Uxxxxxxxx`` | Character with 32-bit hex value | (5) |\n| | *xxxxxxxx* | |\n+-------------------+-----------------------------------+---------+\n\nNotes:\n\n1. As in Standard C, up to three octal digits are accepted.\n\n2. Unlike in Standard C, at most two hex digits are accepted.\n\n3. In a bytes literal, hexadecimal and octal escapes denote the byte\n with the given value. In a string literal, these escapes denote a\n Unicode character with the given value.\n\n4. Individual code units which form parts of a surrogate pair can be\n encoded using this escape sequence. Unlike in Standard C, exactly\n two hex digits are required.\n\n5. Any Unicode character can be encoded this way, but characters\n outside the Basic Multilingual Plane (BMP) will be encoded using a\n surrogate pair if Python is compiled to use 16-bit code units (the\n default). Individual code units which form parts of a surrogate\n pair can be encoded using this escape sequence.\n\nUnlike Standard C, all unrecognized escape sequences are left in the\nstring unchanged, i.e., *the backslash is left in the string*. (This\nbehavior is useful when debugging: if an escape sequence is mistyped,\nthe resulting output is more easily recognized as broken.) It is also\nimportant to note that the escape sequences only recognized in string\nliterals fall into the category of unrecognized escapes for bytes\nliterals.\n\nEven in a raw string, string quotes can be escaped with a backslash,\nbut the backslash remains in the string; for example, ``r"\\""`` is a\nvalid string literal consisting of two characters: a backslash and a\ndouble quote; ``r"\\"`` is not a valid string literal (even a raw\nstring cannot end in an odd number of backslashes). Specifically, *a\nraw string cannot end in a single backslash* (since the backslash\nwould escape the following quote character). Note also that a single\nbackslash followed by a newline is interpreted as those two characters\nas part of the string, *not* as a line continuation.\n', 'subscriptions': '\nSubscriptions\n*************\n\nA subscription selects an item of a sequence (string, tuple or list)\nor mapping (dictionary) object:\n\n subscription ::= primary "[" expression_list "]"\n\nThe primary must evaluate to an object that supports subscription,\ne.g. a list or dictionary. User-defined objects can support\nsubscription by defining a ``__getitem__()`` method.\n\nFor built-in objects, there are two types of objects that support\nsubscription:\n\nIf the primary is a mapping, the expression list must evaluate to an\nobject whose value is one of the keys of the mapping, and the\nsubscription selects the value in the mapping that corresponds to that\nkey. (The expression list is a tuple except if it has exactly one\nitem.)\n\nIf the primary is a sequence, the expression (list) must evaluate to\nan integer. If this value is negative, the length of the sequence is\nadded to it (so that, e.g., ``x[-1]`` selects the last item of ``x``.)\nThe resulting value must be a nonnegative integer less than the number\nof items in the sequence, and the subscription selects the item whose\nindex is that value (counting from zero).\n\nA string\'s items are characters. A character is not a separate data\ntype but a string of exactly one character.\n', 'truth': "\nTruth Value Testing\n*******************\n\nAny object can be tested for truth value, for use in an ``if`` or\n``while`` condition or as operand of the Boolean operations below. The\nfollowing values are considered false:\n\n* ``None``\n\n* ``False``\n\n* zero of any numeric type, for example, ``0``, ``0.0``, ``0j``.\n\n* any empty sequence, for example, ``''``, ``()``, ``[]``.\n\n* any empty mapping, for example, ``{}``.\n\n* instances of user-defined classes, if the class defines a\n ``__bool__()`` or ``__len__()`` method, when that method returns the\n integer zero or ``bool`` value ``False``. [1]\n\nAll other values are considered true --- so objects of many types are\nalways true.\n\nOperations and built-in functions that have a Boolean result always\nreturn ``0`` or ``False`` for false and ``1`` or ``True`` for true,\nunless otherwise stated. (Important exception: the Boolean operations\n``or`` and ``and`` always return one of their operands.)\n", @@ -70,7 +70,7 @@ 'typesmapping': '\nMapping Types --- ``dict``\n**************************\n\nA *mapping* object maps *hashable* values to arbitrary objects.\nMappings are mutable objects. There is currently only one standard\nmapping type, the *dictionary*. (For other containers see the built\nin ``list``, ``set``, and ``tuple`` classes, and the ``collections``\nmodule.)\n\nA dictionary\'s keys are *almost* arbitrary values. Values that are\nnot *hashable*, that is, values containing lists, dictionaries or\nother mutable types (that are compared by value rather than by object\nidentity) may not be used as keys. Numeric types used for keys obey\nthe normal rules for numeric comparison: if two numbers compare equal\n(such as ``1`` and ``1.0``) then they can be used interchangeably to\nindex the same dictionary entry. (Note however, that since computers\nstore floating-point numbers as approximations it is usually unwise to\nuse them as dictionary keys.)\n\nDictionaries can be created by placing a comma-separated list of\n``key: value`` pairs within braces, for example: ``{\'jack\': 4098,\n\'sjoerd\': 4127}`` or ``{4098: \'jack\', 4127: \'sjoerd\'}``, or by the\n``dict`` constructor.\n\nclass class dict([arg])\n\n Return a new dictionary initialized from an optional positional\n argument or from a set of keyword arguments. If no arguments are\n given, return a new empty dictionary. If the positional argument\n *arg* is a mapping object, return a dictionary mapping the same\n keys to the same values as does the mapping object. Otherwise the\n positional argument must be a sequence, a container that supports\n iteration, or an iterator object. The elements of the argument\n must each also be of one of those kinds, and each must in turn\n contain exactly two objects. The first is used as a key in the new\n dictionary, and the second as the key\'s value. If a given key is\n seen more than once, the last value associated with it is retained\n in the new dictionary.\n\n If keyword arguments are given, the keywords themselves with their\n associated values are added as items to the dictionary. If a key\n is specified both in the positional argument and as a keyword\n argument, the value associated with the keyword is retained in the\n dictionary. For example, these all return a dictionary equal to\n ``{"one": 2, "two": 3}``:\n\n * ``dict(one=2, two=3)``\n\n * ``dict({\'one\': 2, \'two\': 3})``\n\n * ``dict(zip((\'one\', \'two\'), (2, 3)))``\n\n * ``dict([[\'two\', 3], [\'one\', 2]])``\n\n The first example only works for keys that are valid Python\n identifiers; the others work with any valid keys.\n\n These are the operations that dictionaries support (and therefore,\n custom mapping types should support too):\n\n len(d)\n\n Return the number of items in the dictionary *d*.\n\n d[key]\n\n Return the item of *d* with key *key*. Raises a ``KeyError`` if\n *key* is not in the map.\n\n If a subclass of dict defines a method ``__missing__()``, if the\n key *key* is not present, the ``d[key]`` operation calls that\n method with the key *key* as argument. The ``d[key]`` operation\n then returns or raises whatever is returned or raised by the\n ``__missing__(key)`` call if the key is not present. No other\n operations or methods invoke ``__missing__()``. If\n ``__missing__()`` is not defined, ``KeyError`` is raised.\n ``__missing__()`` must be a method; it cannot be an instance\n variable. For an example, see ``collections.defaultdict``.\n\n d[key] = value\n\n Set ``d[key]`` to *value*.\n\n del d[key]\n\n Remove ``d[key]`` from *d*. Raises a ``KeyError`` if *key* is\n not in the map.\n\n key in d\n\n Return ``True`` if *d* has a key *key*, else ``False``.\n\n key not in d\n\n Equivalent to ``not key in d``.\n\n iter(d)\n\n Return an iterator over the keys of the dictionary. This is a\n shortcut for ``iterkeys()``.\n\n clear()\n\n Remove all items from the dictionary.\n\n copy()\n\n Return a shallow copy of the dictionary.\n\n classmethod fromkeys(seq[, value])\n\n Create a new dictionary with keys from *seq* and values set to\n *value*.\n\n ``fromkeys()`` is a class method that returns a new dictionary.\n *value* defaults to ``None``.\n\n get(key[, default])\n\n Return the value for *key* if *key* is in the dictionary, else\n *default*. If *default* is not given, it defaults to ``None``,\n so that this method never raises a ``KeyError``.\n\n items()\n\n Return a new view of the dictionary\'s items (``(key, value)``\n pairs). See below for documentation of view objects.\n\n keys()\n\n Return a new view of the dictionary\'s keys. See below for\n documentation of view objects.\n\n pop(key[, default])\n\n If *key* is in the dictionary, remove it and return its value,\n else return *default*. If *default* is not given and *key* is\n not in the dictionary, a ``KeyError`` is raised.\n\n popitem()\n\n Remove and return an arbitrary ``(key, value)`` pair from the\n dictionary.\n\n ``popitem()`` is useful to destructively iterate over a\n dictionary, as often used in set algorithms. If the dictionary\n is empty, calling ``popitem()`` raises a ``KeyError``.\n\n setdefault(key[, default])\n\n If *key* is in the dictionary, return its value. If not, insert\n *key* with a value of *default* and return *default*. *default*\n defaults to ``None``.\n\n update([other])\n\n Update the dictionary with the key/value pairs from *other*,\n overwriting existing keys. Return ``None``.\n\n ``update()`` accepts either another dictionary object or an\n iterable of key/value pairs (as a tuple or other iterable of\n length two). If keyword arguments are specified, the\n dictionary is then is updated with those key/value pairs:\n ``d.update(red=1, blue=2)``.\n\n values()\n\n Return a new view of the dictionary\'s values. See below for\n documentation of view objects.\n\n\nDictionary view objects\n=======================\n\nThe objects returned by ``dict.keys()``, ``dict.values()`` and\n``dict.items()`` are *view objects*. They provide a dynamic view on\nthe dictionary\'s entries, which means that when the dictionary\nchanges, the view reflects these changes.\n\nDictionary views can be iterated over to yield their respective data,\nand support membership tests:\n\nlen(dictview)\n\n Return the number of entries in the dictionary.\n\niter(dictview)\n\n Return an iterator over the keys, values or items (represented as\n tuples of ``(key, value)``) in the dictionary.\n\n Keys and values are iterated over in an arbitrary order which is\n non-random, varies across Python implementations, and depends on\n the dictionary\'s history of insertions and deletions. If keys,\n values and items views are iterated over with no intervening\n modifications to the dictionary, the order of items will directly\n correspond. This allows the creation of ``(value, key)`` pairs\n using ``zip()``: ``pairs = zip(d.values(), d.keys())``. Another\n way to create the same list is ``pairs = [(v, k) for (k, v) in\n d.items()]``.\n\n Iterating views while adding or deleting entries in the dictionary\n will raise a ``RuntimeError``.\n\nx in dictview\n\n Return ``True`` if *x* is in the underlying dictionary\'s keys,\n values or items (in the latter case, *x* should be a ``(key,\n value)`` tuple).\n\nKeys views are set-like since their entries are unique and hashable.\nIf all values are hashable, so that (key, value) pairs are unique and\nhashable, then the items view is also set-like. (Values views are not\ntreated as set-like since the entries are generally not unique.) Then\nthese set operations are available ("other" refers either to another\nview or a set):\n\ndictview & other\n\n Return the intersection of the dictview and the other object as a\n new set.\n\ndictview | other\n\n Return the union of the dictview and the other object as a new set.\n\ndictview - other\n\n Return the difference between the dictview and the other object\n (all elements in *dictview* that aren\'t in *other*) as a new set.\n\ndictview ^ other\n\n Return the symmetric difference (all elements either in *dictview*\n or *other*, but not in both) of the dictview and the other object\n as a new set.\n\nAn example of dictionary view usage:\n\n >>> dishes = {\'eggs\': 2, \'sausage\': 1, \'bacon\': 1, \'spam\': 500}\n >>> keys = dishes.keys()\n >>> values = dishes.values()\n\n >>> # iteration\n >>> n = 0\n >>> for val in values:\n ... n += val\n >>> print(n)\n 504\n\n >>> # keys and values are iterated over in the same order\n >>> list(keys)\n [\'eggs\', \'bacon\', \'sausage\', \'spam\']\n >>> list(values)\n [2, 1, 1, 500]\n\n >>> # view objects are dynamic and reflect dict changes\n >>> del dishes[\'eggs\']\n >>> del dishes[\'sausage\']\n >>> list(keys)\n [\'spam\', \'bacon\']\n\n >>> # set operations\n >>> keys & {\'eggs\', \'bacon\', \'salad\'}\n {\'bacon\'}\n', 'typesmethods': "\nMethods\n*******\n\nMethods are functions that are called using the attribute notation.\nThere are two flavors: built-in methods (such as ``append()`` on\nlists) and class instance methods. Built-in methods are described\nwith the types that support them.\n\nIf you access a method (a function defined in a class namespace)\nthrough an instance, you get a special object: a *bound method* (also\ncalled *instance method*) object. When called, it will add the\n``self`` argument to the argument list. Bound methods have two\nspecial read-only attributes: ``m.__self__`` is the object on which\nthe method operates, and ``m.__func__`` is the function implementing\nthe method. Calling ``m(arg-1, arg-2, ..., arg-n)`` is completely\nequivalent to calling ``m.__func__(m.__self__, arg-1, arg-2, ...,\narg-n)``.\n\nLike function objects, bound method objects support getting arbitrary\nattributes. However, since method attributes are actually stored on\nthe underlying function object (``meth.__func__``), setting method\nattributes on bound methods is disallowed. Attempting to set a method\nattribute results in a ``TypeError`` being raised. In order to set a\nmethod attribute, you need to explicitly set it on the underlying\nfunction object:\n\n class C:\n def method(self):\n pass\n\n c = C()\n c.method.__func__.whoami = 'my name is c'\n\nSee *The standard type hierarchy* for more information.\n", 'typesmodules': "\nModules\n*******\n\nThe only special operation on a module is attribute access:\n``m.name``, where *m* is a module and *name* accesses a name defined\nin *m*'s symbol table. Module attributes can be assigned to. (Note\nthat the ``import`` statement is not, strictly speaking, an operation\non a module object; ``import foo`` does not require a module object\nnamed *foo* to exist, rather it requires an (external) *definition*\nfor a module named *foo* somewhere.)\n\nA special member of every module is ``__dict__``. This is the\ndictionary containing the module's symbol table. Modifying this\ndictionary will actually change the module's symbol table, but direct\nassignment to the ``__dict__`` attribute is not possible (you can\nwrite ``m.__dict__['a'] = 1``, which defines ``m.a`` to be ``1``, but\nyou can't write ``m.__dict__ = {}``). Modifying ``__dict__`` directly\nis not recommended.\n\nModules built into the interpreter are written like this: ````. If loaded from a file, they are written as\n````.\n", - 'typesseq': '\nSequence Types --- ``str``, ``bytes``, ``bytearray``, ``list``, ``tuple``, ``range``\n************************************************************************************\n\nThere are six sequence types: strings, byte sequences (``bytes``\nobjects), byte arrays (``bytearray`` objects), lists, tuples, and\nrange objects. For other containers see the built in ``dict`` and\n``set`` classes, and the ``collections`` module.\n\nStrings contain Unicode characters. Their literals are written in\nsingle or double quotes: ``\'xyzzy\'``, ``"frobozz"``. See *String and\nBytes literals* for more about string literals. In addition to the\nfunctionality described here, there are also string-specific methods\ndescribed in the *String Methods* section.\n\nBytes and bytearray objects contain single bytes -- the former is\nimmutable while the latter is a mutable sequence. Bytes objects can\nbe constructed the constructor, ``bytes()``, and from literals; use a\n``b`` prefix with normal string syntax: ``b\'xyzzy\'``. To construct\nbyte arrays, use the ``bytearray()`` function.\n\nWarning: While string objects are sequences of characters (represented by\n strings of length 1), bytes and bytearray objects are sequences of\n *integers* (between 0 and 255), representing the ASCII value of\n single bytes. That means that for a bytes or bytearray object *b*,\n ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes or\n bytearray object of length 1. The representation of bytes objects\n uses the literal format (``b\'...\'``) since it is generally more\n useful than e.g. ``bytes([50, 19, 100])``. You can always convert a\n bytes object into a list of integers using ``list(b)``.Also, while\n in previous Python versions, byte strings and Unicode strings could\n be exchanged for each other rather freely (barring encoding issues),\n strings and bytes are now completely separate concepts. There\'s no\n implicit en-/decoding if you pass and object of the wrong type. A\n string always compares unequal to a bytes or bytearray object.\n\nLists are constructed with square brackets, separating items with\ncommas: ``[a, b, c]``. Tuples are constructed by the comma operator\n(not within square brackets), with or without enclosing parentheses,\nbut an empty tuple must have the enclosing parentheses, such as ``a,\nb, c`` or ``()``. A single item tuple must have a trailing comma,\nsuch as ``(d,)``.\n\nObjects of type range are created using the ``range()`` function.\nThey don\'t support slicing, concatenation or repetition, and using\n``in``, ``not in``, ``min()`` or ``max()`` on them is inefficient.\n\nMost sequence types support the following operations. The ``in`` and\n``not in`` operations have the same priorities as the comparison\noperations. The ``+`` and ``*`` operations have the same priority as\nthe corresponding numeric operations. [3] Additional methods are\nprovided for *Mutable Sequence Types*.\n\nThis table lists the sequence operations sorted in ascending priority\n(operations in the same box have the same priority). In the table,\n*s* and *t* are sequences of the same type; *n*, *i* and *j* are\nintegers:\n\n+--------------------+----------------------------------+------------+\n| Operation | Result | Notes |\n+====================+==================================+============+\n| ``x in s`` | ``True`` if an item of *s* is | (1) |\n| | equal to *x*, else ``False`` | |\n+--------------------+----------------------------------+------------+\n| ``x not in s`` | ``False`` if an item of *s* is | (1) |\n| | equal to *x*, else ``True`` | |\n+--------------------+----------------------------------+------------+\n| ``s + t`` | the concatenation of *s* and *t* | (6) |\n+--------------------+----------------------------------+------------+\n| ``s * n, n * s`` | *n* shallow copies of *s* | (2) |\n| | concatenated | |\n+--------------------+----------------------------------+------------+\n| ``s[i]`` | *i*\'th item of *s*, origin 0 | (3) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j]`` | slice of *s* from *i* to *j* | (3)(4) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j:k]`` | slice of *s* from *i* to *j* | (3)(5) |\n| | with step *k* | |\n+--------------------+----------------------------------+------------+\n| ``len(s)`` | length of *s* | |\n+--------------------+----------------------------------+------------+\n| ``min(s)`` | smallest item of *s* | |\n+--------------------+----------------------------------+------------+\n| ``max(s)`` | largest item of *s* | |\n+--------------------+----------------------------------+------------+\n\nSequence types also support comparisons. In particular, tuples and\nlists are compared lexicographically by comparing corresponding\nelements. This means that to compare equal, every element must\ncompare equal and the two sequences must be of the same type and have\nthe same length. (For full details see *Comparisons* in the language\nreference.)\n\nNotes:\n\n1. When *s* is a string object, the ``in`` and ``not in`` operations\n act like a substring test.\n\n2. Values of *n* less than ``0`` are treated as ``0`` (which yields an\n empty sequence of the same type as *s*). Note also that the copies\n are shallow; nested structures are not copied. This often haunts\n new Python programmers; consider:\n\n >>> lists = [[]] * 3\n >>> lists\n [[], [], []]\n >>> lists[0].append(3)\n >>> lists\n [[3], [3], [3]]\n\n What has happened is that ``[[]]`` is a one-element list containing\n an empty list, so all three elements of ``[[]] * 3`` are (pointers\n to) this single empty list. Modifying any of the elements of\n ``lists`` modifies this single list. You can create a list of\n different lists this way:\n\n >>> lists = [[] for i in range(3)]\n >>> lists[0].append(3)\n >>> lists[1].append(5)\n >>> lists[2].append(7)\n >>> lists\n [[3], [5], [7]]\n\n3. If *i* or *j* is negative, the index is relative to the end of the\n string: ``len(s) + i`` or ``len(s) + j`` is substituted. But note\n that ``-0`` is still ``0``.\n\n4. The slice of *s* from *i* to *j* is defined as the sequence of\n items with index *k* such that ``i <= k < j``. If *i* or *j* is\n greater than ``len(s)``, use ``len(s)``. If *i* is omitted or\n ``None``, use ``0``. If *j* is omitted or ``None``, use\n ``len(s)``. If *i* is greater than or equal to *j*, the slice is\n empty.\n\n5. The slice of *s* from *i* to *j* with step *k* is defined as the\n sequence of items with index ``x = i + n*k`` such that ``0 <= n <\n (j-i)/k``. In other words, the indices are ``i``, ``i+k``,\n ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is reached (but\n never including *j*). If *i* or *j* is greater than ``len(s)``,\n use ``len(s)``. If *i* or *j* are omitted or ``None``, they become\n "end" values (which end depends on the sign of *k*). Note, *k*\n cannot be zero. If *k* is ``None``, it is treated like ``1``.\n\n6. If *s* and *t* are both strings, some Python implementations such\n as CPython can usually perform an in-place optimization for\n assignments of the form ``s=s+t`` or ``s+=t``. When applicable,\n this optimization makes quadratic run-time much less likely. This\n optimization is both version and implementation dependent. For\n performance sensitive code, it is preferable to use the\n ``str.join()`` method which assures consistent linear concatenation\n performance across versions and implementations.\n\n\nString Methods\n==============\n\nString objects support the methods listed below. Note that none of\nthese methods take keyword arguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, bytes, bytearray, list,\ntuple, range* section. To output formatted strings, see the *String\nFormatting* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\nstr.count(sub[, start[, end]])\n\n Return the number of non-overlapping occurrences of substring *sub*\n in the range [*start*, *end*]. Optional arguments *start* and\n *end* are interpreted as in slice notation.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string. Default encoding is the\n current default string encoding. *errors* may be given to set a\n different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(*args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\nstr.isdecimal()\n\n Return true if all characters in the string are decimal characters\n and there is at least one character, false otherwise. Decimal\n characters include digit characters, and all characters that that\n can be used to form decimal-radix numbers, e.g. U+0660, ARABIC-\n INDIC DIGIT ZERO.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\nstr.isidentifier()\n\n Return true if the string is a valid identifier according to the\n language definition, section *Identifiers and keywords*.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\nstr.isnumeric()\n\n Return true if all characters in the string are numeric characters,\n and there is at least one character, false otherwise. Numeric\n characters include digit characters, and all characters that have\n the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION\n ONE FIFTH.\n\nstr.isprintable()\n\n Return true if all characters in the string are printable or the\n string is empty, false otherwise. Nonprintable characters are\n those characters defined in the Unicode character database as\n "Other" or "Separator", excepting the ASCII space (0x20) which is\n considered printable. (Note that printable characters in this\n context are those which should not be escaped when ``repr()`` is\n invoked on a string. It has no bearing on the handling of strings\n written to ``sys.stdout`` or ``sys.stderr``.)\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. A ``TypeError`` will be raised if there are any\n non-string values in *seq*, including ``bytes`` objects. The\n separator between elements is the string providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\nstatic str.maketrans(x[, y[, z]])\n\n This static method returns a translation table usable for\n ``str.translate()``.\n\n If there is only one argument, it must be a dictionary mapping\n Unicode ordinals (integers) or characters (strings of length 1) to\n Unicode ordinals, strings (of arbitrary lengths) or None.\n Character keys will then be converted to ordinals.\n\n If there are two arguments, they must be strings of equal length,\n and in the resulting dictionary, each character in x will be mapped\n to the character at the same position in y. If there is a third\n argument, it must be a string, whose characters will be mapped to\n None in the result.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\nstr.translate(map)\n\n Return a copy of the *s* where all characters have been mapped\n through the *map* which must be a dictionary of Unicode ordinals\n (integers) to Unicode ordinals, strings or ``None``. Unmapped\n characters are left untouched. Characters mapped to ``None`` are\n deleted.\n\n You can use ``str.maketrans()`` to create a translation map from\n character-to-character mappings in different formats.\n\n Note: An even more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see\n ``encodings.cp1251`` for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n\nOld String Formatting Operations\n================================\n\nNote: The formatting operations described here are obsolete and may go\n away in future versions of Python. Use the new *String Formatting*\n in new code.\n\nString objects have one unique built-in operation: the ``%`` operator\n(modulo). This is also known as the string *formatting* or\n*interpolation* operator. Given ``format % values`` (where *format* is\na string), ``%`` conversion specifications in *format* are replaced\nwith zero or more elements of *values*. The effect is similar to the\nusing ``sprintf`` in the C language.\n\nIf *format* requires a single argument, *values* may be a single non-\ntuple object. [4] Otherwise, *values* must be a tuple with exactly\nthe number of items specified by the format string, or a single\nmapping object (for example, a dictionary).\n\nA conversion specifier contains two or more characters and has the\nfollowing components, which must occur in this order:\n\n1. The ``\'%\'`` character, which marks the start of the specifier.\n\n2. Mapping key (optional), consisting of a parenthesised sequence of\n characters (for example, ``(somename)``).\n\n3. Conversion flags (optional), which affect the result of some\n conversion types.\n\n4. Minimum field width (optional). If specified as an ``\'*\'``\n (asterisk), the actual width is read from the next element of the\n tuple in *values*, and the object to convert comes after the\n minimum field width and optional precision.\n\n5. Precision (optional), given as a ``\'.\'`` (dot) followed by the\n precision. If specified as ``\'*\'`` (an asterisk), the actual width\n is read from the next element of the tuple in *values*, and the\n value to convert comes after the precision.\n\n6. Length modifier (optional).\n\n7. Conversion type.\n\nWhen the right argument is a dictionary (or other mapping type), then\nthe formats in the string *must* include a parenthesised mapping key\ninto that dictionary inserted immediately after the ``\'%\'`` character.\nThe mapping key selects the value to be formatted from the mapping.\nFor example:\n\n>>> print(\'%(language)s has %(#)03d quote types.\' % \\\n... {\'language\': "Python", "#": 2})\nPython has 002 quote types.\n\nIn this case no ``*`` specifiers may occur in a format (since they\nrequire a sequential parameter list).\n\nThe conversion flag characters are:\n\n+-----------+-----------------------------------------------------------------------+\n| Flag | Meaning |\n+===========+=======================================================================+\n| ``\'#\'`` | The value conversion will use the "alternate form" (where defined |\n| | below). |\n+-----------+-----------------------------------------------------------------------+\n| ``\'0\'`` | The conversion will be zero padded for numeric values. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'-\'`` | The converted value is left adjusted (overrides the ``\'0\'`` |\n| | conversion if both are given). |\n+-----------+-----------------------------------------------------------------------+\n| ``\' \'`` | (a space) A blank should be left before a positive number (or empty |\n| | string) produced by a signed conversion. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'+\'`` | A sign character (``\'+\'`` or ``\'-\'``) will precede the conversion |\n| | (overrides a "space" flag). |\n+-----------+-----------------------------------------------------------------------+\n\nA length modifier (``h``, ``l``, or ``L``) may be present, but is\nignored as it is not necessary for Python -- so e.g. ``%ld`` is\nidentical to ``%d``.\n\nThe conversion types are:\n\n+--------------+-------------------------------------------------------+---------+\n| Conversion | Meaning | Notes |\n+==============+=======================================================+=========+\n| ``\'d\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'i\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'o\'`` | Signed octal value. | (1) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'u\'`` | Obsolete type -- it is identical to ``\'d\'``. | (7) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'x\'`` | Signed hexadecimal (lowercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'X\'`` | Signed hexadecimal (uppercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'e\'`` | Floating point exponential format (lowercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'E\'`` | Floating point exponential format (uppercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'f\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'F\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'g\'`` | Floating point format. Uses lowercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'G\'`` | Floating point format. Uses uppercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'c\'`` | Single character (accepts integer or single character | |\n| | string). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'r\'`` | String (converts any python object using ``repr()``). | (5) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'s\'`` | String (converts any python object using ``str()``). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'%\'`` | No argument is converted, results in a ``\'%\'`` | |\n| | character in the result. | |\n+--------------+-------------------------------------------------------+---------+\n\nNotes:\n\n1. The alternate form causes a leading zero (``\'0\'``) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n2. The alternate form causes a leading ``\'0x\'`` or ``\'0X\'`` (depending\n on whether the ``\'x\'`` or ``\'X\'`` format was used) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n3. The alternate form causes the result to always contain a decimal\n point, even if no digits follow it.\n\n The precision determines the number of digits after the decimal\n point and defaults to 6.\n\n4. The alternate form causes the result to always contain a decimal\n point, and trailing zeroes are not removed as they would otherwise\n be.\n\n The precision determines the number of significant digits before\n and after the decimal point and defaults to 6.\n\n5. The precision determines the maximal number of characters used.\n\n1. See **PEP 237**.\n\nSince Python strings have an explicit length, ``%s`` conversions do\nnot assume that ``\'\\0\'`` is the end of the string.\n\nFor safety reasons, floating point precisions are clipped to 50;\n``%f`` conversions for numbers whose absolute value is over 1e50 are\nreplaced by ``%g`` conversions. [5] All other errors raise\nexceptions.\n\nAdditional string operations are defined in standard modules\n``string`` and ``re``.\n\n\nRange Type\n==========\n\nThe ``range`` type is an immutable sequence which is commonly used for\nlooping. The advantage of the ``range`` type is that an ``range``\nobject will always take the same amount of memory, no matter the size\nof the range it represents. There are no consistent performance\nadvantages.\n\nRange objects have very little behavior: they only support indexing,\niteration, and the ``len()`` function.\n\n\nMutable Sequence Types\n======================\n\nList and bytearray objects support additional operations that allow\nin-place modification of the object. Other mutable sequence types\n(when added to the language) should also support these operations.\nStrings and tuples are immutable sequence types: such objects cannot\nbe modified once created. The following operations are defined on\nmutable sequence types (where *x* is an arbitrary object).\n\nNote that while lists allow their items to be of any type, bytearray\nobject "items" are all integers in the range 0 <= x < 256.\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (2) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*\'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (3) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (5) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (6) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([key[, reverse]])`` | sort the items of *s* in place | (6), (7), (8) |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. *x* can be any iterable object.\n\n3. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the sequence length is added, as for slice indices. If it\n is still negative, it is truncated to zero, as for slice indices.\n\n4. When a negative index is passed as the first parameter to the\n ``insert()`` method, the sequence length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n5. The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n6. The ``sort()`` and ``reverse()`` methods modify the sequence in\n place for economy of space when sorting or reversing a large\n sequence. To remind you that they operate by side effect, they\n don\'t return the sorted or reversed sequence.\n\n7. The ``sort()`` method takes optional arguments for controlling the\n comparisons. Each must be specified as a keyword argument.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n The ``sort()`` method is guaranteed to be stable. A sort is stable\n if it guarantees not to change the relative order of elements that\n compare equal --- this is helpful for sorting in multiple passes\n (for example, sort by department, then by salary grade).\n\n While a list is being sorted, the effect of attempting to mutate,\n or even inspect, the list is undefined. The C implementation makes\n the list appear empty for the duration, and raises ``ValueError``\n if it can detect that the list has been mutated during a sort.\n\n8. ``sort()`` is not supported by ``bytearray`` objects.\n\n\nBytes and Byte Array Methods\n============================\n\nBytes and bytearray objects, being "strings of bytes", have all\nmethods found on strings, with the exception of ``encode()``,\n``format()`` and ``isidentifier()``, which do not make sense with\nthese types. For converting the objects to strings, they have a\n``decode()`` method.\n\nWherever one of these methods needs to interpret the bytes as\ncharacters (e.g. the ``is...()`` methods), the ASCII character set is\nassumed.\n\nNote: The methods on bytes and bytearray objects don\'t accept strings as\n their arguments, just as the methods on strings don\'t accept bytes\n as their arguments. For example, you have to write\n\n a = "abc"\n b = a.replace("a", "f")\n\n and\n\n a = b"abc"\n b = a.replace(b"a", b"f")\n\nThe bytes and bytearray types have an additional class method:\n\nclassmethod bytes.fromhex(string)\nclassmethod bytearray.fromhex(string)\n\n This ``bytes`` class method returns a bytes or bytearray object,\n decoding the given string object. The string must contain two\n hexadecimal digits per byte, spaces are ignored.\n\n >>> bytes.fromhex(\'f0 f1f2 \')\n b\'\\xf0\\xf1\\xf2\'\n\nThe maketrans and translate methods differ in semantics from the\nversions available on strings:\n\nbytes.translate(table[, delete])\n\n Return a copy of the bytes or bytearray object where all bytes\n occurring in the optional argument *delete* are removed, and the\n remaining bytes have been mapped through the given translation\n table, which must be a bytes object of length 256.\n\n You can use the ``bytes.maketrans()`` method to create a\n translation table.\n\n Set the *table* argument to ``None`` for translations that only\n delete characters:\n\n >>> b\'read this short text\'.translate(None, b\'aeiou\')\n b\'rd ths shrt txt\'\n\nstatic bytes.maketrans(from, to)\n\n This static method returns a translation table usable for\n ``bytes.translate()`` that will map each character in *from* into\n the character at the same position in *to*; *from* and *to* must be\n bytes objects and have the same length.\n\n New in version 3.1.\n', + 'typesseq': '\nSequence Types --- ``str``, ``bytes``, ``bytearray``, ``list``, ``tuple``, ``range``\n************************************************************************************\n\nThere are six sequence types: strings, byte sequences (``bytes``\nobjects), byte arrays (``bytearray`` objects), lists, tuples, and\nrange objects. For other containers see the built in ``dict`` and\n``set`` classes, and the ``collections`` module.\n\nStrings contain Unicode characters. Their literals are written in\nsingle or double quotes: ``\'xyzzy\'``, ``"frobozz"``. See *String and\nBytes literals* for more about string literals. In addition to the\nfunctionality described here, there are also string-specific methods\ndescribed in the *String Methods* section.\n\nBytes and bytearray objects contain single bytes -- the former is\nimmutable while the latter is a mutable sequence. Bytes objects can\nbe constructed the constructor, ``bytes()``, and from literals; use a\n``b`` prefix with normal string syntax: ``b\'xyzzy\'``. To construct\nbyte arrays, use the ``bytearray()`` function.\n\nWarning: While string objects are sequences of characters (represented by\n strings of length 1), bytes and bytearray objects are sequences of\n *integers* (between 0 and 255), representing the ASCII value of\n single bytes. That means that for a bytes or bytearray object *b*,\n ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes or\n bytearray object of length 1. The representation of bytes objects\n uses the literal format (``b\'...\'``) since it is generally more\n useful than e.g. ``bytes([50, 19, 100])``. You can always convert a\n bytes object into a list of integers using ``list(b)``.Also, while\n in previous Python versions, byte strings and Unicode strings could\n be exchanged for each other rather freely (barring encoding issues),\n strings and bytes are now completely separate concepts. There\'s no\n implicit en-/decoding if you pass and object of the wrong type. A\n string always compares unequal to a bytes or bytearray object.\n\nLists are constructed with square brackets, separating items with\ncommas: ``[a, b, c]``. Tuples are constructed by the comma operator\n(not within square brackets), with or without enclosing parentheses,\nbut an empty tuple must have the enclosing parentheses, such as ``a,\nb, c`` or ``()``. A single item tuple must have a trailing comma,\nsuch as ``(d,)``.\n\nObjects of type range are created using the ``range()`` function.\nThey don\'t support slicing, concatenation or repetition, and using\n``in``, ``not in``, ``min()`` or ``max()`` on them is inefficient.\n\nMost sequence types support the following operations. The ``in`` and\n``not in`` operations have the same priorities as the comparison\noperations. The ``+`` and ``*`` operations have the same priority as\nthe corresponding numeric operations. [3] Additional methods are\nprovided for *Mutable Sequence Types*.\n\nThis table lists the sequence operations sorted in ascending priority\n(operations in the same box have the same priority). In the table,\n*s* and *t* are sequences of the same type; *n*, *i* and *j* are\nintegers:\n\n+--------------------+----------------------------------+------------+\n| Operation | Result | Notes |\n+====================+==================================+============+\n| ``x in s`` | ``True`` if an item of *s* is | (1) |\n| | equal to *x*, else ``False`` | |\n+--------------------+----------------------------------+------------+\n| ``x not in s`` | ``False`` if an item of *s* is | (1) |\n| | equal to *x*, else ``True`` | |\n+--------------------+----------------------------------+------------+\n| ``s + t`` | the concatenation of *s* and *t* | (6) |\n+--------------------+----------------------------------+------------+\n| ``s * n, n * s`` | *n* shallow copies of *s* | (2) |\n| | concatenated | |\n+--------------------+----------------------------------+------------+\n| ``s[i]`` | *i*\'th item of *s*, origin 0 | (3) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j]`` | slice of *s* from *i* to *j* | (3)(4) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j:k]`` | slice of *s* from *i* to *j* | (3)(5) |\n| | with step *k* | |\n+--------------------+----------------------------------+------------+\n| ``len(s)`` | length of *s* | |\n+--------------------+----------------------------------+------------+\n| ``min(s)`` | smallest item of *s* | |\n+--------------------+----------------------------------+------------+\n| ``max(s)`` | largest item of *s* | |\n+--------------------+----------------------------------+------------+\n\nSequence types also support comparisons. In particular, tuples and\nlists are compared lexicographically by comparing corresponding\nelements. This means that to compare equal, every element must\ncompare equal and the two sequences must be of the same type and have\nthe same length. (For full details see *Comparisons* in the language\nreference.)\n\nNotes:\n\n1. When *s* is a string object, the ``in`` and ``not in`` operations\n act like a substring test.\n\n2. Values of *n* less than ``0`` are treated as ``0`` (which yields an\n empty sequence of the same type as *s*). Note also that the copies\n are shallow; nested structures are not copied. This often haunts\n new Python programmers; consider:\n\n >>> lists = [[]] * 3\n >>> lists\n [[], [], []]\n >>> lists[0].append(3)\n >>> lists\n [[3], [3], [3]]\n\n What has happened is that ``[[]]`` is a one-element list containing\n an empty list, so all three elements of ``[[]] * 3`` are (pointers\n to) this single empty list. Modifying any of the elements of\n ``lists`` modifies this single list. You can create a list of\n different lists this way:\n\n >>> lists = [[] for i in range(3)]\n >>> lists[0].append(3)\n >>> lists[1].append(5)\n >>> lists[2].append(7)\n >>> lists\n [[3], [5], [7]]\n\n3. If *i* or *j* is negative, the index is relative to the end of the\n string: ``len(s) + i`` or ``len(s) + j`` is substituted. But note\n that ``-0`` is still ``0``.\n\n4. The slice of *s* from *i* to *j* is defined as the sequence of\n items with index *k* such that ``i <= k < j``. If *i* or *j* is\n greater than ``len(s)``, use ``len(s)``. If *i* is omitted or\n ``None``, use ``0``. If *j* is omitted or ``None``, use\n ``len(s)``. If *i* is greater than or equal to *j*, the slice is\n empty.\n\n5. The slice of *s* from *i* to *j* with step *k* is defined as the\n sequence of items with index ``x = i + n*k`` such that ``0 <= n <\n (j-i)/k``. In other words, the indices are ``i``, ``i+k``,\n ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is reached (but\n never including *j*). If *i* or *j* is greater than ``len(s)``,\n use ``len(s)``. If *i* or *j* are omitted or ``None``, they become\n "end" values (which end depends on the sign of *k*). Note, *k*\n cannot be zero. If *k* is ``None``, it is treated like ``1``.\n\n6. If *s* and *t* are both strings, some Python implementations such\n as CPython can usually perform an in-place optimization for\n assignments of the form ``s=s+t`` or ``s+=t``. When applicable,\n this optimization makes quadratic run-time much less likely. This\n optimization is both version and implementation dependent. For\n performance sensitive code, it is preferable to use the\n ``str.join()`` method which assures consistent linear concatenation\n performance across versions and implementations.\n\n\nString Methods\n==============\n\nString objects support the methods listed below. Note that none of\nthese methods take keyword arguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, bytes, bytearray, list,\ntuple, range* section. To output formatted strings, see the *String\nFormatting* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\nstr.count(sub[, start[, end]])\n\n Return the number of non-overlapping occurrences of substring *sub*\n in the range [*start*, *end*]. Optional arguments *start* and\n *end* are interpreted as in slice notation.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string as a bytes object. Default\n encoding is the current default string encoding. *errors* may be\n given to set a different error handling scheme. The default for\n *errors* is ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(*args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\nstr.isdecimal()\n\n Return true if all characters in the string are decimal characters\n and there is at least one character, false otherwise. Decimal\n characters include digit characters, and all characters that that\n can be used to form decimal-radix numbers, e.g. U+0660, ARABIC-\n INDIC DIGIT ZERO.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\nstr.isidentifier()\n\n Return true if the string is a valid identifier according to the\n language definition, section *Identifiers and keywords*.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\nstr.isnumeric()\n\n Return true if all characters in the string are numeric characters,\n and there is at least one character, false otherwise. Numeric\n characters include digit characters, and all characters that have\n the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION\n ONE FIFTH.\n\nstr.isprintable()\n\n Return true if all characters in the string are printable or the\n string is empty, false otherwise. Nonprintable characters are\n those characters defined in the Unicode character database as\n "Other" or "Separator", excepting the ASCII space (0x20) which is\n considered printable. (Note that printable characters in this\n context are those which should not be escaped when ``repr()`` is\n invoked on a string. It has no bearing on the handling of strings\n written to ``sys.stdout`` or ``sys.stderr``.)\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. A ``TypeError`` will be raised if there are any\n non-string values in *seq*, including ``bytes`` objects. The\n separator between elements is the string providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\nstatic str.maketrans(x[, y[, z]])\n\n This static method returns a translation table usable for\n ``str.translate()``.\n\n If there is only one argument, it must be a dictionary mapping\n Unicode ordinals (integers) or characters (strings of length 1) to\n Unicode ordinals, strings (of arbitrary lengths) or None.\n Character keys will then be converted to ordinals.\n\n If there are two arguments, they must be strings of equal length,\n and in the resulting dictionary, each character in x will be mapped\n to the character at the same position in y. If there is a third\n argument, it must be a string, whose characters will be mapped to\n None in the result.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\nstr.translate(map)\n\n Return a copy of the *s* where all characters have been mapped\n through the *map* which must be a dictionary of Unicode ordinals\n (integers) to Unicode ordinals, strings or ``None``. Unmapped\n characters are left untouched. Characters mapped to ``None`` are\n deleted.\n\n You can use ``str.maketrans()`` to create a translation map from\n character-to-character mappings in different formats.\n\n Note: An even more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see\n ``encodings.cp1251`` for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n\nOld String Formatting Operations\n================================\n\nNote: The formatting operations described here are obsolete and may go\n away in future versions of Python. Use the new *String Formatting*\n in new code.\n\nString objects have one unique built-in operation: the ``%`` operator\n(modulo). This is also known as the string *formatting* or\n*interpolation* operator. Given ``format % values`` (where *format* is\na string), ``%`` conversion specifications in *format* are replaced\nwith zero or more elements of *values*. The effect is similar to the\nusing ``sprintf`` in the C language.\n\nIf *format* requires a single argument, *values* may be a single non-\ntuple object. [4] Otherwise, *values* must be a tuple with exactly\nthe number of items specified by the format string, or a single\nmapping object (for example, a dictionary).\n\nA conversion specifier contains two or more characters and has the\nfollowing components, which must occur in this order:\n\n1. The ``\'%\'`` character, which marks the start of the specifier.\n\n2. Mapping key (optional), consisting of a parenthesised sequence of\n characters (for example, ``(somename)``).\n\n3. Conversion flags (optional), which affect the result of some\n conversion types.\n\n4. Minimum field width (optional). If specified as an ``\'*\'``\n (asterisk), the actual width is read from the next element of the\n tuple in *values*, and the object to convert comes after the\n minimum field width and optional precision.\n\n5. Precision (optional), given as a ``\'.\'`` (dot) followed by the\n precision. If specified as ``\'*\'`` (an asterisk), the actual width\n is read from the next element of the tuple in *values*, and the\n value to convert comes after the precision.\n\n6. Length modifier (optional).\n\n7. Conversion type.\n\nWhen the right argument is a dictionary (or other mapping type), then\nthe formats in the string *must* include a parenthesised mapping key\ninto that dictionary inserted immediately after the ``\'%\'`` character.\nThe mapping key selects the value to be formatted from the mapping.\nFor example:\n\n>>> print(\'%(language)s has %(#)03d quote types.\' % \\\n... {\'language\': "Python", "#": 2})\nPython has 002 quote types.\n\nIn this case no ``*`` specifiers may occur in a format (since they\nrequire a sequential parameter list).\n\nThe conversion flag characters are:\n\n+-----------+-----------------------------------------------------------------------+\n| Flag | Meaning |\n+===========+=======================================================================+\n| ``\'#\'`` | The value conversion will use the "alternate form" (where defined |\n| | below). |\n+-----------+-----------------------------------------------------------------------+\n| ``\'0\'`` | The conversion will be zero padded for numeric values. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'-\'`` | The converted value is left adjusted (overrides the ``\'0\'`` |\n| | conversion if both are given). |\n+-----------+-----------------------------------------------------------------------+\n| ``\' \'`` | (a space) A blank should be left before a positive number (or empty |\n| | string) produced by a signed conversion. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'+\'`` | A sign character (``\'+\'`` or ``\'-\'``) will precede the conversion |\n| | (overrides a "space" flag). |\n+-----------+-----------------------------------------------------------------------+\n\nA length modifier (``h``, ``l``, or ``L``) may be present, but is\nignored as it is not necessary for Python -- so e.g. ``%ld`` is\nidentical to ``%d``.\n\nThe conversion types are:\n\n+--------------+-------------------------------------------------------+---------+\n| Conversion | Meaning | Notes |\n+==============+=======================================================+=========+\n| ``\'d\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'i\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'o\'`` | Signed octal value. | (1) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'u\'`` | Obsolete type -- it is identical to ``\'d\'``. | (7) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'x\'`` | Signed hexadecimal (lowercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'X\'`` | Signed hexadecimal (uppercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'e\'`` | Floating point exponential format (lowercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'E\'`` | Floating point exponential format (uppercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'f\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'F\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'g\'`` | Floating point format. Uses lowercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'G\'`` | Floating point format. Uses uppercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'c\'`` | Single character (accepts integer or single character | |\n| | string). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'r\'`` | String (converts any python object using ``repr()``). | (5) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'s\'`` | String (converts any python object using ``str()``). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'%\'`` | No argument is converted, results in a ``\'%\'`` | |\n| | character in the result. | |\n+--------------+-------------------------------------------------------+---------+\n\nNotes:\n\n1. The alternate form causes a leading zero (``\'0\'``) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n2. The alternate form causes a leading ``\'0x\'`` or ``\'0X\'`` (depending\n on whether the ``\'x\'`` or ``\'X\'`` format was used) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n3. The alternate form causes the result to always contain a decimal\n point, even if no digits follow it.\n\n The precision determines the number of digits after the decimal\n point and defaults to 6.\n\n4. The alternate form causes the result to always contain a decimal\n point, and trailing zeroes are not removed as they would otherwise\n be.\n\n The precision determines the number of significant digits before\n and after the decimal point and defaults to 6.\n\n5. The precision determines the maximal number of characters used.\n\n1. See **PEP 237**.\n\nSince Python strings have an explicit length, ``%s`` conversions do\nnot assume that ``\'\\0\'`` is the end of the string.\n\nChanged in version 3.1: ``%f`` conversions for numbers whose absolute\nvalue is over 1e50 are no longer replaced by ``%g`` conversions.\n\nAdditional string operations are defined in standard modules\n``string`` and ``re``.\n\n\nRange Type\n==========\n\nThe ``range`` type is an immutable sequence which is commonly used for\nlooping. The advantage of the ``range`` type is that an ``range``\nobject will always take the same amount of memory, no matter the size\nof the range it represents. There are no consistent performance\nadvantages.\n\nRange objects have very little behavior: they only support indexing,\niteration, and the ``len()`` function.\n\n\nMutable Sequence Types\n======================\n\nList and bytearray objects support additional operations that allow\nin-place modification of the object. Other mutable sequence types\n(when added to the language) should also support these operations.\nStrings and tuples are immutable sequence types: such objects cannot\nbe modified once created. The following operations are defined on\nmutable sequence types (where *x* is an arbitrary object).\n\nNote that while lists allow their items to be of any type, bytearray\nobject "items" are all integers in the range 0 <= x < 256.\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (2) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*\'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (3) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (5) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (6) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([key[, reverse]])`` | sort the items of *s* in place | (6), (7), (8) |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. *x* can be any iterable object.\n\n3. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the sequence length is added, as for slice indices. If it\n is still negative, it is truncated to zero, as for slice indices.\n\n4. When a negative index is passed as the first parameter to the\n ``insert()`` method, the sequence length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n5. The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n6. The ``sort()`` and ``reverse()`` methods modify the sequence in\n place for economy of space when sorting or reversing a large\n sequence. To remind you that they operate by side effect, they\n don\'t return the sorted or reversed sequence.\n\n7. The ``sort()`` method takes optional arguments for controlling the\n comparisons. Each must be specified as a keyword argument.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n The ``sort()`` method is guaranteed to be stable. A sort is stable\n if it guarantees not to change the relative order of elements that\n compare equal --- this is helpful for sorting in multiple passes\n (for example, sort by department, then by salary grade).\n\n While a list is being sorted, the effect of attempting to mutate,\n or even inspect, the list is undefined. The C implementation makes\n the list appear empty for the duration, and raises ``ValueError``\n if it can detect that the list has been mutated during a sort.\n\n8. ``sort()`` is not supported by ``bytearray`` objects.\n\n\nBytes and Byte Array Methods\n============================\n\nBytes and bytearray objects, being "strings of bytes", have all\nmethods found on strings, with the exception of ``encode()``,\n``format()`` and ``isidentifier()``, which do not make sense with\nthese types. For converting the objects to strings, they have a\n``decode()`` method.\n\nWherever one of these methods needs to interpret the bytes as\ncharacters (e.g. the ``is...()`` methods), the ASCII character set is\nassumed.\n\nNote: The methods on bytes and bytearray objects don\'t accept strings as\n their arguments, just as the methods on strings don\'t accept bytes\n as their arguments. For example, you have to write\n\n a = "abc"\n b = a.replace("a", "f")\n\n and\n\n a = b"abc"\n b = a.replace(b"a", b"f")\n\nbytes.decode([encoding[, errors]])\nbytearray.decode([encoding[, errors]])\n\n Return a string decoded from the given bytes. Default encoding is\n the current default string encoding. *errors* may be given to set\n a different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'`` and any other name registered via\n ``codecs.register_error()``, see section *Codec Base Classes*. For\n a list of possible encodings, see section *Standard Encodings*.\n\nThe bytes and bytearray types have an additional class method:\n\nclassmethod bytes.fromhex(string)\nclassmethod bytearray.fromhex(string)\n\n This ``bytes`` class method returns a bytes or bytearray object,\n decoding the given string object. The string must contain two\n hexadecimal digits per byte, spaces are ignored.\n\n >>> bytes.fromhex(\'f0 f1f2 \')\n b\'\\xf0\\xf1\\xf2\'\n\nThe maketrans and translate methods differ in semantics from the\nversions available on strings:\n\nbytes.translate(table[, delete])\n\n Return a copy of the bytes or bytearray object where all bytes\n occurring in the optional argument *delete* are removed, and the\n remaining bytes have been mapped through the given translation\n table, which must be a bytes object of length 256.\n\n You can use the ``bytes.maketrans()`` method to create a\n translation table.\n\n Set the *table* argument to ``None`` for translations that only\n delete characters:\n\n >>> b\'read this short text\'.translate(None, b\'aeiou\')\n b\'rd ths shrt txt\'\n\nstatic bytes.maketrans(from, to)\n\n This static method returns a translation table usable for\n ``bytes.translate()`` that will map each character in *from* into\n the character at the same position in *to*; *from* and *to* must be\n bytes objects and have the same length.\n\n New in version 3.1.\n', 'typesseq-mutable': '\nMutable Sequence Types\n**********************\n\nList and bytearray objects support additional operations that allow\nin-place modification of the object. Other mutable sequence types\n(when added to the language) should also support these operations.\nStrings and tuples are immutable sequence types: such objects cannot\nbe modified once created. The following operations are defined on\nmutable sequence types (where *x* is an arbitrary object).\n\nNote that while lists allow their items to be of any type, bytearray\nobject "items" are all integers in the range 0 <= x < 256.\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (2) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*\'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (3) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (5) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (6) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([key[, reverse]])`` | sort the items of *s* in place | (6), (7), (8) |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. *x* can be any iterable object.\n\n3. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the sequence length is added, as for slice indices. If it\n is still negative, it is truncated to zero, as for slice indices.\n\n4. When a negative index is passed as the first parameter to the\n ``insert()`` method, the sequence length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n5. The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n6. The ``sort()`` and ``reverse()`` methods modify the sequence in\n place for economy of space when sorting or reversing a large\n sequence. To remind you that they operate by side effect, they\n don\'t return the sorted or reversed sequence.\n\n7. The ``sort()`` method takes optional arguments for controlling the\n comparisons. Each must be specified as a keyword argument.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n The ``sort()`` method is guaranteed to be stable. A sort is stable\n if it guarantees not to change the relative order of elements that\n compare equal --- this is helpful for sorting in multiple passes\n (for example, sort by department, then by salary grade).\n\n While a list is being sorted, the effect of attempting to mutate,\n or even inspect, the list is undefined. The C implementation makes\n the list appear empty for the duration, and raises ``ValueError``\n if it can detect that the list has been mutated during a sort.\n\n8. ``sort()`` is not supported by ``bytearray`` objects.\n', 'unary': '\nUnary arithmetic and bitwise operations\n***************************************\n\nAll unary arithmetic and bitwise operations have the same priority:\n\n u_expr ::= power | "-" u_expr | "+" u_expr | "~" u_expr\n\nThe unary ``-`` (minus) operator yields the negation of its numeric\nargument.\n\nThe unary ``+`` (plus) operator yields its numeric argument unchanged.\n\nThe unary ``~`` (invert) operator yields the bitwise inversion of its\ninteger argument. The bitwise inversion of ``x`` is defined as\n``-(x+1)``. It only applies to integral numbers.\n\nIn all three cases, if the argument does not have the proper type, a\n``TypeError`` exception is raised.\n', 'while': '\nThe ``while`` statement\n***********************\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n', From python-checkins at python.org Wed May 6 22:43:26 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 6 May 2009 22:43:26 +0200 (CEST) Subject: [Python-checkins] r72411 - sandbox/trunk/release/release.py Message-ID: <20090506204326.18DBF1E4011@bag.python.org> Author: benjamin.peterson Date: Wed May 6 22:43:25 2009 New Revision: 72411 Log: RELNOTES is dead Modified: sandbox/trunk/release/release.py Modified: sandbox/trunk/release/release.py ============================================================================== --- sandbox/trunk/release/release.py (original) +++ sandbox/trunk/release/release.py Wed May 6 22:43:25 2009 @@ -179,8 +179,6 @@ 'LICENSE', 'Doc/license.rst', ] - if tag.major == 3: - other_files.append('RELNOTES') print '\nManual editing time...' for fn in other_files: print 'Edit %s' % fn From python-checkins at python.org Wed May 6 22:43:29 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 6 May 2009 22:43:29 +0200 (CEST) Subject: [Python-checkins] r72412 - in python/branches/py3k: Include/patchlevel.h Lib/distutils/__init__.py Lib/idlelib/idlever.py Misc/NEWS Misc/RPM/python-3.1.spec README Message-ID: <20090506204329.11B1E1E40D2@bag.python.org> Author: benjamin.peterson Date: Wed May 6 22:43:28 2009 New Revision: 72412 Log: bump version to 3.1b1 Modified: python/branches/py3k/Include/patchlevel.h python/branches/py3k/Lib/distutils/__init__.py python/branches/py3k/Lib/idlelib/idlever.py python/branches/py3k/Misc/NEWS python/branches/py3k/Misc/RPM/python-3.1.spec python/branches/py3k/README Modified: python/branches/py3k/Include/patchlevel.h ============================================================================== --- python/branches/py3k/Include/patchlevel.h (original) +++ python/branches/py3k/Include/patchlevel.h Wed May 6 22:43:28 2009 @@ -19,11 +19,11 @@ #define PY_MAJOR_VERSION 3 #define PY_MINOR_VERSION 1 #define PY_MICRO_VERSION 0 -#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_ALPHA -#define PY_RELEASE_SERIAL 2 +#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_BETA +#define PY_RELEASE_SERIAL 1 /* Version as a string */ -#define PY_VERSION "3.1a2+" +#define PY_VERSION "3.1b1" /*--end constants--*/ /* Subversion Revision number of this file (not of the repository) */ Modified: python/branches/py3k/Lib/distutils/__init__.py ============================================================================== --- python/branches/py3k/Lib/distutils/__init__.py (original) +++ python/branches/py3k/Lib/distutils/__init__.py Wed May 6 22:43:28 2009 @@ -15,5 +15,5 @@ # Updated automatically by the Python release process. # #--start constants-- -__version__ = "3.1a2" +__version__ = "3.1b1" #--end constants-- Modified: python/branches/py3k/Lib/idlelib/idlever.py ============================================================================== --- python/branches/py3k/Lib/idlelib/idlever.py (original) +++ python/branches/py3k/Lib/idlelib/idlever.py Wed May 6 22:43:28 2009 @@ -1 +1 @@ -IDLE_VERSION = "3.1a2" +IDLE_VERSION = "3.1b1" Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed May 6 22:43:28 2009 @@ -7,7 +7,7 @@ What's New in Python 3.1 beta 1? ================================ -*Release date: XXXX-XX-XX* +*Release date: 2009-05-06* Core and Builtins ----------------- Modified: python/branches/py3k/Misc/RPM/python-3.1.spec ============================================================================== --- python/branches/py3k/Misc/RPM/python-3.1.spec (original) +++ python/branches/py3k/Misc/RPM/python-3.1.spec Wed May 6 22:43:28 2009 @@ -34,7 +34,7 @@ %define name python #--start constants-- -%define version 3.1a2 +%define version 3.1b1 %define libver 3.1 #--end constants-- %define release 1pydotorg Modified: python/branches/py3k/README ============================================================================== --- python/branches/py3k/README (original) +++ python/branches/py3k/README Wed May 6 22:43:28 2009 @@ -1,5 +1,5 @@ -This is Python version 3.1 alpha 2 -================================== +This is Python version 3.1 beta 1 +================================= Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Python Software Foundation. From python-checkins at python.org Wed May 6 22:46:47 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 6 May 2009 22:46:47 +0200 (CEST) Subject: [Python-checkins] r72413 - peps/trunk/pep-0101.txt Message-ID: <20090506204647.3E1221E418F@bag.python.org> Author: benjamin.peterson Date: Wed May 6 22:46:47 2009 New Revision: 72413 Log: update staff Modified: peps/trunk/pep-0101.txt Modified: peps/trunk/pep-0101.txt ============================================================================== --- peps/trunk/pep-0101.txt (original) +++ peps/trunk/pep-0101.txt Wed May 6 22:46:47 2009 @@ -35,7 +35,7 @@ the designated person performing the release. The roles and their current experts are: - * RM = Release Manager: Barry Warsaw (US/Eastern) + * RM = Release Manager: Benjamin Peterson (US/Central) * WE = Windows: Martin von Loewis (Central Europe) * ME = Mac: Ronald Oussoren (Central Europe) * DE = Docs: Georg Brandl (Central Europe) From python-checkins at python.org Wed May 6 22:51:24 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 6 May 2009 22:51:24 +0200 (CEST) Subject: [Python-checkins] r72414 - python/tags/r31b1 Message-ID: <20090506205124.07C7A1E4011@bag.python.org> Author: benjamin.peterson Date: Wed May 6 22:51:23 2009 New Revision: 72414 Log: tag 3.1 beta 1 Added: python/tags/r31b1/ - copied from r72413, /python/branches/py3k/ From nnorwitz at gmail.com Wed May 6 23:34:17 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 6 May 2009 17:34:17 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090506213417.GA19840@python.psfb.org> More important issues: ---------------------- test_hashlib leaked [-31, -6, 6] references, sum=-31 Less important issues: ---------------------- test_asynchat leaked [0, 139, -139] references, sum=0 test_cmd_line leaked [0, 0, -25] references, sum=-25 test_file leaked [77, -77, 0] references, sum=0 test_smtplib leaked [-179, 0, -4] references, sum=-183 test_sys leaked [42, -42, 42] references, sum=42 test_threading leaked [47, 49, 48] references, sum=144 test_urllib2_localnet leaked [285, -279, 3] references, sum=9 From python-checkins at python.org Thu May 7 00:54:20 2009 From: python-checkins at python.org (andrew.kuchling) Date: Thu, 7 May 2009 00:54:20 +0200 (CEST) Subject: [Python-checkins] r72415 - python/trunk/Doc/tools/sphinxext/indexsidebar.html Message-ID: <20090506225420.10DC21E4011@bag.python.org> Author: andrew.kuchling Date: Thu May 7 00:54:19 2009 New Revision: 72415 Log: Remove two dead links Modified: python/trunk/Doc/tools/sphinxext/indexsidebar.html Modified: python/trunk/Doc/tools/sphinxext/indexsidebar.html ============================================================================== --- python/trunk/Doc/tools/sphinxext/indexsidebar.html (original) +++ python/trunk/Doc/tools/sphinxext/indexsidebar.html Thu May 7 00:54:19 2009 @@ -12,12 +12,10 @@
    {# XXX: many of these should probably be merged in the main docs #}
  • FAQs
  • -
  • Introductions
  • Guido's Essays
  • New-style Classes
  • PEP Index
  • Beginner's Guide
  • -
  • Topic Guides
  • Book List
  • Audio/Visual Talks
  • Other Doc Collections
  • From python-checkins at python.org Thu May 7 01:00:43 2009 From: python-checkins at python.org (andrew.kuchling) Date: Thu, 7 May 2009 01:00:43 +0200 (CEST) Subject: [Python-checkins] r72416 - in python/branches/release26-maint: Doc/tools/sphinxext/indexsidebar.html Message-ID: <20090506230043.EE9261E4011@bag.python.org> Author: andrew.kuchling Date: Thu May 7 01:00:43 2009 New Revision: 72416 Log: Merged revisions 72415 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72415 | andrew.kuchling | 2009-05-06 18:54:19 -0400 (Wed, 06 May 2009) | 1 line Remove two dead links ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/tools/sphinxext/indexsidebar.html Modified: python/branches/release26-maint/Doc/tools/sphinxext/indexsidebar.html ============================================================================== --- python/branches/release26-maint/Doc/tools/sphinxext/indexsidebar.html (original) +++ python/branches/release26-maint/Doc/tools/sphinxext/indexsidebar.html Thu May 7 01:00:43 2009 @@ -12,12 +12,10 @@
      {# XXX: many of these should probably be merged in the main docs #}
    • FAQs
    • -
    • Introductions
    • Guido's Essays
    • New-style Classes
    • PEP Index
    • Beginner's Guide
    • -
    • Topic Guides
    • Book List
    • Audio/Visual Talks
    • Other Doc Collections
    • From python-checkins at python.org Thu May 7 01:26:59 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 7 May 2009 01:26:59 +0200 (CEST) Subject: [Python-checkins] r72417 - in python/branches/py3k: Include/patchlevel.h Misc/NEWS Message-ID: <20090506232659.72DCF1E401A@bag.python.org> Author: benjamin.peterson Date: Thu May 7 01:26:59 2009 New Revision: 72417 Log: post release updates Modified: python/branches/py3k/Include/patchlevel.h python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Include/patchlevel.h ============================================================================== --- python/branches/py3k/Include/patchlevel.h (original) +++ python/branches/py3k/Include/patchlevel.h Thu May 7 01:26:59 2009 @@ -23,7 +23,7 @@ #define PY_RELEASE_SERIAL 1 /* Version as a string */ -#define PY_VERSION "3.1b1" +#define PY_VERSION "3.1b1+" /*--end constants--*/ /* Subversion Revision number of this file (not of the repository) */ Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu May 7 01:26:59 2009 @@ -4,6 +4,18 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) +What's New in Python 3.1 release candiate 1? +============================================ + +*Release date: XXXX-XX-XX* + +Core and Builtins +----------------- + +Library +------- + + What's New in Python 3.1 beta 1? ================================ From buildbot at python.org Thu May 7 02:14:21 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 07 May 2009 00:14:21 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090507001421.AD7D81E401B@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/917 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Thu May 7 03:39:26 2009 From: python-checkins at python.org (r.david.murray) Date: Thu, 7 May 2009 03:39:26 +0200 (CEST) Subject: [Python-checkins] r72418 - python/trunk/Doc/library/email.message.rst Message-ID: <20090507013926.164771E401B@bag.python.org> Author: r.david.murray Date: Thu May 7 03:39:25 2009 New Revision: 72418 Log: Document how to pass a 'decode' argument to get_payload when is_multipart is False. Modified: python/trunk/Doc/library/email.message.rst Modified: python/trunk/Doc/library/email.message.rst ============================================================================== --- python/trunk/Doc/library/email.message.rst (original) +++ python/trunk/Doc/library/email.message.rst Thu May 7 03:39:25 2009 @@ -112,6 +112,9 @@ *decode* flag is ``True``, then ``None`` is returned. The default for *decode* is ``False``. + To pass a value for the decode flag to a non-multipart message, specify + ``None`` as the value of *i*. + .. method:: set_payload(payload[, charset]) From python-checkins at python.org Thu May 7 03:43:57 2009 From: python-checkins at python.org (r.david.murray) Date: Thu, 7 May 2009 03:43:57 +0200 (CEST) Subject: [Python-checkins] r72419 - python/trunk/Doc/library/email.message.rst Message-ID: <20090507014357.5F15A1E401B@bag.python.org> Author: r.david.murray Date: Thu May 7 03:43:57 2009 New Revision: 72419 Log: Revert inappropriate doc change. Modified: python/trunk/Doc/library/email.message.rst Modified: python/trunk/Doc/library/email.message.rst ============================================================================== --- python/trunk/Doc/library/email.message.rst (original) +++ python/trunk/Doc/library/email.message.rst Thu May 7 03:43:57 2009 @@ -112,9 +112,6 @@ *decode* flag is ``True``, then ``None`` is returned. The default for *decode* is ``False``. - To pass a value for the decode flag to a non-multipart message, specify - ``None`` as the value of *i*. - .. method:: set_payload(payload[, charset]) From buildbot at python.org Thu May 7 07:58:02 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 07 May 2009 05:58:02 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090507055803.29BBE1E4016@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/542 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 486, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' 1 test failed: test_import ====================================================================== ERROR: testImport (test.test_import.ImportTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 61, in test_with_extension mod = __import__(TESTFN) ImportError: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 486, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 486, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' sincerely, -The Buildbot From python-checkins at python.org Thu May 7 11:02:23 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 7 May 2009 11:02:23 +0200 (CEST) Subject: [Python-checkins] r72420 - peps/trunk/pep-0376.txt Message-ID: <20090507090223.D3EE51E4028@bag.python.org> Author: tarek.ziade Date: Thu May 7 11:02:23 2009 New Revision: 72420 Log: removed the EGG_INFO_FILES part Modified: peps/trunk/pep-0376.txt Modified: peps/trunk/pep-0376.txt ============================================================================== --- peps/trunk/pep-0376.txt (original) +++ peps/trunk/pep-0376.txt Thu May 7 11:02:23 2009 @@ -149,19 +149,6 @@ file, so the old `record` behavior will be deprecated. XXX see how to handle old record (new option, or wait for 2 version?) -Listing the .egg-info elements in Distutils -=========================================== - -In Distutils, the `dist` module will introduce an `EGG_INFO_FILES` constant -to list all files located in the `.egg-info` directory:: - - from collections import namedtuple - - EggInfos = namedtuple('EggInfo', 'manifest record pkg_info') - - # files added in egg-info - EGG_INFO_FILES = EggInfos('RECORD', 'PKG-INFO') - Back to our `zlib` example, we will have:: - zlib @@ -169,8 +156,6 @@ PKG-INFO RECORD -XXX See if we want to add Python version in the PKG-INFO - New functions in pkgutil ======================== @@ -199,8 +184,6 @@ Uses `get_egg_info` and gets any file inside the directory, pointed by filename. - filename can be any value found in `distutils.sdist.EGG_INFO_FILES`. - Let's use it with our `zlib` example:: >>> from pkgutil import get_egg_info, get_metadata, get_egg_info_file @@ -209,15 +192,13 @@ >>> metadata = get_metadata('zlib') >>> metadata.version '2.5.2' - >>> from distutils.dist import EGG_INFO_FILES - >>> get_egg_info_file('zlib', EGG_INFO_FILES.manifest).read() + >>> get_egg_info_file('zlib', 'PKG-INFO').read() some ... files - -Adding an Uninstall API -======================= +Adding an Uninstall function +============================ Distutils provides a very basic way to install a project, which is running the `install` command over the `setup.py` script of the distribution. @@ -227,10 +208,15 @@ mentioned in another `RECORD` file. This command will be added in the `util` module and will take the name -of the project to uninstall:: +of the project to uninstall. A call to uninstall will return a list +of uninstalled files. If the project is not found, a Distutils:: >>> from distutils.util import uninstall >>> uninstall('zlib') + ['/opt/local/lib/python2.6/site-packages/zlib/file1', + '/opt/local/lib/python2.6/site-packages/zlib/file2'] + +If the project is not found, a ``DistutilsUninstallError`` will be raised. To make it a reference API for third-party projects that wish to provide an `uninstall feature`. The `uninstall` API can also be invoked with a @@ -243,6 +229,7 @@ ... logging.info('Removing %s' % path) ... return True >>> uninstall('zlib', _remove_and_log) + >>> def _dry_run(path): ... logging.info('Removing %s (dry run)' % path) ... return False From nnorwitz at gmail.com Thu May 7 11:27:34 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 7 May 2009 05:27:34 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090507092734.GA30315@python.psfb.org> More important issues: ---------------------- test_hashlib leaked [83, -2, 4] references, sum=85 Less important issues: ---------------------- test_smtplib leaked [114, -109, 0] references, sum=5 test_socketserver leaked [-80, 70, 7] references, sum=-3 test_sys leaked [42, -21, -21] references, sum=0 test_threading leaked [48, 48, 48] references, sum=144 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 From python-checkins at python.org Thu May 7 12:56:44 2009 From: python-checkins at python.org (andrew.kuchling) Date: Thu, 7 May 2009 12:56:44 +0200 (CEST) Subject: [Python-checkins] r72421 - in python/branches/py3k: Doc/tools/sphinxext/indexsidebar.html Message-ID: <20090507105644.D458C1E4024@bag.python.org> Author: andrew.kuchling Date: Thu May 7 12:56:44 2009 New Revision: 72421 Log: Merged revisions 72415 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72415 | andrew.kuchling | 2009-05-06 18:54:19 -0400 (Wed, 06 May 2009) | 1 line Remove two dead links ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/tools/sphinxext/indexsidebar.html Modified: python/branches/py3k/Doc/tools/sphinxext/indexsidebar.html ============================================================================== --- python/branches/py3k/Doc/tools/sphinxext/indexsidebar.html (original) +++ python/branches/py3k/Doc/tools/sphinxext/indexsidebar.html Thu May 7 12:56:44 2009 @@ -12,12 +12,10 @@
        {# XXX: many of these should probably be merged in the main docs #}
      • FAQs
      • -
      • Introductions
      • Guido's Essays
      • New-style Classes
      • PEP Index
      • Beginner's Guide
      • -
      • Topic Guides
      • Book List
      • Audio/Visual Talks
      • Other Doc Collections
      • From python-checkins at python.org Thu May 7 13:45:39 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 7 May 2009 13:45:39 +0200 (CEST) Subject: [Python-checkins] r72422 - python/trunk/Lib/aifc.py Message-ID: <20090507114539.20B811E408C@bag.python.org> Author: benjamin.peterson Date: Thu May 7 13:45:38 2009 New Revision: 72422 Log: actually close files instead of leaving it to the gc #5955 Modified: python/trunk/Lib/aifc.py Modified: python/trunk/Lib/aifc.py ============================================================================== --- python/trunk/Lib/aifc.py (original) +++ python/trunk/Lib/aifc.py Thu May 7 13:45:38 2009 @@ -347,7 +347,7 @@ if self._decomp: self._decomp.CloseDecompressor() self._decomp = None - self._file = None + self._file.close() def tell(self): return self._soundpos @@ -734,8 +734,7 @@ self._comp = None # Prevent ref cycles self._convert = None - self._file.flush() - self._file = None + self._file.close() # # Internal methods. From python-checkins at python.org Thu May 7 13:53:38 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 7 May 2009 13:53:38 +0200 (CEST) Subject: [Python-checkins] r72423 - in python/branches/py3k: Lib/aifc.py Message-ID: <20090507115338.A9B8F1E4021@bag.python.org> Author: benjamin.peterson Date: Thu May 7 13:53:38 2009 New Revision: 72423 Log: Merged revisions 72422 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72422 | benjamin.peterson | 2009-05-07 06:45:38 -0500 (Thu, 07 May 2009) | 1 line actually close files instead of leaving it to the gc #5955 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/aifc.py Modified: python/branches/py3k/Lib/aifc.py ============================================================================== --- python/branches/py3k/Lib/aifc.py (original) +++ python/branches/py3k/Lib/aifc.py Thu May 7 13:53:38 2009 @@ -331,7 +331,7 @@ self._soundpos = 0 def close(self): - self._file = None + self._file.close() def tell(self): return self._soundpos @@ -692,8 +692,7 @@ self._patchheader() # Prevent ref cycles self._convert = None - self._file.flush() - self._file = None + self._file.close() # # Internal methods. From buildbot at python.org Thu May 7 14:20:49 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 07 May 2009 12:20:49 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090507122049.A945D1E4002@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1265 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: andrew.kuchling,benjamin.peterson,r.david.murray BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Thu May 7 14:34:24 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 7 May 2009 14:34:24 +0200 (CEST) Subject: [Python-checkins] r72424 - peps/branches/jim-update-345/pep-0345.txt Message-ID: <20090507123424.994971E4002@bag.python.org> Author: tarek.ziade Date: Thu May 7 14:34:24 2009 New Revision: 72424 Log: commiting Tres's update Modified: peps/branches/jim-update-345/pep-0345.txt Modified: peps/branches/jim-update-345/pep-0345.txt ============================================================================== --- peps/branches/jim-update-345/pep-0345.txt (original) +++ peps/branches/jim-update-345/pep-0345.txt Thu May 7 14:34:24 2009 @@ -61,9 +61,7 @@ Version A string containing the package's version number. This - field should be parseable by one of the Version classes - (StrictVersion or LooseVersion) in the distutils.version - module. + field must be in the format specified in `Version Specifiers`_. Example:: @@ -134,7 +132,7 @@ Download-URL A string containing the URL from which this version of the package can be downloaded. (This means that the URL can't be something like - ".../package-latest.tgz", but instead must be "../package-0.45.tgz".) + ".../package-latest.tgz", but instead must be ".../package-0.45.tgz".) Author (optional) A string containing the author's name at a minimum; additional @@ -148,7 +146,7 @@ Author-email A string containing the author's e-mail address. It can contain a name and e-mail address in the legal forms for a RFC-822 - 'From:' header. It's not optional because cataloging systems + ``From:`` header. It's not optional because cataloging systems can use the e-mail portion of this field as a unique key representing the author. A catalog might provide authors the ability to store their GPG key, personal home page, and other @@ -167,7 +165,7 @@ Note that this field is intended for use when a package is being maintained by someone other than the original author: it should be - omitted if it is identical to 'Author'. + omitted if it is identical to ``Author``. Example:: @@ -177,27 +175,31 @@ Maintainer-email (optional) A string containing the maintainer's e-mail address. It can contain a name and e-mail address in the legal forms for a RFC-822 - 'From:' header. + ``From:`` header. Note that this field is intended for use when a package is being maintained by someone other than the original author: it should be - omitted if it is identical to 'Author-email'. + omitted if it is identical to ``Author-email``. Example:: Maintainer-email: "C. Schultz" -License +License (optional) Text indicating the license covering the package where the license is not a selection from the "License" Trove classifiers. See - "Classifier" below. + "Classifier" below. This field may also be used to specify a + particular version of a licencse which is named via the ``Classifier`` + field, or to indicate a variation or exception to such a license. - Example:: + Examples:: License: This software may only be obtained by sending the author a postcard, and then the user promises not to redistribute it. + License: GPL version 3, excluding DRM provisions + Classifier (multiple use) Each entry is a string giving a single classification value for the package. Classifiers are described in PEP 301 [2]. @@ -212,7 +214,7 @@ package required by this package. The format of a requirement string is identical to that of a - module or package name usable with the 'import' statement, + module or package name usable with the ``import`` statement, optionally followed by a version declaration within parentheses. A version declaration is a series of conditional operators and @@ -233,7 +235,7 @@ There's no canonical list of what strings should be used; the Python community is left to choose its own standards. - Example:: + Examples:: Requires: re Requires: sys @@ -241,7 +243,7 @@ Requires: xml.parsers.expat (>1.0) Requires: psycopg - Note: this field is now deprecated in favor of 'Requires-Dist'. + Note: this field is now deprecated in favor of ``Requires-Dist``. Provides (multiple use) Each entry contains a string describing a package or module that @@ -251,7 +253,7 @@ operator); the package's version number will be implied if none is specified. - Example:: + Examples:: Provides: xml Provides: xml.utils @@ -259,7 +261,7 @@ Provides: xml.dom Provides: xmltools (1.3) - Note: this field is now deprecated in favor of 'Provides-Dist'. + Note: this field is now deprecated in favor of ``Provides-Dist``. Obsoletes (multiple use) Each entry contains a string describing a package or module @@ -276,29 +278,28 @@ Obsoletes: Gorgon - Note: this field is now deprecated in favor of 'Obsoletes-Dist'. + Note: this field is now deprecated in favor of ``Obsoletes-Dist``. Requires-Dist (multiple use) Each entry contains a string naming some other distutils project required by this package. The format of a requirement string is identical to that of a - distutils project name (e.g., as found in the 'Name:' field. + distutils project name (e.g., as found in the ``Name:`` field. optionally followed by a version declaration within parentheses. + The distutils project names should correspond to names as found + on the `Python Package Index`_. + A version declaration is a series of conditional operators and version numbers, separated by commas. Conditional operators must be one of "<", ">", "<=", ">=", "==", and "!=". Version - numbers must be in the format accepted by the - 'verlib.py' module (see PEP ###). + numbers must be in the format specified in `Version Specifiers`_. Any number of conditional operators can be specified, e.g. the string ">1.0, !=1.3.4, <2.0" is a legal version declaration. - The distutils project names should correspond to names as found - on the Python Package Index (PyPI, see PEP ###). - - Example:: + Examples:: Requires-Dist: pkginfo Requires-Dist: PasteDeploy @@ -307,69 +308,75 @@ Provides-Dist (multiple use) Each entry contains a string naming a distutlis project which is contained within this distribution. This field *must* include - the project identified in the 'Name' field. + the project identified in the ``Name`` field. A distribution may provide additional names, e.g. to indicate that - multiple projects have been bundled together. + multiple projects have been bundled together. For instance, source + distributions of the ``ZODB`` project have historically included + the ``transaction`` project, which is now available as a separate + distribution. Installing such a source distribution satisfies + requirements for both ``ZODB`` and ``transaction``. A distribution may also provide a "virtual" project name, which does not correspond to any separately-distributed project: such a name might be used to indicate an abstract capability which could be supplied - by one of multiple projects. + by one of multiple projects. E.g., multiple projects might supply + RDBMS bindings for use by a given ORM: each project might declare + that it provides ``ORM-bindings``, allowing other projects to depend + only on having at most one of them installed. A version declaration may be supplied (without a comparison - operator); the package's version number will be implied if none - is specified. + operator); the distribution's version number will be implied if none + is specified. Version numbers must be in the format specified in + `Version Specifiers`_. - Example:: + Examples:: Provides-Dist: OtherPackage + Provides-Dist: AnotherPackage (3.4) Provides-Dist: virtual_package Obsoletes-Dist (multiple use) Each entry contains a string describing a distutils project which this package renders obsolete, meaning that the two packages - should not be installed at the same time. Version declarations - can be supplied. + should not be installed at the same time. + + Version declarations can be supplied. Version numbers must be in the + format specified in `Version Specifiers`_. The most common use of this field will be in case a project name changes, e.g. Gorgon 2.3 gets subsumed into Torqued Python 1.0. When you install Torqued Python, the Gorgon distribution should be removed. - Example:: + Examples:: Obsoletes-Dist: Gorgon + Obsoletes-Dist: OtherPackage (<3.0) Requires-Python This field specifies the Python version(s) that the package is guaranteed to be compatible with. The format of the field is a series of conditional operators and version numbers, separated by commas. Conditional operators must be one of "<", ">", "<=", - ">=", "==", and "!=". Version numbers must be in the format - accepted by the distutils.version.StrictVersion class: two or three - dot-separated numeric components, with an optional "pre-release" - tag on the end consisting of the letter 'a' or 'b' followed by a - number. Example version numbers are "1.0", "2.3a2" and "1.3.99". + ">=", "==", and "!=". + + Version numbers must be in the format specified in `Version Specifiers`_. Any number of conditional operators can be specified, e.g. the string ">1.0, !=1.3.4, <2.0" is a legal version declaration. - Example:: + Examples:: Requires-Python: >2.1 Requires-Python: >=2.3.4 - XXX This field doesn't take into account possible future - incompatibilities through deprecation. We could specify that the - ">" operator only work for up to two releases? This is based on - the typical deprecation plan that Python usually follows (warning - for two releases and then error). That is, >=2.3.4 works for - 2.3.4, 2.4 and 2.5. Requires-External (multiple use) Each entry contains a string describing some dependency in the - system that the package is to be used. + system that the package is to be used. This field is intended to + serve as a hint to downstream package maintainers, and has no + semantics which are meaningful to the ``distutils`` package. The format of a requirement string is a name of an external dependency, optionally followed by a version declaration within @@ -377,45 +384,48 @@ A version declaration is a series of conditional operators and version numbers, separated by commas. Conditional operators - must be one of "<", ">", "<=", ">=", "==", and "!=". Version - numbers must be in the format accepted by the - distutils.version.StrictVersion class: two or three - dot-separated numeric components, with an optional "pre-release" - tag on the end consisting of the letter 'a' or 'b' followed by a - number. Example version numbers are "1.0", "2.3a2", "1.3.99", + must be one of "<", ">", "<=", ">=", "==", and "!=". Because they + refer to non-Python software releases, version numbers for + this field are **not** required to conform to the format + specified in `Version Specifiers`_: they should correspond to the + version scheme used by the external dependency. Any number of conditional operators can be specified, e.g. the string ">1.0, !=1.3.4, <2.0" is a legal version declaration. The canonical list of what strings are allowed is available - in the `Cheese Shop`_ database. New names may be added to the - database either through the web or using the command-line; - Python community is left to choose its own standards. + in the `Python Package Index`_ database: see + `External References Registry`_ below for a description of how + the allowed values are managed. Some dependencies are anticipated to be quite broad, eg. "C", indicating a C compiler is required. - Example:: + Examples:: Requires: C - Requires: libpng + Requires: libpng (>=1.5) Copyright Indicates the party or parties, and the year of copyright covering the package. - Example:: + Examples:: Copyright: Guido van Rossum, 1991 Copyright: Python Software Foundation, 2005 Copyright: Public Domain +Version Specifiers +================== + +(TODO: fill in the ``verlib.py`` specification here). External References Registry ============================ -Stores in the `Cheese Shop`_ database a list of (name, description, +Stores in the `Python Package Index`_ database a list of (name, description, URI) identifying an external reference that may be used as a value in a Requires-External field. @@ -427,13 +437,13 @@ The names in the registry will be created under a first-comes first-wins basis. Other packagers of Python software (eg. to deb, rpm, etc) should be -able to translate the requires-external field to names in their own +able to translate the `Requires-external` field to names in their own packaging system. XXX command-line interface needs work, obviously Summary of Differences From PEP 314 ------------------------------------ +=================================== * Metadata-Version is now 1.2. @@ -464,7 +474,7 @@ .. [1] reStructuredText markup: http://docutils.sourceforge.net/ -.. _`Cheese Shop`: http://cheeseshop.python.org/ +.. _`Python Package Index`: http://pypi.python.org/pypi/ Copyright From buildbot at python.org Thu May 7 17:11:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 07 May 2009 15:11:27 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090507151137.5CA921E4002@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/765 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_thread.py", line 49, in task self.done_mutex.release() _thread.error: release unlocked lock 1 test failed: test_time make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu May 7 18:27:03 2009 From: python-checkins at python.org (r.david.murray) Date: Thu, 7 May 2009 18:27:03 +0200 (CEST) Subject: [Python-checkins] r72425 - in python/trunk/Lib: aifc.py test/test_aifc.py Message-ID: <20090507162703.1CE151E4016@bag.python.org> Author: r.david.murray Date: Thu May 7 18:27:02 2009 New Revision: 72425 Log: Issue5955: aifc's close method did not close the file it wrapped, now it does. This also means getfp method now returns the real fp. Modified: python/trunk/Lib/aifc.py python/trunk/Lib/test/test_aifc.py Modified: python/trunk/Lib/aifc.py ============================================================================== --- python/trunk/Lib/aifc.py (original) +++ python/trunk/Lib/aifc.py Thu May 7 18:27:02 2009 @@ -282,10 +282,11 @@ self._convert = None self._markers = [] self._soundpos = 0 - self._file = Chunk(file) - if self._file.getname() != 'FORM': + self._file = file + chunk = Chunk(file) + if chunk.getname() != 'FORM': raise Error, 'file does not start with FORM id' - formdata = self._file.read(4) + formdata = chunk.read(4) if formdata == 'AIFF': self._aifc = 0 elif formdata == 'AIFC': Modified: python/trunk/Lib/test/test_aifc.py ============================================================================== --- python/trunk/Lib/test/test_aifc.py (original) +++ python/trunk/Lib/test/test_aifc.py Thu May 7 18:27:02 2009 @@ -91,6 +91,21 @@ # XXX: this test fails, not sure if it should succeed or not # self.assertEqual(f.readframes(5), fout.readframes(5)) + def test_close(self): + class Wrapfile(object): + def __init__(self, file): + self.file = open(file) + self.closed = False + def close(self): + self.file.close() + self.closed = True + def __getattr__(self, attr): return getattr(self.file, attr) + testfile = Wrapfile(self.sndfilepath) + f = self.f = aifc.open(testfile) + self.assertEqual(testfile.closed, False) + f.close() + self.assertEqual(testfile.closed, True) + def test_main(): run_unittest(AIFCTest) From python-checkins at python.org Thu May 7 18:29:19 2009 From: python-checkins at python.org (r.david.murray) Date: Thu, 7 May 2009 18:29:19 +0200 (CEST) Subject: [Python-checkins] r72426 - python/trunk/Misc/NEWS Message-ID: <20090507162919.EB2D71E4002@bag.python.org> Author: r.david.murray Date: Thu May 7 18:29:19 2009 New Revision: 72426 Log: News item for Issue5955. Modified: python/trunk/Misc/NEWS Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu May 7 18:29:19 2009 @@ -285,6 +285,9 @@ Library ------- +- Issue 5955: aifc's close method did not close the file it wrapped, + now it does. This also means getfp method now returns the real fp. + - Issue #4875: On win32, ctypes.util.find_library does no longer return directories. From python-checkins at python.org Thu May 7 18:37:01 2009 From: python-checkins at python.org (mark.dickinson) Date: Thu, 7 May 2009 18:37:01 +0200 (CEST) Subject: [Python-checkins] r72427 - python/branches/py3k/Misc/NEWS Message-ID: <20090507163701.D74C11E4002@bag.python.org> Author: mark.dickinson Date: Thu May 7 18:37:01 2009 New Revision: 72427 Log: Misc/NEWS entry for r72248 Modified: python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu May 7 18:37:01 2009 @@ -24,6 +24,9 @@ Core and Builtins ----------------- +- Issue #5914: Add new C API function PyOS_string_to_double, and + deprecate PyOS_ascii_strtod and PyOS_ascii_atof. + - Issue #3382: float.__format__, complex.__format__, and %-formatting no longer map 'F' to 'f'. Because of issue #5859 (below), this only affects nan -> NAN and inf -> INF. From python-checkins at python.org Thu May 7 18:37:44 2009 From: python-checkins at python.org (mark.dickinson) Date: Thu, 7 May 2009 18:37:44 +0200 (CEST) Subject: [Python-checkins] r72428 - python/branches/release30-maint Message-ID: <20090507163744.82B211E4002@bag.python.org> Author: mark.dickinson Date: Thu May 7 18:37:44 2009 New Revision: 72428 Log: Blocked revisions 72427 via svnmerge ........ r72427 | mark.dickinson | 2009-05-07 17:37:01 +0100 (Thu, 07 May 2009) | 2 lines Misc/NEWS entry for r72248 ........ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Thu May 7 18:45:44 2009 From: python-checkins at python.org (r.david.murray) Date: Thu, 7 May 2009 18:45:44 +0200 (CEST) Subject: [Python-checkins] r72429 - in python/branches/release26-maint: Lib/aifc.py Lib/test/test_aifc.py Misc/NEWS Message-ID: <20090507164544.9BA451E402B@bag.python.org> Author: r.david.murray Date: Thu May 7 18:45:44 2009 New Revision: 72429 Log: Merged revisions 72422,72425-72426 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72422 | benjamin.peterson | 2009-05-07 07:45:38 -0400 (Thu, 07 May 2009) | 1 line actually close files instead of leaving it to the gc #5955 ........ r72425 | r.david.murray | 2009-05-07 12:27:02 -0400 (Thu, 07 May 2009) | 3 lines Issue5955: aifc's close method did not close the file it wrapped, now it does. This also means getfp method now returns the real fp. ........ r72426 | r.david.murray | 2009-05-07 12:29:19 -0400 (Thu, 07 May 2009) | 3 lines News item for Issue5955. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/aifc.py python/branches/release26-maint/Lib/test/test_aifc.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/aifc.py ============================================================================== --- python/branches/release26-maint/Lib/aifc.py (original) +++ python/branches/release26-maint/Lib/aifc.py Thu May 7 18:45:44 2009 @@ -282,10 +282,11 @@ self._convert = None self._markers = [] self._soundpos = 0 - self._file = Chunk(file) - if self._file.getname() != 'FORM': + self._file = file + chunk = Chunk(file) + if chunk.getname() != 'FORM': raise Error, 'file does not start with FORM id' - formdata = self._file.read(4) + formdata = chunk.read(4) if formdata == 'AIFF': self._aifc = 0 elif formdata == 'AIFC': @@ -347,7 +348,7 @@ if self._decomp: self._decomp.CloseDecompressor() self._decomp = None - self._file = None + self._file.close() def tell(self): return self._soundpos @@ -732,8 +733,7 @@ if self._comp: self._comp.CloseCompressor() self._comp = None - self._file.flush() - self._file = None + self._file.close() # # Internal methods. Modified: python/branches/release26-maint/Lib/test/test_aifc.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_aifc.py (original) +++ python/branches/release26-maint/Lib/test/test_aifc.py Thu May 7 18:45:44 2009 @@ -45,6 +45,21 @@ #XXX Need more tests! + def test_close(self): + class Wrapfile(object): + def __init__(self, file): + self.file = open(file) + self.closed = False + def close(self): + self.file.close() + self.closed = True + def __getattr__(self, attr): return getattr(self.file, attr) + testfile = Wrapfile(self.sndfilepath) + f = self.f = aifc.open(testfile) + self.assertEqual(testfile.closed, False) + f.close() + self.assertEqual(testfile.closed, True) + def test_main(): run_unittest(AIFCTest) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Thu May 7 18:45:44 2009 @@ -40,6 +40,9 @@ Library ------- +- Issue 5955: aifc's close method did not close the file it wrapped, + now it does. This also means getfp method now returns the real fp. + - Issue #4875: On win32, ctypes.util.find_library does no longer return directories. From python-checkins at python.org Thu May 7 20:09:58 2009 From: python-checkins at python.org (r.david.murray) Date: Thu, 7 May 2009 20:09:58 +0200 (CEST) Subject: [Python-checkins] r72434 - python/trunk/Lib/test/test_aifc.py Message-ID: <20090507180958.E720A1E401E@bag.python.org> Author: r.david.murray Date: Thu May 7 20:09:58 2009 New Revision: 72434 Log: Pre-opened test file needs to be opened in binary mode. Modified: python/trunk/Lib/test/test_aifc.py Modified: python/trunk/Lib/test/test_aifc.py ============================================================================== --- python/trunk/Lib/test/test_aifc.py (original) +++ python/trunk/Lib/test/test_aifc.py Thu May 7 20:09:58 2009 @@ -94,7 +94,7 @@ def test_close(self): class Wrapfile(object): def __init__(self, file): - self.file = open(file) + self.file = open(file, 'rb') self.closed = False def close(self): self.file.close() From python-checkins at python.org Thu May 7 20:24:38 2009 From: python-checkins at python.org (r.david.murray) Date: Thu, 7 May 2009 20:24:38 +0200 (CEST) Subject: [Python-checkins] r72435 - in python/branches/py3k: Lib/aifc.py Lib/test/test_aifc.py Misc/NEWS Message-ID: <20090507182438.494A31E4016@bag.python.org> Author: r.david.murray Date: Thu May 7 20:24:38 2009 New Revision: 72435 Log: Merged revisions 72425-72426 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72425 | r.david.murray | 2009-05-07 12:27:02 -0400 (Thu, 07 May 2009) | 3 lines Issue5955: aifc's close method did not close the file it wrapped, now it does. This also means getfp method now returns the real fp. ........ r72426 | r.david.murray | 2009-05-07 12:29:19 -0400 (Thu, 07 May 2009) | 3 lines News item for Issue5955. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/aifc.py python/branches/py3k/Lib/test/test_aifc.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/aifc.py ============================================================================== --- python/branches/py3k/Lib/aifc.py (original) +++ python/branches/py3k/Lib/aifc.py Thu May 7 20:24:38 2009 @@ -281,10 +281,11 @@ self._convert = None self._markers = [] self._soundpos = 0 - self._file = Chunk(file) - if self._file.getname() != b'FORM': + self._file = file + chunk = Chunk(file) + if chunk.getname() != b'FORM': raise Error('file does not start with FORM id') - formdata = self._file.read(4) + formdata = chunk.read(4) if formdata == b'AIFF': self._aifc = 0 elif formdata == b'AIFC': Modified: python/branches/py3k/Lib/test/test_aifc.py ============================================================================== --- python/branches/py3k/Lib/test/test_aifc.py (original) +++ python/branches/py3k/Lib/test/test_aifc.py Thu May 7 20:24:38 2009 @@ -94,6 +94,21 @@ # XXX: this test fails, not sure if it should succeed or not # self.assertEqual(f.readframes(5), fout.readframes(5)) + def test_close(self): + class Wrapfile(object): + def __init__(self, file): + self.file = open(file, 'rb') + self.closed = False + def close(self): + self.file.close() + self.closed = True + def __getattr__(self, attr): return getattr(self.file, attr) + testfile = Wrapfile(self.sndfilepath) + f = self.f = aifc.open(testfile) + self.assertEqual(testfile.closed, False) + f.close() + self.assertEqual(testfile.closed, True) + def test_main(): run_unittest(AIFCTest) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu May 7 20:24:38 2009 @@ -15,6 +15,9 @@ Library ------- +- Issue 5955: aifc's close method did not close the file it wrapped, + now it does. This also means getfp method now returns the real fp. + What's New in Python 3.1 beta 1? ================================ From python-checkins at python.org Thu May 7 20:25:20 2009 From: python-checkins at python.org (r.david.murray) Date: Thu, 7 May 2009 20:25:20 +0200 (CEST) Subject: [Python-checkins] r72436 - in python/branches/release26-maint: Lib/test/test_aifc.py Message-ID: <20090507182520.A94641E409D@bag.python.org> Author: r.david.murray Date: Thu May 7 20:25:20 2009 New Revision: 72436 Log: Merged revisions 72434 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72434 | r.david.murray | 2009-05-07 14:09:58 -0400 (Thu, 07 May 2009) | 2 lines Pre-opened test file needs to be opened in binary mode. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_aifc.py Modified: python/branches/release26-maint/Lib/test/test_aifc.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_aifc.py (original) +++ python/branches/release26-maint/Lib/test/test_aifc.py Thu May 7 20:25:20 2009 @@ -48,7 +48,7 @@ def test_close(self): class Wrapfile(object): def __init__(self, file): - self.file = open(file) + self.file = open(file, 'rb') self.closed = False def close(self): self.file.close() From python-checkins at python.org Thu May 7 20:55:11 2009 From: python-checkins at python.org (r.david.murray) Date: Thu, 7 May 2009 20:55:11 +0200 (CEST) Subject: [Python-checkins] r72437 - in python/branches/release30-maint: Lib/aifc.py Lib/test/test_aifc.py Misc/NEWS Message-ID: <20090507185511.5A46A1E4016@bag.python.org> Author: r.david.murray Date: Thu May 7 20:55:11 2009 New Revision: 72437 Log: Merged revisions 72423,72435 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72423 | benjamin.peterson | 2009-05-07 07:53:38 -0400 (Thu, 07 May 2009) | 9 lines Merged revisions 72422 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72422 | benjamin.peterson | 2009-05-07 06:45:38 -0500 (Thu, 07 May 2009) | 1 line actually close files instead of leaving it to the gc #5955 ........ ................ r72435 | r.david.murray | 2009-05-07 14:24:38 -0400 (Thu, 07 May 2009) | 14 lines Merged revisions 72425-72426 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72425 | r.david.murray | 2009-05-07 12:27:02 -0400 (Thu, 07 May 2009) | 3 lines Issue5955: aifc's close method did not close the file it wrapped, now it does. This also means getfp method now returns the real fp. ........ r72426 | r.david.murray | 2009-05-07 12:29:19 -0400 (Thu, 07 May 2009) | 3 lines News item for Issue5955. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/aifc.py python/branches/release30-maint/Lib/test/test_aifc.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/aifc.py ============================================================================== --- python/branches/release30-maint/Lib/aifc.py (original) +++ python/branches/release30-maint/Lib/aifc.py Thu May 7 20:55:11 2009 @@ -281,10 +281,11 @@ self._convert = None self._markers = [] self._soundpos = 0 - self._file = Chunk(file) - if self._file.getname() != b'FORM': + self._file = file + chunk = Chunk(file) + if chunk.getname() != b'FORM': raise Error('file does not start with FORM id') - formdata = self._file.read(4) + formdata = chunk.read(4) if formdata == b'AIFF': self._aifc = 0 elif formdata == b'AIFC': @@ -331,7 +332,7 @@ self._soundpos = 0 def close(self): - self._file = None + self._file.close() def tell(self): return self._soundpos @@ -690,8 +691,7 @@ self._datalength != self._datawritten or \ self._marklength: self._patchheader() - self._file.flush() - self._file = None + self._file.close() # # Internal methods. Modified: python/branches/release30-maint/Lib/test/test_aifc.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_aifc.py (original) +++ python/branches/release30-maint/Lib/test/test_aifc.py Thu May 7 20:55:11 2009 @@ -48,6 +48,21 @@ #XXX Need more tests! + def test_close(self): + class Wrapfile(object): + def __init__(self, file): + self.file = open(file, 'rb') + self.closed = False + def close(self): + self.file.close() + self.closed = True + def __getattr__(self, attr): return getattr(self.file, attr) + testfile = Wrapfile(self.sndfilepath) + f = self.f = aifc.open(testfile) + self.assertEqual(testfile.closed, False) + f.close() + self.assertEqual(testfile.closed, True) + def test_main(): run_unittest(AIFCTest) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Thu May 7 20:55:11 2009 @@ -55,6 +55,9 @@ Library ------- +- Issue #5955: aifc's close method did not close the file it wrapped, + now it does. This also means getfp method now returns the real fp. + - Issue #5940: distutils.command.build_clib.check_library_list was not doing the right type checkings anymore. From python-checkins at python.org Thu May 7 21:14:15 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 7 May 2009 21:14:15 +0200 (CEST) Subject: [Python-checkins] r72438 - python/branches/py3k/Demo/metaclasses Message-ID: <20090507191415.0D23A1E40F5@bag.python.org> Author: benjamin.peterson Date: Thu May 7 21:14:14 2009 New Revision: 72438 Log: remove old metaclass demos Removed: python/branches/py3k/Demo/metaclasses/ From buildbot at python.org Thu May 7 21:19:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 07 May 2009 19:19:06 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090507191906.53E4C1E401C@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/478 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/threading.py", line 524, in __bootstrap_inner self.run() File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/bsddb/test/test_thread.py", line 306, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/bsddb/dbutils.py", line 68, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30994, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') 1 test failed: test_os make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu May 7 21:36:09 2009 From: python-checkins at python.org (eric.smith) Date: Thu, 7 May 2009 21:36:09 +0200 (CEST) Subject: [Python-checkins] r72439 - python/trunk/Doc/library/string.rst Message-ID: <20090507193609.476031E4016@bag.python.org> Author: eric.smith Date: Thu May 7 21:36:09 2009 New Revision: 72439 Log: Fixed wording for formatting integers: precision is not allowed. Modified: python/trunk/Doc/library/string.rst Modified: python/trunk/Doc/library/string.rst ============================================================================== --- python/trunk/Doc/library/string.rst (original) +++ python/trunk/Doc/library/string.rst Thu May 7 21:36:09 2009 @@ -395,7 +395,7 @@ ``'f'`` and ``'F'``, or before and after the decimal point for a floating point value formatted with ``'g'`` or ``'G'``. For non-number types the field indicates the maximum field size - in other words, how many characters will be -used from the field content. The *precision* is ignored for integer values. +used from the field content. The *precision* is not allowed for integer values. Finally, the *type* determines how the data should be presented. From python-checkins at python.org Thu May 7 21:37:22 2009 From: python-checkins at python.org (eric.smith) Date: Thu, 7 May 2009 21:37:22 +0200 (CEST) Subject: [Python-checkins] r72440 - in python/branches/release26-maint: Doc/library/string.rst Message-ID: <20090507193722.5E2391E4016@bag.python.org> Author: eric.smith Date: Thu May 7 21:37:22 2009 New Revision: 72440 Log: Merged revisions 72439 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72439 | eric.smith | 2009-05-07 15:36:09 -0400 (Thu, 07 May 2009) | 1 line Fixed wording for formatting integers: precision is not allowed. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/library/string.rst Modified: python/branches/release26-maint/Doc/library/string.rst ============================================================================== --- python/branches/release26-maint/Doc/library/string.rst (original) +++ python/branches/release26-maint/Doc/library/string.rst Thu May 7 21:37:22 2009 @@ -388,7 +388,7 @@ ``'f'`` and ``'F'``, or before and after the decimal point for a floating point value formatted with ``'g'`` or ``'G'``. For non-number types the field indicates the maximum field size - in other words, how many characters will be -used from the field content. The *precision* is ignored for integer values. +used from the field content. The *precision* is not allowed for integer values. Finally, the *type* determines how the data should be presented. From python-checkins at python.org Thu May 7 21:38:09 2009 From: python-checkins at python.org (eric.smith) Date: Thu, 7 May 2009 21:38:09 +0200 (CEST) Subject: [Python-checkins] r72441 - in python/branches/py3k: Doc/library/string.rst Message-ID: <20090507193809.C36CE1E4016@bag.python.org> Author: eric.smith Date: Thu May 7 21:38:09 2009 New Revision: 72441 Log: Merged revisions 72439 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72439 | eric.smith | 2009-05-07 15:36:09 -0400 (Thu, 07 May 2009) | 1 line Fixed wording for formatting integers: precision is not allowed. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/string.rst Modified: python/branches/py3k/Doc/library/string.rst ============================================================================== --- python/branches/py3k/Doc/library/string.rst (original) +++ python/branches/py3k/Doc/library/string.rst Thu May 7 21:38:09 2009 @@ -370,7 +370,7 @@ ``'f'`` and ``'F'``, or before and after the decimal point for a floating point value formatted with ``'g'`` or ``'G'``. For non-number types the field indicates the maximum field size - in other words, how many characters will be -used from the field content. The *precision* is ignored for integer values. +used from the field content. The *precision* is not allowed for integer values. Finally, the *type* determines how the data should be presented. From python-checkins at python.org Thu May 7 21:39:04 2009 From: python-checkins at python.org (eric.smith) Date: Thu, 7 May 2009 21:39:04 +0200 (CEST) Subject: [Python-checkins] r72442 - in python/branches/release30-maint: Doc/library/string.rst Message-ID: <20090507193904.F368E1E4016@bag.python.org> Author: eric.smith Date: Thu May 7 21:39:04 2009 New Revision: 72442 Log: Merged revisions 72441 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72441 | eric.smith | 2009-05-07 15:38:09 -0400 (Thu, 07 May 2009) | 9 lines Merged revisions 72439 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72439 | eric.smith | 2009-05-07 15:36:09 -0400 (Thu, 07 May 2009) | 1 line Fixed wording for formatting integers: precision is not allowed. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/library/string.rst Modified: python/branches/release30-maint/Doc/library/string.rst ============================================================================== --- python/branches/release30-maint/Doc/library/string.rst (original) +++ python/branches/release30-maint/Doc/library/string.rst Thu May 7 21:39:04 2009 @@ -365,7 +365,7 @@ ``'f'`` and ``'F'``, or before and after the decimal point for a floating point value formatted with ``'g'`` or ``'G'``. For non-number types the field indicates the maximum field size - in other words, how many characters will be -used from the field content. The *precision* is ignored for integer values. +used from the field content. The *precision* is not allowed for integer values. Finally, the *type* determines how the data should be presented. From buildbot at python.org Thu May 7 22:10:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 07 May 2009 20:10:07 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090507201007.CE84C1E402E@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/921 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,eric.smith BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_os make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu May 7 23:04:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 07 May 2009 21:04:20 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090507210420.D11AB1E4016@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/715 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.dickinson,r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_os test_time make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu May 7 23:13:02 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 7 May 2009 23:13:02 +0200 (CEST) Subject: [Python-checkins] r72443 - python/trunk/Lib/distutils/command/build_clib.py Message-ID: <20090507211302.3DCB41E4002@bag.python.org> Author: tarek.ziade Date: Thu May 7 23:13:02 2009 New Revision: 72443 Log: removed remaining spaces Modified: python/trunk/Lib/distutils/command/build_clib.py Modified: python/trunk/Lib/distutils/command/build_clib.py ============================================================================== --- python/trunk/Lib/distutils/command/build_clib.py (original) +++ python/trunk/Lib/distutils/command/build_clib.py Thu May 7 23:13:02 2009 @@ -22,12 +22,12 @@ from distutils.sysconfig import customize_compiler from distutils import log -def show_compilers (): +def show_compilers(): from distutils.ccompiler import show_compilers show_compilers() -class build_clib (Command): +class build_clib(Command): description = "build C/C++ libraries used by Python extensions" @@ -178,7 +178,7 @@ filenames.extend(sources) return filenames - def build_libraries (self, libraries): + def build_libraries(self, libraries): for (lib_name, build_info) in libraries: sources = build_info.get('sources') if sources is None or not isinstance(sources, (list, tuple)): From python-checkins at python.org Thu May 7 23:14:34 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 7 May 2009 23:14:34 +0200 (CEST) Subject: [Python-checkins] r72444 - python/branches/py3k Message-ID: <20090507211434.302621E4002@bag.python.org> Author: tarek.ziade Date: Thu May 7 23:14:34 2009 New Revision: 72444 Log: Blocked revisions 72443 via svnmerge ........ r72443 | tarek.ziade | 2009-05-07 23:13:02 +0200 (Thu, 07 May 2009) | 1 line removed remaining spaces ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Thu May 7 23:20:35 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 7 May 2009 23:20:35 +0200 (CEST) Subject: [Python-checkins] r72445 - in python/trunk: Lib/distutils/sysconfig.py Lib/distutils/tests/test_build_clib.py Lib/distutils/tests/test_sysconfig.py Makefile.pre.in Misc/ACKS Misc/NEWS configure.in Message-ID: <20090507212035.6C5851E4016@bag.python.org> Author: tarek.ziade Date: Thu May 7 23:20:34 2009 New Revision: 72445 Log: Fixed #5941: added ARFLAGS for the archiver command. Modified: python/trunk/Lib/distutils/sysconfig.py python/trunk/Lib/distutils/tests/test_build_clib.py python/trunk/Lib/distutils/tests/test_sysconfig.py python/trunk/Makefile.pre.in python/trunk/Misc/ACKS python/trunk/Misc/NEWS python/trunk/configure.in Modified: python/trunk/Lib/distutils/sysconfig.py ============================================================================== --- python/trunk/Lib/distutils/sysconfig.py (original) +++ python/trunk/Lib/distutils/sysconfig.py Thu May 7 23:20:34 2009 @@ -165,9 +165,9 @@ varies across Unices and is stored in Python's Makefile. """ if compiler.compiler_type == "unix": - (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar) = \ + (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \ get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', - 'CCSHARED', 'LDSHARED', 'SO', 'AR') + 'CCSHARED', 'LDSHARED', 'SO', 'AR', 'ARFLAGS') if 'CC' in os.environ: cc = os.environ['CC'] @@ -190,6 +190,10 @@ ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] if 'AR' in os.environ: ar = os.environ['AR'] + if 'ARFLAGS' in os.environ: + archiver = ar + ' ' + os.environ['ARFLAGS'] + else: + archiver = ar + ' ' + ar_flags cc_cmd = cc + ' ' + cflags compiler.set_executables( @@ -199,7 +203,7 @@ compiler_cxx=cxx, linker_so=ldshared, linker_exe=cc, - archiver=ar) + archiver=archiver) compiler.shared_lib_extension = so_ext Modified: python/trunk/Lib/distutils/tests/test_build_clib.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_build_clib.py (original) +++ python/trunk/Lib/distutils/tests/test_build_clib.py Thu May 7 23:20:34 2009 @@ -1,9 +1,12 @@ """Tests for distutils.command.build_clib.""" import unittest +import os +import sys from distutils.command.build_clib import build_clib from distutils.errors import DistutilsSetupError from distutils.tests import support +from distutils.spawn import find_executable class BuildCLibTestCase(support.TempdirManager, support.LoggingSilencer, @@ -97,6 +100,43 @@ cmd.distribution.libraries = 'WONTWORK' self.assertRaises(DistutilsSetupError, cmd.finalize_options) + def test_run(self): + # can't test on windows + if sys.platform == 'win32': + return + + pkg_dir, dist = self.create_dist() + cmd = build_clib(dist) + + foo_c = os.path.join(pkg_dir, 'foo.c') + self.write_file(foo_c, 'int main(void) { return 1;}') + cmd.libraries = [('foo', {'sources': [foo_c]})] + + build_temp = os.path.join(pkg_dir, 'build') + os.mkdir(build_temp) + cmd.build_temp = build_temp + cmd.build_clib = build_temp + + # before we run the command, we want to make sure + # all commands are present on the system + # by creating a compiler and checking its executables + from distutils.ccompiler import new_compiler + from distutils.sysconfig import customize_compiler + + compiler = new_compiler() + customize_compiler(compiler) + for ccmd in compiler.executables.values(): + if ccmd is None: + continue + if find_executable(ccmd[0]) is None: + return # can't test + + # this should work + cmd.run() + + # let's check the result + self.assert_('libfoo.a' in os.listdir(build_temp)) + def test_suite(): return unittest.makeSuite(BuildCLibTestCase) Modified: python/trunk/Lib/distutils/tests/test_sysconfig.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_sysconfig.py (original) +++ python/trunk/Lib/distutils/tests/test_sysconfig.py Thu May 7 23:20:34 2009 @@ -49,7 +49,8 @@ if get_default_compiler() != 'unix': return - os.environ['AR'] = 'xxx' + os.environ['AR'] = 'my_ar' + os.environ['ARFLAGS'] = '-arflags' # make sure AR gets caught class compiler: @@ -60,7 +61,7 @@ comp = compiler() sysconfig.customize_compiler(comp) - self.assertEquals(comp.exes['archiver'], 'xxx') + self.assertEquals(comp.exes['archiver'], 'my_ar -arflags') def test_suite(): Modified: python/trunk/Makefile.pre.in ============================================================================== --- python/trunk/Makefile.pre.in (original) +++ python/trunk/Makefile.pre.in Thu May 7 23:20:34 2009 @@ -67,6 +67,7 @@ SGI_ABI= @SGI_ABI@ CCSHARED= @CCSHARED@ LINKFORSHARED= @LINKFORSHARED@ +ARFLAGS= @ARFLAGS@ # Extra C flags added for building the interpreter object files. CFLAGSFORSHARED=@CFLAGSFORSHARED@ # C flags used for building the interpreter object files @@ -403,12 +404,12 @@ # avoid long command lines, same as LIBRARY_OBJS $(LIBRARY): $(LIBRARY_OBJS) -rm -f $@ - $(AR) cr $@ Modules/getbuildinfo.o - $(AR) cr $@ $(PARSER_OBJS) - $(AR) cr $@ $(OBJECT_OBJS) - $(AR) cr $@ $(PYTHON_OBJS) - $(AR) cr $@ $(MODULE_OBJS) $(SIGNAL_OBJS) - $(AR) cr $@ $(MODOBJS) + $(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o + $(AR) $(ARFLAGS) $@ $(PARSER_OBJS) + $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS) + $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS) + $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS) + $(AR) $(ARFLAGS) $@ $(MODOBJS) $(RANLIB) $@ libpython$(VERSION).so: $(LIBRARY_OBJS) Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Thu May 7 23:20:34 2009 @@ -145,6 +145,7 @@ David Costanzo Scott Cotton Greg Couch +David Cournapeau Steve Cousins Alex Coventry Matthew Dixon Cowles Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu May 7 23:20:34 2009 @@ -285,6 +285,11 @@ Library ------- +- Issue #5941: Distutils build_clib command was not working anymore because + of an incomplete costumization of the archiver command. Added ARFLAGS in the + Makefile besides AR and make Distutils use it. Original patch by David + Cournapeau. + - Issue 5955: aifc's close method did not close the file it wrapped, now it does. This also means getfp method now returns the real fp. Modified: python/trunk/configure.in ============================================================================== --- python/trunk/configure.in (original) +++ python/trunk/configure.in Thu May 7 23:20:34 2009 @@ -770,6 +770,13 @@ AC_SUBST(AR) AC_CHECK_PROGS(AR, ar aal, ar) +# tweak ARFLAGS only if the user didn't set it on the command line +AC_SUBST(ARFLAGS) +if test -z "$ARFLAGS" +then + ARFLAGS="rc" +fi + AC_SUBST(SVNVERSION) AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found) if test $SVNVERSION = found From python-checkins at python.org Thu May 7 23:24:44 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 7 May 2009 23:24:44 +0200 (CEST) Subject: [Python-checkins] r72446 - in python/branches/py3k: Lib/distutils/sysconfig.py Lib/distutils/tests/test_build_clib.py Lib/distutils/tests/test_sysconfig.py Makefile.pre.in Misc/ACKS Misc/NEWS configure.in Message-ID: <20090507212444.241271E4002@bag.python.org> Author: tarek.ziade Date: Thu May 7 23:24:43 2009 New Revision: 72446 Log: Merged revisions 72445 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72445 | tarek.ziade | 2009-05-07 23:20:34 +0200 (Thu, 07 May 2009) | 1 line Fixed #5941: added ARFLAGS for the archiver command. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/sysconfig.py python/branches/py3k/Lib/distutils/tests/test_build_clib.py python/branches/py3k/Lib/distutils/tests/test_sysconfig.py python/branches/py3k/Makefile.pre.in python/branches/py3k/Misc/ACKS python/branches/py3k/Misc/NEWS python/branches/py3k/configure.in Modified: python/branches/py3k/Lib/distutils/sysconfig.py ============================================================================== --- python/branches/py3k/Lib/distutils/sysconfig.py (original) +++ python/branches/py3k/Lib/distutils/sysconfig.py Thu May 7 23:24:43 2009 @@ -160,9 +160,9 @@ varies across Unices and is stored in Python's Makefile. """ if compiler.compiler_type == "unix": - (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar) = \ + (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \ get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', - 'CCSHARED', 'LDSHARED', 'SO', 'AR') + 'CCSHARED', 'LDSHARED', 'SO', 'AR', 'ARFLAGS') if 'CC' in os.environ: cc = os.environ['CC'] @@ -185,6 +185,10 @@ ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] if 'AR' in os.environ: ar = os.environ['AR'] + if 'ARFLAGS' in os.environ: + archiver = ar + ' ' + os.environ['ARFLAGS'] + else: + archiver = ar + ' ' + ar_flags cc_cmd = cc + ' ' + cflags compiler.set_executables( @@ -194,7 +198,7 @@ compiler_cxx=cxx, linker_so=ldshared, linker_exe=cc, - archiver=ar) + archiver=archiver) compiler.shared_lib_extension = so_ext Modified: python/branches/py3k/Lib/distutils/tests/test_build_clib.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_build_clib.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_build_clib.py Thu May 7 23:24:43 2009 @@ -1,9 +1,12 @@ """Tests for distutils.command.build_clib.""" import unittest +import os +import sys from distutils.command.build_clib import build_clib from distutils.errors import DistutilsSetupError from distutils.tests import support +from distutils.spawn import find_executable class BuildCLibTestCase(support.TempdirManager, support.LoggingSilencer, @@ -97,6 +100,43 @@ cmd.distribution.libraries = 'WONTWORK' self.assertRaises(DistutilsSetupError, cmd.finalize_options) + def test_run(self): + # can't test on windows + if sys.platform == 'win32': + return + + pkg_dir, dist = self.create_dist() + cmd = build_clib(dist) + + foo_c = os.path.join(pkg_dir, 'foo.c') + self.write_file(foo_c, 'int main(void) { return 1;}') + cmd.libraries = [('foo', {'sources': [foo_c]})] + + build_temp = os.path.join(pkg_dir, 'build') + os.mkdir(build_temp) + cmd.build_temp = build_temp + cmd.build_clib = build_temp + + # before we run the command, we want to make sure + # all commands are present on the system + # by creating a compiler and checking its executables + from distutils.ccompiler import new_compiler + from distutils.sysconfig import customize_compiler + + compiler = new_compiler() + customize_compiler(compiler) + for ccmd in compiler.executables.values(): + if ccmd is None: + continue + if find_executable(ccmd[0]) is None: + return # can't test + + # this should work + cmd.run() + + # let's check the result + self.assert_('libfoo.a' in os.listdir(build_temp)) + def test_suite(): return unittest.makeSuite(BuildCLibTestCase) Modified: python/branches/py3k/Lib/distutils/tests/test_sysconfig.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_sysconfig.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_sysconfig.py Thu May 7 23:24:43 2009 @@ -49,7 +49,8 @@ if get_default_compiler() != 'unix': return - os.environ['AR'] = 'xxx' + os.environ['AR'] = 'my_ar' + os.environ['ARFLAGS'] = '-arflags' # make sure AR gets caught class compiler: @@ -60,7 +61,7 @@ comp = compiler() sysconfig.customize_compiler(comp) - self.assertEquals(comp.exes['archiver'], 'xxx') + self.assertEquals(comp.exes['archiver'], 'my_ar -arflags') def test_suite(): Modified: python/branches/py3k/Makefile.pre.in ============================================================================== --- python/branches/py3k/Makefile.pre.in (original) +++ python/branches/py3k/Makefile.pre.in Thu May 7 23:24:43 2009 @@ -67,6 +67,7 @@ SGI_ABI= @SGI_ABI@ CCSHARED= @CCSHARED@ LINKFORSHARED= @LINKFORSHARED@ +ARFLAGS= @ARFLAGS@ # Extra C flags added for building the interpreter object files. CFLAGSFORSHARED=@CFLAGSFORSHARED@ # C flags used for building the interpreter object files @@ -422,12 +423,12 @@ # avoid long command lines, same as LIBRARY_OBJS $(LIBRARY): $(LIBRARY_OBJS) -rm -f $@ - $(AR) cr $@ Modules/getbuildinfo.o - $(AR) cr $@ $(PARSER_OBJS) - $(AR) cr $@ $(OBJECT_OBJS) - $(AR) cr $@ $(PYTHON_OBJS) - $(AR) cr $@ $(MODULE_OBJS) $(SIGNAL_OBJS) - $(AR) cr $@ $(MODOBJS) + $(AR) $(ARFLAGS) $@ Modules/getbuildinfo.o + $(AR) $(ARFLAGS) $@ $(PARSER_OBJS) + $(AR) $(ARFLAGS) $@ $(OBJECT_OBJS) + $(AR) $(ARFLAGS) $@ $(PYTHON_OBJS) + $(AR) $(ARFLAGS) $@ $(MODULE_OBJS) $(SIGNAL_OBJS) + $(AR) $(ARFLAGS) $@ $(MODOBJS) $(RANLIB) $@ libpython$(VERSION).so: $(LIBRARY_OBJS) Modified: python/branches/py3k/Misc/ACKS ============================================================================== --- python/branches/py3k/Misc/ACKS (original) +++ python/branches/py3k/Misc/ACKS Thu May 7 23:24:43 2009 @@ -144,6 +144,7 @@ David Costanzo Scott Cotton Greg Couch +David Cournapeau Steve Cousins Alex Coventry Matthew Dixon Cowles Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu May 7 23:24:43 2009 @@ -581,6 +581,11 @@ Library ------- +- Issue #5941: Distutils build_clib command was not working anymore because + of an incomplete costumization of the archiver command. Added ARFLAGS in the + Makefile besides AR and make Distutils use it. Original patch by David + Cournapeau. + - Issue #2245: aifc now skips chunk types it doesn't recognize, per spec. - Issue #5874: distutils.tests.test_config_cmd is not locale-sensitive Modified: python/branches/py3k/configure.in ============================================================================== --- python/branches/py3k/configure.in (original) +++ python/branches/py3k/configure.in Thu May 7 23:24:43 2009 @@ -726,6 +726,13 @@ AC_SUBST(AR) AC_CHECK_PROGS(AR, ar aal, ar) +# tweak ARFLAGS only if the user didn't set it on the command line +AC_SUBST(ARFLAGS) +if test -z "$ARFLAGS" +then + ARFLAGS="rc" +fi + AC_SUBST(SVNVERSION) AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found) if test $SVNVERSION = found From python-checkins at python.org Thu May 7 23:27:12 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 7 May 2009 23:27:12 +0200 (CEST) Subject: [Python-checkins] r72447 - python/branches/release30-maint Message-ID: <20090507212712.479621E4002@bag.python.org> Author: tarek.ziade Date: Thu May 7 23:27:11 2009 New Revision: 72447 Log: Blocked revisions 72446 via svnmerge ................ r72446 | tarek.ziade | 2009-05-07 23:24:43 +0200 (Thu, 07 May 2009) | 9 lines Merged revisions 72445 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72445 | tarek.ziade | 2009-05-07 23:20:34 +0200 (Thu, 07 May 2009) | 1 line Fixed #5941: added ARFLAGS for the archiver command. ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Thu May 7 23:29:02 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 7 May 2009 23:29:02 +0200 (CEST) Subject: [Python-checkins] r72448 - python/branches/release26-maint Message-ID: <20090507212902.3906B1E4002@bag.python.org> Author: tarek.ziade Date: Thu May 7 23:28:45 2009 New Revision: 72448 Log: Blocked revisions 72443 via svnmerge ........ r72443 | tarek.ziade | 2009-05-07 23:13:02 +0200 (Thu, 07 May 2009) | 1 line removed remaining spaces ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Thu May 7 23:29:53 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 7 May 2009 23:29:53 +0200 (CEST) Subject: [Python-checkins] r72449 - python/branches/release26-maint Message-ID: <20090507212953.2A54D1E4002@bag.python.org> Author: tarek.ziade Date: Thu May 7 23:29:52 2009 New Revision: 72449 Log: Blocked revisions 72445 via svnmerge ........ r72445 | tarek.ziade | 2009-05-07 23:20:34 +0200 (Thu, 07 May 2009) | 1 line Fixed #5941: added ARFLAGS for the archiver command. ........ Modified: python/branches/release26-maint/ (props changed) From buildbot at python.org Fri May 8 00:17:43 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 07 May 2009 22:17:43 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090507221743.469BA1E4016@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/923 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: tarek.ziade BUILD FAILED: failed compile sincerely, -The Buildbot From python-checkins at python.org Fri May 8 00:18:49 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 8 May 2009 00:18:49 +0200 (CEST) Subject: [Python-checkins] r72450 - python/branches/py3k/configure Message-ID: <20090507221849.3B72F1E4016@bag.python.org> Author: tarek.ziade Date: Fri May 8 00:18:49 2009 New Revision: 72450 Log: run autoconf (step forgotten in r72446) Modified: python/branches/py3k/configure Modified: python/branches/py3k/configure ============================================================================== --- python/branches/py3k/configure (original) +++ python/branches/py3k/configure Fri May 8 00:18:49 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 72144 . +# From configure.in Revision: 72446 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 3.1. # @@ -695,6 +695,7 @@ LINKCC RANLIB AR +ARFLAGS SVNVERSION INSTALL_PROGRAM INSTALL_SCRIPT @@ -4260,6 +4261,13 @@ test -n "$AR" || AR="ar" +# tweak ARFLAGS only if the user didn't set it on the command line + +if test -z "$ARFLAGS" +then + ARFLAGS="rc" +fi + # Extract the first word of "svnversion", so it can be a program name with args. set dummy svnversion; ac_word=$2 @@ -26090,6 +26098,7 @@ LINKCC!$LINKCC$ac_delim RANLIB!$RANLIB$ac_delim AR!$AR$ac_delim +ARFLAGS!$ARFLAGS$ac_delim SVNVERSION!$SVNVERSION$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim @@ -26107,7 +26116,6 @@ LINKFORSHARED!$LINKFORSHARED$ac_delim CFLAGSFORSHARED!$CFLAGSFORSHARED$ac_delim SHLIBS!$SHLIBS$ac_delim -USE_SIGNAL_MODULE!$USE_SIGNAL_MODULE$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -26149,6 +26157,7 @@ ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +USE_SIGNAL_MODULE!$USE_SIGNAL_MODULE$ac_delim SIGNAL_OBJS!$SIGNAL_OBJS$ac_delim USE_THREAD_MODULE!$USE_THREAD_MODULE$ac_delim LDLAST!$LDLAST$ac_delim @@ -26170,7 +26179,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 19; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 20; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 From python-checkins at python.org Fri May 8 00:19:27 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 8 May 2009 00:19:27 +0200 (CEST) Subject: [Python-checkins] r72451 - python/trunk/configure Message-ID: <20090507221927.9052F1E4023@bag.python.org> Author: tarek.ziade Date: Fri May 8 00:19:27 2009 New Revision: 72451 Log: run autoconf (step forgotten in r72445) Modified: python/trunk/configure Modified: python/trunk/configure ============================================================================== --- python/trunk/configure (original) +++ python/trunk/configure Fri May 8 00:19:27 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 72114 . +# From configure.in Revision: 72445 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.7. # @@ -697,6 +697,7 @@ LINKCC RANLIB AR +ARFLAGS SVNVERSION INSTALL_PROGRAM INSTALL_SCRIPT @@ -4312,6 +4313,13 @@ test -n "$AR" || AR="ar" +# tweak ARFLAGS only if the user didn't set it on the command line + +if test -z "$ARFLAGS" +then + ARFLAGS="rc" +fi + # Extract the first word of "svnversion", so it can be a program name with args. set dummy svnversion; ac_word=$2 @@ -26036,6 +26044,7 @@ LINKCC!$LINKCC$ac_delim RANLIB!$RANLIB$ac_delim AR!$AR$ac_delim +ARFLAGS!$ARFLAGS$ac_delim SVNVERSION!$SVNVERSION$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim @@ -26051,7 +26060,6 @@ BLDSHARED!$BLDSHARED$ac_delim CCSHARED!$CCSHARED$ac_delim LINKFORSHARED!$LINKFORSHARED$ac_delim -CFLAGSFORSHARED!$CFLAGSFORSHARED$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -26093,6 +26101,7 @@ ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +CFLAGSFORSHARED!$CFLAGSFORSHARED$ac_delim SHLIBS!$SHLIBS$ac_delim USE_SIGNAL_MODULE!$USE_SIGNAL_MODULE$ac_delim SIGNAL_OBJS!$SIGNAL_OBJS$ac_delim @@ -26117,7 +26126,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 22; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 23; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 From python-checkins at python.org Fri May 8 00:20:12 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 8 May 2009 00:20:12 +0200 (CEST) Subject: [Python-checkins] r72452 - python/branches/release26-maint Message-ID: <20090507222012.8EB8E1E4016@bag.python.org> Author: tarek.ziade Date: Fri May 8 00:20:12 2009 New Revision: 72452 Log: Blocked revisions 72451 via svnmerge ........ r72451 | tarek.ziade | 2009-05-08 00:19:27 +0200 (Fri, 08 May 2009) | 1 line run autoconf (step forgotten in r72445) ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri May 8 00:21:27 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 8 May 2009 00:21:27 +0200 (CEST) Subject: [Python-checkins] r72453 - python/branches/release30-maint Message-ID: <20090507222127.A62FF1E4062@bag.python.org> Author: tarek.ziade Date: Fri May 8 00:21:27 2009 New Revision: 72453 Log: Blocked revisions 72450 via svnmerge ........ r72450 | tarek.ziade | 2009-05-08 00:18:49 +0200 (Fri, 08 May 2009) | 1 line run autoconf (step forgotten in r72446) ........ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Fri May 8 01:01:56 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 8 May 2009 01:01:56 +0200 (CEST) Subject: [Python-checkins] r72454 - python/trunk/Lib/distutils/tests/test_sysconfig.py Message-ID: <20090507230156.65DC11E4016@bag.python.org> Author: tarek.ziade Date: Fri May 8 01:01:56 2009 New Revision: 72454 Log: fixed AR/ARFLAGS values in test_sysconfig Modified: python/trunk/Lib/distutils/tests/test_sysconfig.py Modified: python/trunk/Lib/distutils/tests/test_sysconfig.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_sysconfig.py (original) +++ python/trunk/Lib/distutils/tests/test_sysconfig.py Fri May 8 01:01:56 2009 @@ -11,11 +11,15 @@ class SysconfigTestCase(unittest.TestCase): def setUp(self): - self.old_AR = os.environ.get('AR') + self.old_flags = [('AR', os.environ.get('AR')), + ('ARFLAGS', os.environ.get('ARFLAGS'))] def tearDown(self): - if self.old_AR is not None: - os.environ['AR'] = self.old_AR + for name, value in self.old_flags: + if value is not None: + os.environ[name] = value + elif name in os.environ: + del os.environ[name] def test_get_config_h_filename(self): config_h = sysconfig.get_config_h_filename() From python-checkins at python.org Fri May 8 01:11:34 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 8 May 2009 01:11:34 +0200 (CEST) Subject: [Python-checkins] r72455 - in python/branches/py3k: Lib/distutils/tests/test_sysconfig.py Message-ID: <20090507231134.21F391E4016@bag.python.org> Author: tarek.ziade Date: Fri May 8 01:11:34 2009 New Revision: 72455 Log: Merged revisions 72454 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72454 | tarek.ziade | 2009-05-08 01:01:56 +0200 (Fri, 08 May 2009) | 1 line fixed AR/ARFLAGS values in test_sysconfig ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_sysconfig.py Modified: python/branches/py3k/Lib/distutils/tests/test_sysconfig.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_sysconfig.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_sysconfig.py Fri May 8 01:11:34 2009 @@ -11,11 +11,15 @@ class SysconfigTestCase(unittest.TestCase): def setUp(self): - self.old_AR = os.environ.get('AR') + self.old_flags = [('AR', os.environ.get('AR')), + ('ARFLAGS', os.environ.get('ARFLAGS'))] def tearDown(self): - if self.old_AR is not None: - os.environ['AR'] = self.old_AR + for name, value in self.old_flags: + if value is not None: + os.environ[name] = value + elif name in os.environ: + del os.environ[name] def test_get_config_h_filename(self): config_h = sysconfig.get_config_h_filename() From python-checkins at python.org Fri May 8 01:12:35 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 8 May 2009 01:12:35 +0200 (CEST) Subject: [Python-checkins] r72456 - python/branches/release26-maint Message-ID: <20090507231235.514971E4016@bag.python.org> Author: tarek.ziade Date: Fri May 8 01:12:35 2009 New Revision: 72456 Log: Blocked revisions 72454 via svnmerge ........ r72454 | tarek.ziade | 2009-05-08 01:01:56 +0200 (Fri, 08 May 2009) | 1 line fixed AR/ARFLAGS values in test_sysconfig ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri May 8 01:13:30 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 8 May 2009 01:13:30 +0200 (CEST) Subject: [Python-checkins] r72457 - python/branches/release30-maint Message-ID: <20090507231330.E873B1E4016@bag.python.org> Author: tarek.ziade Date: Fri May 8 01:13:30 2009 New Revision: 72457 Log: Blocked revisions 72455 via svnmerge ................ r72455 | tarek.ziade | 2009-05-08 01:11:34 +0200 (Fri, 08 May 2009) | 9 lines Merged revisions 72454 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72454 | tarek.ziade | 2009-05-08 01:01:56 +0200 (Fri, 08 May 2009) | 1 line fixed AR/ARFLAGS values in test_sysconfig ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Fri May 8 04:28:39 2009 From: python-checkins at python.org (philip.jenvey) Date: Fri, 8 May 2009 04:28:39 +0200 (CEST) Subject: [Python-checkins] r72458 - in python/trunk/Lib: cgi.py commands.py gzip.py macpath.py ntpath.py plistlib.py posixpath.py tarfile.py xmllib.py Message-ID: <20090508022839.64A481E4002@bag.python.org> Author: philip.jenvey Date: Fri May 8 04:28:39 2009 New Revision: 72458 Log: #4351: more appropriate DeprecationWarning stacklevels Modified: python/trunk/Lib/cgi.py python/trunk/Lib/commands.py python/trunk/Lib/gzip.py python/trunk/Lib/macpath.py python/trunk/Lib/ntpath.py python/trunk/Lib/plistlib.py python/trunk/Lib/posixpath.py python/trunk/Lib/tarfile.py python/trunk/Lib/xmllib.py Modified: python/trunk/Lib/cgi.py ============================================================================== --- python/trunk/Lib/cgi.py (original) +++ python/trunk/Lib/cgi.py Fri May 8 04:28:39 2009 @@ -181,14 +181,14 @@ def parse_qs(qs, keep_blank_values=0, strict_parsing=0): """Parse a query given as a string argument.""" warn("cgi.parse_qs is deprecated, use urlparse.parse_qs \ - instead",PendingDeprecationWarning) + instead", PendingDeprecationWarning, 2) return urlparse.parse_qs(qs, keep_blank_values, strict_parsing) def parse_qsl(qs, keep_blank_values=0, strict_parsing=0): """Parse a query given as a string argument.""" warn("cgi.parse_qsl is deprecated, use urlparse.parse_qsl instead", - PendingDeprecationWarning) + PendingDeprecationWarning, 2) return urlparse.parse_qsl(qs, keep_blank_values, strict_parsing) def parse_multipart(fp, pdict): Modified: python/trunk/Lib/commands.py ============================================================================== --- python/trunk/Lib/commands.py (original) +++ python/trunk/Lib/commands.py Fri May 8 04:28:39 2009 @@ -37,7 +37,7 @@ def getstatus(file): """Return output of "ls -ld " in a string.""" import warnings - warnings.warn("commands.getstatus() is deprecated", DeprecationWarning) + warnings.warn("commands.getstatus() is deprecated", DeprecationWarning, 2) return getoutput('ls -ld' + mkarg(file)) Modified: python/trunk/Lib/gzip.py ============================================================================== --- python/trunk/Lib/gzip.py (original) +++ python/trunk/Lib/gzip.py Fri May 8 04:28:39 2009 @@ -124,7 +124,7 @@ @property def filename(self): import warnings - warnings.warn("use the name attribute", DeprecationWarning) + warnings.warn("use the name attribute", DeprecationWarning, 2) if self.mode == WRITE and self.name[-3:] != ".gz": return self.name + ".gz" return self.name Modified: python/trunk/Lib/macpath.py ============================================================================== --- python/trunk/Lib/macpath.py (original) +++ python/trunk/Lib/macpath.py Fri May 8 04:28:39 2009 @@ -170,7 +170,8 @@ beyond that arg is always passed to func. It can be used, e.g., to pass a filename pattern, or a mutable object designed to accumulate statistics. Passing None for arg is common.""" - warnings.warnpy3k("In 3.x, os.path.walk is removed in favor of os.walk.") + warnings.warnpy3k("In 3.x, os.path.walk is removed in favor of os.walk.", + stacklevel=2) try: names = os.listdir(top) except os.error: Modified: python/trunk/Lib/ntpath.py ============================================================================== --- python/trunk/Lib/ntpath.py (original) +++ python/trunk/Lib/ntpath.py Fri May 8 04:28:39 2009 @@ -250,7 +250,8 @@ beyond that arg is always passed to func. It can be used, e.g., to pass a filename pattern, or a mutable object designed to accumulate statistics. Passing None for arg is common.""" - warnings.warnpy3k("In 3.x, os.path.walk is removed in favor of os.walk.") + warnings.warnpy3k("In 3.x, os.path.walk is removed in favor of os.walk.", + stacklevel=2) try: names = os.listdir(top) except os.error: Modified: python/trunk/Lib/plistlib.py ============================================================================== --- python/trunk/Lib/plistlib.py (original) +++ python/trunk/Lib/plistlib.py Fri May 8 04:28:39 2009 @@ -114,7 +114,8 @@ def readPlistFromResource(path, restype='plst', resid=0): """Read plst resource from the resource fork of path. """ - warnings.warnpy3k("In 3.x, readPlistFromResource is removed.") + warnings.warnpy3k("In 3.x, readPlistFromResource is removed.", + stacklevel=2) from Carbon.File import FSRef, FSGetResourceForkName from Carbon.Files import fsRdPerm from Carbon import Res @@ -129,7 +130,7 @@ def writePlistToResource(rootObject, path, restype='plst', resid=0): """Write 'rootObject' as a plst resource to the resource fork of path. """ - warnings.warnpy3k("In 3.x, writePlistToResource is removed.") + warnings.warnpy3k("In 3.x, writePlistToResource is removed.", stacklevel=2) from Carbon.File import FSRef, FSGetResourceForkName from Carbon.Files import fsRdWrPerm from Carbon import Res @@ -300,13 +301,13 @@ raise AttributeError, attr from warnings import warn warn("Attribute access from plist dicts is deprecated, use d[key] " - "notation instead", PendingDeprecationWarning) + "notation instead", PendingDeprecationWarning, 2) return value def __setattr__(self, attr, value): from warnings import warn warn("Attribute access from plist dicts is deprecated, use d[key] " - "notation instead", PendingDeprecationWarning) + "notation instead", PendingDeprecationWarning, 2) self[attr] = value def __delattr__(self, attr): @@ -316,14 +317,14 @@ raise AttributeError, attr from warnings import warn warn("Attribute access from plist dicts is deprecated, use d[key] " - "notation instead", PendingDeprecationWarning) + "notation instead", PendingDeprecationWarning, 2) class Dict(_InternalDict): def __init__(self, **kwargs): from warnings import warn warn("The plistlib.Dict class is deprecated, use builtin dict instead", - PendingDeprecationWarning) + PendingDeprecationWarning, 2) super(Dict, self).__init__(**kwargs) @@ -336,7 +337,7 @@ def __init__(self, **kwargs): from warnings import warn warn("The Plist class is deprecated, use the readPlist() and " - "writePlist() functions instead", PendingDeprecationWarning) + "writePlist() functions instead", PendingDeprecationWarning, 2) super(Plist, self).__init__(**kwargs) def fromFile(cls, pathOrFile): Modified: python/trunk/Lib/posixpath.py ============================================================================== --- python/trunk/Lib/posixpath.py (original) +++ python/trunk/Lib/posixpath.py Fri May 8 04:28:39 2009 @@ -216,7 +216,8 @@ beyond that arg is always passed to func. It can be used, e.g., to pass a filename pattern, or a mutable object designed to accumulate statistics. Passing None for arg is common.""" - warnings.warnpy3k("In 3.x, os.path.walk is removed in favor of os.walk.") + warnings.warnpy3k("In 3.x, os.path.walk is removed in favor of os.walk.", + stacklevel=2) try: names = os.listdir(top) except os.error: Modified: python/trunk/Lib/tarfile.py ============================================================================== --- python/trunk/Lib/tarfile.py (original) +++ python/trunk/Lib/tarfile.py Fri May 8 04:28:39 2009 @@ -1588,7 +1588,8 @@ return self.format == USTAR_FORMAT def _setposix(self, value): import warnings - warnings.warn("use the format attribute instead", DeprecationWarning) + warnings.warn("use the format attribute instead", DeprecationWarning, + 2) if value: self.format = USTAR_FORMAT else: Modified: python/trunk/Lib/xmllib.py ============================================================================== --- python/trunk/Lib/xmllib.py (original) +++ python/trunk/Lib/xmllib.py Fri May 8 04:28:39 2009 @@ -6,7 +6,8 @@ import string import warnings -warnings.warn("The xmllib module is obsolete. Use xml.sax instead.", DeprecationWarning) +warnings.warn("The xmllib module is obsolete. Use xml.sax instead.", + DeprecationWarning, 2) del warnings version = '0.3' From python-checkins at python.org Fri May 8 04:46:09 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 8 May 2009 04:46:09 +0200 (CEST) Subject: [Python-checkins] r72459 - python/branches/py3k Message-ID: <20090508024609.DA1831E4048@bag.python.org> Author: benjamin.peterson Date: Fri May 8 04:46:09 2009 New Revision: 72459 Log: Blocked revisions 72458 via svnmerge ........ r72458 | philip.jenvey | 2009-05-07 21:28:39 -0500 (Thu, 07 May 2009) | 2 lines #4351: more appropriate DeprecationWarning stacklevels ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Fri May 8 04:47:03 2009 From: python-checkins at python.org (philip.jenvey) Date: Fri, 8 May 2009 04:47:03 +0200 (CEST) Subject: [Python-checkins] r72460 - in python/branches/release26-maint: Lib/cgi.py Lib/commands.py Lib/gzip.py Lib/macpath.py Lib/ntpath.py Lib/plistlib.py Lib/posixpath.py Lib/tarfile.py Lib/xmllib.py Message-ID: <20090508024703.099AB1E401C@bag.python.org> Author: philip.jenvey Date: Fri May 8 04:47:02 2009 New Revision: 72460 Log: Merged revisions 72458 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72458 | philip.jenvey | 2009-05-07 19:28:39 -0700 (Thu, 07 May 2009) | 2 lines #4351: more appropriate DeprecationWarning stacklevels ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/cgi.py python/branches/release26-maint/Lib/commands.py python/branches/release26-maint/Lib/gzip.py python/branches/release26-maint/Lib/macpath.py python/branches/release26-maint/Lib/ntpath.py python/branches/release26-maint/Lib/plistlib.py python/branches/release26-maint/Lib/posixpath.py python/branches/release26-maint/Lib/tarfile.py python/branches/release26-maint/Lib/xmllib.py Modified: python/branches/release26-maint/Lib/cgi.py ============================================================================== --- python/branches/release26-maint/Lib/cgi.py (original) +++ python/branches/release26-maint/Lib/cgi.py Fri May 8 04:47:02 2009 @@ -181,14 +181,14 @@ def parse_qs(qs, keep_blank_values=0, strict_parsing=0): """Parse a query given as a string argument.""" warn("cgi.parse_qs is deprecated, use urlparse.parse_qs \ - instead",PendingDeprecationWarning) + instead", PendingDeprecationWarning, 2) return urlparse.parse_qs(qs, keep_blank_values, strict_parsing) def parse_qsl(qs, keep_blank_values=0, strict_parsing=0): """Parse a query given as a string argument.""" warn("cgi.parse_qsl is deprecated, use urlparse.parse_qsl instead", - PendingDeprecationWarning) + PendingDeprecationWarning, 2) return urlparse.parse_qsl(qs, keep_blank_values, strict_parsing) def parse_multipart(fp, pdict): Modified: python/branches/release26-maint/Lib/commands.py ============================================================================== --- python/branches/release26-maint/Lib/commands.py (original) +++ python/branches/release26-maint/Lib/commands.py Fri May 8 04:47:02 2009 @@ -33,7 +33,7 @@ def getstatus(file): """Return output of "ls -ld " in a string.""" import warnings - warnings.warn("commands.getstatus() is deprecated", DeprecationWarning) + warnings.warn("commands.getstatus() is deprecated", DeprecationWarning, 2) return getoutput('ls -ld' + mkarg(file)) Modified: python/branches/release26-maint/Lib/gzip.py ============================================================================== --- python/branches/release26-maint/Lib/gzip.py (original) +++ python/branches/release26-maint/Lib/gzip.py Fri May 8 04:47:02 2009 @@ -114,7 +114,7 @@ @property def filename(self): import warnings - warnings.warn("use the name attribute", DeprecationWarning) + warnings.warn("use the name attribute", DeprecationWarning, 2) if self.mode == WRITE and self.name[-3:] != ".gz": return self.name + ".gz" return self.name Modified: python/branches/release26-maint/Lib/macpath.py ============================================================================== --- python/branches/release26-maint/Lib/macpath.py (original) +++ python/branches/release26-maint/Lib/macpath.py Fri May 8 04:47:02 2009 @@ -170,7 +170,8 @@ beyond that arg is always passed to func. It can be used, e.g., to pass a filename pattern, or a mutable object designed to accumulate statistics. Passing None for arg is common.""" - warnings.warnpy3k("In 3.x, os.path.walk is removed in favor of os.walk.") + warnings.warnpy3k("In 3.x, os.path.walk is removed in favor of os.walk.", + stacklevel=2) try: names = os.listdir(top) except os.error: Modified: python/branches/release26-maint/Lib/ntpath.py ============================================================================== --- python/branches/release26-maint/Lib/ntpath.py (original) +++ python/branches/release26-maint/Lib/ntpath.py Fri May 8 04:47:02 2009 @@ -250,7 +250,8 @@ beyond that arg is always passed to func. It can be used, e.g., to pass a filename pattern, or a mutable object designed to accumulate statistics. Passing None for arg is common.""" - warnings.warnpy3k("In 3.x, os.path.walk is removed in favor of os.walk.") + warnings.warnpy3k("In 3.x, os.path.walk is removed in favor of os.walk.", + stacklevel=2) try: names = os.listdir(top) except os.error: Modified: python/branches/release26-maint/Lib/plistlib.py ============================================================================== --- python/branches/release26-maint/Lib/plistlib.py (original) +++ python/branches/release26-maint/Lib/plistlib.py Fri May 8 04:47:02 2009 @@ -114,7 +114,8 @@ def readPlistFromResource(path, restype='plst', resid=0): """Read plst resource from the resource fork of path. """ - warnings.warnpy3k("In 3.x, readPlistFromResource is removed.") + warnings.warnpy3k("In 3.x, readPlistFromResource is removed.", + stacklevel=2) from Carbon.File import FSRef, FSGetResourceForkName from Carbon.Files import fsRdPerm from Carbon import Res @@ -129,7 +130,7 @@ def writePlistToResource(rootObject, path, restype='plst', resid=0): """Write 'rootObject' as a plst resource to the resource fork of path. """ - warnings.warnpy3k("In 3.x, writePlistToResource is removed.") + warnings.warnpy3k("In 3.x, writePlistToResource is removed.", stacklevel=2) from Carbon.File import FSRef, FSGetResourceForkName from Carbon.Files import fsRdWrPerm from Carbon import Res @@ -300,13 +301,13 @@ raise AttributeError, attr from warnings import warn warn("Attribute access from plist dicts is deprecated, use d[key] " - "notation instead", PendingDeprecationWarning) + "notation instead", PendingDeprecationWarning, 2) return value def __setattr__(self, attr, value): from warnings import warn warn("Attribute access from plist dicts is deprecated, use d[key] " - "notation instead", PendingDeprecationWarning) + "notation instead", PendingDeprecationWarning, 2) self[attr] = value def __delattr__(self, attr): @@ -316,14 +317,14 @@ raise AttributeError, attr from warnings import warn warn("Attribute access from plist dicts is deprecated, use d[key] " - "notation instead", PendingDeprecationWarning) + "notation instead", PendingDeprecationWarning, 2) class Dict(_InternalDict): def __init__(self, **kwargs): from warnings import warn warn("The plistlib.Dict class is deprecated, use builtin dict instead", - PendingDeprecationWarning) + PendingDeprecationWarning, 2) super(Dict, self).__init__(**kwargs) @@ -336,7 +337,7 @@ def __init__(self, **kwargs): from warnings import warn warn("The Plist class is deprecated, use the readPlist() and " - "writePlist() functions instead", PendingDeprecationWarning) + "writePlist() functions instead", PendingDeprecationWarning, 2) super(Plist, self).__init__(**kwargs) def fromFile(cls, pathOrFile): Modified: python/branches/release26-maint/Lib/posixpath.py ============================================================================== --- python/branches/release26-maint/Lib/posixpath.py (original) +++ python/branches/release26-maint/Lib/posixpath.py Fri May 8 04:47:02 2009 @@ -216,7 +216,8 @@ beyond that arg is always passed to func. It can be used, e.g., to pass a filename pattern, or a mutable object designed to accumulate statistics. Passing None for arg is common.""" - warnings.warnpy3k("In 3.x, os.path.walk is removed in favor of os.walk.") + warnings.warnpy3k("In 3.x, os.path.walk is removed in favor of os.walk.", + stacklevel=2) try: names = os.listdir(top) except os.error: Modified: python/branches/release26-maint/Lib/tarfile.py ============================================================================== --- python/branches/release26-maint/Lib/tarfile.py (original) +++ python/branches/release26-maint/Lib/tarfile.py Fri May 8 04:47:02 2009 @@ -1591,7 +1591,8 @@ return self.format == USTAR_FORMAT def _setposix(self, value): import warnings - warnings.warn("use the format attribute instead", DeprecationWarning) + warnings.warn("use the format attribute instead", DeprecationWarning, + 2) if value: self.format = USTAR_FORMAT else: Modified: python/branches/release26-maint/Lib/xmllib.py ============================================================================== --- python/branches/release26-maint/Lib/xmllib.py (original) +++ python/branches/release26-maint/Lib/xmllib.py Fri May 8 04:47:02 2009 @@ -6,7 +6,8 @@ import string import warnings -warnings.warn("The xmllib module is obsolete. Use xml.sax instead.", DeprecationWarning) +warnings.warn("The xmllib module is obsolete. Use xml.sax instead.", + DeprecationWarning, 2) del warnings version = '0.3' From python-checkins at python.org Fri May 8 05:06:01 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 8 May 2009 05:06:01 +0200 (CEST) Subject: [Python-checkins] r72461 - in python/trunk: Include/object.h Lib/test/test_descr.py Objects/object.c Objects/typeobject.c Message-ID: <20090508030601.38BA41E4002@bag.python.org> Author: benjamin.peterson Date: Fri May 8 05:06:00 2009 New Revision: 72461 Log: add _PyObject_LookupSpecial to handle fetching special method lookup Modified: python/trunk/Include/object.h python/trunk/Lib/test/test_descr.py python/trunk/Objects/object.c python/trunk/Objects/typeobject.c Modified: python/trunk/Include/object.h ============================================================================== --- python/trunk/Include/object.h (original) +++ python/trunk/Include/object.h Fri May 8 05:06:00 2009 @@ -451,6 +451,7 @@ PyAPI_FUNC(PyObject *) PyType_GenericNew(PyTypeObject *, PyObject *, PyObject *); PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *); +PyAPI_FUNC(PyObject *) _PyObject_LookupSpecial(PyObject *, char *, PyObject **); PyAPI_FUNC(unsigned int) PyType_ClearCache(void); PyAPI_FUNC(void) PyType_Modified(PyTypeObject *); Modified: python/trunk/Lib/test/test_descr.py ============================================================================== --- python/trunk/Lib/test/test_descr.py (original) +++ python/trunk/Lib/test/test_descr.py Fri May 8 05:06:00 2009 @@ -1665,6 +1665,58 @@ self.assertEqual(E().foo, C.foo) # i.e., unbound self.assert_(repr(C.foo.__get__(C(1))).startswith(" The Buildbot has detected a new failure of x86 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%203.x/builds/803 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Unknown signal 32 sincerely, -The Buildbot From python-checkins at python.org Fri May 8 05:25:19 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 8 May 2009 05:25:19 +0200 (CEST) Subject: [Python-checkins] r72462 - in python/branches/py3k: Include/object.h Lib/test/test_descr.py Objects/object.c Objects/typeobject.c Message-ID: <20090508032519.C78471E4002@bag.python.org> Author: benjamin.peterson Date: Fri May 8 05:25:19 2009 New Revision: 72462 Log: Merged revisions 72461 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72461 | benjamin.peterson | 2009-05-07 22:06:00 -0500 (Thu, 07 May 2009) | 1 line add _PyObject_LookupSpecial to handle fetching special method lookup ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Include/object.h python/branches/py3k/Lib/test/test_descr.py python/branches/py3k/Objects/object.c python/branches/py3k/Objects/typeobject.c Modified: python/branches/py3k/Include/object.h ============================================================================== --- python/branches/py3k/Include/object.h (original) +++ python/branches/py3k/Include/object.h Fri May 8 05:25:19 2009 @@ -414,6 +414,7 @@ PyAPI_FUNC(PyObject *) PyType_GenericNew(PyTypeObject *, PyObject *, PyObject *); PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *); +PyAPI_FUNC(PyObject *) _PyObject_LookupSpecial(PyObject *, char *, PyObject **); PyAPI_FUNC(unsigned int) PyType_ClearCache(void); PyAPI_FUNC(void) PyType_Modified(PyTypeObject *); Modified: python/branches/py3k/Lib/test/test_descr.py ============================================================================== --- python/branches/py3k/Lib/test/test_descr.py (original) +++ python/branches/py3k/Lib/test/test_descr.py Fri May 8 05:25:19 2009 @@ -1538,6 +1538,58 @@ self.assertEqual(E().foo.__func__, C.foo) # i.e., unbound self.assert_(repr(C.foo.__get__(C(1))).startswith(""); @@ -488,10 +482,10 @@ return v; } - /* Doesn't create a reference */ - func = _PyType_Lookup(Py_TYPE(v), bytesstring); + func = _PyObject_LookupSpecial(v, "__bytes__", &bytesstring); if (func != NULL) { result = PyObject_CallFunctionObjArgs(func, v, NULL); + Py_DECREF(func); if (result == NULL) return NULL; if (!PyBytes_Check(result)) { @@ -503,7 +497,6 @@ } return result; } - PyErr_Clear(); return PyBytes_FromObject(v); } Modified: python/branches/py3k/Objects/typeobject.c ============================================================================== --- python/branches/py3k/Objects/typeobject.c (original) +++ python/branches/py3k/Objects/typeobject.c Fri May 8 05:25:19 2009 @@ -1125,6 +1125,8 @@ when the _PyType_Lookup() call fails; - lookup_method() always raises an exception upon errors. + + - _PyObject_LookupSpecial() exported for the benefit of other places. */ static PyObject * @@ -1157,6 +1159,12 @@ return res; } +PyObject * +_PyObject_LookupSpecial(PyObject *self, char *attrstr, PyObject **attrobj) +{ + return lookup_maybe(self, attrstr, attrobj); +} + /* A variation of PyObject_CallMethod that uses lookup_method() instead of PyObject_GetAttrString(). This uses the same convention as lookup_method to cache the interned name string object. */ From python-checkins at python.org Fri May 8 05:27:59 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 8 May 2009 05:27:59 +0200 (CEST) Subject: [Python-checkins] r72463 - python/branches/py3k/Objects/object.c Message-ID: <20090508032759.DD5231E4002@bag.python.org> Author: benjamin.peterson Date: Fri May 8 05:27:59 2009 New Revision: 72463 Log: this is now a bound method Modified: python/branches/py3k/Objects/object.c Modified: python/branches/py3k/Objects/object.c ============================================================================== --- python/branches/py3k/Objects/object.c (original) +++ python/branches/py3k/Objects/object.c Fri May 8 05:27:59 2009 @@ -484,7 +484,7 @@ func = _PyObject_LookupSpecial(v, "__bytes__", &bytesstring); if (func != NULL) { - result = PyObject_CallFunctionObjArgs(func, v, NULL); + result = PyObject_CallFunctionObjArgs(func, NULL); Py_DECREF(func); if (result == NULL) return NULL; From python-checkins at python.org Fri May 8 05:29:26 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 8 May 2009 05:29:26 +0200 (CEST) Subject: [Python-checkins] r72464 - python/trunk/Objects/object.c Message-ID: <20090508032926.58D9E1E4002@bag.python.org> Author: benjamin.peterson Date: Fri May 8 05:29:26 2009 New Revision: 72464 Log: this is now a bound method Modified: python/trunk/Objects/object.c Modified: python/trunk/Objects/object.c ============================================================================== --- python/trunk/Objects/object.c (original) +++ python/trunk/Objects/object.c Fri May 8 05:29:26 2009 @@ -506,7 +506,7 @@ func = _PyObject_LookupSpecial(v, "__unicode__", &unicodestr); if (func != NULL) { unicode_method_found = 1; - res = PyObject_CallFunctionObjArgs(func, v, NULL); + res = PyObject_CallFunctionObjArgs(func, NULL); Py_DECREF(func); } } From python-checkins at python.org Fri May 8 05:31:15 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 8 May 2009 05:31:15 +0200 (CEST) Subject: [Python-checkins] r72465 - python/branches/py3k Message-ID: <20090508033115.C1FF41E4002@bag.python.org> Author: benjamin.peterson Date: Fri May 8 05:31:15 2009 New Revision: 72465 Log: Blocked revisions 72464 via svnmerge ........ r72464 | benjamin.peterson | 2009-05-07 22:29:26 -0500 (Thu, 07 May 2009) | 1 line this is now a bound method ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Fri May 8 05:45:10 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 08 May 2009 03:45:10 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 2.6 Message-ID: <20090508034510.9BAC31E4002@bag.python.org> The Buildbot has detected a new failure of x86 gentoo 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%202.6/builds/304 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: philip.jenvey BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Fri May 8 05:57:12 2009 From: python-checkins at python.org (philip.jenvey) Date: Fri, 8 May 2009 05:57:12 +0200 (CEST) Subject: [Python-checkins] r72466 - in python/branches/py3k/Lib: cgi.py gzip.py plistlib.py string.py Message-ID: <20090508035712.BE1EF1E401C@bag.python.org> Author: philip.jenvey Date: Fri May 8 05:57:12 2009 New Revision: 72466 Log: #4351: more appropriate DeprecationWarning stacklevels Modified: python/branches/py3k/Lib/cgi.py python/branches/py3k/Lib/gzip.py python/branches/py3k/Lib/plistlib.py python/branches/py3k/Lib/string.py Modified: python/branches/py3k/Lib/cgi.py ============================================================================== --- python/branches/py3k/Lib/cgi.py (original) +++ python/branches/py3k/Lib/cgi.py Fri May 8 05:57:12 2009 @@ -163,13 +163,13 @@ def parse_qs(qs, keep_blank_values=0, strict_parsing=0): """Parse a query given as a string argument.""" warn("cgi.parse_qs is deprecated, use urllib.parse.parse_qs instead", - DeprecationWarning) + DeprecationWarning, 2) return urllib.parse.parse_qs(qs, keep_blank_values, strict_parsing) def parse_qsl(qs, keep_blank_values=0, strict_parsing=0): """Parse a query given as a string argument.""" warn("cgi.parse_qsl is deprecated, use urllib.parse.parse_qsl instead", - DeprecationWarning) + DeprecationWarning, 2) return urllib.parse.parse_qsl(qs, keep_blank_values, strict_parsing) def parse_multipart(fp, pdict): Modified: python/branches/py3k/Lib/gzip.py ============================================================================== --- python/branches/py3k/Lib/gzip.py (original) +++ python/branches/py3k/Lib/gzip.py Fri May 8 05:57:12 2009 @@ -136,7 +136,7 @@ @property def filename(self): import warnings - warnings.warn("use the name attribute", DeprecationWarning) + warnings.warn("use the name attribute", DeprecationWarning, 2) if self.mode == WRITE and self.name[-3:] != ".gz": return self.name + ".gz" return self.name Modified: python/branches/py3k/Lib/plistlib.py ============================================================================== --- python/branches/py3k/Lib/plistlib.py (original) +++ python/branches/py3k/Lib/plistlib.py Fri May 8 05:57:12 2009 @@ -263,13 +263,13 @@ raise AttributeError(attr) from warnings import warn warn("Attribute access from plist dicts is deprecated, use d[key] " - "notation instead", PendingDeprecationWarning) + "notation instead", PendingDeprecationWarning, 2) return value def __setattr__(self, attr, value): from warnings import warn warn("Attribute access from plist dicts is deprecated, use d[key] " - "notation instead", PendingDeprecationWarning) + "notation instead", PendingDeprecationWarning, 2) self[attr] = value def __delattr__(self, attr): @@ -279,14 +279,14 @@ raise AttributeError(attr) from warnings import warn warn("Attribute access from plist dicts is deprecated, use d[key] " - "notation instead", PendingDeprecationWarning) + "notation instead", PendingDeprecationWarning, 2) class Dict(_InternalDict): def __init__(self, **kwargs): from warnings import warn warn("The plistlib.Dict class is deprecated, use builtin dict instead", - PendingDeprecationWarning) + PendingDeprecationWarning, 2) super().__init__(**kwargs) @@ -299,7 +299,7 @@ def __init__(self, **kwargs): from warnings import warn warn("The Plist class is deprecated, use the readPlist() and " - "writePlist() functions instead", PendingDeprecationWarning) + "writePlist() functions instead", PendingDeprecationWarning, 2) super().__init__(**kwargs) def fromFile(cls, pathOrFile): Modified: python/branches/py3k/Lib/string.py ============================================================================== --- python/branches/py3k/Lib/string.py (original) +++ python/branches/py3k/Lib/string.py Fri May 8 05:57:12 2009 @@ -51,7 +51,7 @@ """ import warnings warnings.warn("string.maketrans is deprecated, use bytes.maketrans instead", - DeprecationWarning) + DeprecationWarning, 2) if len(frm) != len(to): raise ValueError("maketrans arguments must have same length") if not (isinstance(frm, bytes) and isinstance(to, bytes)): From buildbot at python.org Fri May 8 07:38:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 08 May 2009 05:38:41 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090508053841.8584E1E410F@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%202.6/builds/319 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Fri May 8 10:11:30 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 8 May 2009 04:11:30 -0400 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090508081130.GA26896@python.psfb.org> 337 tests OK. 1 test failed: test_descr 35 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 6 skips unexpected on linux2: test_multiprocessing test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aetypes test_aifc test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named MacOS test_array test_ascii_formatd test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 test_bsddb3 skipped -- Use of the `bsddb' resource not enabled test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compileall test_compiler test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_curses test_curses skipped -- Use of the `curses' resource not enabled test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test test_descr failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_descr.py", line 1711, in test_special_method_lookup runner(X()) TypeError: hello() takes exactly 1 argument (0 given) test_descrtut test_difflib test_dircache test_dis test_distutils /tmp/tmpXC3tTb/foo/foo.c:1:28: warning: no newline at end of file test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future5 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [15401 refs] [15401 refs] [15401 refs] [25327 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_importlib test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_ipaddr test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_linecache test_linuxaudiodev test_linuxaudiodev skipped -- Use of the `audio' resource not enabled test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named MacOS test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_memoryview test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os test_ossaudiodev test_ossaudiodev skipped -- Use of the `audio' resource not enabled test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_pdb test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 /tmp/python-test/local/lib/python2.7/test/test_pep352.py:31: PendingDeprecationWarning: Please use assertTrue instead. (ins.__class__.__name__, attr)) /tmp/python-test/local/lib/python2.7/test/test_pep352.py:92: PendingDeprecationWarning: Please use assertEqual instead. given, expected)) test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [17001 refs] [17001 refs] test_plistlib test_poll test_popen [15406 refs] [15406 refs] [15406 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [20870 refs] test_pyexpat test_queue test_quopri [17926 refs] [17926 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [15401 refs] [15401 refs] [15404 refs] [15401 refs] test_slice test_smtplib test_socket test_socketserver test_socketserver skipped -- Use of the `network' resource not enabled test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- module os has no attribute startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [17246 refs] [15616 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] . [15401 refs] [15401 refs] this bit of output is from a test of stdout in a different process ... [15401 refs] [15401 refs] [15616 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry test_symtable test_syntax test_sys [15401 refs] [15401 refs] [15630 refs] [15424 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [15404 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [18664 refs] [21074 refs] [20051 refs] [20051 refs] [20051 refs] [20051 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tk test_tk skipped -- No module named _tkinter test_tokenize test_trace test_traceback test_transformer test_ttk_guionly test_ttk_guionly skipped -- No module named _tkinter test_ttk_textonly test_ttk_textonly skipped -- No module named _tkinter test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllib2net skipped -- Use of the `network' resource not enabled test_urllibnet test_urllibnet skipped -- Use of the `network' resource not enabled test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib /tmp/python-test/local/lib/python2.7/test/test_xmllib.py:24: DeprecationWarning: The xmllib module is obsolete. Use xml.sax instead. import xmllib test_xmlrpc test_xpickle test_xpickle -- skipping backwards compat tests. Use 'regrtest.py -u xpickle' to run them. test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zipimport_support test_zlib 337 tests OK. 1 test failed: test_descr 35 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 6 skips unexpected on linux2: test_multiprocessing test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [755791 refs] From nnorwitz at gmail.com Fri May 8 10:19:26 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 8 May 2009 04:19:26 -0400 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090508081926.GA29346@python.psfb.org> 337 tests OK. 1 test failed: test_descr 35 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 6 skips unexpected on linux2: test_multiprocessing test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aetypes test_aifc test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named MacOS test_array test_ascii_formatd test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 test_bsddb3 skipped -- Use of the `bsddb' resource not enabled test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compileall test_compiler test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_curses test_curses skipped -- Use of the `curses' resource not enabled test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test test_descr failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_descr.py", line 1711, in test_special_method_lookup runner(X()) TypeError: hello() takes exactly 1 argument (0 given) test_descrtut test_difflib test_dircache test_dis test_distutils [19526 refs] /tmp/tmpgvGR3U/foo/foo.c:1:28: warning: no newline at end of file [19526 refs] test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future5 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [15401 refs] [15401 refs] [15401 refs] [25327 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_importlib test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_ipaddr test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_linecache test_linuxaudiodev test_linuxaudiodev skipped -- Use of the `audio' resource not enabled test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named MacOS test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_memoryview test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os test_ossaudiodev test_ossaudiodev skipped -- Use of the `audio' resource not enabled test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_pdb test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 /tmp/python-test/local/lib/python2.7/test/test_pep352.py:31: PendingDeprecationWarning: Please use assertTrue instead. (ins.__class__.__name__, attr)) /tmp/python-test/local/lib/python2.7/test/test_pep352.py:92: PendingDeprecationWarning: Please use assertEqual instead. given, expected)) test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [17001 refs] [17001 refs] test_plistlib test_poll test_popen [15406 refs] [15406 refs] [15406 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [20870 refs] test_pyexpat test_queue test_quopri [17926 refs] [17926 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [15401 refs] [15401 refs] [15404 refs] [15401 refs] test_slice test_smtplib test_socket test_socketserver test_socketserver skipped -- Use of the `network' resource not enabled test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- module os has no attribute startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [17246 refs] [15616 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] . [15401 refs] [15401 refs] this bit of output is from a test of stdout in a different process ... [15401 refs] [15401 refs] [15616 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry test_symtable test_syntax test_sys [15401 refs] [15401 refs] [15630 refs] [15424 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [15404 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [18664 refs] [20237 refs] [20051 refs] [20051 refs] [20051 refs] [20051 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tk test_tk skipped -- No module named _tkinter test_tokenize test_trace test_traceback test_transformer test_ttk_guionly test_ttk_guionly skipped -- No module named _tkinter test_ttk_textonly test_ttk_textonly skipped -- No module named _tkinter test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllib2net skipped -- Use of the `network' resource not enabled test_urllibnet test_urllibnet skipped -- Use of the `network' resource not enabled test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib /tmp/python-test/local/lib/python2.7/test/test_xmllib.py:24: DeprecationWarning: The xmllib module is obsolete. Use xml.sax instead. import xmllib test_xmlrpc test_xpickle test_xpickle -- skipping backwards compat tests. Use 'regrtest.py -u xpickle' to run them. test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zipimport_support test_zlib 337 tests OK. 1 test failed: test_descr 35 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 6 skips unexpected on linux2: test_multiprocessing test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [755021 refs] From nnorwitz at gmail.com Fri May 8 11:26:11 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 8 May 2009 05:26:11 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090508092611.GA15860@python.psfb.org> More important issues: ---------------------- test_hashlib leaked [0, 0, 85] references, sum=85 Less important issues: ---------------------- test_file leaked [0, 0, 80] references, sum=80 test_smtplib leaked [-82, 88, -88] references, sum=-82 test_socketserver leaked [84, -84, 0] references, sum=0 test_sys leaked [42, -21, 0] references, sum=21 test_threading leaked [48, 53, 43] references, sum=144 test_urllib2_localnet leaked [-280, 3, 3] references, sum=-274 From nnorwitz at gmail.com Fri May 8 11:44:57 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 8 May 2009 05:44:57 -0400 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090508094457.GA20607@python.psfb.org> 342 tests OK. 1 test failed: test_descr 27 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_cd test_cl test_epoll test_gl test_imgfile test_ioctl test_kqueue test_macos test_macostools test_multiprocessing test_pep277 test_py3kwarn test_scriptpackages test_startfile test_sunaudiodev test_tcl test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_winreg test_winsound test_zipfile64 6 skips unexpected on linux2: test_multiprocessing test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aetypes test_aifc test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named MacOS test_array test_ascii_formatd test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 Sleepycat Software: Berkeley DB 4.1.25: (December 19, 2002) Test path prefix: /tmp/z-test_bsddb3-15868 test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compileall test_compiler testCompileLibrary still working, be patient... test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test test_descr failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/test/test_descr.py", line 1711, in test_special_method_lookup runner(X()) TypeError: hello() takes exactly 1 argument (0 given) test_descrtut test_difflib test_dircache test_dis test_distutils /tmp/tmpVtgPzp/foo/foo.c:1:28: warning: no newline at end of file test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future5 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [15401 refs] [15401 refs] [15401 refs] [25327 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_importlib test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_ipaddr test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_linecache test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named MacOS test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_memoryview test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_pdb test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 /tmp/python-test/local/lib/python2.7/test/test_pep352.py:31: PendingDeprecationWarning: Please use assertTrue instead. (ins.__class__.__name__, attr)) /tmp/python-test/local/lib/python2.7/test/test_pep352.py:92: PendingDeprecationWarning: Please use assertEqual instead. given, expected)) test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [17001 refs] [17001 refs] test_plistlib test_poll test_popen [15406 refs] [15406 refs] [15406 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [20870 refs] test_pyexpat test_queue test_quopri [17926 refs] [17926 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [15401 refs] [15401 refs] [15404 refs] [15401 refs] test_slice test_smtplib test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- module os has no attribute startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [17246 refs] [15616 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] . [15401 refs] [15401 refs] this bit of output is from a test of stdout in a different process ... [15401 refs] [15401 refs] [15616 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry test_symtable test_syntax test_sys [15401 refs] [15401 refs] [15630 refs] [15424 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [15404 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [18664 refs] [20237 refs] [20051 refs] [20051 refs] [20051 refs] [20051 refs] test_threading_local test_threadsignals test_time test_timeout test_tk test_tk skipped -- No module named _tkinter test_tokenize test_trace test_traceback test_transformer test_ttk_guionly test_ttk_guionly skipped -- No module named _tkinter test_ttk_textonly test_ttk_textonly skipped -- No module named _tkinter test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllibnet test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib /tmp/python-test/local/lib/python2.7/test/test_xmllib.py:24: DeprecationWarning: The xmllib module is obsolete. Use xml.sax instead. import xmllib test_xmlrpc test_xpickle sh: line 1: python2.4: command not found sh: line 1: python2.6: command not found test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zipimport_support test_zlib 342 tests OK. 1 test failed: test_descr 27 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_cd test_cl test_epoll test_gl test_imgfile test_ioctl test_kqueue test_macos test_macostools test_multiprocessing test_pep277 test_py3kwarn test_scriptpackages test_startfile test_sunaudiodev test_tcl test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_winreg test_winsound test_zipfile64 6 skips unexpected on linux2: test_multiprocessing test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [770858 refs] From python-checkins at python.org Fri May 8 14:17:36 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 8 May 2009 14:17:36 +0200 (CEST) Subject: [Python-checkins] r72467 - python/trunk/Doc/library/shelve.rst Message-ID: <20090508121736.2AD691E400C@bag.python.org> Author: georg.brandl Date: Fri May 8 14:17:34 2009 New Revision: 72467 Log: Fix name. Modified: python/trunk/Doc/library/shelve.rst Modified: python/trunk/Doc/library/shelve.rst ============================================================================== --- python/trunk/Doc/library/shelve.rst (original) +++ python/trunk/Doc/library/shelve.rst Fri May 8 14:17:34 2009 @@ -1,4 +1,3 @@ - :mod:`shelve` --- Python object persistence =========================================== @@ -38,7 +37,7 @@ accessed entries are written back (there is no way to determine which accessed entries are mutable, nor which ones were actually mutated). -Shelve objects support all methods supported by dictionaries. This eases the +Shelf objects support all methods supported by dictionaries. This eases the transition from dictionary based scripts to those requiring persistent storage. One additional method is supported: From python-checkins at python.org Fri May 8 15:07:40 2009 From: python-checkins at python.org (jeroen.ruigrok) Date: Fri, 8 May 2009 15:07:40 +0200 (CEST) Subject: [Python-checkins] r72468 - python/trunk/Lib/locale.py Message-ID: <20090508130740.2CB951E400C@bag.python.org> Author: jeroen.ruigrok Date: Fri May 8 15:07:39 2009 New Revision: 72468 Log: Add ISO-8859-16. Modified: python/trunk/Lib/locale.py Modified: python/trunk/Lib/locale.py ============================================================================== --- python/trunk/Lib/locale.py (original) +++ python/trunk/Lib/locale.py Fri May 8 15:07:39 2009 @@ -598,6 +598,7 @@ 'iso8859_13': 'ISO8859-13', 'iso8859_14': 'ISO8859-14', 'iso8859_15': 'ISO8859-15', + 'iso8859_16': 'ISO8859-16', 'iso8859_2': 'ISO8859-2', 'iso8859_3': 'ISO8859-3', 'iso8859_4': 'ISO8859-4', From python-checkins at python.org Fri May 8 16:11:23 2009 From: python-checkins at python.org (jeroen.ruigrok) Date: Fri, 8 May 2009 16:11:23 +0200 (CEST) Subject: [Python-checkins] r72469 - in python/trunk: Lib/locale.py Misc/NEWS Message-ID: <20090508141123.C00531E4024@bag.python.org> Author: jeroen.ruigrok Date: Fri May 8 16:11:23 2009 New Revision: 72469 Log: Update the Windows locale mapping with the ones introduced with Vista. Modified: python/trunk/Lib/locale.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/locale.py ============================================================================== --- python/trunk/Lib/locale.py (original) +++ python/trunk/Lib/locale.py Fri May 8 16:11:23 2009 @@ -1485,7 +1485,7 @@ # # This list has been updated from # http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_238z.asp -# to include every locale up to Windows XP. +# to include every locale up to Windows Vista. # # NOTE: this mapping is incomplete. If your language is missing, please # submit a bug report to Python bug manager, which you can find via: @@ -1497,6 +1497,8 @@ windows_locale = { 0x0436: "af_ZA", # Afrikaans 0x041c: "sq_AL", # Albanian + 0x0484: "gsw_FR",# Alsatian - France + 0x045e: "am_ET", # Amharic - Ethiopia 0x0401: "ar_SA", # Arabic - Saudi Arabia 0x0801: "ar_IQ", # Arabic - Iraq 0x0c01: "ar_EG", # Arabic - Egypt @@ -1514,15 +1516,18 @@ 0x3c01: "ar_BH", # Arabic - Bahrain 0x4001: "ar_QA", # Arabic - Qatar 0x042b: "hy_AM", # Armenian - 0x042c: "az_AZ", # Azeri Latin + 0x044d: "as_IN", # Assamese - India + 0x042c: "az_AZ", # Azeri - Latin 0x082c: "az_AZ", # Azeri - Cyrillic - 0x042d: "eu_ES", # Basque + 0x046d: "ba_RU", # Bashkir + 0x042d: "eu_ES", # Basque - Russia 0x0423: "be_BY", # Belarusian 0x0445: "bn_IN", # Begali - 0x201a: "bs_BA", # Bosnian - 0x141a: "bs_BA", # Bosnian - Cyrillic + 0x201a: "bs_BA", # Bosnian - Cyrillic + 0x141a: "bs_BA", # Bosnian - Latin 0x047e: "br_FR", # Breton - France 0x0402: "bg_BG", # Bulgarian +# 0x0455: "my_MM", # Burmese - Not supported 0x0403: "ca_ES", # Catalan 0x0004: "zh_CHS",# Chinese - Simplified 0x0404: "zh_TW", # Chinese - Taiwan @@ -1531,6 +1536,7 @@ 0x1004: "zh_SG", # Chinese - Singapore 0x1404: "zh_MO", # Chinese - Macao S.A.R. 0x7c04: "zh_CHT",# Chinese - Traditional + 0x0483: "co_FR", # Corsican - France 0x041a: "hr_HR", # Croatian 0x101a: "hr_BA", # Croatian - Bosnia 0x0405: "cs_CZ", # Czech @@ -1551,7 +1557,10 @@ 0x2809: "en_BZ", # English - Belize 0x2c09: "en_TT", # English - Trinidad 0x3009: "en_ZW", # English - Zimbabwe - 0x3409: "en_PH", # English - Phillippines + 0x3409: "en_PH", # English - Philippines + 0x4009: "en_IN", # English - India + 0x4409: "en_MY", # English - Malaysia + 0x4809: "en_IN", # English - Singapore 0x0425: "et_EE", # Estonian 0x0438: "fo_FO", # Faroese 0x0464: "fil_PH",# Filipino @@ -1571,38 +1580,44 @@ 0x1007: "de_LU", # German - Luxembourg 0x1407: "de_LI", # German - Liechtenstein 0x0408: "el_GR", # Greek + 0x046f: "kl_GL", # Greenlandic - Greenland 0x0447: "gu_IN", # Gujarati + 0x0468: "ha_NG", # Hausa - Latin 0x040d: "he_IL", # Hebrew 0x0439: "hi_IN", # Hindi 0x040e: "hu_HU", # Hungarian 0x040f: "is_IS", # Icelandic 0x0421: "id_ID", # Indonesian - 0x045d: "iu_CA", # Inuktitut + 0x045d: "iu_CA", # Inuktitut - Syllabics 0x085d: "iu_CA", # Inuktitut - Latin 0x083c: "ga_IE", # Irish - Ireland - 0x0434: "xh_ZA", # Xhosa - South Africa - 0x0435: "zu_ZA", # Zulu 0x0410: "it_IT", # Italian - Italy 0x0810: "it_CH", # Italian - Switzerland 0x0411: "ja_JP", # Japanese 0x044b: "kn_IN", # Kannada - India 0x043f: "kk_KZ", # Kazakh + 0x0453: "kh_KH", # Khmer - Cambodia + 0x0486: "qut_GT",# K'iche - Guatemala + 0x0487: "rw_RW", # Kinyarwanda - Rwanda 0x0457: "kok_IN",# Konkani 0x0412: "ko_KR", # Korean 0x0440: "ky_KG", # Kyrgyz + 0x0454: "lo_LA", # Lao - Lao PDR 0x0426: "lv_LV", # Latvian 0x0427: "lt_LT", # Lithuanian + 0x082e: "dsb_DE",# Lower Sorbian - Germany 0x046e: "lb_LU", # Luxembourgish - 0x042f: "mk_MK", # FYRO Macedonian + 0x042f: "mk_MK", # FYROM Macedonian 0x043e: "ms_MY", # Malay - Malaysia - 0x083e: "ms_BN", # Malay - Brunei + 0x083e: "ms_BN", # Malay - Brunei Darussalam 0x044c: "ml_IN", # Malayalam - India 0x043a: "mt_MT", # Maltese 0x0481: "mi_NZ", # Maori 0x047a: "arn_CL",# Mapudungun 0x044e: "mr_IN", # Marathi 0x047c: "moh_CA",# Mohawk - Canada - 0x0450: "mn_MN", # Mongolian + 0x0450: "mn_MN", # Mongolian - Cyrillic + 0x0850: "mn_CN", # Mongolian - PRC 0x0461: "ne_NP", # Nepali 0x0414: "nb_NO", # Norwegian - Bokmal 0x0814: "nn_NO", # Norwegian - Nynorsk @@ -1618,7 +1633,7 @@ 0x086b: "quz_EC",# Quechua (Ecuador) 0x0c6b: "quz_PE",# Quechua (Peru) 0x0418: "ro_RO", # Romanian - Romania - 0x0417: "rm_CH", # Raeto-Romanese + 0x0417: "rm_CH", # Romansh 0x0419: "ru_RU", # Russian 0x243b: "smn_FI",# Sami Finland 0x103b: "smj_NO",# Sami Norway @@ -1634,6 +1649,7 @@ 0x1c1a: "sr_BA", # Serbian - Bosnia Cyrillic 0x081a: "sr_SP", # Serbian - Latin 0x181a: "sr_BA", # Serbian - Bosnia Latin + 0x045b: "si_LK", # Sinhala - Sri Lanka 0x046c: "ns_ZA", # Northern Sotho 0x0432: "tn_ZA", # Setswana - Southern Africa 0x041b: "sk_SK", # Slovak @@ -1658,22 +1674,37 @@ 0x480a: "es_HN", # Spanish - Honduras 0x4c0a: "es_NI", # Spanish - Nicaragua 0x500a: "es_PR", # Spanish - Puerto Rico + 0x540a: "es_US", # Spanish - United States +# 0x0430: "", # Sutu - Not supported 0x0441: "sw_KE", # Swahili 0x041d: "sv_SE", # Swedish - Sweden 0x081d: "sv_FI", # Swedish - Finland 0x045a: "syr_SY",# Syriac + 0x0428: "tg_TJ", # Tajik - Cyrillic + 0x085f: "tmz_DZ",# Tamazight - Latin 0x0449: "ta_IN", # Tamil 0x0444: "tt_RU", # Tatar 0x044a: "te_IN", # Telugu 0x041e: "th_TH", # Thai + 0x0851: "bo_BT", # Tibetan - Bhutan + 0x0451: "bo_CN", # Tibetan - PRC 0x041f: "tr_TR", # Turkish + 0x0442: "tk_TM", # Turkmen - Cyrillic + 0x0480: "ug_CN", # Uighur - Arabic 0x0422: "uk_UA", # Ukrainian + 0x042e: "wen_DE",# Upper Sorbian - Germany 0x0420: "ur_PK", # Urdu 0x0820: "ur_IN", # Urdu - India 0x0443: "uz_UZ", # Uzbek - Latin 0x0843: "uz_UZ", # Uzbek - Cyrillic 0x042a: "vi_VN", # Vietnamese 0x0452: "cy_GB", # Welsh + 0x0488: "wo_SN", # Wolof - Senegal + 0x0434: "xh_ZA", # Xhosa - South Africa + 0x0485: "sah_RU",# Yakut - Cyrillic + 0x0478: "ii_CN", # Yi - PRC + 0x046a: "yo_NG", # Yoruba - Nigeria + 0x0435: "zu_ZA", # Zulu } def _print_locale(): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri May 8 16:11:23 2009 @@ -876,6 +876,8 @@ makeunicodedata.py and regenerated the Unicode database (This fixes u'\u1d79'.lower() == '\x00'). +- Windows locale mapping updated to Vista. + Tools/Demos ----------- From python-checkins at python.org Fri May 8 16:17:00 2009 From: python-checkins at python.org (jeroen.ruigrok) Date: Fri, 8 May 2009 16:17:00 +0200 (CEST) Subject: [Python-checkins] r72470 - in python/branches/py3k: Lib/locale.py Message-ID: <20090508141700.720921E4014@bag.python.org> Author: jeroen.ruigrok Date: Fri May 8 16:17:00 2009 New Revision: 72470 Log: Merged revisions 72468 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72468 | jeroen.ruigrok | 2009-05-08 15:07:39 +0200 (vr, 08 mei 2009) | 2 lines Add ISO-8859-16. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/locale.py Modified: python/branches/py3k/Lib/locale.py ============================================================================== --- python/branches/py3k/Lib/locale.py (original) +++ python/branches/py3k/Lib/locale.py Fri May 8 16:17:00 2009 @@ -609,6 +609,7 @@ 'iso8859_13': 'ISO8859-13', 'iso8859_14': 'ISO8859-14', 'iso8859_15': 'ISO8859-15', + 'iso8859_16': 'ISO8859-16', 'iso8859_2': 'ISO8859-2', 'iso8859_3': 'ISO8859-3', 'iso8859_4': 'ISO8859-4', From buildbot at python.org Fri May 8 16:43:10 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 08 May 2009 14:43:10 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090508144310.996781E4024@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/547 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,philip.jenvey BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 486, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' 2 tests failed: test_descr test_import ====================================================================== ERROR: test_special_method_lookup (test.test_descr.ClassPropertiesAndMethods) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_descr.py", line 1584, in test_special_method_lookup runner(X()) TypeError: hello() takes exactly 1 positional argument (0 given) ====================================================================== ERROR: testImport (test.test_import.ImportTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 61, in test_with_extension mod = __import__(TESTFN) ImportError: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 486, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 486, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' sincerely, -The Buildbot From python-checkins at python.org Fri May 8 18:44:52 2009 From: python-checkins at python.org (jeroen.ruigrok) Date: Fri, 8 May 2009 18:44:52 +0200 (CEST) Subject: [Python-checkins] r72472 - in python/branches/release30-maint: Lib/locale.py Message-ID: <20090508164452.D3E6C1E400C@bag.python.org> Author: jeroen.ruigrok Date: Fri May 8 18:44:52 2009 New Revision: 72472 Log: Merged revisions 72470 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72470 | jeroen.ruigrok | 2009-05-08 16:17:00 +0200 (vr, 08 mei 2009) | 9 lines Merged revisions 72468 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72468 | jeroen.ruigrok | 2009-05-08 15:07:39 +0200 (vr, 08 mei 2009) | 2 lines Add ISO-8859-16. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/locale.py Modified: python/branches/release30-maint/Lib/locale.py ============================================================================== --- python/branches/release30-maint/Lib/locale.py (original) +++ python/branches/release30-maint/Lib/locale.py Fri May 8 18:44:52 2009 @@ -602,6 +602,7 @@ 'iso8859_13': 'ISO8859-13', 'iso8859_14': 'ISO8859-14', 'iso8859_15': 'ISO8859-15', + 'iso8859_16': 'ISO8859-16', 'iso8859_2': 'ISO8859-2', 'iso8859_3': 'ISO8859-3', 'iso8859_4': 'ISO8859-4', From buildbot at python.org Fri May 8 19:07:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 08 May 2009 17:07:57 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 3.0 Message-ID: <20090508170757.27AAB1E400C@bag.python.org> The Buildbot has detected a new failure of x86 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%203.0/builds/377 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: jeroen.ruigrok BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Unknown signal 32 sincerely, -The Buildbot From python-checkins at python.org Fri May 8 19:59:29 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 8 May 2009 19:59:29 +0200 (CEST) Subject: [Python-checkins] r72474 - python/trunk/Lib/test/test_descr.py Message-ID: <20090508175929.7999E1E4018@bag.python.org> Author: benjamin.peterson Date: Fri May 8 19:59:29 2009 New Revision: 72474 Log: fix this test Modified: python/trunk/Lib/test/test_descr.py Modified: python/trunk/Lib/test/test_descr.py ============================================================================== --- python/trunk/Lib/test/test_descr.py (original) +++ python/trunk/Lib/test/test_descr.py Fri May 8 19:59:29 2009 @@ -1699,15 +1699,13 @@ self.impl = impl def __get__(self, obj, owner): record.append(1) - return self - def __call__(self, *args): - return self.impl(*args) + return self.impl.__get__(obj, owner) for name, runner, meth_impl in specials: class X(Checker): pass - setattr(X, name, staticmethod(meth_impl)) + setattr(X, name, meth_impl) runner(X()) record = [] From python-checkins at python.org Fri May 8 20:18:46 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 8 May 2009 20:18:46 +0200 (CEST) Subject: [Python-checkins] r72475 - in python/branches/py3k: Lib/test/test_descr.py Message-ID: <20090508181846.0C6F71E400C@bag.python.org> Author: benjamin.peterson Date: Fri May 8 20:18:45 2009 New Revision: 72475 Log: Merged revisions 72474 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72474 | benjamin.peterson | 2009-05-08 12:59:29 -0500 (Fri, 08 May 2009) | 1 line fix this test ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_descr.py Modified: python/branches/py3k/Lib/test/test_descr.py ============================================================================== --- python/branches/py3k/Lib/test/test_descr.py (original) +++ python/branches/py3k/Lib/test/test_descr.py Fri May 8 20:18:45 2009 @@ -1572,15 +1572,13 @@ self.impl = impl def __get__(self, obj, owner): record.append(1) - return self - def __call__(self, *args): - return self.impl(*args) + return self.impl.__get__(obj, owner) for name, runner, meth_impl in specials: class X(Checker): pass - setattr(X, name, staticmethod(meth_impl)) + setattr(X, name, meth_impl) runner(X()) record = [] From python-checkins at python.org Fri May 8 22:09:40 2009 From: python-checkins at python.org (thomas.heller) Date: Fri, 8 May 2009 22:09:40 +0200 (CEST) Subject: [Python-checkins] r72476 - python/trunk/Modules/_ctypes/libffi.diff Message-ID: <20090508200940.91A871E400C@bag.python.org> Author: thomas.heller Date: Fri May 8 22:09:40 2009 New Revision: 72476 Log: Add a file that contains diffs between offical libffi files and the files in this repository. Should make it easier to merge new libffi versions. Added: python/trunk/Modules/_ctypes/libffi.diff (contents, props changed) Added: python/trunk/Modules/_ctypes/libffi.diff ============================================================================== --- (empty file) +++ python/trunk/Modules/_ctypes/libffi.diff Fri May 8 22:09:40 2009 @@ -0,0 +1,207 @@ +This file contains the diffs between the files in the libffi +subdirectory and the 'official' source files from +ftp://sourceware.org/pub/libffi/libffi-3.0.5.tar.gz + +Index: libffi/aclocal.m4 +=================================================================== +--- libffi/aclocal.m4 (working copy) ++++ libffi/aclocal.m4 (revision 72475) +@@ -1155,7 +1155,7 @@ + test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + +- # We can hardcode non-existant directories. ++ # We can hardcode non-existent directories. + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library +Index: libffi/configure.ac +=================================================================== +--- libffi/configure.ac (working copy) ++++ libffi/configure.ac (revision 72475) +@@ -1,4 +1,7 @@ + dnl Process this with autoconf to create configure ++# ++# file from libffi - slightly patched for ctypes ++# + + AC_PREREQ(2.59) + +@@ -83,6 +86,9 @@ + i?86-*-solaris2.1[[0-9]]*) + TARGET=X86_64; TARGETDIR=x86 + ;; ++ i*86-*-nto-qnx*) ++ TARGET=X86; TARGETDIR=x86 ++ ;; + i?86-*-*) + TARGET=X86; TARGETDIR=x86 + ;; +@@ -100,10 +106,10 @@ + ;; + + mips-sgi-irix5.* | mips-sgi-irix6.*) +- TARGET=MIPS; TARGETDIR=mips ++ TARGET=MIPS_IRIX; TARGETDIR=mips + ;; + mips*-*-linux*) +- TARGET=MIPS; TARGETDIR=mips ++ TARGET=MIPS_LINUX; TARGETDIR=mips + ;; + + powerpc*-*-linux* | powerpc-*-sysv*) +@@ -156,7 +162,7 @@ + AC_MSG_ERROR(["libffi has not been ported to $host."]) + fi + +-AM_CONDITIONAL(MIPS, test x$TARGET = xMIPS) ++AM_CONDITIONAL(MIPS,[expr x$TARGET : 'xMIPS' > /dev/null]) + AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC) + AM_CONDITIONAL(X86, test x$TARGET = xX86) + AM_CONDITIONAL(X86_FREEBSD, test x$TARGET = xX86_FREEBSD) +@@ -360,6 +366,10 @@ + + AC_CONFIG_LINKS(include/ffitarget.h:src/$TARGETDIR/ffitarget.h) + +-AC_CONFIG_FILES(include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc) ++AC_CONFIG_FILES(include/ffi.h) + ++AC_CONFIG_LINKS(include/ffi_common.h:include/ffi_common.h) ++ ++AC_CONFIG_FILES(fficonfig.py) ++ + AC_OUTPUT +Index: libffi/configure +=================================================================== +--- libffi/configure (working copy) ++++ libffi/configure (revision 72475) +@@ -9546,7 +9546,7 @@ + test -n "$runpath_var" || \ + test "X$hardcode_automatic" = "Xyes" ; then + +- # We can hardcode non-existant directories. ++ # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library +@@ -13514,7 +13514,7 @@ + test -n "$runpath_var_CXX" || \ + test "X$hardcode_automatic_CXX" = "Xyes" ; then + +- # We can hardcode non-existant directories. ++ # We can hardcode non-existent directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library +@@ -16117,7 +16117,7 @@ + test -n "$runpath_var_F77" || \ + test "X$hardcode_automatic_F77" = "Xyes" ; then + +- # We can hardcode non-existant directories. ++ # We can hardcode non-existent directories. + if test "$hardcode_direct_F77" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library +@@ -18720,7 +18720,7 @@ + test -n "$runpath_var_GCJ" || \ + test "X$hardcode_automatic_GCJ" = "Xyes" ; then + +- # We can hardcode non-existant directories. ++ # We can hardcode non-existent directories. + if test "$hardcode_direct_GCJ" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library +@@ -20406,6 +20406,9 @@ + i?86-*-solaris2.1[0-9]*) + TARGET=X86_64; TARGETDIR=x86 + ;; ++ i*86-*-nto-qnx*) ++ TARGET=X86; TARGETDIR=x86 ++ ;; + i?86-*-*) + TARGET=X86; TARGETDIR=x86 + ;; +@@ -20423,10 +20426,10 @@ + ;; + + mips-sgi-irix5.* | mips-sgi-irix6.*) +- TARGET=MIPS; TARGETDIR=mips ++ TARGET=MIPS_IRIX; TARGETDIR=mips + ;; + mips*-*-linux*) +- TARGET=MIPS; TARGETDIR=mips ++ TARGET=MIPS_LINUX; TARGETDIR=mips + ;; + + powerpc*-*-linux* | powerpc-*-sysv*) +@@ -20481,7 +20484,7 @@ + { (exit 1); exit 1; }; } + fi + +- if test x$TARGET = xMIPS; then ++ if expr x$TARGET : 'xMIPS' > /dev/null; then + MIPS_TRUE= + MIPS_FALSE='#' + else +@@ -22712,9 +22715,15 @@ + ac_config_links="$ac_config_links include/ffitarget.h:src/$TARGETDIR/ffitarget.h" + + +-ac_config_files="$ac_config_files include/Makefile include/ffi.h Makefile testsuite/Makefile man/Makefile libffi.pc" ++ac_config_files="$ac_config_files include/ffi.h" + + ++ac_config_links="$ac_config_links include/ffi_common.h:include/ffi_common.h" ++ ++ ++ac_config_files="$ac_config_files fficonfig.py" ++ ++ + cat >confcache <<\_ACEOF + # This file is a shell script that caches the results of configure + # tests run on this system so they can be shared between configure +@@ -23498,12 +23507,9 @@ + "include") CONFIG_COMMANDS="$CONFIG_COMMANDS include" ;; + "src") CONFIG_COMMANDS="$CONFIG_COMMANDS src" ;; + "include/ffitarget.h") CONFIG_LINKS="$CONFIG_LINKS include/ffitarget.h:src/$TARGETDIR/ffitarget.h" ;; +- "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; + "include/ffi.h") CONFIG_FILES="$CONFIG_FILES include/ffi.h" ;; +- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; +- "testsuite/Makefile") CONFIG_FILES="$CONFIG_FILES testsuite/Makefile" ;; +- "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; +- "libffi.pc") CONFIG_FILES="$CONFIG_FILES libffi.pc" ;; ++ "include/ffi_common.h") CONFIG_LINKS="$CONFIG_LINKS include/ffi_common.h:include/ffi_common.h" ;; ++ "fficonfig.py") CONFIG_FILES="$CONFIG_FILES fficonfig.py" ;; + + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 + echo "$as_me: error: invalid argument: $ac_config_target" >&2;} +Index: libffi/src/x86/ffi.c +=================================================================== +--- libffi/src/x86/ffi.c (working copy) ++++ libffi/src/x86/ffi.c (revision 72475) +@@ -388,10 +388,10 @@ + return FFI_BAD_ABI; + } + +- // we currently don't support certain kinds of arguments for raw ++ /* we currently don't support certain kinds of arguments for raw + // closures. This should be implemented by a separate assembly language + // routine, since it would require argument processing, something we +- // don't do now for performance. ++ // don't do now for performance. */ + + for (i = cif->nargs-1; i >= 0; i--) + { +Index: libffi/src/x86/ffi64.c +=================================================================== +--- libffi/src/x86/ffi64.c (working copy) ++++ libffi/src/x86/ffi64.c (revision 72475) +@@ -52,7 +52,7 @@ + /* Register class used for passing given 64bit part of the argument. + These represent classes as documented by the PS ABI, with the exception + of SSESF, SSEDF classes, that are basically SSE class, just gcc will +- use SF or DFmode move instead of DImode to avoid reformating penalties. ++ use SF or DFmode move instead of DImode to avoid reformatting penalties. + + Similary we play games with INTEGERSI_CLASS to use cheaper SImode moves + whenever possible (upper half does contain padding). */ From python-checkins at python.org Fri May 8 22:42:27 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 8 May 2009 22:42:27 +0200 (CEST) Subject: [Python-checkins] r72477 - in python/branches/py3k: Doc/c-api/init.rst Doc/howto/functional.rst Doc/howto/regex.rst Doc/library/2to3.rst Doc/library/collections.rst Doc/library/decimal.rst Doc/library/json.rst Doc/library/shelve.rst Doc/library/subprocess.rst Doc/library/traceback.rst Doc/library/unittest.rst Doc/whatsnew/2.7.rst Lib/collections.py Lib/logging/__init__.py Lib/test/regrtest.py Lib/test/test_aifc.py Lib/test/test_descr.py Lib/test/test_logging.py Lib/test/test_shutil.py Lib/test/test_unittest.py Lib/unittest.py Modules/_ctypes/libffi.diff Message-ID: <20090508204227.DC45F1E410E@bag.python.org> Author: benjamin.peterson Date: Fri May 8 22:42:26 2009 New Revision: 72477 Log: Merged revisions 70768,71657,71721,71729,71794,71976,72036-72037,72079,72085,72131-72134,72191,72197-72198,72219,72221,72225,72303,72434,72467,72476 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r70768 | andrew.kuchling | 2009-03-30 17:29:15 -0500 (Mon, 30 Mar 2009) | 1 line Typo fixes ........ r71657 | vinay.sajip | 2009-04-16 14:07:37 -0500 (Thu, 16 Apr 2009) | 1 line Issue #5768: Change to Unicode output logic and test case for same. ........ r71721 | benjamin.peterson | 2009-04-18 14:26:19 -0500 (Sat, 18 Apr 2009) | 1 line fix a few nits in unittest.py #5771 ........ r71729 | benjamin.peterson | 2009-04-18 16:03:10 -0500 (Sat, 18 Apr 2009) | 1 line move test to a more appropiate one ........ r71794 | vinay.sajip | 2009-04-22 07:10:47 -0500 (Wed, 22 Apr 2009) | 2 lines Issue #5170: Fixed regression caused when fixing #5768. ........ r71976 | mark.dickinson | 2009-04-26 14:54:55 -0500 (Sun, 26 Apr 2009) | 2 lines Fix typo in function name ........ r72036 | georg.brandl | 2009-04-27 12:04:23 -0500 (Mon, 27 Apr 2009) | 1 line #5848: small unittest doc patch. ........ r72037 | georg.brandl | 2009-04-27 12:09:53 -0500 (Mon, 27 Apr 2009) | 1 line #5840: dont claim we dont support TLS. ........ r72079 | r.david.murray | 2009-04-28 14:02:55 -0500 (Tue, 28 Apr 2009) | 2 lines Remove spurious 'u'. ........ r72085 | georg.brandl | 2009-04-28 16:48:35 -0500 (Tue, 28 Apr 2009) | 1 line Make the doctests in the docs pass, except for those in the turtle module. ........ r72131 | benjamin.peterson | 2009-04-29 17:43:35 -0500 (Wed, 29 Apr 2009) | 1 line fix test_shutil on ZFS #5676 ........ r72132 | georg.brandl | 2009-04-29 17:44:07 -0500 (Wed, 29 Apr 2009) | 1 line #5878: fix repr of re object. ........ r72133 | benjamin.peterson | 2009-04-29 17:44:15 -0500 (Wed, 29 Apr 2009) | 1 line make sure mode is removable while cleaning up test droppings ........ r72134 | benjamin.peterson | 2009-04-29 19:06:33 -0500 (Wed, 29 Apr 2009) | 1 line make sure to close file ........ r72191 | michael.foord | 2009-05-02 06:43:06 -0500 (Sat, 02 May 2009) | 9 lines Adds an exit parameter to unittest.main(). If False main no longer calls sys.exit. Closes issue 3379. Michael Foord ........ r72197 | benjamin.peterson | 2009-05-02 11:24:37 -0500 (Sat, 02 May 2009) | 1 line don't let sys.argv be used in the tests ........ r72198 | andrew.kuchling | 2009-05-02 12:12:15 -0500 (Sat, 02 May 2009) | 1 line Add items ........ r72219 | michael.foord | 2009-05-02 15:15:05 -0500 (Sat, 02 May 2009) | 8 lines Add addCleanup and doCleanups to unittest.TestCase. Closes issue 5679. Michael Foord ........ r72221 | benjamin.peterson | 2009-05-02 15:26:53 -0500 (Sat, 02 May 2009) | 1 line add myself ........ r72225 | michael.foord | 2009-05-02 17:43:34 -0500 (Sat, 02 May 2009) | 1 line ........ r72303 | benjamin.peterson | 2009-05-04 19:55:24 -0500 (Mon, 04 May 2009) | 1 line using sys._getframe(x), where x > 0 doesnt' work on IronPython ........ r72434 | r.david.murray | 2009-05-07 13:09:58 -0500 (Thu, 07 May 2009) | 2 lines Pre-opened test file needs to be opened in binary mode. ........ r72467 | georg.brandl | 2009-05-08 07:17:34 -0500 (Fri, 08 May 2009) | 1 line Fix name. ........ r72476 | thomas.heller | 2009-05-08 15:09:40 -0500 (Fri, 08 May 2009) | 4 lines Add a file that contains diffs between offical libffi files and the files in this repository. Should make it easier to merge new libffi versions. ........ Added: python/branches/py3k/Modules/_ctypes/libffi.diff - copied unchanged from r72476, /python/trunk/Modules/_ctypes/libffi.diff Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/c-api/init.rst python/branches/py3k/Doc/howto/functional.rst python/branches/py3k/Doc/howto/regex.rst python/branches/py3k/Doc/library/2to3.rst python/branches/py3k/Doc/library/collections.rst python/branches/py3k/Doc/library/decimal.rst python/branches/py3k/Doc/library/json.rst python/branches/py3k/Doc/library/shelve.rst python/branches/py3k/Doc/library/subprocess.rst python/branches/py3k/Doc/library/traceback.rst python/branches/py3k/Doc/library/unittest.rst python/branches/py3k/Doc/whatsnew/2.7.rst python/branches/py3k/Lib/collections.py python/branches/py3k/Lib/logging/__init__.py python/branches/py3k/Lib/test/regrtest.py python/branches/py3k/Lib/test/test_aifc.py python/branches/py3k/Lib/test/test_descr.py python/branches/py3k/Lib/test/test_logging.py python/branches/py3k/Lib/test/test_shutil.py python/branches/py3k/Lib/test/test_unittest.py python/branches/py3k/Lib/unittest.py Modified: python/branches/py3k/Doc/c-api/init.rst ============================================================================== --- python/branches/py3k/Doc/c-api/init.rst (original) +++ python/branches/py3k/Doc/c-api/init.rst Fri May 8 22:42:26 2009 @@ -416,10 +416,9 @@ The Python interpreter needs to keep some bookkeeping information separate per thread --- for this it uses a data structure called :ctype:`PyThreadState`. There's one global variable, however: the pointer to the current -:ctype:`PyThreadState` structure. While most thread packages have a way to -store "per-thread global data," Python's internal platform independent thread -abstraction doesn't support this yet. Therefore, the current thread state must -be manipulated explicitly. +:ctype:`PyThreadState` structure. Before the addition of :dfn:`thread-local +storage` (:dfn:`TLS`) the current thread state had to be manipulated +explicitly. This is easy enough in most cases. Most code manipulating the global interpreter lock has the following simple structure:: Modified: python/branches/py3k/Doc/howto/functional.rst ============================================================================== --- python/branches/py3k/Doc/howto/functional.rst (original) +++ python/branches/py3k/Doc/howto/functional.rst Fri May 8 22:42:26 2009 @@ -473,7 +473,7 @@ >>> gen = generate_ints(3) >>> gen - + >>> next(gen) 0 >>> next(gen) Modified: python/branches/py3k/Doc/howto/regex.rst ============================================================================== --- python/branches/py3k/Doc/howto/regex.rst (original) +++ python/branches/py3k/Doc/howto/regex.rst Fri May 8 22:42:26 2009 @@ -264,7 +264,7 @@ >>> import re >>> p = re.compile('ab*') >>> p - + <_sre.SRE_Pattern object at 80b4150> :func:`re.compile` also accepts an optional *flags* argument, used to enable various special features and syntax variations. We'll go over the available Modified: python/branches/py3k/Doc/library/2to3.rst ============================================================================== --- python/branches/py3k/Doc/library/2to3.rst (original) +++ python/branches/py3k/Doc/library/2to3.rst Fri May 8 22:42:26 2009 @@ -352,6 +352,7 @@ :synopsis: the 2to3 library .. moduleauthor:: Guido van Rossum .. moduleauthor:: Collin Winter +.. moduleauthor:: Benjamin Peterson .. note:: Modified: python/branches/py3k/Doc/library/collections.rst ============================================================================== --- python/branches/py3k/Doc/library/collections.rst (original) +++ python/branches/py3k/Doc/library/collections.rst Fri May 8 22:42:26 2009 @@ -169,7 +169,7 @@ class is similar to bags or multisets in other languages. Elements are counted from an *iterable* or initialized from another - *mapping* (or counter):: + *mapping* (or counter): >>> c = Counter() # a new, empty counter >>> c = Counter('gallahad') # a new counter from an iterable @@ -177,7 +177,7 @@ >>> c = Counter(cats=4, dogs=8) # a new counter from keyword args Counter objects have a dictionary interface except that they return a zero - count for missing items instead of raising a :exc:`KeyError`:: + count for missing items instead of raising a :exc:`KeyError`: >>> c = Counter(['eggs', 'ham']) >>> c['bacon'] # count of a missing element is zero @@ -210,7 +210,7 @@ Return a list of the *n* most common elements and their counts from the most common to the least. If *n* is not specified, :func:`most_common` returns *all* elements in the counter. Elements with equal counts are - ordered arbitrarily:: + ordered arbitrarily: >>> Counter('abracadabra').most_common(3) [('a', 5), ('r', 2), ('b', 2)] Modified: python/branches/py3k/Doc/library/decimal.rst ============================================================================== --- python/branches/py3k/Doc/library/decimal.rst (original) +++ python/branches/py3k/Doc/library/decimal.rst Fri May 8 22:42:26 2009 @@ -1746,7 +1746,7 @@ >>> Decimal('3.214').quantize(TWOPLACES, context=Context(traps=[Inexact])) Traceback (most recent call last): ... - Inexact + Inexact: None Q. Once I have valid two place inputs, how do I maintain that invariant throughout an application? Modified: python/branches/py3k/Doc/library/json.rst ============================================================================== --- python/branches/py3k/Doc/library/json.rst (original) +++ python/branches/py3k/Doc/library/json.rst Fri May 8 22:42:26 2009 @@ -165,12 +165,12 @@ document) to a Python object. *object_hook* is an optional function that will be called with the result of - any object literal decode (a :class:`dict`). The return value of + any object literal decoded (a :class:`dict`). The return value of *object_hook* will be used instead of the :class:`dict`. This feature can be used to implement custom decoders (e.g. JSON-RPC class hinting). *object_pairs_hook* is an optional function that will be called with the - result of any object literal decode with an ordered list of pairs. The + result of any object literal decoded with an ordered list of pairs. The return value of *object_pairs_hook* will be used instead of the :class:`dict`. This feature can be used to implement custom decoders that rely on the order that the key and value pairs are decoded (for example, Modified: python/branches/py3k/Doc/library/shelve.rst ============================================================================== --- python/branches/py3k/Doc/library/shelve.rst (original) +++ python/branches/py3k/Doc/library/shelve.rst Fri May 8 22:42:26 2009 @@ -1,4 +1,3 @@ - :mod:`shelve` --- Python object persistence =========================================== @@ -35,7 +34,7 @@ accessed entries are written back (there is no way to determine which accessed entries are mutable, nor which ones were actually mutated). -Shelve objects support all methods supported by dictionaries. This eases the +Shelf objects support all methods supported by dictionaries. This eases the transition from dictionary based scripts to those requiring persistent storage. One additional method is supported: Modified: python/branches/py3k/Doc/library/subprocess.rst ============================================================================== --- python/branches/py3k/Doc/library/subprocess.rst (original) +++ python/branches/py3k/Doc/library/subprocess.rst Fri May 8 22:42:26 2009 @@ -174,13 +174,13 @@ :attr:`returncode` attribute and output in the :attr:`output` attribute. - The arguments are the same as for the :class:`Popen` constructor. Example: + The arguments are the same as for the :class:`Popen` constructor. Example:: >>> subprocess.check_output(["ls", "-l", "/dev/null"]) 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n' The stdout argument is not allowed as it is used internally. - To capture standard error in the result, use stderr=subprocess.STDOUT. + To capture standard error in the result, use ``stderr=subprocess.STDOUT``:: >>> subprocess.check_output( ["/bin/sh", "-c", "ls non_existent_file ; exit 0"], Modified: python/branches/py3k/Doc/library/traceback.rst ============================================================================== --- python/branches/py3k/Doc/library/traceback.rst (original) +++ python/branches/py3k/Doc/library/traceback.rst Fri May 8 22:42:26 2009 @@ -228,7 +228,7 @@ *** extract_tb: [('', 10, '', 'lumberjack()'), ('', 4, 'lumberjack', 'bright_side_of_death()'), - (u'', 7, 'bright_side_of_death', 'return tuple()[0]')] + ('', 7, 'bright_side_of_death', 'return tuple()[0]')] *** format_tb: [' File "", line 10, in \n lumberjack()\n', ' File "", line 4, in lumberjack\n bright_side_of_death()\n', Modified: python/branches/py3k/Doc/library/unittest.rst ============================================================================== --- python/branches/py3k/Doc/library/unittest.rst (original) +++ python/branches/py3k/Doc/library/unittest.rst Fri May 8 22:42:26 2009 @@ -954,7 +954,6 @@ along with the method name. .. versionchanged:: 3.1 - In earlier versions this only returned the first line of the test method's docstring, if available or the :const:`None`. That led to undesirable behavior of not printing the test name when someone was @@ -978,6 +977,36 @@ .. versionadded:: 3.1 + .. method:: addCleanup(function[, *args[, **kwargs]]) + + Add a function to be called after :meth:`tearDown` to cleanup resources + used during the test. Functions will be called in reverse order to the + order they are added (LIFO). They are called with any arguments and + keyword arguments passed into :meth:`addCleanup` when they are + added. + + If :meth:`setUp` fails, meaning that :meth:`tearDown` is not called, + then any cleanup functions added will still be called. + + .. versionadded:: 2.7 + + + .. method:: doCleanups() + + This method is called uncoditionally after :meth:`tearDown`, or + after :meth:`setUp` if :meth:`setUp` raises an exception. + + It is responsible for calling all the cleanup functions added by + :meth:`addCleanup`. If you need cleanup functions to be called + *prior* to :meth:`tearDown` then you can call :meth:`doCleanups` + yourself. + + :meth:`doCleanups` pops methods off the stack of cleanup + functions one at a time, so it can be called at any time. + + .. versionadded:: 2.7 + + .. class:: FunctionTestCase(testFunc[, setUp[, tearDown[, description]]]) This class implements the portion of the :class:`TestCase` interface which @@ -1046,6 +1075,20 @@ Return the number of tests represented by this test object, including all individual tests and sub-suites. + + .. method:: __iter__() + + Tests grouped by a :class:`TestSuite` are always accessed by iteration. + Subclasses can lazily provide tests by overriding :meth:`__iter__`. Note + that this method maybe called several times on a single suite + (for example when counting tests or comparing for equality) + so the tests returned must be the same for repeated iterations. + + .. versionchanged:: 2.7 + In earlier versions the :class:`TestSuite` accessed tests directly rather + than through iteration, so overriding :meth:`__iter__` wasn't sufficient + for providing tests. + In the typical usage of a :class:`TestSuite` object, the :meth:`run` method is invoked by a :class:`TestRunner` rather than by the end-user test harness. @@ -1190,7 +1233,6 @@ holding formatted tracebacks. Each tuple represents a test which raised an unexpected exception. - .. attribute:: failures A list containing 2-tuples of :class:`TestCase` instances and strings @@ -1266,6 +1308,20 @@ The default implementation does nothing. + .. method:: startTestRun(test) + + Called once before any tests are executed. + + .. versionadded:: 2.7 + + + .. method:: stopTestRun(test) + + Called once before any tests are executed. + + .. versionadded:: 2.7 + + .. method:: addError(test, err) Called when the test case *test* raises an unexpected exception *err* is a @@ -1335,8 +1391,14 @@ has a few configurable parameters, but is essentially very simple. Graphical applications which run test suites should provide alternate implementations. + .. method:: _makeResult() + + This method returns the instance of ``TestResult`` used by :meth:`run`. + It is not intended to be called directly, but can be overridden in + subclasses to provide a custom ``TestResult``. -.. function:: main([module[, defaultTest[, argv[, testRunner[, testLoader]]]]]) + +.. function:: main([module[, defaultTest[, argv[, testRunner[, testLoader[, exit]]]]]]) A command-line program that runs a set of tests; this is primarily for making test modules conveniently executable. The simplest use for this function is to @@ -1346,4 +1408,18 @@ unittest.main() The *testRunner* argument can either be a test runner class or an already - created instance of it. + created instance of it. By default ``main`` calls :func:`sys.exit` with + an exit code indicating success or failure of the tests run. + + ``main`` supports being used from the interactive interpreter by passing in the + argument ``exit=False``. This displays the result on standard output without + calling :func:`sys.exit`:: + + >>> from unittest import main + >>> main(module='test_module', exit=False) + + Calling ``main`` actually returns an instance of the ``TestProgram`` class. + This stores the result of the tests run as the ``result`` attribute. + + .. versionchanged:: 2.7 + The ``exit`` parameter was added. Modified: python/branches/py3k/Doc/whatsnew/2.7.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/2.7.rst (original) +++ python/branches/py3k/Doc/whatsnew/2.7.rst Fri May 8 22:42:26 2009 @@ -121,6 +121,31 @@ (Contributed by Fredrik Johansson and Victor Stinner; :issue:`3439`.) +* Conversions from long integers and regular integers to floating + point now round differently, returning the floating-point number + closest to the number. This doesn't matter for small integers that + can be converted exactly, but for large numbers that will + unavoidably lose precision, Python 2.7 will now approximate more + closely. For example, Python 2.6 computed the following:: + + >>> n = 295147905179352891391 + >>> float(n) + 2.9514790517935283e+20 + >>> n - long(float(n)) + 65535L + + Python 2.7's floating-point result is larger, but much closer to the + true value:: + + >>> n = 295147905179352891391 + >>> float(n) + 2.9514790517935289e+20 + >>> n-long(float(n) + ... ) + -1L + + (Implemented by Mark Dickinson; :issue:`3166`.) + * The :class:`bytearray` type's :meth:`translate` method will now accept ``None`` as its first argument. (Fixed by Georg Brandl; :issue:`4759`.) @@ -220,21 +245,24 @@ * New class: the :class:`Counter` class in the :mod:`collections` module is useful for tallying data. :class:`Counter` instances behave mostly like dictionaries but return zero for missing keys instead of - raising a :exc:`KeyError`:: + raising a :exc:`KeyError`: - >>> from collections import Counter - >>> c=Counter() - >>> for letter in 'here is a sample of english text': - ... c[letter] += 1 - ... - >>> c - Counter({' ': 6, 'e': 5, 's': 3, 'a': 2, 'i': 2, 'h': 2, - 'l': 2, 't': 2, 'g': 1, 'f': 1, 'm': 1, 'o': 1, 'n': 1, - 'p': 1, 'r': 1, 'x': 1}) - >>> c['e'] - 5 - >>> c['z'] - 0 + .. doctest:: + :options: +NORMALIZE_WHITESPACE + + >>> from collections import Counter + >>> c = Counter() + >>> for letter in 'here is a sample of english text': + ... c[letter] += 1 + ... + >>> c + Counter({' ': 6, 'e': 5, 's': 3, 'a': 2, 'i': 2, 'h': 2, + 'l': 2, 't': 2, 'g': 1, 'f': 1, 'm': 1, 'o': 1, 'n': 1, + 'p': 1, 'r': 1, 'x': 1}) + >>> c['e'] + 5 + >>> c['z'] + 0 There are two additional :class:`Counter` methods: :meth:`most_common` returns the N most common elements and their counts, and :meth:`elements` @@ -247,7 +275,7 @@ 'a', 'a', ' ', ' ', ' ', ' ', ' ', ' ', 'e', 'e', 'e', 'e', 'e', 'g', 'f', 'i', 'i', 'h', 'h', 'm', 'l', 'l', 'o', 'n', 'p', 's', - 's', 's', 'r', 't', 't', 'x'] + 's', 's', 'r', 't', 't', 'x' Contributed by Raymond Hettinger; :issue:`1696199`. @@ -257,7 +285,8 @@ renamed to legal names that are derived from the field's position within the list of fields: - >>> T=namedtuple('T', ['field1', '$illegal', 'for', 'field2'], rename=True) + >>> from collections import namedtuple + >>> T = namedtuple('T', ['field1', '$illegal', 'for', 'field2'], rename=True) >>> T._fields ('field1', '_1', '_2', 'field2') @@ -294,6 +323,10 @@ ``Decimal('0.1000000000000000055511151231257827021181583404541015625')``. (Implemented by Raymond Hettinger; :issue:`4796`.) +* The :class:`Fraction` class will now accept two rational numbers + as arguments to its constructor. + (Implemented by Mark Dickinson; :issue:`5812`.) + * New function: the :mod:`gc` module's :func:`is_tracked` returns true if a given instance is tracked by the garbage collector, false otherwise. (Contributed by Antoine Pitrou; :issue:`4688`.) @@ -419,6 +452,13 @@ (Implemented by Antoine Pitrou; :issue:`4444`.) + The methods :meth:`addCleanup` and :meth:`doCleanups` were added. + :meth:`addCleanup` allows you to add cleanup functions that + will be called unconditionally (after :meth:`setUp` if + :meth:`setUp` fails, otherwise after :meth:`tearDown`). This allows + for much simpler resource allocation and deallocation during tests. + :issue:`5679` + A number of new methods were added that provide more specialized tests. Many of these methods were written by Google engineers for use in their test suites; Gregory P. Smith, Michael Foord, and @@ -473,6 +513,14 @@ to provide additional information about why the two objects are matching, much as the new sequence comparison methods do. + :func:`unittest.main` now takes an optional ``exit`` argument. + If False ``main`` doesn't call :func:`sys.exit` allowing it to + be used from the interactive interpreter. :issue:`3379`. + + :class:`TestResult` has new :meth:`startTestRun` and + :meth:`stopTestRun` methods; called immediately before + and after a test run. :issue:`5728` by Robert Collins. + * The :func:`is_zipfile` function in the :mod:`zipfile` module will now accept a file object, in addition to the path names accepted in earlier versions. (Contributed by Gabriel Genellina; :issue:`4756`.) @@ -553,6 +601,10 @@ is particularly useful for asynchronous IO operations. (Contributed by Kristjan Valur Jonsson; :issue:`4293`.) +* Global symbols defined by the :mod:`ctypes` module are now prefixed + with ``Py`, or with ``_ctypes``. (Implemented by Thomas + Heller; :issue:`3102`.) + * The :program:`configure` script now checks for floating-point rounding bugs on certain 32-bit Intel chips and defines a :cmacro:`X87_DOUBLE_ROUNDING` preprocessor definition. No code currently uses this definition, @@ -591,10 +643,10 @@ * When importing a module from a :file:`.pyc` or :file:`.pyo` file with an existing :file:`.py` counterpart, the :attr:`co_filename` - attributes of all code objects if the original filename is obsolete, - which can happen if the file has been renamed, moved, or is accessed - through different paths. (Patch by Ziga Seilnacht and Jean-Paul - Calderone; :issue:`1180193`.) + attributes of the resulting code objects are overwritten when the + original filename is obsolete. This can happen if the file has been + renamed, moved, or is accessed through different paths. (Patch by + Ziga Seilnacht and Jean-Paul Calderone; :issue:`1180193`.) * The :file:`regrtest.py` script now takes a :option:`--randseed=` switch that takes an integer that will be used as the random seed Modified: python/branches/py3k/Lib/collections.py ============================================================================== --- python/branches/py3k/Lib/collections.py (original) +++ python/branches/py3k/Lib/collections.py Fri May 8 22:42:26 2009 @@ -271,9 +271,12 @@ # For pickling to work, the __module__ variable needs to be set to the frame # where the named tuple is created. Bypass this step in enviroments where - # sys._getframe is not defined (Jython for example). - if hasattr(_sys, '_getframe'): + # sys._getframe is not defined (Jython for example) or sys._getframe is not + # defined for arguments greater than 0 (IronPython). + try: result.__module__ = _sys._getframe(1).f_globals.get('__name__', '__main__') + except (AttributeError, ValueError): + pass return result Modified: python/branches/py3k/Lib/logging/__init__.py ============================================================================== --- python/branches/py3k/Lib/logging/__init__.py (original) +++ python/branches/py3k/Lib/logging/__init__.py Fri May 8 22:42:26 2009 @@ -756,7 +756,7 @@ The record is then written to the stream with a trailing newline. If exception information is present, it is formatted using traceback.print_exception and appended to the stream. If the stream - has an 'encoding' attribute, it is used to encode the message before + has an 'encoding' attribute, it is used to determine how to do the output to the stream. """ try: @@ -767,11 +767,21 @@ stream.write(fs % msg) else: try: - if (isinstance(msg, unicode) or - getattr(stream, 'encoding', None) is None): - stream.write(fs % msg) + if (isinstance(msg, unicode) and + getattr(stream, 'encoding', None)): + fs = fs.decode(stream.encoding) + try: + stream.write(fs % msg) + except UnicodeEncodeError: + #Printing to terminals sometimes fails. For example, + #with an encoding of 'cp1251', the above write will + #work if written to a stream opened or wrapped by + #the codecs module, but fail when writing to a + #terminal even when the codepage is set to cp1251. + #An extra encoding step seems to be needed. + stream.write((fs % msg).encode(stream.encoding)) else: - stream.write(fs % msg.encode(stream.encoding)) + stream.write(fs % msg) except UnicodeError: stream.write(fs % msg.encode("UTF-8")) self.flush() Modified: python/branches/py3k/Lib/test/regrtest.py ============================================================================== --- python/branches/py3k/Lib/test/regrtest.py (original) +++ python/branches/py3k/Lib/test/regrtest.py Fri May 8 22:42:26 2009 @@ -663,6 +663,7 @@ def cleanup_test_droppings(testname, verbose): import shutil + import stat # Try to clean up junk commonly left behind. While tests shouldn't leave # any files or directories behind, when a test fails that can be tedious @@ -687,6 +688,10 @@ if verbose: print("%r left behind %s %r" % (testname, kind, name)) try: + # if we have chmod, fix possible permissions problems + # that might prevent cleanup + if (hasattr(os, 'chmod')): + os.chmod(name, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO) nuker(name) except Exception as msg: print(("%r left behind %s %r and it couldn't be " Modified: python/branches/py3k/Lib/test/test_aifc.py ============================================================================== --- python/branches/py3k/Lib/test/test_aifc.py (original) +++ python/branches/py3k/Lib/test/test_aifc.py Fri May 8 22:42:26 2009 @@ -27,7 +27,7 @@ def test_skipunknown(self): #Issue 2245 #This file contains chunk types aifc doesn't recognize. - f = aifc.open(self.sndfilepath) + self.f = aifc.open(self.sndfilepath) def test_params(self): f = self.f = aifc.open(self.sndfilepath) Modified: python/branches/py3k/Lib/test/test_descr.py ============================================================================== --- python/branches/py3k/Lib/test/test_descr.py (original) +++ python/branches/py3k/Lib/test/test_descr.py Fri May 8 22:42:26 2009 @@ -3585,31 +3585,6 @@ self.assertEqual(e.a, 2) self.assertEqual(C2.__subclasses__(), [D]) - # stuff that shouldn't: - class L(list): - pass - - try: - L.__bases__ = (dict,) - except TypeError: - pass - else: - self.fail("shouldn't turn list subclass into dict subclass") - - try: - list.__bases__ = (dict,) - except TypeError: - pass - else: - self.fail("shouldn't be able to assign to list.__bases__") - - try: - D.__bases__ = (C2, list) - except TypeError: - pass - else: - assert 0, "best_base calculation found wanting" - try: del D.__bases__ except (TypeError, AttributeError): @@ -3657,6 +3632,36 @@ if tp is not object: self.assertEqual(len(tp.__bases__), 1, tp) + class L(list): + pass + + class C(object): + pass + + class D(C): + pass + + try: + L.__bases__ = (dict,) + except TypeError: + pass + else: + self.fail("shouldn't turn list subclass into dict subclass") + + try: + list.__bases__ = (dict,) + except TypeError: + pass + else: + self.fail("shouldn't be able to assign to list.__bases__") + + try: + D.__bases__ = (C, list) + except TypeError: + pass + else: + assert 0, "best_base calculation found wanting" + def test_mutable_bases_with_failing_mro(self): # Testing mutable bases with failing mro... Modified: python/branches/py3k/Lib/test/test_logging.py ============================================================================== --- python/branches/py3k/Lib/test/test_logging.py (original) +++ python/branches/py3k/Lib/test/test_logging.py Fri May 8 22:42:26 2009 @@ -894,6 +894,7 @@ message = '\u0434\u043e \u0441\u0432\u0438\u0434\u0430\u043d\u0438\u044f' #Ensure it's written in a Cyrillic encoding writer_class = codecs.getwriter('cp1251') + writer_class.encoding = 'cp1251' stream = io.BytesIO() writer = writer_class(stream, 'strict') handler = logging.StreamHandler(writer) Modified: python/branches/py3k/Lib/test/test_shutil.py ============================================================================== --- python/branches/py3k/Lib/test/test_shutil.py (original) +++ python/branches/py3k/Lib/test/test_shutil.py Fri May 8 22:42:26 2009 @@ -46,9 +46,23 @@ shutil.rmtree(TESTFN) def check_args_to_onerror(self, func, arg, exc): + # test_rmtree_errors deliberately runs rmtree + # on a directory that is chmod 400, which will fail. + # This function is run when shutil.rmtree fails. + # 99.9% of the time it initially fails to remove + # a file in the directory, so the first time through + # func is os.remove. + # However, some Linux machines running ZFS on + # FUSE experienced a failure earlier in the process + # at os.listdir. The first failure may legally + # be either. if self.errorState == 0: - self.assertEqual(func, os.remove) - self.assertEqual(arg, self.childpath) + if func is os.remove: + self.assertEqual(arg, self.childpath) + else: + self.assertIs(func, os.listdir, + "func must be either os.remove or os.listdir") + self.assertEqual(arg, TESTFN) self.failUnless(issubclass(exc[0], OSError)) self.errorState = 1 else: Modified: python/branches/py3k/Lib/test/test_unittest.py ============================================================================== --- python/branches/py3k/Lib/test/test_unittest.py (original) +++ python/branches/py3k/Lib/test/test_unittest.py Fri May 8 22:42:26 2009 @@ -9,9 +9,10 @@ import re from test import support import unittest -from unittest import TestCase +from unittest import TestCase, TestProgram import types from copy import deepcopy +import io ### Support code ################################################################ @@ -25,10 +26,18 @@ self._events.append('startTest') super().startTest(test) + def startTestRun(self): + self._events.append('startTestRun') + super(LoggingResult, self).startTestRun() + def stopTest(self, test): self._events.append('stopTest') super().stopTest(test) + def stopTestRun(self): + self._events.append('stopTestRun') + super(LoggingResult, self).stopTestRun() + def addFailure(self, *args): self._events.append('addFailure') super().addFailure(*args) @@ -1826,6 +1835,12 @@ self.assertEqual(result.testsRun, 1) self.assertEqual(result.shouldStop, False) + # "Called before and after tests are run. The default implementation does nothing." + def test_startTestRun_stopTestRun(self): + result = unittest.TestResult() + result.startTestRun() + result.stopTestRun() + # "addSuccess(test)" # ... # "Called when the test case test succeeds" @@ -1973,6 +1988,53 @@ class Bar(Foo): def test2(self): pass +class LoggingTestCase(unittest.TestCase): + """A test case which logs its calls.""" + + def __init__(self, events): + super(LoggingTestCase, self).__init__('test') + self.events = events + + def setUp(self): + self.events.append('setUp') + + def test(self): + self.events.append('test') + + def tearDown(self): + self.events.append('tearDown') + +class ResultWithNoStartTestRunStopTestRun(object): + """An object honouring TestResult before startTestRun/stopTestRun.""" + + def __init__(self): + self.failures = [] + self.errors = [] + self.testsRun = 0 + self.skipped = [] + self.expectedFailures = [] + self.unexpectedSuccesses = [] + self.shouldStop = False + + def startTest(self, test): + pass + + def stopTest(self, test): + pass + + def addError(self, test): + pass + + def addFailure(self, test): + pass + + def addSuccess(self, test): + pass + + def wasSuccessful(self): + return True + + ################################################################ ### /Support code for Test_TestCase @@ -2067,19 +2129,30 @@ events = [] result = LoggingResult(events) - class Foo(unittest.TestCase): + class Foo(LoggingTestCase): def setUp(self): - events.append('setUp') + super(Foo, self).setUp() raise RuntimeError('raised by Foo.setUp') - def test(self): - events.append('test') + Foo(events).run(result) + expected = ['startTest', 'setUp', 'addError', 'stopTest'] + self.assertEqual(events, expected) - def tearDown(self): - events.append('tearDown') + # "With a temporary result stopTestRun is called when setUp errors. + def test_run_call_order__error_in_setUp_default_result(self): + events = [] - Foo('test').run(result) - expected = ['startTest', 'setUp', 'addError', 'stopTest'] + class Foo(LoggingTestCase): + def defaultTestResult(self): + return LoggingResult(self.events) + + def setUp(self): + super(Foo, self).setUp() + raise RuntimeError('raised by Foo.setUp') + + Foo(events).run() + expected = ['startTestRun', 'startTest', 'setUp', 'addError', + 'stopTest', 'stopTestRun'] self.assertEqual(events, expected) # "When a setUp() method is defined, the test runner will run that method @@ -2093,20 +2166,32 @@ events = [] result = LoggingResult(events) - class Foo(unittest.TestCase): - def setUp(self): - events.append('setUp') - + class Foo(LoggingTestCase): def test(self): - events.append('test') + super(Foo, self).test() raise RuntimeError('raised by Foo.test') - def tearDown(self): - events.append('tearDown') - expected = ['startTest', 'setUp', 'test', 'addError', 'tearDown', 'stopTest'] - Foo('test').run(result) + Foo(events).run(result) + self.assertEqual(events, expected) + + # "With a default result, an error in the test still results in stopTestRun + # being called." + def test_run_call_order__error_in_test_default_result(self): + events = [] + + class Foo(LoggingTestCase): + def defaultTestResult(self): + return LoggingResult(self.events) + + def test(self): + super(Foo, self).test() + raise RuntimeError('raised by Foo.test') + + expected = ['startTestRun', 'startTest', 'setUp', 'test', 'addError', + 'tearDown', 'stopTest', 'stopTestRun'] + Foo(events).run() self.assertEqual(events, expected) # "When a setUp() method is defined, the test runner will run that method @@ -2120,20 +2205,30 @@ events = [] result = LoggingResult(events) - class Foo(unittest.TestCase): - def setUp(self): - events.append('setUp') - + class Foo(LoggingTestCase): def test(self): - events.append('test') + super(Foo, self).test() self.fail('raised by Foo.test') - def tearDown(self): - events.append('tearDown') - expected = ['startTest', 'setUp', 'test', 'addFailure', 'tearDown', 'stopTest'] - Foo('test').run(result) + Foo(events).run(result) + self.assertEqual(events, expected) + + # "When a test fails with a default result stopTestRun is still called." + def test_run_call_order__failure_in_test_default_result(self): + + class Foo(LoggingTestCase): + def defaultTestResult(self): + return LoggingResult(self.events) + def test(self): + super(Foo, self).test() + self.fail('raised by Foo.test') + + expected = ['startTestRun', 'startTest', 'setUp', 'test', 'addFailure', + 'tearDown', 'stopTest', 'stopTestRun'] + events = [] + Foo(events).run() self.assertEqual(events, expected) # "When a setUp() method is defined, the test runner will run that method @@ -2147,22 +2242,44 @@ events = [] result = LoggingResult(events) - class Foo(unittest.TestCase): - def setUp(self): - events.append('setUp') - - def test(self): - events.append('test') - + class Foo(LoggingTestCase): def tearDown(self): - events.append('tearDown') + super(Foo, self).tearDown() raise RuntimeError('raised by Foo.tearDown') - Foo('test').run(result) + Foo(events).run(result) expected = ['startTest', 'setUp', 'test', 'tearDown', 'addError', 'stopTest'] self.assertEqual(events, expected) + # "When tearDown errors with a default result stopTestRun is still called." + def test_run_call_order__error_in_tearDown_default_result(self): + + class Foo(LoggingTestCase): + def defaultTestResult(self): + return LoggingResult(self.events) + def tearDown(self): + super(Foo, self).tearDown() + raise RuntimeError('raised by Foo.tearDown') + + events = [] + Foo(events).run() + expected = ['startTestRun', 'startTest', 'setUp', 'test', 'tearDown', + 'addError', 'stopTest', 'stopTestRun'] + self.assertEqual(events, expected) + + # "TestCase.run() still works when the defaultTestResult is a TestResult + # that does not support startTestRun and stopTestRun. + def test_run_call_order_default_result(self): + + class Foo(unittest.TestCase): + def defaultTestResult(self): + return ResultWithNoStartTestRunStopTestRun() + def test(self): + pass + + Foo('test').run() + # "This class attribute gives the exception raised by the test() method. # If a test framework needs to use a specialized exception, possibly to # carry additional information, it must subclass this exception in @@ -2253,7 +2370,9 @@ self.failUnless(isinstance(Foo().id(), str)) # "If result is omitted or None, a temporary result object is created - # and used, but is not made available to the caller" + # and used, but is not made available to the caller. As TestCase owns the + # temporary result startTestRun and stopTestRun are called. + def test_run__uses_defaultTestResult(self): events = [] @@ -2267,7 +2386,8 @@ # Make run() find a result object on its own Foo('test').run() - expected = ['startTest', 'test', 'addSuccess', 'stopTest'] + expected = ['startTestRun', 'startTest', 'test', 'addSuccess', + 'stopTest', 'stopTestRun'] self.assertEqual(events, expected) def testShortDescriptionWithoutDocstring(self): @@ -3012,6 +3132,220 @@ "^unexpectedly identical: None : oops$"]) +class TestCleanUp(TestCase): + + def testCleanUp(self): + class TestableTest(TestCase): + def testNothing(self): + pass + + test = TestableTest('testNothing') + self.assertEqual(test._cleanups, []) + + cleanups = [] + + def cleanup1(*args, **kwargs): + cleanups.append((1, args, kwargs)) + + def cleanup2(*args, **kwargs): + cleanups.append((2, args, kwargs)) + + test.addCleanup(cleanup1, 1, 2, 3, four='hello', five='goodbye') + test.addCleanup(cleanup2) + + self.assertEqual(test._cleanups, + [(cleanup1, (1, 2, 3), dict(four='hello', five='goodbye')), + (cleanup2, (), {})]) + + result = test.doCleanups() + self.assertTrue(result) + + self.assertEqual(cleanups, [(2, (), {}), (1, (1, 2, 3), dict(four='hello', five='goodbye'))]) + + def testCleanUpWithErrors(self): + class TestableTest(TestCase): + def testNothing(self): + pass + + class MockResult(object): + errors = [] + def addError(self, test, exc_info): + self.errors.append((test, exc_info)) + + result = MockResult() + test = TestableTest('testNothing') + test._result = result + + exc1 = Exception('foo') + exc2 = Exception('bar') + def cleanup1(): + raise exc1 + + def cleanup2(): + raise exc2 + + test.addCleanup(cleanup1) + test.addCleanup(cleanup2) + + self.assertFalse(test.doCleanups()) + + (test1, (Type1, instance1, _)), (test2, (Type2, instance2, _)) = reversed(MockResult.errors) + self.assertEqual((test1, Type1, instance1), (test, Exception, exc1)) + self.assertEqual((test2, Type2, instance2), (test, Exception, exc2)) + + def testCleanupInRun(self): + blowUp = False + ordering = [] + + class TestableTest(TestCase): + def setUp(self): + ordering.append('setUp') + if blowUp: + raise Exception('foo') + + def testNothing(self): + ordering.append('test') + + def tearDown(self): + ordering.append('tearDown') + + test = TestableTest('testNothing') + + def cleanup1(): + ordering.append('cleanup1') + def cleanup2(): + ordering.append('cleanup2') + test.addCleanup(cleanup1) + test.addCleanup(cleanup2) + + def success(some_test): + self.assertEqual(some_test, test) + ordering.append('success') + + result = unittest.TestResult() + result.addSuccess = success + + test.run(result) + self.assertEqual(ordering, ['setUp', 'test', 'tearDown', + 'cleanup2', 'cleanup1', 'success']) + + blowUp = True + ordering = [] + test = TestableTest('testNothing') + test.addCleanup(cleanup1) + test.run(result) + self.assertEqual(ordering, ['setUp', 'cleanup1']) + + +class Test_TestProgram(TestCase): + + # Horrible white box test + def testNoExit(self): + result = object() + test = object() + + class FakeRunner(object): + def run(self, test): + self.test = test + return result + + runner = FakeRunner() + + try: + oldParseArgs = TestProgram.parseArgs + TestProgram.parseArgs = lambda *args: None + TestProgram.test = test + + program = TestProgram(testRunner=runner, exit=False) + + self.assertEqual(program.result, result) + self.assertEqual(runner.test, test) + + finally: + TestProgram.parseArgs = oldParseArgs + del TestProgram.test + + + class FooBar(unittest.TestCase): + def testPass(self): + assert True + def testFail(self): + assert False + + class FooBarLoader(unittest.TestLoader): + """Test loader that returns a suite containing FooBar.""" + def loadTestsFromModule(self, module): + return self.suiteClass( + [self.loadTestsFromTestCase(Test_TestProgram.FooBar)]) + + + def test_NonExit(self): + program = unittest.main(exit=False, + argv=["foobar"], + testRunner=unittest.TextTestRunner(stream=io.StringIO()), + testLoader=self.FooBarLoader()) + self.assertTrue(hasattr(program, 'result')) + + + def test_Exit(self): + self.assertRaises( + SystemExit, + unittest.main, + argv=["foobar"], + testRunner=unittest.TextTestRunner(stream=io.StringIO()), + exit=True, + testLoader=self.FooBarLoader()) + + + def test_ExitAsDefault(self): + self.assertRaises( + SystemExit, + unittest.main, + argv=["foobar"], + testRunner=unittest.TextTestRunner(stream=io.StringIO()), + testLoader=self.FooBarLoader()) + + +class Test_TextTestRunner(TestCase): + """Tests for TextTestRunner.""" + + def test_works_with_result_without_startTestRun_stopTestRun(self): + class OldTextResult(ResultWithNoStartTestRunStopTestRun): + separator2 = '' + def printErrors(self): + pass + + class Runner(unittest.TextTestRunner): + def __init__(self): + super(Runner, self).__init__(io.StringIO()) + + def _makeResult(self): + return OldTextResult() + + runner = Runner() + runner.run(unittest.TestSuite()) + + def test_startTestRun_stopTestRun_called(self): + class LoggingTextResult(LoggingResult): + separator2 = '' + def printErrors(self): + pass + + class LoggingRunner(unittest.TextTestRunner): + def __init__(self, events): + super(LoggingRunner, self).__init__(io.StringIO()) + self._events = events + + def _makeResult(self): + return LoggingTextResult(self._events) + + events = [] + runner = LoggingRunner(events) + runner.run(unittest.TestSuite()) + expected = ['startTestRun', 'stopTestRun'] + self.assertEqual(events, expected) + + ###################################################################### ## Main ###################################################################### @@ -3019,7 +3353,8 @@ def test_main(): support.run_unittest(Test_TestCase, Test_TestLoader, Test_TestSuite, Test_TestResult, Test_FunctionTestCase, - Test_TestSkipping, Test_Assertions, TestLongMessage) + Test_TestSkipping, Test_Assertions, TestLongMessage, + Test_TestProgram, TestCleanUp) if __name__ == "__main__": test_main() Modified: python/branches/py3k/Lib/unittest.py ============================================================================== --- python/branches/py3k/Lib/unittest.py (original) +++ python/branches/py3k/Lib/unittest.py Fri May 8 22:42:26 2009 @@ -173,10 +173,22 @@ "Called when the given test is about to be run" self.testsRun = self.testsRun + 1 + def startTestRun(self): + """Called once before any tests are executed. + + See startTest for a method called before each test. + """ + def stopTest(self, test): "Called when the given test has been run" pass + def stopTestRun(self): + """Called once after all tests are executed. + + See stopTest for a method called after each test. + """ + def addError(self, test, err): """Called when an error has occurred. 'err' is a tuple of values as returned by sys.exc_info(). @@ -262,7 +274,7 @@ def __enter__(self): pass - def __exit__(self, exc_type, exc_value, traceback): + def __exit__(self, exc_type, exc_value, tb): if exc_type is None: try: exc_name = self.expected.__name__ @@ -341,12 +353,14 @@ not have a method with the specified name. """ self._testMethodName = methodName + self._result = None try: testMethod = getattr(self, methodName) except AttributeError: raise ValueError("no such test method in %s: %s" % \ (self.__class__, methodName)) self._testMethodDoc = testMethod.__doc__ + self._cleanups = [] # Map types to custom assertEqual functions that will compare # instances of said type in more detail to generate a more useful @@ -373,6 +387,14 @@ """ self._type_equality_funcs[typeobj] = _AssertWrapper(function) + def addCleanup(self, function, *args, **kwargs): + """Add a function, with arguments, to be called when the test is + completed. Functions added are called on a LIFO basis and are + called after tearDown on test failure or success. + + Cleanup items are called even if setUp fails (unlike tearDown).""" + self._cleanups.append((function, args, kwargs)) + def setUp(self): "Hook method for setting up the test fixture before exercising it." pass @@ -428,45 +450,70 @@ (_strclass(self.__class__), self._testMethodName) def run(self, result=None): + orig_result = result if result is None: result = self.defaultTestResult() + startTestRun = getattr(result, 'startTestRun', None) + if startTestRun is not None: + startTestRun() + + self._result = result result.startTest(self) testMethod = getattr(self, self._testMethodName) try: - try: - self.setUp() - except SkipTest as e: - result.addSkip(self, str(e)) - return - except Exception: - result.addError(self, sys.exc_info()) - return - success = False try: - testMethod() - except self.failureException: - result.addFailure(self, sys.exc_info()) - except _ExpectedFailure as e: - result.addExpectedFailure(self, e.exc_info) - except _UnexpectedSuccess: - result.addUnexpectedSuccess(self) + self.setUp() except SkipTest as e: result.addSkip(self, str(e)) except Exception: result.addError(self, sys.exc_info()) else: - success = True + try: + testMethod() + except self.failureException: + result.addFailure(self, sys.exc_info()) + except _ExpectedFailure as e: + result.addExpectedFailure(self, e.exc_info) + except _UnexpectedSuccess: + result.addUnexpectedSuccess(self) + except SkipTest as e: + result.addSkip(self, str(e)) + except Exception: + result.addError(self, sys.exc_info()) + else: + success = True - try: - self.tearDown() - except Exception: - result.addError(self, sys.exc_info()) - success = False + try: + self.tearDown() + except Exception: + result.addError(self, sys.exc_info()) + success = False + + cleanUpSuccess = self.doCleanups() + success = success and cleanUpSuccess if success: result.addSuccess(self) finally: result.stopTest(self) + if orig_result is None: + stopTestRun = getattr(result, 'stopTestRun', None) + if stopTestRun is not None: + stopTestRun() + + def doCleanups(self): + """Execute all cleanup functions. Normally called for you after + tearDown.""" + result = self._result + ok = True + while self._cleanups: + function, args, kwargs = self._cleanups.pop(-1) + try: + function(*args, **kwargs) + except Exception: + ok = False + result.addError(self, sys.exc_info()) + return ok def __call__(self, *args, **kwds): return self.run(*args, **kwds) @@ -1037,7 +1084,7 @@ def __eq__(self, other): if not isinstance(other, self.__class__): return NotImplemented - return self._tests == other._tests + return list(self) == list(other) def __ne__(self, other): return not self == other @@ -1160,8 +1207,7 @@ self._testFunc, self._description)) def __str__(self): - return "%s (%s)" % (_strclass(self.__class__), - self.__testFunc.__name__) + return "%s (%s)" % (_strclass(self.__class__), self._testFunc.__name__) def __repr__(self): return "<%s testFunc=%s>" % (_strclass(self.__class__), self._testFunc) @@ -1449,7 +1495,15 @@ "Run the given test case or test suite." result = self._makeResult() startTime = time.time() - test(result) + startTestRun = getattr(result, 'startTestRun', None) + if startTestRun is not None: + startTestRun() + try: + test(result) + finally: + stopTestRun = getattr(result, 'stopTestRun', None) + if stopTestRun is not None: + stopTestRun() stopTime = time.time() timeTaken = stopTime - startTime result.printErrors() @@ -1511,7 +1565,7 @@ """ def __init__(self, module='__main__', defaultTest=None, argv=None, testRunner=TextTestRunner, - testLoader=defaultTestLoader): + testLoader=defaultTestLoader, exit=True): if isinstance(module, str): self.module = __import__(module) for part in module.split('.')[1:]: @@ -1520,6 +1574,8 @@ self.module = module if argv is None: argv = sys.argv + + self.exit = exit self.verbosity = 1 self.defaultTest = defaultTest self.testRunner = testRunner @@ -1571,8 +1627,9 @@ else: # it is assumed to be a TestRunner instance testRunner = self.testRunner - result = testRunner.run(self.test) - sys.exit(not result.wasSuccessful()) + self.result = testRunner.run(self.test) + if self.exit: + sys.exit(not self.result.wasSuccessful()) main = TestProgram From python-checkins at python.org Fri May 8 22:54:43 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 8 May 2009 22:54:43 +0200 (CEST) Subject: [Python-checkins] r72478 - python/branches/py3k/Lib/http/server.py Message-ID: <20090508205443.2109E1E400C@bag.python.org> Author: benjamin.peterson Date: Fri May 8 22:54:42 2009 New Revision: 72478 Log: port r72246 Modified: python/branches/py3k/Lib/http/server.py Modified: python/branches/py3k/Lib/http/server.py ============================================================================== --- python/branches/py3k/Lib/http/server.py (original) +++ python/branches/py3k/Lib/http/server.py Fri May 8 22:54:42 2009 @@ -883,6 +883,9 @@ (dir, rest) if self.path requires running a CGI script. Returns False otherwise. + If any exception is raised, the caller should assume that + self.path was rejected as invalid and act accordingly. + The default implementation tests whether the normalized url path begins with one of the strings in self.cgi_directories (and the next character is a '/' or the end of the string). From python-checkins at python.org Fri May 8 22:58:08 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 8 May 2009 22:58:08 +0200 (CEST) Subject: [Python-checkins] r72479 - python/trunk/Modules/resource.c Message-ID: <20090508205808.667A61E400C@bag.python.org> Author: mark.dickinson Date: Fri May 8 22:58:08 2009 New Revision: 72479 Log: Issue #5933: Fix gcc -Wextra compiler warnings (and remove some trailing whitespace). Modified: python/trunk/Modules/resource.c Modified: python/trunk/Modules/resource.c ============================================================================== --- python/trunk/Modules/resource.c (original) +++ python/trunk/Modules/resource.c Fri May 8 22:58:08 2009 @@ -147,7 +147,7 @@ int resource; PyObject *curobj, *maxobj; - if (!PyArg_ParseTuple(args, "i(OO):setrlimit", + if (!PyArg_ParseTuple(args, "i(OO):setrlimit", &resource, &curobj, &maxobj)) return NULL; @@ -159,27 +159,27 @@ #if !defined(HAVE_LARGEFILE_SUPPORT) rl.rlim_cur = PyInt_AsLong(curobj); - if (rl.rlim_cur == -1 && PyErr_Occurred()) + if (rl.rlim_cur == (rlim_t)-1 && PyErr_Occurred()) return NULL; rl.rlim_max = PyInt_AsLong(maxobj); - if (rl.rlim_max == -1 && PyErr_Occurred()) + if (rl.rlim_max == (rlim_t)-1 && PyErr_Occurred()) return NULL; #else /* The limits are probably bigger than a long */ rl.rlim_cur = PyLong_Check(curobj) ? PyLong_AsLongLong(curobj) : PyInt_AsLong(curobj); - if (rl.rlim_cur == -1 && PyErr_Occurred()) + if (rl.rlim_cur == (rlim_t)-1 && PyErr_Occurred()) return NULL; rl.rlim_max = PyLong_Check(maxobj) ? PyLong_AsLongLong(maxobj) : PyInt_AsLong(maxobj); - if (rl.rlim_max == -1 && PyErr_Occurred()) + if (rl.rlim_max == (rlim_t)-1 && PyErr_Occurred()) return NULL; #endif rl.rlim_cur = rl.rlim_cur & RLIM_INFINITY; rl.rlim_max = rl.rlim_max & RLIM_INFINITY; if (setrlimit(resource, &rl) == -1) { - if (errno == EINVAL) + if (errno == EINVAL) PyErr_SetString(PyExc_ValueError, "current limit exceeds maximum limit"); else if (errno == EPERM) From python-checkins at python.org Fri May 8 22:59:42 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 8 May 2009 22:59:42 +0200 (CEST) Subject: [Python-checkins] r72480 - python/branches/py3k Message-ID: <20090508205942.E81F11E400C@bag.python.org> Author: benjamin.peterson Date: Fri May 8 22:59:42 2009 New Revision: 72480 Log: Blocked revisions 72053,72111,72114,72246,72343,72418-72419,72451 via svnmerge ........ r72053 | raymond.hettinger | 2009-04-27 16:12:54 -0500 (Mon, 27 Apr 2009) | 1 line Add example to the seealso section. ........ r72111 | matthias.klose | 2009-04-29 14:52:49 -0500 (Wed, 29 Apr 2009) | 3 lines - Issue #4587: Add configure option --with-dbmliborder=db1:db2:... to specify the order that backends for the dbm extension are checked. ........ r72114 | matthias.klose | 2009-04-29 15:09:50 -0500 (Wed, 29 Apr 2009) | 2 lines - configure.in: Don't error, when no --with-dbmliborder option is present ........ r72246 | gregory.p.smith | 2009-05-03 15:27:25 -0500 (Sun, 03 May 2009) | 2 lines docstring update. ........ r72343 | senthil.kumaran | 2009-05-05 12:34:42 -0500 (Tue, 05 May 2009) | 1 line Fixing issue5861 - test_urllib fails on windows. Agree to comment to have ':' in pathname2url as windows recognizes it. test_urllib passes now. ........ r72418 | r.david.murray | 2009-05-06 20:39:25 -0500 (Wed, 06 May 2009) | 3 lines Document how to pass a 'decode' argument to get_payload when is_multipart is False. ........ r72419 | r.david.murray | 2009-05-06 20:43:57 -0500 (Wed, 06 May 2009) | 2 lines Revert inappropriate doc change. ........ r72451 | tarek.ziade | 2009-05-07 17:19:27 -0500 (Thu, 07 May 2009) | 1 line run autoconf (step forgotten in r72445) ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Fri May 8 22:59:58 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 8 May 2009 22:59:58 +0200 (CEST) Subject: [Python-checkins] r72481 - in python/branches/release26-maint: Modules/resource.c Message-ID: <20090508205958.1B4E11E400C@bag.python.org> Author: mark.dickinson Date: Fri May 8 22:59:57 2009 New Revision: 72481 Log: Merged revisions 72479 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72479 | mark.dickinson | 2009-05-08 21:58:08 +0100 (Fri, 08 May 2009) | 3 lines Issue #5933: Fix gcc -Wextra compiler warnings (and remove some trailing whitespace). ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Modules/resource.c Modified: python/branches/release26-maint/Modules/resource.c ============================================================================== --- python/branches/release26-maint/Modules/resource.c (original) +++ python/branches/release26-maint/Modules/resource.c Fri May 8 22:59:57 2009 @@ -147,7 +147,7 @@ int resource; PyObject *curobj, *maxobj; - if (!PyArg_ParseTuple(args, "i(OO):setrlimit", + if (!PyArg_ParseTuple(args, "i(OO):setrlimit", &resource, &curobj, &maxobj)) return NULL; @@ -159,27 +159,27 @@ #if !defined(HAVE_LARGEFILE_SUPPORT) rl.rlim_cur = PyInt_AsLong(curobj); - if (rl.rlim_cur == -1 && PyErr_Occurred()) + if (rl.rlim_cur == (rlim_t)-1 && PyErr_Occurred()) return NULL; rl.rlim_max = PyInt_AsLong(maxobj); - if (rl.rlim_max == -1 && PyErr_Occurred()) + if (rl.rlim_max == (rlim_t)-1 && PyErr_Occurred()) return NULL; #else /* The limits are probably bigger than a long */ rl.rlim_cur = PyLong_Check(curobj) ? PyLong_AsLongLong(curobj) : PyInt_AsLong(curobj); - if (rl.rlim_cur == -1 && PyErr_Occurred()) + if (rl.rlim_cur == (rlim_t)-1 && PyErr_Occurred()) return NULL; rl.rlim_max = PyLong_Check(maxobj) ? PyLong_AsLongLong(maxobj) : PyInt_AsLong(maxobj); - if (rl.rlim_max == -1 && PyErr_Occurred()) + if (rl.rlim_max == (rlim_t)-1 && PyErr_Occurred()) return NULL; #endif rl.rlim_cur = rl.rlim_cur & RLIM_INFINITY; rl.rlim_max = rl.rlim_max & RLIM_INFINITY; if (setrlimit(resource, &rl) == -1) { - if (errno == EINVAL) + if (errno == EINVAL) PyErr_SetString(PyExc_ValueError, "current limit exceeds maximum limit"); else if (errno == EPERM) From python-checkins at python.org Fri May 8 23:01:57 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 8 May 2009 23:01:57 +0200 (CEST) Subject: [Python-checkins] r72482 - in python/branches/py3k: Modules/resource.c Message-ID: <20090508210157.5CAE51E400C@bag.python.org> Author: mark.dickinson Date: Fri May 8 23:01:57 2009 New Revision: 72482 Log: Merged revisions 72479 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72479 | mark.dickinson | 2009-05-08 21:58:08 +0100 (Fri, 08 May 2009) | 3 lines Issue #5933: Fix gcc -Wextra compiler warnings (and remove some trailing whitespace). ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Modules/resource.c Modified: python/branches/py3k/Modules/resource.c ============================================================================== --- python/branches/py3k/Modules/resource.c (original) +++ python/branches/py3k/Modules/resource.c Fri May 8 23:01:57 2009 @@ -147,7 +147,7 @@ int resource; PyObject *curobj, *maxobj; - if (!PyArg_ParseTuple(args, "i(OO):setrlimit", + if (!PyArg_ParseTuple(args, "i(OO):setrlimit", &resource, &curobj, &maxobj)) return NULL; @@ -159,27 +159,27 @@ #if !defined(HAVE_LARGEFILE_SUPPORT) rl.rlim_cur = PyLong_AsLong(curobj); - if (rl.rlim_cur == -1 && PyErr_Occurred()) + if (rl.rlim_cur == (rlim_t)-1 && PyErr_Occurred()) return NULL; rl.rlim_max = PyLong_AsLong(maxobj); - if (rl.rlim_max == -1 && PyErr_Occurred()) + if (rl.rlim_max == (rlim_t)-1 && PyErr_Occurred()) return NULL; #else /* The limits are probably bigger than a long */ rl.rlim_cur = PyLong_Check(curobj) ? PyLong_AsLongLong(curobj) : PyLong_AsLong(curobj); - if (rl.rlim_cur == -1 && PyErr_Occurred()) + if (rl.rlim_cur == (rlim_t)-1 && PyErr_Occurred()) return NULL; rl.rlim_max = PyLong_Check(maxobj) ? PyLong_AsLongLong(maxobj) : PyLong_AsLong(maxobj); - if (rl.rlim_max == -1 && PyErr_Occurred()) + if (rl.rlim_max == (rlim_t)-1 && PyErr_Occurred()) return NULL; #endif rl.rlim_cur = rl.rlim_cur & RLIM_INFINITY; rl.rlim_max = rl.rlim_max & RLIM_INFINITY; if (setrlimit(resource, &rl) == -1) { - if (errno == EINVAL) + if (errno == EINVAL) PyErr_SetString(PyExc_ValueError, "current limit exceeds maximum limit"); else if (errno == EPERM) From python-checkins at python.org Fri May 8 23:03:37 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 8 May 2009 23:03:37 +0200 (CEST) Subject: [Python-checkins] r72483 - in python/branches/release30-maint: Modules/resource.c Message-ID: <20090508210337.425471E400C@bag.python.org> Author: mark.dickinson Date: Fri May 8 23:03:36 2009 New Revision: 72483 Log: Merged revisions 72482 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72482 | mark.dickinson | 2009-05-08 22:01:57 +0100 (Fri, 08 May 2009) | 10 lines Merged revisions 72479 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72479 | mark.dickinson | 2009-05-08 21:58:08 +0100 (Fri, 08 May 2009) | 3 lines Issue #5933: Fix gcc -Wextra compiler warnings (and remove some trailing whitespace). ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Modules/resource.c Modified: python/branches/release30-maint/Modules/resource.c ============================================================================== --- python/branches/release30-maint/Modules/resource.c (original) +++ python/branches/release30-maint/Modules/resource.c Fri May 8 23:03:36 2009 @@ -147,7 +147,7 @@ int resource; PyObject *curobj, *maxobj; - if (!PyArg_ParseTuple(args, "i(OO):setrlimit", + if (!PyArg_ParseTuple(args, "i(OO):setrlimit", &resource, &curobj, &maxobj)) return NULL; @@ -159,27 +159,27 @@ #if !defined(HAVE_LARGEFILE_SUPPORT) rl.rlim_cur = PyLong_AsLong(curobj); - if (rl.rlim_cur == -1 && PyErr_Occurred()) + if (rl.rlim_cur == (rlim_t)-1 && PyErr_Occurred()) return NULL; rl.rlim_max = PyLong_AsLong(maxobj); - if (rl.rlim_max == -1 && PyErr_Occurred()) + if (rl.rlim_max == (rlim_t)-1 && PyErr_Occurred()) return NULL; #else /* The limits are probably bigger than a long */ rl.rlim_cur = PyLong_Check(curobj) ? PyLong_AsLongLong(curobj) : PyLong_AsLong(curobj); - if (rl.rlim_cur == -1 && PyErr_Occurred()) + if (rl.rlim_cur == (rlim_t)-1 && PyErr_Occurred()) return NULL; rl.rlim_max = PyLong_Check(maxobj) ? PyLong_AsLongLong(maxobj) : PyLong_AsLong(maxobj); - if (rl.rlim_max == -1 && PyErr_Occurred()) + if (rl.rlim_max == (rlim_t)-1 && PyErr_Occurred()) return NULL; #endif rl.rlim_cur = rl.rlim_cur & RLIM_INFINITY; rl.rlim_max = rl.rlim_max & RLIM_INFINITY; if (setrlimit(resource, &rl) == -1) { - if (errno == EINVAL) + if (errno == EINVAL) PyErr_SetString(PyExc_ValueError, "current limit exceeds maximum limit"); else if (errno == EPERM) From python-checkins at python.org Fri May 8 23:07:35 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 8 May 2009 23:07:35 +0200 (CEST) Subject: [Python-checkins] r72484 - python/branches/py3k Message-ID: <20090508210735.0EED11E4095@bag.python.org> Author: benjamin.peterson Date: Fri May 8 23:07:34 2009 New Revision: 72484 Log: Blocked revisions 72107 via svnmerge ........ r72107 | matthias.klose | 2009-04-29 12:18:19 -0500 (Wed, 29 Apr 2009) | 3 lines - Issue #4587: Add configure option --with-dbmliborder=db1:db2:... to specify the order that backends for the dbm extension are checked. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Fri May 8 23:28:46 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 8 May 2009 23:28:46 +0200 (CEST) Subject: [Python-checkins] r72485 - python/branches/py3k/Modules/resource.c Message-ID: <20090508212846.467581E400C@bag.python.org> Author: mark.dickinson Date: Fri May 8 23:28:46 2009 New Revision: 72485 Log: Clean up some int/long detection remnants in resource module. Modified: python/branches/py3k/Modules/resource.c Modified: python/branches/py3k/Modules/resource.c ============================================================================== --- python/branches/py3k/Modules/resource.c (original) +++ python/branches/py3k/Modules/resource.c Fri May 8 23:28:46 2009 @@ -166,12 +166,10 @@ return NULL; #else /* The limits are probably bigger than a long */ - rl.rlim_cur = PyLong_Check(curobj) ? - PyLong_AsLongLong(curobj) : PyLong_AsLong(curobj); + rl.rlim_cur = PyLong_AsLongLong(curobj); if (rl.rlim_cur == (rlim_t)-1 && PyErr_Occurred()) return NULL; - rl.rlim_max = PyLong_Check(maxobj) ? - PyLong_AsLongLong(maxobj) : PyLong_AsLong(maxobj); + rl.rlim_max = PyLong_AsLongLong(maxobj); if (rl.rlim_max == (rlim_t)-1 && PyErr_Occurred()) return NULL; #endif From python-checkins at python.org Fri May 8 23:29:32 2009 From: python-checkins at python.org (mark.dickinson) Date: Fri, 8 May 2009 23:29:32 +0200 (CEST) Subject: [Python-checkins] r72486 - in python/branches/release30-maint: Modules/resource.c Message-ID: <20090508212932.5C0861E400C@bag.python.org> Author: mark.dickinson Date: Fri May 8 23:29:32 2009 New Revision: 72486 Log: Merged revisions 72485 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r72485 | mark.dickinson | 2009-05-08 22:28:46 +0100 (Fri, 08 May 2009) | 2 lines Clean up some int/long detection remnants in resource module. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Modules/resource.c Modified: python/branches/release30-maint/Modules/resource.c ============================================================================== --- python/branches/release30-maint/Modules/resource.c (original) +++ python/branches/release30-maint/Modules/resource.c Fri May 8 23:29:32 2009 @@ -166,12 +166,10 @@ return NULL; #else /* The limits are probably bigger than a long */ - rl.rlim_cur = PyLong_Check(curobj) ? - PyLong_AsLongLong(curobj) : PyLong_AsLong(curobj); + rl.rlim_cur = PyLong_AsLongLong(curobj); if (rl.rlim_cur == (rlim_t)-1 && PyErr_Occurred()) return NULL; - rl.rlim_max = PyLong_Check(maxobj) ? - PyLong_AsLongLong(maxobj) : PyLong_AsLong(maxobj); + rl.rlim_max = PyLong_AsLongLong(maxobj); if (rl.rlim_max == (rlim_t)-1 && PyErr_Occurred()) return NULL; #endif From python-checkins at python.org Fri May 8 23:51:07 2009 From: python-checkins at python.org (jeffrey.yasskin) Date: Fri, 8 May 2009 23:51:07 +0200 (CEST) Subject: [Python-checkins] r72487 - in python/trunk: Doc/c-api/code.rst Doc/c-api/concrete.rst Include/code.h Lib/test/test_code.py Misc/NEWS Modules/_ctypes/callbacks.c Modules/_testcapimodule.c Modules/pyexpat.c Objects/codeobject.c Message-ID: <20090508215107.8366E1E4023@bag.python.org> Author: jeffrey.yasskin Date: Fri May 8 23:51:06 2009 New Revision: 72487 Log: PyCode_NewEmpty: Most uses of PyCode_New found by http://www.google.com/codesearch?q=PyCode_New are trying to build an empty code object, usually to put it in a dummy frame object. This patch adds a PyCode_NewEmpty wrapper which lets the user specify just the filename, function name, and first line number, instead of also requiring lots of code internals. Added: python/trunk/Doc/c-api/code.rst Modified: python/trunk/Doc/c-api/concrete.rst python/trunk/Include/code.h python/trunk/Lib/test/test_code.py python/trunk/Misc/NEWS python/trunk/Modules/_ctypes/callbacks.c python/trunk/Modules/_testcapimodule.c python/trunk/Modules/pyexpat.c python/trunk/Objects/codeobject.c Added: python/trunk/Doc/c-api/code.rst ============================================================================== --- (empty file) +++ python/trunk/Doc/c-api/code.rst Fri May 8 23:51:06 2009 @@ -0,0 +1,50 @@ +.. highlightlang:: c + +.. _codeobjects: + +Code Objects +------------ + +.. sectionauthor:: Jeffrey Yasskin + + +.. index:: + object: code + +Code objects are a low-level detail of the CPython implementation. +Each one represents a chunk of executable code that hasn't yet been +bound into a function. + +.. ctype:: PyCodeObject + + The C structure of the objects used to describe code objects. The + fields of this type are subject to change at any time. + + +.. cvar:: PyTypeObject PyCode_Type + + This is an instance of :ctype:`PyTypeObject` representing the Python + :class:`code` type. + + +.. cfunction:: int PyCode_Check(PyObject *co) + + Return true if *co* is a :class:`code` object + +.. cfunction:: int PyCode_GetNumFree(PyObject *co) + + Return the number of free variables in *co*. + +.. cfunction:: PyCodeObject *PyCode_New(int argcount, int nlocals, int stacksize, int flags, PyObject *code, PyObject *consts, PyObject *names, PyObject *varnames, PyObject *freevars, PyObject *cellvars, PyObject *filename, PyObject *name, int firstlineno, PyObject *lnotab) + + Return a new code object. If you need a dummy code object to + create a frame, use :cfunc:`PyCode_NewEmpty` instead. Calling + :cfunc:`PyCode_New` directly can bind you to a precise Python + version since the definition of the bytecode changes often. + + +.. cfunction:: int PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno) + + Return a new empty code object with the specified filename, + function name, and first line number. It is illegal to + :keyword:`exec` or :func:`eval` the resulting code object. Modified: python/trunk/Doc/c-api/concrete.rst ============================================================================== --- python/trunk/Doc/c-api/concrete.rst (original) +++ python/trunk/Doc/c-api/concrete.rst Fri May 8 23:51:06 2009 @@ -105,3 +105,4 @@ gen.rst datetime.rst set.rst + code.rst Modified: python/trunk/Include/code.h ============================================================================== --- python/trunk/Include/code.h (original) +++ python/trunk/Include/code.h Fri May 8 23:51:06 2009 @@ -70,6 +70,11 @@ int, int, int, int, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int, PyObject *); /* same as struct above */ + +/* Creates a new empty code object with the specified source location. */ +PyAPI_FUNC(PyCodeObject *) +PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno); + PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int); /* for internal use only */ Modified: python/trunk/Lib/test/test_code.py ============================================================================== --- python/trunk/Lib/test/test_code.py (original) +++ python/trunk/Lib/test/test_code.py Fri May 8 23:51:06 2009 @@ -80,6 +80,9 @@ """ +import unittest +import _testcapi + def consts(t): """Yield a doctest-safe sequence of object reprs.""" for elt in t: @@ -96,10 +99,21 @@ print "%s: %s" % (attr, getattr(co, "co_" + attr)) print "consts:", tuple(consts(co.co_consts)) + +class CodeTest(unittest.TestCase): + + def test_newempty(self): + co = _testcapi.code_newempty("filename", "funcname", 15) + self.assertEquals(co.co_filename, "filename") + self.assertEquals(co.co_name, "funcname") + self.assertEquals(co.co_firstlineno, 15) + + def test_main(verbose=None): - from test.test_support import run_doctest + from test.test_support import run_doctest, run_unittest from test import test_code run_doctest(test_code, verbose) + run_unittest(CodeTest) if __name__ == '__main__': Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri May 8 23:51:06 2009 @@ -927,6 +927,9 @@ C-API ----- +- Issue #5959: Add a PyCode_NewEmpty() function to create a new empty code + object at a specified file, function, and line number. + - Issue #1419652: Change the first argument to PyImport_AppendInittab() to ``const char *`` as the string is stored beyond the call. Modified: python/trunk/Modules/_ctypes/callbacks.c ============================================================================== --- python/trunk/Modules/_ctypes/callbacks.c (original) +++ python/trunk/Modules/_ctypes/callbacks.c Fri May 8 23:51:06 2009 @@ -99,40 +99,13 @@ /* after code that pyrex generates */ void _ctypes_add_traceback(char *funcname, char *filename, int lineno) { - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; PyObject *py_globals = 0; - PyObject *empty_tuple = 0; - PyObject *empty_string = 0; PyCodeObject *py_code = 0; PyFrameObject *py_frame = 0; - - py_srcfile = PyString_FromString(filename); - if (!py_srcfile) goto bad; - py_funcname = PyString_FromString(funcname); - if (!py_funcname) goto bad; + py_globals = PyDict_New(); if (!py_globals) goto bad; - empty_tuple = PyTuple_New(0); - if (!empty_tuple) goto bad; - empty_string = PyString_FromString(""); - if (!empty_string) goto bad; - py_code = PyCode_New( - 0, /*int argcount,*/ - 0, /*int nlocals,*/ - 0, /*int stacksize,*/ - 0, /*int flags,*/ - empty_string, /*PyObject *code,*/ - empty_tuple, /*PyObject *consts,*/ - empty_tuple, /*PyObject *names,*/ - empty_tuple, /*PyObject *varnames,*/ - empty_tuple, /*PyObject *freevars,*/ - empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - lineno, /*int firstlineno,*/ - empty_string /*PyObject *lnotab*/ - ); + py_code = PyCode_NewEmpty(filename, funcname, lineno); if (!py_code) goto bad; py_frame = PyFrame_New( PyThreadState_Get(), /*PyThreadState *tstate,*/ @@ -145,10 +118,6 @@ PyTraceBack_Here(py_frame); bad: Py_XDECREF(py_globals); - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - Py_XDECREF(empty_tuple); - Py_XDECREF(empty_string); Py_XDECREF(py_code); Py_XDECREF(py_frame); } Modified: python/trunk/Modules/_testcapimodule.c ============================================================================== --- python/trunk/Modules/_testcapimodule.c (original) +++ python/trunk/Modules/_testcapimodule.c Fri May 8 23:51:06 2009 @@ -988,6 +988,21 @@ Py_RETURN_NONE; } +/* To test that the result of PyCode_NewEmpty has the right members. */ +static PyObject * +code_newempty(PyObject *self, PyObject *args) +{ + const char *filename; + const char *funcname; + int firstlineno; + + if (!PyArg_ParseTuple(args, "ssi:code_newempty", + &filename, &funcname, &firstlineno)) + return NULL; + + return (PyObject *)PyCode_NewEmpty(filename, funcname, firstlineno); +} + static PyMethodDef TestMethods[] = { {"raise_exception", raise_exception, METH_VARARGS}, {"test_config", (PyCFunction)test_config, METH_NOARGS}, @@ -1033,6 +1048,7 @@ {"_pending_threadfunc", pending_threadfunc, METH_VARARGS}, #endif {"traceback_print", traceback_print, METH_VARARGS}, + {"code_newempty", code_newempty, METH_VARARGS}, {NULL, NULL} /* sentinel */ }; Modified: python/trunk/Modules/pyexpat.c ============================================================================== --- python/trunk/Modules/pyexpat.c (original) +++ python/trunk/Modules/pyexpat.c Fri May 8 23:51:06 2009 @@ -261,52 +261,11 @@ static PyCodeObject* getcode(enum HandlerTypes slot, char* func_name, int lineno) { - PyObject *code = NULL; - PyObject *name = NULL; - PyObject *nulltuple = NULL; - PyObject *filename = NULL; - if (handler_info[slot].tb_code == NULL) { - code = PyString_FromString(""); - if (code == NULL) - goto failed; - name = PyString_FromString(func_name); - if (name == NULL) - goto failed; - nulltuple = PyTuple_New(0); - if (nulltuple == NULL) - goto failed; - filename = PyString_FromString(__FILE__); handler_info[slot].tb_code = - PyCode_New(0, /* argcount */ - 0, /* nlocals */ - 0, /* stacksize */ - 0, /* flags */ - code, /* code */ - nulltuple, /* consts */ - nulltuple, /* names */ - nulltuple, /* varnames */ -#if PYTHON_API_VERSION >= 1010 - nulltuple, /* freevars */ - nulltuple, /* cellvars */ -#endif - filename, /* filename */ - name, /* name */ - lineno, /* firstlineno */ - code /* lnotab */ - ); - if (handler_info[slot].tb_code == NULL) - goto failed; - Py_DECREF(code); - Py_DECREF(nulltuple); - Py_DECREF(filename); - Py_DECREF(name); + PyCode_NewEmpty(__FILE__, func_name, lineno); } return handler_info[slot].tb_code; - failed: - Py_XDECREF(code); - Py_XDECREF(name); - return NULL; } #ifdef FIX_TRACE Modified: python/trunk/Objects/codeobject.c ============================================================================== --- python/trunk/Objects/codeobject.c (original) +++ python/trunk/Objects/codeobject.c Fri May 8 23:51:06 2009 @@ -107,6 +107,52 @@ return co; } +PyCodeObject * +PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno) +{ + static PyObject *emptystring = NULL; + static PyObject *nulltuple = NULL; + PyObject *filename_ob = NULL; + PyObject *funcname_ob = NULL; + PyCodeObject *result = NULL; + if (emptystring == NULL) { + emptystring = PyString_FromString(""); + if (emptystring == NULL) + goto failed; + } + if (nulltuple == NULL) { + nulltuple = PyTuple_New(0); + if (nulltuple == NULL) + goto failed; + } + funcname_ob = PyString_FromString(funcname); + if (funcname_ob == NULL) + goto failed; + filename_ob = PyString_FromString(filename); + if (filename_ob == NULL) + goto failed; + + result = PyCode_New(0, /* argcount */ + 0, /* nlocals */ + 0, /* stacksize */ + 0, /* flags */ + emptystring, /* code */ + nulltuple, /* consts */ + nulltuple, /* names */ + nulltuple, /* varnames */ + nulltuple, /* freevars */ + nulltuple, /* cellvars */ + filename_ob, /* filename */ + funcname_ob, /* name */ + firstlineno, /* firstlineno */ + emptystring /* lnotab */ + ); + +failed: + Py_XDECREF(funcname_ob); + Py_XDECREF(filename_ob); + return result; +} #define OFF(x) offsetof(PyCodeObject, x) From buildbot at python.org Fri May 8 23:52:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 08 May 2009 21:52:18 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090508215219.2D38A1E400C@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/4964 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_signal make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat May 9 00:23:21 2009 From: python-checkins at python.org (jeffrey.yasskin) Date: Sat, 9 May 2009 00:23:21 +0200 (CEST) Subject: [Python-checkins] r72488 - in python/trunk: Doc/c-api/reflection.rst Include/code.h Include/frameobject.h Misc/NEWS Objects/frameobject.c Python/_warnings.c Python/ceval.c Python/traceback.c Message-ID: <20090508222321.BF8751E4018@bag.python.org> Author: jeffrey.yasskin Date: Sat May 9 00:23:21 2009 New Revision: 72488 Log: Issue 5954, PyFrame_GetLineNumber: Most uses of PyCode_Addr2Line (http://www.google.com/codesearch?q=PyCode_Addr2Line) are just trying to get the line number of a specified frame, but there's no way to do that directly. Forcing people to go through the code object makes them know more about the guts of the interpreter than they should need. The remaining uses of PyCode_Addr2Line seem to be getting the line from a traceback (for example, http://www.google.com/codesearch/p?hl=en#u_9_nDrchrw/pygame-1.7.1release/src/base.c&q=PyCode_Addr2Line), which is replaced by the tb_lineno field. So we may be able to deprecate PyCode_Addr2Line entirely for external use. Modified: python/trunk/Doc/c-api/reflection.rst python/trunk/Include/code.h python/trunk/Include/frameobject.h python/trunk/Misc/NEWS python/trunk/Objects/frameobject.c python/trunk/Python/_warnings.c python/trunk/Python/ceval.c python/trunk/Python/traceback.c Modified: python/trunk/Doc/c-api/reflection.rst ============================================================================== --- python/trunk/Doc/c-api/reflection.rst (original) +++ python/trunk/Doc/c-api/reflection.rst Sat May 9 00:23:21 2009 @@ -29,6 +29,11 @@ currently executing. +.. cfunction:: int PyFrame_GetLineNumber(PyFrameObject *frame) + + Return the line number that *frame* is currently executing. + + .. cfunction:: int PyEval_GetRestricted() If there is a current frame and it is executing in restricted mode, return true, Modified: python/trunk/Include/code.h ============================================================================== --- python/trunk/Include/code.h (original) +++ python/trunk/Include/code.h Sat May 9 00:23:21 2009 @@ -75,6 +75,9 @@ PyAPI_FUNC(PyCodeObject *) PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno); +/* Return the line number associated with the specified bytecode index + in this code object. If you just need the line number of a frame, + use PyFrame_GetLineNumber() instead. */ PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int); /* for internal use only */ Modified: python/trunk/Include/frameobject.h ============================================================================== --- python/trunk/Include/frameobject.h (original) +++ python/trunk/Include/frameobject.h Sat May 9 00:23:21 2009 @@ -38,8 +38,11 @@ PyThreadState *f_tstate; int f_lasti; /* Last instruction if called */ - /* As of 2.3 f_lineno is only valid when tracing is active (i.e. when - f_trace is set) -- at other times use PyCode_Addr2Line instead. */ + /* Call PyFrame_GetLineNumber() instead of reading this field + directly. As of 2.3 f_lineno is only valid when tracing is + active (i.e. when f_trace is set). At other times we use + PyCode_Addr2Line to calculate the line from the current + bytecode index. */ int f_lineno; /* Current line number */ int f_iblock; /* index in f_blockstack */ PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */ @@ -77,6 +80,9 @@ PyAPI_FUNC(int) PyFrame_ClearFreeList(void); +/* Return the line of code the frame is currently executing. */ +PyAPI_FUNC(int) PyFrame_GetLineNumber(PyFrameObject *); + #ifdef __cplusplus } #endif Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat May 9 00:23:21 2009 @@ -927,6 +927,9 @@ C-API ----- +- Issue #5954: Add a PyFrame_GetLineNumber() function to replace most uses of + PyCode_Addr2Line(). + - Issue #5959: Add a PyCode_NewEmpty() function to create a new empty code object at a specified file, function, and line number. Modified: python/trunk/Objects/frameobject.c ============================================================================== --- python/trunk/Objects/frameobject.c (original) +++ python/trunk/Objects/frameobject.c Sat May 9 00:23:21 2009 @@ -60,17 +60,19 @@ return f->f_locals; } -static PyObject * -frame_getlineno(PyFrameObject *f, void *closure) +int +PyFrame_GetLineNumber(PyFrameObject *f) { - int lineno; - if (f->f_trace) - lineno = f->f_lineno; + return f->f_lineno; else - lineno = PyCode_Addr2Line(f->f_code, f->f_lasti); + return PyCode_Addr2Line(f->f_code, f->f_lasti); +} - return PyInt_FromLong(lineno); +static PyObject * +frame_getlineno(PyFrameObject *f, void *closure) +{ + return PyInt_FromLong(PyFrame_GetLineNumber(f)); } /* Setter for f_lineno - you can set f_lineno from within a trace function in @@ -351,16 +353,14 @@ static int frame_settrace(PyFrameObject *f, PyObject* v, void *closure) { - /* We rely on f_lineno being accurate when f_trace is set. */ + PyObject* old_value; - PyObject* old_value = f->f_trace; + /* We rely on f_lineno being accurate when f_trace is set. */ + f->f_lineno = PyFrame_GetLineNumber(f); + old_value = f->f_trace; Py_XINCREF(v); f->f_trace = v; - - if (v != NULL) - f->f_lineno = PyCode_Addr2Line(f->f_code, f->f_lasti); - Py_XDECREF(old_value); return 0; Modified: python/trunk/Python/_warnings.c ============================================================================== --- python/trunk/Python/_warnings.c (original) +++ python/trunk/Python/_warnings.c Sat May 9 00:23:21 2009 @@ -454,7 +454,7 @@ } else { globals = f->f_globals; - *lineno = PyCode_Addr2Line(f->f_code, f->f_lasti); + *lineno = PyFrame_GetLineNumber(f); } *module = NULL; Modified: python/trunk/Python/ceval.c ============================================================================== --- python/trunk/Python/ceval.c (original) +++ python/trunk/Python/ceval.c Sat May 9 00:23:21 2009 @@ -2698,7 +2698,7 @@ default: fprintf(stderr, "XXX lineno: %d, opcode: %d\n", - PyCode_Addr2Line(f->f_code, f->f_lasti), + PyFrame_GetLineNumber(f), opcode); PyErr_SetString(PyExc_SystemError, "unknown opcode"); why = WHY_EXCEPTION; Modified: python/trunk/Python/traceback.c ============================================================================== --- python/trunk/Python/traceback.c (original) +++ python/trunk/Python/traceback.c Sat May 9 00:23:21 2009 @@ -96,8 +96,7 @@ Py_XINCREF(frame); tb->tb_frame = frame; tb->tb_lasti = frame->f_lasti; - tb->tb_lineno = PyCode_Addr2Line(frame->f_code, - frame->f_lasti); + tb->tb_lineno = PyFrame_GetLineNumber(frame); PyObject_GC_Track(tb); } return tb; From buildbot at python.org Sat May 9 00:52:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 08 May 2009 22:52:37 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090508225237.DB5E21E4018@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%202.6/builds/322 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_urllib2_localnet make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat May 9 01:16:47 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sat, 9 May 2009 01:16:47 +0200 (CEST) Subject: [Python-checkins] r72489 - in python/trunk/Lib: ipaddr.py test/test_ipaddr.py Message-ID: <20090508231647.64B791E4018@bag.python.org> Author: gregory.p.smith Date: Sat May 9 01:16:47 2009 New Revision: 72489 Log: Fix an off by one error on negative indexs to __getitem__ http://code.google.com/p/ipaddr-py/issues/detail?id=15 Modified: python/trunk/Lib/ipaddr.py python/trunk/Lib/test/test_ipaddr.py Modified: python/trunk/Lib/ipaddr.py ============================================================================== --- python/trunk/Lib/ipaddr.py (original) +++ python/trunk/Lib/ipaddr.py Sat May 9 01:16:47 2009 @@ -209,6 +209,7 @@ raise IndexError return self._string_from_ip_int(self.network + n) else: + n += 1 if self.broadcast + n < self.network: raise IndexError return self._string_from_ip_int(self.broadcast + n) Modified: python/trunk/Lib/test/test_ipaddr.py ============================================================================== --- python/trunk/Lib/test/test_ipaddr.py (original) +++ python/trunk/Lib/test/test_ipaddr.py Sat May 9 01:16:47 2009 @@ -254,6 +254,17 @@ self.assertEqual(self.ipv6[5], '2001:658:22a:cafe::5') + def test_getitem(self): + # http://code.google.com/p/ipaddr-py/issues/detail?id=15 + addr = ipaddr.IPv4('172.31.255.128/255.255.255.240') + self.assertEqual(28, addr.prefixlen) + addr_list = list(addr) + self.assertEqual('172.31.255.128', addr_list[0]) + self.assertEqual('172.31.255.128', addr[0]) + self.assertEqual('172.31.255.143', addr_list[-1]) + self.assertEqual('172.31.255.143', addr[-1]) + self.assertEqual(addr_list[-1], addr[-1]) + def test_equals(self): self.assertTrue(self.ipv4 == ipaddr.IPv4('1.2.3.4/24')) self.assertFalse(self.ipv4 == ipaddr.IPv4('1.2.3.4/23')) From python-checkins at python.org Sat May 9 01:19:47 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sat, 9 May 2009 01:19:47 +0200 (CEST) Subject: [Python-checkins] r72490 - in python/branches/py3k: Lib/ipaddr.py Lib/test/test_ipaddr.py Message-ID: <20090508231947.495CA1E4018@bag.python.org> Author: gregory.p.smith Date: Sat May 9 01:19:47 2009 New Revision: 72490 Log: Merged revisions 72489 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72489 | gregory.p.smith | 2009-05-08 16:16:47 -0700 (Fri, 08 May 2009) | 3 lines Fix an off by one error on negative indexs to __getitem__ http://code.google.com/p/ipaddr-py/issues/detail?id=15 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/ipaddr.py python/branches/py3k/Lib/test/test_ipaddr.py Modified: python/branches/py3k/Lib/ipaddr.py ============================================================================== --- python/branches/py3k/Lib/ipaddr.py (original) +++ python/branches/py3k/Lib/ipaddr.py Sat May 9 01:19:47 2009 @@ -209,6 +209,7 @@ raise IndexError return self._string_from_ip_int(self.network + n) else: + n += 1 if self.broadcast + n < self.network: raise IndexError return self._string_from_ip_int(self.broadcast + n) Modified: python/branches/py3k/Lib/test/test_ipaddr.py ============================================================================== --- python/branches/py3k/Lib/test/test_ipaddr.py (original) +++ python/branches/py3k/Lib/test/test_ipaddr.py Sat May 9 01:19:47 2009 @@ -274,6 +274,17 @@ self.assertEqual(self.ipv6[5], '2001:658:22a:cafe::5') + def test_getitem(self): + # http://code.google.com/p/ipaddr-py/issues/detail?id=15 + addr = ipaddr.IPv4('172.31.255.128/255.255.255.240') + self.assertEqual(28, addr.prefixlen) + addr_list = list(addr) + self.assertEqual('172.31.255.128', addr_list[0]) + self.assertEqual('172.31.255.128', addr[0]) + self.assertEqual('172.31.255.143', addr_list[-1]) + self.assertEqual('172.31.255.143', addr[-1]) + self.assertEqual(addr_list[-1], addr[-1]) + def test_equals(self): self.assertTrue(self.ipv4 == ipaddr.IPv4('1.2.3.4/24')) self.assertFalse(self.ipv4 == ipaddr.IPv4('1.2.3.4/23')) From buildbot at python.org Sat May 9 01:58:21 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 08 May 2009 23:58:21 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090508235821.25E711E4024@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/934 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: gregory.p.smith BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_time make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat May 9 02:33:27 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 02:33:27 +0200 (CEST) Subject: [Python-checkins] r72491 - in sandbox/trunk/2to3/lib2to3: fixer_base.py fixer_util.py fixes/fix_apply.py fixes/fix_basestring.py fixes/fix_buffer.py fixes/fix_callable.py fixes/fix_dict.py fixes/fix_except.py fixes/fix_exec.py fixes/fix_execfile.py fixes/fix_filter.py fixes/fix_funcattrs.py fixes/fix_getcwdu.py fixes/fix_has_key.py fixes/fix_idioms.py fixes/fix_import.py fixes/fix_imports.py fixes/fix_input.py fixes/fix_intern.py fixes/fix_itertools.py fixes/fix_itertools_imports.py fixes/fix_long.py fixes/fix_map.py fixes/fix_metaclass.py fixes/fix_methodattrs.py fixes/fix_ne.py fixes/fix_next.py fixes/fix_nonzero.py fixes/fix_numliterals.py fixes/fix_paren.py fixes/fix_print.py fixes/fix_raise.py fixes/fix_raw_input.py fixes/fix_reduce.py fixes/fix_renames.py fixes/fix_repr.py fixes/fix_set_literal.py fixes/fix_standarderror.py fixes/fix_sys_exc.py fixes/fix_throw.py fixes/fix_tuple_params.py fixes/fix_types.py fixes/fix_unicode.py fixes/fix_ws_comma.py fixes/fix_xrange.py fixes/fix_xreadlines.py fixes/fix_zip.py main.py patcomp.py pgen2/driver.py pgen2/tokenize.py pytree.py refactor.py tests/data/different_encoding.py tests/support.py tests/test_all_fixers.py tests/test_fixers.py tests/test_parser.py tests/test_refactor.py Message-ID: <20090509003327.CF5331E4024@bag.python.org> Author: benjamin.peterson Date: Sat May 9 02:33:27 2009 New Revision: 72491 Log: make 2to3 use unicode internally on 2.x This started out as a fix for #2660, but became this large refactoring when I realized the dire state this was in. 2to3 now uses tokenize.detect_encoding to decode the files correctly into unicode. Added: sandbox/trunk/2to3/lib2to3/tests/data/different_encoding.py (contents, props changed) Modified: sandbox/trunk/2to3/lib2to3/fixer_base.py sandbox/trunk/2to3/lib2to3/fixer_util.py sandbox/trunk/2to3/lib2to3/fixes/fix_apply.py sandbox/trunk/2to3/lib2to3/fixes/fix_basestring.py sandbox/trunk/2to3/lib2to3/fixes/fix_buffer.py sandbox/trunk/2to3/lib2to3/fixes/fix_callable.py sandbox/trunk/2to3/lib2to3/fixes/fix_dict.py sandbox/trunk/2to3/lib2to3/fixes/fix_except.py sandbox/trunk/2to3/lib2to3/fixes/fix_exec.py sandbox/trunk/2to3/lib2to3/fixes/fix_execfile.py sandbox/trunk/2to3/lib2to3/fixes/fix_filter.py sandbox/trunk/2to3/lib2to3/fixes/fix_funcattrs.py sandbox/trunk/2to3/lib2to3/fixes/fix_getcwdu.py sandbox/trunk/2to3/lib2to3/fixes/fix_has_key.py sandbox/trunk/2to3/lib2to3/fixes/fix_idioms.py sandbox/trunk/2to3/lib2to3/fixes/fix_import.py sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py sandbox/trunk/2to3/lib2to3/fixes/fix_input.py sandbox/trunk/2to3/lib2to3/fixes/fix_intern.py sandbox/trunk/2to3/lib2to3/fixes/fix_itertools.py sandbox/trunk/2to3/lib2to3/fixes/fix_itertools_imports.py sandbox/trunk/2to3/lib2to3/fixes/fix_long.py sandbox/trunk/2to3/lib2to3/fixes/fix_map.py sandbox/trunk/2to3/lib2to3/fixes/fix_metaclass.py sandbox/trunk/2to3/lib2to3/fixes/fix_methodattrs.py sandbox/trunk/2to3/lib2to3/fixes/fix_ne.py sandbox/trunk/2to3/lib2to3/fixes/fix_next.py sandbox/trunk/2to3/lib2to3/fixes/fix_nonzero.py sandbox/trunk/2to3/lib2to3/fixes/fix_numliterals.py sandbox/trunk/2to3/lib2to3/fixes/fix_paren.py sandbox/trunk/2to3/lib2to3/fixes/fix_print.py sandbox/trunk/2to3/lib2to3/fixes/fix_raise.py sandbox/trunk/2to3/lib2to3/fixes/fix_raw_input.py sandbox/trunk/2to3/lib2to3/fixes/fix_reduce.py sandbox/trunk/2to3/lib2to3/fixes/fix_renames.py sandbox/trunk/2to3/lib2to3/fixes/fix_repr.py sandbox/trunk/2to3/lib2to3/fixes/fix_set_literal.py sandbox/trunk/2to3/lib2to3/fixes/fix_standarderror.py sandbox/trunk/2to3/lib2to3/fixes/fix_sys_exc.py sandbox/trunk/2to3/lib2to3/fixes/fix_throw.py sandbox/trunk/2to3/lib2to3/fixes/fix_tuple_params.py sandbox/trunk/2to3/lib2to3/fixes/fix_types.py sandbox/trunk/2to3/lib2to3/fixes/fix_unicode.py sandbox/trunk/2to3/lib2to3/fixes/fix_ws_comma.py sandbox/trunk/2to3/lib2to3/fixes/fix_xrange.py sandbox/trunk/2to3/lib2to3/fixes/fix_xreadlines.py sandbox/trunk/2to3/lib2to3/fixes/fix_zip.py sandbox/trunk/2to3/lib2to3/main.py sandbox/trunk/2to3/lib2to3/patcomp.py sandbox/trunk/2to3/lib2to3/pgen2/driver.py sandbox/trunk/2to3/lib2to3/pgen2/tokenize.py sandbox/trunk/2to3/lib2to3/pytree.py sandbox/trunk/2to3/lib2to3/refactor.py sandbox/trunk/2to3/lib2to3/tests/support.py sandbox/trunk/2to3/lib2to3/tests/test_all_fixers.py sandbox/trunk/2to3/lib2to3/tests/test_fixers.py sandbox/trunk/2to3/lib2to3/tests/test_parser.py sandbox/trunk/2to3/lib2to3/tests/test_refactor.py Modified: sandbox/trunk/2to3/lib2to3/fixer_base.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixer_base.py (original) +++ sandbox/trunk/2to3/lib2to3/fixer_base.py Sat May 9 02:33:27 2009 @@ -94,14 +94,14 @@ """ raise NotImplementedError() - def new_name(self, template="xxx_todo_changeme"): + def new_name(self, template=u"xxx_todo_changeme"): """Return a string suitable for use as an identifier The new name is guaranteed not to conflict with other identifiers. """ name = template while name in self.used_names: - name = template + str(self.numbers.next()) + name = template + unicode(self.numbers.next()) self.used_names.add(name) return name @@ -120,7 +120,7 @@ """ lineno = node.get_lineno() for_output = node.clone() - for_output.set_prefix("") + for_output.set_prefix(u"") msg = "Line %d: could not convert: %s" self.log_message(msg % (lineno, for_output)) if reason: Modified: sandbox/trunk/2to3/lib2to3/fixer_util.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixer_util.py (original) +++ sandbox/trunk/2to3/lib2to3/fixer_util.py Sat May 9 02:33:27 2009 @@ -14,13 +14,13 @@ def KeywordArg(keyword, value): return Node(syms.argument, - [keyword, Leaf(token.EQUAL, '='), value]) + [keyword, Leaf(token.EQUAL, u'='), value]) def LParen(): - return Leaf(token.LPAR, "(") + return Leaf(token.LPAR, u"(") def RParen(): - return Leaf(token.RPAR, ")") + return Leaf(token.RPAR, u")") def Assign(target, source): """Build an assignment statement""" @@ -43,11 +43,11 @@ def Comma(): """A comma leaf""" - return Leaf(token.COMMA, ",") + return Leaf(token.COMMA, u",") def Dot(): """A period (.) leaf""" - return Leaf(token.DOT, ".") + return Leaf(token.DOT, u".") def ArgList(args, lparen=LParen(), rparen=RParen()): """A parenthesised argument list, used by Call()""" @@ -65,20 +65,20 @@ def Newline(): """A newline literal""" - return Leaf(token.NEWLINE, "\n") + return Leaf(token.NEWLINE, u"\n") def BlankLine(): """A blank line""" - return Leaf(token.NEWLINE, "") + return Leaf(token.NEWLINE, u"") def Number(n, prefix=None): return Leaf(token.NUMBER, n, prefix=prefix) def Subscript(index_node): """A numeric or string subscript""" - return Node(syms.trailer, [Leaf(token.LBRACE, '['), + return Node(syms.trailer, [Leaf(token.LBRACE, u'['), index_node, - Leaf(token.RBRACE, ']')]) + Leaf(token.RBRACE, u']')]) def String(string, prefix=None): """A string leaf""" @@ -89,24 +89,24 @@ If test is None, the "if test" part is omitted. """ - xp.set_prefix("") - fp.set_prefix(" ") - it.set_prefix(" ") - for_leaf = Leaf(token.NAME, "for") - for_leaf.set_prefix(" ") - in_leaf = Leaf(token.NAME, "in") - in_leaf.set_prefix(" ") + xp.set_prefix(u"") + fp.set_prefix(u" ") + it.set_prefix(u" ") + for_leaf = Leaf(token.NAME, u"for") + for_leaf.set_prefix(u" ") + in_leaf = Leaf(token.NAME, u"in") + in_leaf.set_prefix(u" ") inner_args = [for_leaf, fp, in_leaf, it] if test: - test.set_prefix(" ") - if_leaf = Leaf(token.NAME, "if") - if_leaf.set_prefix(" ") + test.set_prefix(u" ") + if_leaf = Leaf(token.NAME, u"if") + if_leaf.set_prefix(u" ") inner_args.append(Node(syms.comp_if, [if_leaf, test])) inner = Node(syms.listmaker, [xp, Node(syms.comp_for, inner_args)]) return Node(syms.atom, - [Leaf(token.LBRACE, "["), + [Leaf(token.LBRACE, u"["), inner, - Leaf(token.RBRACE, "]")]) + Leaf(token.RBRACE, u"]")]) def FromImport(package_name, name_leafs): """ Return an import statement in the form: @@ -120,9 +120,9 @@ # Pull the leaves out of their old tree leaf.remove() - children = [Leaf(token.NAME, 'from'), - Leaf(token.NAME, package_name, prefix=" "), - Leaf(token.NAME, 'import', prefix=" "), + children = [Leaf(token.NAME, u'from'), + Leaf(token.NAME, package_name, prefix=u" "), + Leaf(token.NAME, u'import', prefix=u" "), Node(syms.import_as_names, name_leafs)] imp = Node(syms.import_from, children) return imp @@ -141,8 +141,8 @@ and isinstance(node.children[0], Leaf) and isinstance(node.children[1], Node) and isinstance(node.children[2], Leaf) - and node.children[0].value == "(" - and node.children[2].value == ")") + and node.children[0].value == u"(" + and node.children[2].value == u")") def is_list(node): """Does the node represent a list literal?""" @@ -150,8 +150,8 @@ and len(node.children) > 1 and isinstance(node.children[0], Leaf) and isinstance(node.children[-1], Leaf) - and node.children[0].value == "[" - and node.children[-1].value == "]") + and node.children[0].value == u"[" + and node.children[-1].value == u"]") ########################################################### @@ -317,11 +317,11 @@ if package is None: import_ = Node(syms.import_name, [ - Leaf(token.NAME, 'import'), - Leaf(token.NAME, name, prefix=' ') + Leaf(token.NAME, u'import'), + Leaf(token.NAME, name, prefix=u' ') ]) else: - import_ = FromImport(package, [Leaf(token.NAME, name, prefix=' ')]) + import_ = FromImport(package, [Leaf(token.NAME, name, prefix=u' ')]) children = [import_, Newline()] if add_newline_before: @@ -409,7 +409,7 @@ if package and unicode(node.children[1]).strip() != package: return None n = node.children[3] - if package and _find('as', n): + if package and _find(u'as', n): # See test_from_import_as for explanation return None elif n.type == syms.import_as_names and _find(name, n): Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_apply.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_apply.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_apply.py Sat May 9 02:33:27 2009 @@ -46,12 +46,12 @@ if kwds is not None: kwds = kwds.clone() kwds.set_prefix("") - l_newargs = [pytree.Leaf(token.STAR, "*"), args] + l_newargs = [pytree.Leaf(token.STAR, u"*"), args] if kwds is not None: l_newargs.extend([Comma(), - pytree.Leaf(token.DOUBLESTAR, "**"), + pytree.Leaf(token.DOUBLESTAR, u"**"), kwds]) - l_newargs[-2].set_prefix(" ") # that's the ** token + l_newargs[-2].set_prefix(u" ") # that's the ** token # XXX Sometimes we could be cleverer, e.g. apply(f, (x, y) + t) # can be translated into f(x, y, *t) instead of f(*(x, y) + t) #new = pytree.Node(syms.power, (func, ArgList(l_newargs))) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_basestring.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_basestring.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_basestring.py Sat May 9 02:33:27 2009 @@ -10,4 +10,4 @@ PATTERN = "'basestring'" def transform(self, node, results): - return Name("str", prefix=node.get_prefix()) + return Name(u"str", prefix=node.get_prefix()) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_buffer.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_buffer.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_buffer.py Sat May 9 02:33:27 2009 @@ -18,4 +18,4 @@ def transform(self, node, results): name = results["name"] - name.replace(Name("memoryview", prefix=name.get_prefix())) + name.replace(Name(u"memoryview", prefix=name.get_prefix())) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_callable.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_callable.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_callable.py Sat May 9 02:33:27 2009 @@ -27,5 +27,5 @@ def transform(self, node, results): func = results["func"] - args = [func.clone(), String(', '), String("'__call__'")] - return Call(Name("hasattr"), args, prefix=node.get_prefix()) + args = [func.clone(), String(u', '), String(u"'__call__'")] + return Call(Name(u"hasattr"), args, prefix=node.get_prefix()) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_dict.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_dict.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_dict.py Sat May 9 02:33:27 2009 @@ -51,7 +51,7 @@ tail = results["tail"] syms = self.syms method_name = method.value - isiter = method_name.startswith("iter") + isiter = method_name.startswith(u"iter") if isiter: method_name = method_name[4:] assert method_name in ("keys", "items", "values"), repr(method) @@ -65,8 +65,8 @@ results["parens"].clone()] new = pytree.Node(syms.power, args) if not special: - new.set_prefix("") - new = Call(Name(isiter and "iter" or "list"), [new]) + new.set_prefix(u"") + new = Call(Name(isiter and u"iter" or u"list"), [new]) if tail: new = pytree.Node(syms.power, [new] + tail) new.set_prefix(node.get_prefix()) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_except.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_except.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_except.py Sat May 9 02:33:27 2009 @@ -30,7 +30,7 @@ def find_excepts(nodes): for i, n in enumerate(nodes): if n.type == syms.except_clause: - if n.children[0].value == 'except': + if n.children[0].value == u'except': yield (n, nodes[i+2]) class FixExcept(fixer_base.BaseFix): @@ -52,13 +52,13 @@ for except_clause, e_suite in find_excepts(try_cleanup): if len(except_clause.children) == 4: (E, comma, N) = except_clause.children[1:4] - comma.replace(Name("as", prefix=" ")) + comma.replace(Name(u"as", prefix=u" ")) if N.type != token.NAME: # Generate a new N for the except clause - new_N = Name(self.new_name(), prefix=" ") + new_N = Name(self.new_name(), prefix=u" ") target = N.clone() - target.set_prefix("") + target.set_prefix(u"") N.replace(new_N) new_N = new_N.clone() @@ -74,7 +74,7 @@ # The assignment is different if old_N is a tuple or list # In that case, the assignment is old_N = new_N.args if is_tuple(N) or is_list(N): - assign = Assign(target, Attr(new_N, Name('args'))) + assign = Assign(target, Attr(new_N, Name(u'args'))) else: assign = Assign(target, new_N) @@ -82,10 +82,10 @@ for child in reversed(suite_stmts[:i]): e_suite.insert_child(0, child) e_suite.insert_child(i, assign) - elif N.get_prefix() == "": + elif N.get_prefix() == u"": # No space after a comma is legal; no space after "as", # not so much. - N.set_prefix(" ") + N.set_prefix(u" ") #TODO(cwinter) fix this when children becomes a smart list children = [c.clone() for c in node.children[:3]] + try_cleanup + tail Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_exec.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_exec.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_exec.py Sat May 9 02:33:27 2009 @@ -36,4 +36,4 @@ if c is not None: args.extend([Comma(), c.clone()]) - return Call(Name("exec"), args, prefix=node.get_prefix()) + return Call(Name(u"exec"), args, prefix=node.get_prefix()) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_execfile.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_execfile.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_execfile.py Sat May 9 02:33:27 2009 @@ -31,21 +31,21 @@ execfile_paren = node.children[-1].children[-1].clone() # Construct open().read(). open_args = ArgList([filename.clone()], rparen=execfile_paren) - open_call = Node(syms.power, [Name("open"), open_args]) - read = [Node(syms.trailer, [Dot(), Name('read')]), + open_call = Node(syms.power, [Name(u"open"), open_args]) + read = [Node(syms.trailer, [Dot(), Name(u'read')]), Node(syms.trailer, [LParen(), RParen()])] open_expr = [open_call] + read # Wrap the open call in a compile call. This is so the filename will be # preserved in the execed code. filename_arg = filename.clone() - filename_arg.set_prefix(" ") - exec_str = String("'exec'", " ") + filename_arg.set_prefix(u" ") + exec_str = String(u"'exec'", u" ") compile_args = open_expr + [Comma(), filename_arg, Comma(), exec_str] - compile_call = Call(Name("compile"), compile_args, "") + compile_call = Call(Name(u"compile"), compile_args, u"") # Finally, replace the execfile call with an exec call. args = [compile_call] if globals is not None: args.extend([Comma(), globals.clone()]) if locals is not None: args.extend([Comma(), locals.clone()]) - return Call(Name("exec"), args, prefix=node.get_prefix()) + return Call(Name(u"exec"), args, prefix=node.get_prefix()) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_filter.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_filter.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_filter.py Sat May 9 02:33:27 2009 @@ -60,16 +60,16 @@ results.get("xp").clone()) elif "none" in results: - new = ListComp(Name("_f"), - Name("_f"), + new = ListComp(Name(u"_f"), + Name(u"_f"), results["seq"].clone(), - Name("_f")) + Name(u"_f")) else: if in_special_context(node): return None new = node.clone() - new.set_prefix("") - new = Call(Name("list"), [new]) + new.set_prefix(u"") + new = Call(Name(u"list"), [new]) new.set_prefix(node.get_prefix()) return new Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_funcattrs.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_funcattrs.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_funcattrs.py Sat May 9 02:33:27 2009 @@ -15,5 +15,5 @@ def transform(self, node, results): attr = results["attr"][0] - attr.replace(Name(("__%s__" % attr.value[5:]), + attr.replace(Name((u"__%s__" % attr.value[5:]), prefix=attr.get_prefix())) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_getcwdu.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_getcwdu.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_getcwdu.py Sat May 9 02:33:27 2009 @@ -15,4 +15,4 @@ def transform(self, node, results): name = results["name"] - name.replace(Name("getcwd", prefix=name.get_prefix())) + name.replace(Name(u"getcwd", prefix=name.get_prefix())) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_has_key.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_has_key.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_has_key.py Sat May 9 02:33:27 2009 @@ -91,10 +91,10 @@ before = before[0] else: before = pytree.Node(syms.power, before) - before.set_prefix(" ") - n_op = Name("in", prefix=" ") + before.set_prefix(u" ") + n_op = Name(u"in", prefix=u" ") if negation: - n_not = Name("not", prefix=" ") + n_not = Name(u"not", prefix=u" ") n_op = pytree.Node(syms.comp_op, (n_not, n_op)) new = pytree.Node(syms.comparison, (arg, n_op, before)) if after: Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_idioms.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_idioms.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_idioms.py Sat May 9 02:33:27 2009 @@ -105,14 +105,14 @@ T.set_prefix(" ") test = Call(Name("isinstance"), [x, Comma(), T]) if "n" in results: - test.set_prefix(" ") - test = Node(syms.not_test, [Name("not"), test]) + test.set_prefix(u" ") + test = Node(syms.not_test, [Name(u"not"), test]) test.set_prefix(node.get_prefix()) return test def transform_while(self, node, results): one = results["while"] - one.replace(Name("True", prefix=one.get_prefix())) + one.replace(Name(u"True", prefix=one.get_prefix())) def transform_sort(self, node, results): sort_stmt = results["sort"] @@ -121,11 +121,11 @@ simple_expr = results.get("expr") if list_call: - list_call.replace(Name("sorted", prefix=list_call.get_prefix())) + list_call.replace(Name(u"sorted", prefix=list_call.get_prefix())) elif simple_expr: new = simple_expr.clone() - new.set_prefix("") - simple_expr.replace(Call(Name("sorted"), [new], + new.set_prefix(u"") + simple_expr.replace(Call(Name(u"sorted"), [new], prefix=simple_expr.get_prefix())) else: raise RuntimeError("should not have reached here") Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_import.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_import.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_import.py Sat May 9 02:33:27 2009 @@ -54,7 +54,7 @@ while not hasattr(imp, 'value'): imp = imp.children[0] if self.probably_a_local_import(imp.value): - imp.value = "." + imp.value + imp.value = u"." + imp.value imp.changed() return node else: Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_imports.py Sat May 9 02:33:27 2009 @@ -123,7 +123,7 @@ import_mod = results.get("module_name") if import_mod: mod_name = import_mod.value - new_name = self.mapping[mod_name] + new_name = unicode(self.mapping[mod_name]) import_mod.replace(Name(new_name, prefix=import_mod.get_prefix())) if "name_import" in results: # If it's not a "from x import x, y" or "import x as y" import, Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_input.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_input.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_input.py Sat May 9 02:33:27 2009 @@ -22,5 +22,5 @@ return new = node.clone() - new.set_prefix("") - return Call(Name("eval"), [new], prefix=node.get_prefix()) + new.set_prefix(u"") + return Call(Name(u"eval"), [new], prefix=node.get_prefix()) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_intern.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_intern.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_intern.py Sat May 9 02:33:27 2009 @@ -34,11 +34,11 @@ if after: after = [n.clone() for n in after] new = pytree.Node(syms.power, - Attr(Name("sys"), Name("intern")) + + Attr(Name(u"sys"), Name(u"intern")) + [pytree.Node(syms.trailer, [results["lpar"].clone(), newarglist, results["rpar"].clone()])] + after) new.set_prefix(node.get_prefix()) - touch_import(None, 'sys', node) + touch_import(None, u'sys', node) return new Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_itertools.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_itertools.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_itertools.py Sat May 9 02:33:27 2009 @@ -27,7 +27,7 @@ def transform(self, node, results): prefix = None func = results['func'][0] - if 'it' in results and func.value != 'ifilterfalse': + if 'it' in results and func.value != u'ifilterfalse': dot, it = (results['dot'], results['it']) # Remove the 'itertools' prefix = it.get_prefix() Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_itertools_imports.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_itertools_imports.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_itertools_imports.py Sat May 9 02:33:27 2009 @@ -24,12 +24,12 @@ assert child.type == syms.import_as_name name_node = child.children[0] member_name = name_node.value - if member_name in ('imap', 'izip', 'ifilter'): + if member_name in (u'imap', u'izip', u'ifilter'): child.value = None child.remove() - elif member_name == 'ifilterfalse': + elif member_name == u'ifilterfalse': node.changed() - name_node.value = 'filterfalse' + name_node.value = u'filterfalse' # Make sure the import statement is still sane children = imports.children[:] or [imports] Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_long.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_long.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_long.py Sat May 9 02:33:27 2009 @@ -13,7 +13,7 @@ PATTERN = "'long'" - static_int = Name("int") + static_int = Name(u"int") def transform(self, node, results): if is_probably_builtin(node): Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_map.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_map.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_map.py Sat May 9 02:33:27 2009 @@ -63,8 +63,8 @@ if node.parent.type == syms.simple_stmt: self.warning(node, "You should use a for loop here") new = node.clone() - new.set_prefix("") - new = Call(Name("list"), [new]) + new.set_prefix(u"") + new = Call(Name(u"list"), [new]) elif "map_lambda" in results: new = ListComp(results.get("xp").clone(), results.get("fp").clone(), @@ -76,7 +76,7 @@ if in_special_context(node): return None new = node.clone() - new.set_prefix("") - new = Call(Name("list"), [new]) + new.set_prefix(u"") + new = Call(Name(u"list"), [new]) new.set_prefix(node.get_prefix()) return new Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_metaclass.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_metaclass.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_metaclass.py Sat May 9 02:33:27 2009 @@ -113,7 +113,7 @@ # Check if the expr_node is a simple assignment. left_node = expr_node.children[0] if isinstance(left_node, Leaf) and \ - left_node.value == '__metaclass__': + left_node.value == u'__metaclass__': # We found a assignment to __metaclass__. fixup_simple_stmt(node, i, simple_node) remove_trailing_newline(simple_node) @@ -182,9 +182,9 @@ # Node(classdef, ['class', 'name', ':', suite]) # 0 1 2 3 arglist = Node(syms.arglist, []) - node.insert_child(2, Leaf(token.RPAR, ')')) + node.insert_child(2, Leaf(token.RPAR, u')')) node.insert_child(2, arglist) - node.insert_child(2, Leaf(token.LPAR, '(')) + node.insert_child(2, Leaf(token.LPAR, u'(')) else: raise ValueError("Unexpected class definition") @@ -194,16 +194,16 @@ orig_meta_prefix = meta_txt.get_prefix() if arglist.children: - arglist.append_child(Leaf(token.COMMA, ',')) - meta_txt.set_prefix(' ') + arglist.append_child(Leaf(token.COMMA, u',')) + meta_txt.set_prefix(u' ') else: - meta_txt.set_prefix('') + meta_txt.set_prefix(u'') # compact the expression "metaclass = Meta" -> "metaclass=Meta" expr_stmt = last_metaclass.children[0] assert expr_stmt.type == syms.expr_stmt - expr_stmt.children[1].set_prefix('') - expr_stmt.children[2].set_prefix('') + expr_stmt.children[1].set_prefix(u'') + expr_stmt.children[2].set_prefix(u'') arglist.append_child(last_metaclass) @@ -213,15 +213,15 @@ if not suite.children: # one-liner that was just __metaclass_ suite.remove() - pass_leaf = Leaf(text_type, 'pass') + pass_leaf = Leaf(text_type, u'pass') pass_leaf.set_prefix(orig_meta_prefix) node.append_child(pass_leaf) - node.append_child(Leaf(token.NEWLINE, '\n')) + node.append_child(Leaf(token.NEWLINE, u'\n')) elif len(suite.children) > 1 and \ (suite.children[-2].type == token.INDENT and suite.children[-1].type == token.DEDENT): # there was only one line in the class body and it was __metaclass__ - pass_leaf = Leaf(text_type, 'pass') + pass_leaf = Leaf(text_type, u'pass') suite.insert_child(-1, pass_leaf) - suite.insert_child(-1, Leaf(token.NEWLINE, '\n')) + suite.insert_child(-1, Leaf(token.NEWLINE, u'\n')) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_methodattrs.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_methodattrs.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_methodattrs.py Sat May 9 02:33:27 2009 @@ -19,5 +19,5 @@ def transform(self, node, results): attr = results["attr"][0] - new = MAP[attr.value] + new = unicode(MAP[attr.value]) attr.replace(Name(new, prefix=attr.get_prefix())) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_ne.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_ne.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_ne.py Sat May 9 02:33:27 2009 @@ -14,9 +14,9 @@ def match(self, node): # Override - return node.type == token.NOTEQUAL and node.value == "<>" + return node.type == token.NOTEQUAL and node.value == u"<>" def transform(self, node, results): - new = pytree.Leaf(token.NOTEQUAL, "!=") + new = pytree.Leaf(token.NOTEQUAL, u"!=") new.set_prefix(node.get_prefix()) return new Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_next.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_next.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_next.py Sat May 9 02:33:27 2009 @@ -35,7 +35,7 @@ def start_tree(self, tree, filename): super(FixNext, self).start_tree(tree, filename) - n = find_binding('next', tree) + n = find_binding(u'next', tree) if n: self.warning(n, bind_warning) self.shadowed_next = True @@ -52,13 +52,13 @@ if base: if self.shadowed_next: - attr.replace(Name("__next__", prefix=attr.get_prefix())) + attr.replace(Name(u"__next__", prefix=attr.get_prefix())) else: base = [n.clone() for n in base] - base[0].set_prefix("") - node.replace(Call(Name("next", prefix=node.get_prefix()), base)) + base[0].set_prefix(u"") + node.replace(Call(Name(u"next", prefix=node.get_prefix()), base)) elif name: - n = Name("__next__", prefix=name.get_prefix()) + n = Name(u"__next__", prefix=name.get_prefix()) name.replace(n) elif attr: # We don't do this transformation if we're assigning to "x.next". @@ -66,10 +66,10 @@ # so it's being done here. if is_assign_target(node): head = results["head"] - if "".join([str(n) for n in head]).strip() == '__builtin__': + if "".join([str(n) for n in head]).strip() == u'__builtin__': self.warning(node, bind_warning) return - attr.replace(Name("__next__")) + attr.replace(Name(u"__next__")) elif "global" in results: self.warning(node, bind_warning) self.shadowed_next = True Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_nonzero.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_nonzero.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_nonzero.py Sat May 9 02:33:27 2009 @@ -16,5 +16,5 @@ def transform(self, node, results): name = results["name"] - new = Name("__bool__", prefix=name.get_prefix()) + new = Name(u"__bool__", prefix=name.get_prefix()) name.replace(new) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_numliterals.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_numliterals.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_numliterals.py Sat May 9 02:33:27 2009 @@ -15,13 +15,13 @@ def match(self, node): # Override return (node.type == token.NUMBER and - (node.value.startswith("0") or node.value[-1] in "Ll")) + (node.value.startswith(u"0") or node.value[-1] in u"Ll")) def transform(self, node, results): val = node.value - if val[-1] in 'Ll': + if val[-1] in u'Ll': val = val[:-1] - elif val.startswith('0') and val.isdigit() and len(set(val)) > 1: - val = "0o" + val[1:] + elif val.startswith(u'0') and val.isdigit() and len(set(val)) > 1: + val = u"0o" + val[1:] return Number(val, prefix=node.get_prefix()) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_paren.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_paren.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_paren.py Sat May 9 02:33:27 2009 @@ -37,6 +37,6 @@ lparen = LParen() lparen.set_prefix(target.get_prefix()) - target.set_prefix("") # Make it hug the parentheses + target.set_prefix(u"") # Make it hug the parentheses target.insert_child(0, lparen) target.append_child(RParen()) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_print.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_print.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_print.py Sat May 9 02:33:27 2009 @@ -44,10 +44,10 @@ if bare_print: # Special-case print all by itself - bare_print.replace(Call(Name("print"), [], + bare_print.replace(Call(Name(u"print"), [], prefix=bare_print.get_prefix())) return - assert node.children[0] == Name("print") + assert node.children[0] == Name(u"print") args = node.children[1:] if len(args) == 1 and parend_expr.match(args[0]): # We don't want to keep sticking parens around an @@ -58,33 +58,33 @@ if args and args[-1] == Comma(): args = args[:-1] end = " " - if args and args[0] == pytree.Leaf(token.RIGHTSHIFT, ">>"): + if args and args[0] == pytree.Leaf(token.RIGHTSHIFT, u">>"): assert len(args) >= 2 file = args[1].clone() args = args[3:] # Strip a possible comma after the file expression # Now synthesize a print(args, sep=..., end=..., file=...) node. l_args = [arg.clone() for arg in args] if l_args: - l_args[0].set_prefix("") + l_args[0].set_prefix(u"") if sep is not None or end is not None or file is not None: if sep is not None: - self.add_kwarg(l_args, "sep", String(repr(sep))) + self.add_kwarg(l_args, u"sep", String(repr(sep))) if end is not None: - self.add_kwarg(l_args, "end", String(repr(end))) + self.add_kwarg(l_args, u"end", String(repr(end))) if file is not None: - self.add_kwarg(l_args, "file", file) - n_stmt = Call(Name("print"), l_args) + self.add_kwarg(l_args, u"file", file) + n_stmt = Call(Name(u"print"), l_args) n_stmt.set_prefix(node.get_prefix()) return n_stmt def add_kwarg(self, l_nodes, s_kwd, n_expr): # XXX All this prefix-setting may lose comments (though rarely) - n_expr.set_prefix("") + n_expr.set_prefix(u"") n_argument = pytree.Node(self.syms.argument, (Name(s_kwd), - pytree.Leaf(token.EQUAL, "="), + pytree.Leaf(token.EQUAL, u"="), n_expr)) if l_nodes: l_nodes.append(Comma()) - n_argument.set_prefix(" ") + n_argument.set_prefix(u" ") l_nodes.append(n_argument) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_raise.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_raise.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_raise.py Sat May 9 02:33:27 2009 @@ -56,7 +56,7 @@ if "val" not in results: # One-argument raise - new = pytree.Node(syms.raise_stmt, [Name("raise"), exc]) + new = pytree.Node(syms.raise_stmt, [Name(u"raise"), exc]) new.set_prefix(node.get_prefix()) return new @@ -64,19 +64,19 @@ if is_tuple(val): args = [c.clone() for c in val.children[1:-1]] else: - val.set_prefix("") + val.set_prefix(u"") args = [val] if "tb" in results: tb = results["tb"].clone() - tb.set_prefix("") + tb.set_prefix(u"") e = Call(exc, args) - with_tb = Attr(e, Name('with_traceback')) + [ArgList([tb])] - new = pytree.Node(syms.simple_stmt, [Name("raise")] + with_tb) + with_tb = Attr(e, Name(u'with_traceback')) + [ArgList([tb])] + new = pytree.Node(syms.simple_stmt, [Name(u"raise")] + with_tb) new.set_prefix(node.get_prefix()) return new else: return pytree.Node(syms.raise_stmt, - [Name("raise"), Call(exc, args)], + [Name(u"raise"), Call(exc, args)], prefix=node.get_prefix()) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_raw_input.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_raw_input.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_raw_input.py Sat May 9 02:33:27 2009 @@ -13,4 +13,4 @@ def transform(self, node, results): name = results["name"] - name.replace(Name("input", prefix=name.get_prefix())) + name.replace(Name(u"input", prefix=name.get_prefix())) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_reduce.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_reduce.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_reduce.py Sat May 9 02:33:27 2009 @@ -30,4 +30,4 @@ """ def transform(self, node, results): - touch_import('functools', 'reduce', node) + touch_import(u'functools', u'reduce', node) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_renames.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_renames.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_renames.py Sat May 9 02:33:27 2009 @@ -65,5 +65,5 @@ #import_mod = results.get("module") if mod_name and attr_name: - new_attr = LOOKUP[(mod_name.value, attr_name.value)] + new_attr = unicode(LOOKUP[(mod_name.value, attr_name.value)]) attr_name.replace(Name(new_attr, prefix=attr_name.get_prefix())) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_repr.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_repr.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_repr.py Sat May 9 02:33:27 2009 @@ -19,4 +19,4 @@ if expr.type == self.syms.testlist1: expr = parenthesize(expr) - return Call(Name("repr"), [expr], prefix=node.get_prefix()) + return Call(Name(u"repr"), [expr], prefix=node.get_prefix()) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_set_literal.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_set_literal.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_set_literal.py Sat May 9 02:33:27 2009 @@ -34,9 +34,9 @@ items = results["items"] # Build the contents of the literal - literal = [pytree.Leaf(token.LBRACE, "{")] + literal = [pytree.Leaf(token.LBRACE, u"{")] literal.extend(n.clone() for n in items.children) - literal.append(pytree.Leaf(token.RBRACE, "}")) + literal.append(pytree.Leaf(token.RBRACE, u"}")) # Set the prefix of the right brace to that of the ')' or ']' literal[-1].set_prefix(items.next_sibling.get_prefix()) maker = pytree.Node(syms.dictsetmaker, literal) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_standarderror.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_standarderror.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_standarderror.py Sat May 9 02:33:27 2009 @@ -15,4 +15,4 @@ """ def transform(self, node, results): - return Name("Exception", prefix=node.get_prefix()) + return Name(u"Exception", prefix=node.get_prefix()) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_sys_exc.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_sys_exc.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_sys_exc.py Sat May 9 02:33:27 2009 @@ -22,8 +22,8 @@ sys_attr = results["attribute"][0] index = Number(self.exc_info.index(sys_attr.value)) - call = Call(Name("exc_info"), prefix=sys_attr.get_prefix()) - attr = Attr(Name("sys"), call) + call = Call(Name(u"exc_info"), prefix=sys_attr.get_prefix()) + attr = Attr(Name(u"sys"), call) attr[1].children[0].set_prefix(results["dot"].get_prefix()) attr.append(Subscript(index)) return Node(syms.power, attr, prefix=node.get_prefix()) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_throw.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_throw.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_throw.py Sat May 9 02:33:27 2009 @@ -32,7 +32,7 @@ return # Leave "g.throw(E)" alone - val = results.get("val") + val = results.get(u"val") if val is None: return @@ -40,17 +40,17 @@ if is_tuple(val): args = [c.clone() for c in val.children[1:-1]] else: - val.set_prefix("") + val.set_prefix(u"") args = [val] throw_args = results["args"] if "tb" in results: tb = results["tb"].clone() - tb.set_prefix("") + tb.set_prefix(u"") e = Call(exc, args) - with_tb = Attr(e, Name('with_traceback')) + [ArgList([tb])] + with_tb = Attr(e, Name(u'with_traceback')) + [ArgList([tb])] throw_args.replace(pytree.Node(syms.power, with_tb)) else: throw_args.replace(Call(exc, args)) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_tuple_params.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_tuple_params.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_tuple_params.py Sat May 9 02:33:27 2009 @@ -55,7 +55,7 @@ else: start = 0 indent = "; " - end = pytree.Leaf(token.INDENT, "") + end = pytree.Leaf(token.INDENT, u"") # We need access to self for new_name(), and making this a method # doesn't feel right. Closing over self and new_lines makes the @@ -63,10 +63,10 @@ def handle_tuple(tuple_arg, add_prefix=False): n = Name(self.new_name()) arg = tuple_arg.clone() - arg.set_prefix("") + arg.set_prefix(u"") stmt = Assign(arg, n.clone()) if add_prefix: - n.set_prefix(" ") + n.set_prefix(u" ") tuple_arg.replace(n) new_lines.append(pytree.Node(syms.simple_stmt, [stmt, end.clone()])) @@ -91,7 +91,7 @@ # TODO(cwinter) suite-cleanup after = start if start == 0: - new_lines[0].set_prefix(" ") + new_lines[0].set_prefix(u" ") elif is_docstring(suite[0].children[start]): new_lines[0].set_prefix(indent) after = start + 1 @@ -109,7 +109,7 @@ # Replace lambda ((((x)))): x with lambda x: x if inner.type == token.NAME: inner = inner.clone() - inner.set_prefix(" ") + inner.set_prefix(u" ") args.replace(inner) return @@ -117,7 +117,7 @@ to_index = map_to_index(params) tup_name = self.new_name(tuple_name(params)) - new_param = Name(tup_name, prefix=" ") + new_param = Name(tup_name, prefix=u" ") args.replace(new_param.clone()) for n in body.post_order(): if n.type == token.NAME and n.value in to_index: @@ -166,4 +166,4 @@ l.append(tuple_name(obj)) else: l.append(obj) - return "_".join(l) + return u"_".join(l) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_types.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_types.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_types.py Sat May 9 02:33:27 2009 @@ -56,7 +56,7 @@ PATTERN = '|'.join(_pats) def transform(self, node, results): - new_value = _TYPE_MAPPING.get(results["name"].value) + new_value = unicode(_TYPE_MAPPING.get(results["name"].value)) if new_value: return Name(new_value, prefix=node.get_prefix()) return None Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_unicode.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_unicode.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_unicode.py Sat May 9 02:33:27 2009 @@ -12,17 +12,17 @@ def transform(self, node, results): if node.type == token.NAME: - if node.value == "unicode": + if node.value == u"unicode": new = node.clone() - new.value = "str" + new.value = u"str" return new - if node.value == "unichr": + if node.value == u"unichr": new = node.clone() - new.value = "chr" + new.value = u"chr" return new # XXX Warn when __unicode__ found? elif node.type == token.STRING: - if re.match(r"[uU][rR]?[\'\"]", node.value): + if re.match(ur"[uU][rR]?[\'\"]", node.value): new = node.clone() new.value = new.value[1:] return new Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_ws_comma.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_ws_comma.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_ws_comma.py Sat May 9 02:33:27 2009 @@ -17,8 +17,8 @@ any<(not(',') any)+ ',' ((not(',') any)+ ',')* [not(',') any]> """ - COMMA = pytree.Leaf(token.COMMA, ",") - COLON = pytree.Leaf(token.COLON, ":") + COMMA = pytree.Leaf(token.COMMA, u",") + COLON = pytree.Leaf(token.COLON, u":") SEPS = (COMMA, COLON) def transform(self, node, results): @@ -27,13 +27,13 @@ for child in new.children: if child in self.SEPS: prefix = child.get_prefix() - if prefix.isspace() and "\n" not in prefix: - child.set_prefix("") + if prefix.isspace() and u"\n" not in prefix: + child.set_prefix(u"") comma = True else: if comma: prefix = child.get_prefix() if not prefix: - child.set_prefix(" ") + child.set_prefix(u" ") comma = False return new Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_xrange.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_xrange.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_xrange.py Sat May 9 02:33:27 2009 @@ -19,22 +19,22 @@ def transform(self, node, results): name = results["name"] - if name.value == "xrange": + if name.value == u"xrange": return self.transform_xrange(node, results) - elif name.value == "range": + elif name.value == u"range": return self.transform_range(node, results) else: raise ValueError(repr(name)) def transform_xrange(self, node, results): name = results["name"] - name.replace(Name("range", prefix=name.get_prefix())) + name.replace(Name(u"range", prefix=name.get_prefix())) def transform_range(self, node, results): if not self.in_special_context(node): - range_call = Call(Name("range"), [results["args"].clone()]) + range_call = Call(Name(u"range"), [results["args"].clone()]) # Encase the range call in list(). - list_call = Call(Name("list"), [range_call], + list_call = Call(Name(u"list"), [range_call], prefix=node.get_prefix()) # Put things that were after the range() call after the list call. for n in results["rest"]: Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_xreadlines.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_xreadlines.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_xreadlines.py Sat May 9 02:33:27 2009 @@ -19,6 +19,6 @@ no_call = results.get("no_call") if no_call: - no_call.replace(Name("__iter__", prefix=no_call.get_prefix())) + no_call.replace(Name(u"__iter__", prefix=no_call.get_prefix())) else: node.replace([x.clone() for x in results["call"]]) Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_zip.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_zip.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_zip.py Sat May 9 02:33:27 2009 @@ -28,7 +28,7 @@ return None new = node.clone() - new.set_prefix("") - new = Call(Name("list"), [new]) + new.set_prefix(u"") + new = Call(Name(u"list"), [new]) new.set_prefix(node.get_prefix()) return new Modified: sandbox/trunk/2to3/lib2to3/main.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/main.py (original) +++ sandbox/trunk/2to3/lib2to3/main.py Sat May 9 02:33:27 2009 @@ -23,7 +23,7 @@ self.errors.append((msg, args, kwargs)) self.logger.error(msg, *args, **kwargs) - def write_file(self, new_text, filename, old_text): + def write_file(self, new_text, filename, old_text, encoding): if not self.nobackups: # Make backup backup = filename + ".bak" @@ -37,8 +37,8 @@ except os.error, err: self.log_message("Can't rename %s to %s", filename, backup) # Actually write the new file - super(StdoutRefactoringTool, self).write_file(new_text, - filename, old_text) + write = super(StdoutRefactoringTool, self).write_file + write(new_text, filename, old_text, encoding) if not self.nobackups: shutil.copymode(backup, filename) Modified: sandbox/trunk/2to3/lib2to3/patcomp.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/patcomp.py (original) +++ sandbox/trunk/2to3/lib2to3/patcomp.py Sat May 9 02:33:27 2009 @@ -133,7 +133,7 @@ assert len(nodes) >= 1 node = nodes[0] if node.type == token.STRING: - value = literals.evalString(node.value) + value = unicode(literals.evalString(node.value)) return pytree.LeafPattern(content=value) elif node.type == token.NAME: value = node.value Modified: sandbox/trunk/2to3/lib2to3/pgen2/driver.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/pgen2/driver.py (original) +++ sandbox/trunk/2to3/lib2to3/pgen2/driver.py Sat May 9 02:33:27 2009 @@ -16,6 +16,7 @@ __all__ = ["Driver", "load_grammar"] # Python imports +import codecs import os import logging import sys @@ -41,7 +42,7 @@ lineno = 1 column = 0 type = value = start = end = line_text = None - prefix = "" + prefix = u"" for quintuple in tokens: type, value, start, end, line_text = quintuple if start != (lineno, column): @@ -90,9 +91,9 @@ """Parse a stream and return the syntax tree.""" return self.parse_stream_raw(stream, debug) - def parse_file(self, filename, debug=False): + def parse_file(self, filename, encoding=None, debug=False): """Parse a file and return the syntax tree.""" - stream = open(filename) + stream = codecs.open(filename, "r", encoding) try: return self.parse_stream(stream, debug) finally: Modified: sandbox/trunk/2to3/lib2to3/pgen2/tokenize.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/pgen2/tokenize.py (original) +++ sandbox/trunk/2to3/lib2to3/pgen2/tokenize.py Sat May 9 02:33:27 2009 @@ -30,6 +30,7 @@ 'GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro' import string, re +from codecs import BOM_UTF8, lookup from lib2to3.pgen2.token import * from . import token @@ -226,6 +227,75 @@ startline = False toks_append(tokval) +cookie_re = re.compile("coding[:=]\s*([-\w.]+)") + +def detect_encoding(readline): + """ + The detect_encoding() function is used to detect the encoding that should + be used to decode a Python source file. It requires one argment, readline, + in the same way as the tokenize() generator. + + It will call readline a maximum of twice, and return the encoding used + (as a string) and a list of any lines (left as bytes) it has read + in. + + It detects the encoding from the presence of a utf-8 bom or an encoding + cookie as specified in pep-0263. If both a bom and a cookie are present, + but disagree, a SyntaxError will be raised. If the encoding cookie is an + invalid charset, raise a SyntaxError. + + If no encoding is specified, then the default of 'utf-8' will be returned. + """ + bom_found = False + encoding = None + def read_or_stop(): + try: + return readline() + except StopIteration: + return b'' + + def find_cookie(line): + try: + line_string = line.decode('ascii') + except UnicodeDecodeError: + return None + + matches = cookie_re.findall(line_string) + if not matches: + return None + encoding = matches[0] + try: + codec = lookup(encoding) + except LookupError: + # This behaviour mimics the Python interpreter + raise SyntaxError("unknown encoding: " + encoding) + + if bom_found and codec.name != 'utf-8': + # This behaviour mimics the Python interpreter + raise SyntaxError('encoding problem: utf-8') + return encoding + + first = read_or_stop() + if first.startswith(BOM_UTF8): + bom_found = True + first = first[3:] + if not first: + return 'utf-8', [] + + encoding = find_cookie(first) + if encoding: + return encoding, [first] + + second = read_or_stop() + if not second: + return 'utf-8', [first] + + encoding = find_cookie(second) + if encoding: + return encoding, [first, second] + + return 'utf-8', [first, second] + def untokenize(iterable): """Transform tokens back into Python source code. Modified: sandbox/trunk/2to3/lib2to3/pytree.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/pytree.py (original) +++ sandbox/trunk/2to3/lib2to3/pytree.py Sat May 9 02:33:27 2009 @@ -213,9 +213,13 @@ """ next_sib = self.next_sibling if next_sib is None: - return "" + return u"" return next_sib.get_prefix() + if sys.version_info < (3, 0): + def __str__(self): + return unicode(self).encode("ascii") + class Node(Base): @@ -245,13 +249,16 @@ type_repr(self.type), self.children) - def __str__(self): + def __unicode__(self): """ Return a pretty string representation. This reproduces the input source exactly. """ - return "".join(map(str, self.children)) + return u"".join(map(unicode, self.children)) + + if sys.version_info > (3, 0): + __str__ = __unicode__ def _eq(self, other): """Compare two nodes for equality.""" @@ -353,13 +360,16 @@ self.type, self.value) - def __str__(self): + def __unicode__(self): """ Return a pretty string representation. This reproduces the input source exactly. """ - return self.prefix + str(self.value) + return self.prefix + unicode(self.value) + + if sys.version_info > (3, 0): + __str__ = __unicode__ def _eq(self, other): """Compare two nodes for equality.""" Modified: sandbox/trunk/2to3/lib2to3/refactor.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/refactor.py (original) +++ sandbox/trunk/2to3/lib2to3/refactor.py Sat May 9 02:33:27 2009 @@ -22,8 +22,7 @@ from itertools import chain # Local imports -from .pgen2 import driver -from .pgen2 import tokenize +from .pgen2 import driver, tokenize from . import pytree from . import patcomp @@ -87,6 +86,25 @@ return [pkg_name + "." + fix_name for fix_name in get_all_fix_names(pkg_name, False)] +def _identity(obj): + return obj + +if sys.version_info < (3, 0): + import codecs + _open_with_encoding = codecs.open + # codecs.open doesn't translate newlines sadly. + def _from_system_newlines(input): + return input.replace(u"\r\n", u"\n") + if os.linesep != "\n": + def _to_system_newlines(input): + return input.replace(u"\n", os.linesep) + else: + _to_system_newlines = _identity +else: + _open_with_encoding = open + _from_system_newlines = _identity + _to_system_newlines = _identity + class FixerError(Exception): """A fixer could not be loaded.""" @@ -213,29 +231,42 @@ # Modify dirnames in-place to remove subdirs with leading dots dirnames[:] = [dn for dn in dirnames if not dn.startswith(".")] - def refactor_file(self, filename, write=False, doctests_only=False): - """Refactors a file.""" + def _read_python_source(self, filename): + """ + Do our best to decode a Python source file correctly. + """ try: - f = open(filename) + f = open(filename, "rb") except IOError, err: self.log_error("Can't open %s: %s", filename, err) - return + return None, None try: - input = f.read() + "\n" # Silence certain parse errors + encoding = tokenize.detect_encoding(f.readline)[0] finally: f.close() + with _open_with_encoding(filename, "r", encoding=encoding) as f: + return _from_system_newlines(f.read()), encoding + + def refactor_file(self, filename, write=False, doctests_only=False): + """Refactors a file.""" + input, encoding = self._read_python_source(filename) + if input is None: + # Reading the file failed. + return + input += u"\n" # Silence certain parse errors if doctests_only: self.log_debug("Refactoring doctests in %s", filename) output = self.refactor_docstring(input, filename) if output != input: - self.processed_file(output, filename, input, write=write) + self.processed_file(output, filename, input, write, encoding) else: self.log_debug("No doctest changes in %s", filename) else: tree = self.refactor_string(input, filename) if tree and tree.was_changed: # The [:-1] is to take off the \n we added earlier - self.processed_file(str(tree)[:-1], filename, write=write) + self.processed_file(unicode(tree)[:-1], filename, + write=write, encoding=encoding) else: self.log_debug("No changes in %s", filename) @@ -321,31 +352,26 @@ node.replace(new) node = new - def processed_file(self, new_text, filename, old_text=None, write=False): + def processed_file(self, new_text, filename, old_text=None, write=False, + encoding=None): """ Called when a file has been refactored, and there are changes. """ self.files.append(filename) if old_text is None: - try: - f = open(filename, "r") - except IOError, err: - self.log_error("Can't read %s: %s", filename, err) + old_text = self._read_python_source(filename)[0] + if old_text is None: return - try: - old_text = f.read() - finally: - f.close() if old_text == new_text: self.log_debug("No changes to %s", filename) return self.print_output(diff_texts(old_text, new_text, filename)) if write: - self.write_file(new_text, filename, old_text) + self.write_file(new_text, filename, old_text, encoding) else: self.log_debug("Not writing changes to %s", filename) - def write_file(self, new_text, filename, old_text): + def write_file(self, new_text, filename, old_text, encoding=None): """Writes a string to a file. It first shows a unified diff between the old text and the new text, and @@ -353,12 +379,12 @@ set. """ try: - f = open(filename, "w") + f = _open_with_encoding(filename, "w", encoding=encoding) except os.error, err: self.log_error("Can't create %s: %s", filename, err) return try: - f.write(new_text) + f.write(_to_system_newlines(new_text)) except os.error, err: self.log_error("Can't write %s: %s", filename, err) finally: @@ -398,7 +424,7 @@ indent = line[:i] elif (indent is not None and (line.startswith(indent + self.PS2) or - line == indent + self.PS2.rstrip() + "\n")): + line == indent + self.PS2.rstrip() + u"\n")): block.append(line) else: if block is not None: @@ -410,7 +436,7 @@ if block is not None: result.extend(self.refactor_doctest(block, block_lineno, indent, filename)) - return "".join(result) + return u"".join(result) def refactor_doctest(self, block, lineno, indent, filename): """Refactors one doctest. @@ -425,7 +451,7 @@ except Exception, err: if self.log.isEnabledFor(logging.DEBUG): for line in block: - self.log_debug("Source: %s", line.rstrip("\n")) + self.log_debug("Source: %s", line.rstrip(u"\n")) self.log_error("Can't parse docstring in %s line %s: %s: %s", filename, lineno, err.__class__.__name__, err) return block @@ -433,9 +459,9 @@ new = str(tree).splitlines(True) # Undo the adjustment of the line numbers in wrap_toks() below. clipped, new = new[:lineno-1], new[lineno-1:] - assert clipped == ["\n"] * (lineno-1), clipped - if not new[-1].endswith("\n"): - new[-1] += "\n" + assert clipped == [u"\n"] * (lineno-1), clipped + if not new[-1].endswith(u"\n"): + new[-1] += u"\n" block = [indent + self.PS1 + new.pop(0)] if new: block += [indent + self.PS2 + line for line in new] @@ -497,8 +523,8 @@ for line in block: if line.startswith(prefix): yield line[len(prefix):] - elif line == prefix.rstrip() + "\n": - yield "\n" + elif line == prefix.rstrip() + u"\n": + yield u"\n" else: raise AssertionError("line=%r, prefix=%r" % (line, prefix)) prefix = prefix2 Added: sandbox/trunk/2to3/lib2to3/tests/data/different_encoding.py ============================================================================== --- (empty file) +++ sandbox/trunk/2to3/lib2to3/tests/data/different_encoding.py Sat May 9 02:33:27 2009 @@ -0,0 +1,4 @@ +#!/usr/bin/env python +# -*- coding: iso-8859-1 -*- +print(u'??????????????????????????????????????????????????????????????') + Modified: sandbox/trunk/2to3/lib2to3/tests/support.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/support.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/support.py Sat May 9 02:33:27 2009 @@ -37,7 +37,7 @@ unittest.TextTestRunner(verbosity=2).run(tests) def reformat(string): - return dedent(string) + "\n\n" + return dedent(string) + u"\n\n" def get_refactorer(fixers=None, options=None): """ Modified: sandbox/trunk/2to3/lib2to3/tests/test_all_fixers.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/test_all_fixers.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/test_all_fixers.py Sat May 9 02:33:27 2009 @@ -27,7 +27,7 @@ def test_all_project_files(self): for filepath in support.all_project_files(): print "Fixing %s..." % filepath - self.refactor.refactor_string(open(filepath).read(), filepath) + self.refactor.refactor_file(filepath) if __name__ == "__main__": Modified: sandbox/trunk/2to3/lib2to3/tests/test_fixers.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/test_fixers.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/test_fixers.py Sat May 9 02:33:27 2009 @@ -25,7 +25,7 @@ options = {"print_function" : False} self.refactor = support.get_refactorer(fix_list, options) self.fixer_log = [] - self.filename = "" + self.filename = u"" for fixer in chain(self.refactor.pre_order, self.refactor.post_order): @@ -35,7 +35,7 @@ before = support.reformat(before) after = support.reformat(after) tree = self.refactor.refactor_string(before, self.filename) - self.failUnlessEqual(after, str(tree)) + self.failUnlessEqual(after, unicode(tree)) return tree def check(self, before, after, ignore_warnings=False): Modified: sandbox/trunk/2to3/lib2to3/tests/test_parser.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/test_parser.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/test_parser.py Sat May 9 02:33:27 2009 @@ -14,9 +14,9 @@ # Python imports import os -import os.path # Local imports +from lib2to3.pgen2 import tokenize from ..pgen2.parse import ParseError @@ -150,13 +150,25 @@ def test_all_project_files(self): for filepath in support.all_project_files(): print "Parsing %s..." % filepath - tree = driver.parse_file(filepath, debug=True) - if diff(filepath, tree): + with open(filepath, "rb") as fp: + encoding = tokenize.detect_encoding(fp.readline)[0] + fp.seek(0) + source = fp.read() + if encoding: + source = source.decode(encoding) + tree = driver.parse_string(source) + new = unicode(tree) + if encoding: + new = new.encode(encoding) + if diff(filepath, new): self.fail("Idempotency failed: %s" % filepath) class TestLiterals(GrammarTest): + def validate(self, s): + driver.parse_string(support.dedent(s) + "\n\n") + def test_multiline_bytes_literals(self): s = """ md5test(b"\xaa" * 80, @@ -185,10 +197,10 @@ self.validate(s) -def diff(fn, tree): +def diff(fn, result): f = open("@", "w") try: - f.write(str(tree)) + f.write(result) finally: f.close() try: Modified: sandbox/trunk/2to3/lib2to3/tests/test_refactor.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/test_refactor.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/test_refactor.py Sat May 9 02:33:27 2009 @@ -121,19 +121,31 @@ +def cheese(): pass""".splitlines() self.assertEqual(diff_lines[:-1], expected) - def test_refactor_file(self): - test_file = os.path.join(FIXER_DIR, "parrot_example.py") - old_contents = open(test_file, "r").read() - rt = self.rt() + def check_file_refactoring(self, test_file, fixers=_DEFAULT_FIXERS): + def read_file(): + with open(test_file, "rb") as fp: + return fp.read() + old_contents = read_file() + rt = self.rt(fixers=fixers) rt.refactor_file(test_file) - self.assertEqual(old_contents, open(test_file, "r").read()) + self.assertEqual(old_contents, read_file()) - rt.refactor_file(test_file, True) try: - self.assertNotEqual(old_contents, open(test_file, "r").read()) + rt.refactor_file(test_file, True) + self.assertNotEqual(old_contents, read_file()) finally: - open(test_file, "w").write(old_contents) + with open(test_file, "wb") as fp: + fp.write(old_contents) + + def test_refactor_file(self): + test_file = os.path.join(FIXER_DIR, "parrot_example.py") + self.check_file_refactoring(test_file) + + def test_file_encoding(self): + fn = os.path.join(FIXER_DIR, "..", "different_encoding.py") + fixes = refactor.get_fixers_from_package("lib2to3.fixes") + self.check_file_refactoring(fn, fixes) def test_refactor_docstring(self): rt = self.rt() From python-checkins at python.org Sat May 9 02:35:38 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 02:35:38 +0200 (CEST) Subject: [Python-checkins] r72492 - sandbox/trunk/2to3/lib2to3/tests/support.py Message-ID: <20090509003538.E3A7B1E4143@bag.python.org> Author: benjamin.peterson Date: Sat May 9 02:35:38 2009 New Revision: 72492 Log: remove compat code Modified: sandbox/trunk/2to3/lib2to3/tests/support.py Modified: sandbox/trunk/2to3/lib2to3/tests/support.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/support.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/support.py Sat May 9 02:35:38 2009 @@ -9,12 +9,9 @@ import re from textwrap import dedent -#sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) - # Local imports -from .. import pytree -from .. import refactor -from ..pgen2 import driver +from lib2to3 import pytree, refactor +from lib2to3.pgen2 import driver test_dir = os.path.dirname(__file__) proj_dir = os.path.normpath(os.path.join(test_dir, "..")) @@ -25,12 +22,6 @@ def parse_string(string): return driver.parse_string(reformat(string), debug=True) -# Python 2.3's TestSuite is not iter()-able -if sys.version_info < (2, 4): - def TestSuite_iter(self): - return iter(self._tests) - unittest.TestSuite.__iter__ = TestSuite_iter - def run_all_tests(test_mod=None, tests=None): if tests is None: tests = unittest.TestLoader().loadTestsFromModule(test_mod) From python-checkins at python.org Sat May 9 02:54:16 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 02:54:16 +0200 (CEST) Subject: [Python-checkins] r72493 - in sandbox/trunk/2to3/lib2to3: refactor.py tests/data/crlf.py tests/test_refactor.py Message-ID: <20090509005416.26DFE1E4023@bag.python.org> Author: benjamin.peterson Date: Sat May 9 02:54:15 2009 New Revision: 72493 Log: add a test for \r\n newlines Added: sandbox/trunk/2to3/lib2to3/tests/data/crlf.py (contents, props changed) Modified: sandbox/trunk/2to3/lib2to3/refactor.py sandbox/trunk/2to3/lib2to3/tests/test_refactor.py Modified: sandbox/trunk/2to3/lib2to3/refactor.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/refactor.py (original) +++ sandbox/trunk/2to3/lib2to3/refactor.py Sat May 9 02:54:15 2009 @@ -95,11 +95,11 @@ # codecs.open doesn't translate newlines sadly. def _from_system_newlines(input): return input.replace(u"\r\n", u"\n") - if os.linesep != "\n": - def _to_system_newlines(input): + def _to_system_newlines(input): + if os.linesep != "\n": return input.replace(u"\n", os.linesep) - else: - _to_system_newlines = _identity + else: + return input else: _open_with_encoding = open _from_system_newlines = _identity Added: sandbox/trunk/2to3/lib2to3/tests/data/crlf.py ============================================================================== --- (empty file) +++ sandbox/trunk/2to3/lib2to3/tests/data/crlf.py Sat May 9 02:54:15 2009 @@ -0,0 +1,3 @@ +print "hi" + +print "Like bad Windows newlines?" Modified: sandbox/trunk/2to3/lib2to3/tests/test_refactor.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/test_refactor.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/test_refactor.py Sat May 9 02:54:15 2009 @@ -14,7 +14,8 @@ from . import support -FIXER_DIR = os.path.join(os.path.dirname(__file__), "data/fixers") +TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), "data") +FIXER_DIR = os.path.join(TEST_DATA_DIR, "fixers") sys.path.append(FIXER_DIR) try: @@ -22,6 +23,8 @@ finally: sys.path.pop() +_2TO3_FIXERS = refactor.get_fixers_from_package("lib2to3.fixes") + class TestRefactoringTool(unittest.TestCase): def setUp(self): @@ -121,7 +124,7 @@ +def cheese(): pass""".splitlines() self.assertEqual(diff_lines[:-1], expected) - def check_file_refactoring(self, test_file, fixers=_DEFAULT_FIXERS): + def check_file_refactoring(self, test_file, fixers=_2TO3_FIXERS): def read_file(): with open(test_file, "rb") as fp: return fp.read() @@ -140,12 +143,21 @@ def test_refactor_file(self): test_file = os.path.join(FIXER_DIR, "parrot_example.py") - self.check_file_refactoring(test_file) + self.check_file_refactoring(test_file, _DEFAULT_FIXERS) def test_file_encoding(self): - fn = os.path.join(FIXER_DIR, "..", "different_encoding.py") - fixes = refactor.get_fixers_from_package("lib2to3.fixes") - self.check_file_refactoring(fn, fixes) + fn = os.path.join(TEST_DATA_DIR, "different_encoding.py") + self.check_file_refactoring(fn) + + def test_crlf_newlines(self): + old_sep = os.linesep + os.linesep = "\r\n" + try: + fn = os.path.join(TEST_DATA_DIR, "crlf.py") + fixes = refactor.get_fixers_from_package("lib2to3.fixes") + self.check_file_refactoring(fn, fixes) + finally: + os.linesep = old_sep def test_refactor_docstring(self): rt = self.rt() From python-checkins at python.org Sat May 9 03:01:45 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 03:01:45 +0200 (CEST) Subject: [Python-checkins] r72494 - in python/trunk/Lib/lib2to3: fixer_base.py fixer_util.py fixes/fix_apply.py fixes/fix_basestring.py fixes/fix_buffer.py fixes/fix_callable.py fixes/fix_dict.py fixes/fix_except.py fixes/fix_exec.py fixes/fix_execfile.py fixes/fix_filter.py fixes/fix_funcattrs.py fixes/fix_getcwdu.py fixes/fix_has_key.py fixes/fix_idioms.py fixes/fix_import.py fixes/fix_imports.py fixes/fix_input.py fixes/fix_intern.py fixes/fix_itertools.py fixes/fix_itertools_imports.py fixes/fix_long.py fixes/fix_map.py fixes/fix_metaclass.py fixes/fix_methodattrs.py fixes/fix_ne.py fixes/fix_next.py fixes/fix_nonzero.py fixes/fix_numliterals.py fixes/fix_paren.py fixes/fix_print.py fixes/fix_raise.py fixes/fix_raw_input.py fixes/fix_reduce.py fixes/fix_renames.py fixes/fix_repr.py fixes/fix_set_literal.py fixes/fix_standarderror.py fixes/fix_sys_exc.py fixes/fix_throw.py fixes/fix_tuple_params.py fixes/fix_types.py fixes/fix_unicode.py fixes/fix_ws_comma.py fixes/fix_xrange.py fixes/fix_xreadlines.py fixes/fix_zip.py main.py patcomp.py pgen2/driver.py pgen2/tokenize.py pytree.py refactor.py tests/data/crlf.py tests/data/different_encoding.py tests/support.py tests/test_all_fixers.py tests/test_fixers.py tests/test_parser.py tests/test_refactor.py Message-ID: <20090509010145.329071E4023@bag.python.org> Author: benjamin.peterson Date: Sat May 9 03:01:14 2009 New Revision: 72494 Log: Merged revisions 72491-72493 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r72491 | benjamin.peterson | 2009-05-08 19:33:27 -0500 (Fri, 08 May 2009) | 7 lines make 2to3 use unicode internally on 2.x This started out as a fix for #2660, but became this large refactoring when I realized the dire state this was in. 2to3 now uses tokenize.detect_encoding to decode the files correctly into unicode. ........ r72492 | benjamin.peterson | 2009-05-08 19:35:38 -0500 (Fri, 08 May 2009) | 1 line remove compat code ........ r72493 | benjamin.peterson | 2009-05-08 19:54:15 -0500 (Fri, 08 May 2009) | 1 line add a test for \r\n newlines ........ Added: python/trunk/Lib/lib2to3/tests/data/crlf.py - copied unchanged from r72493, /sandbox/trunk/2to3/lib2to3/tests/data/crlf.py python/trunk/Lib/lib2to3/tests/data/different_encoding.py - copied unchanged from r72493, /sandbox/trunk/2to3/lib2to3/tests/data/different_encoding.py Modified: python/trunk/Lib/lib2to3/ (props changed) python/trunk/Lib/lib2to3/fixer_base.py python/trunk/Lib/lib2to3/fixer_util.py python/trunk/Lib/lib2to3/fixes/fix_apply.py python/trunk/Lib/lib2to3/fixes/fix_basestring.py python/trunk/Lib/lib2to3/fixes/fix_buffer.py python/trunk/Lib/lib2to3/fixes/fix_callable.py python/trunk/Lib/lib2to3/fixes/fix_dict.py python/trunk/Lib/lib2to3/fixes/fix_except.py python/trunk/Lib/lib2to3/fixes/fix_exec.py python/trunk/Lib/lib2to3/fixes/fix_execfile.py python/trunk/Lib/lib2to3/fixes/fix_filter.py python/trunk/Lib/lib2to3/fixes/fix_funcattrs.py python/trunk/Lib/lib2to3/fixes/fix_getcwdu.py python/trunk/Lib/lib2to3/fixes/fix_has_key.py python/trunk/Lib/lib2to3/fixes/fix_idioms.py python/trunk/Lib/lib2to3/fixes/fix_import.py python/trunk/Lib/lib2to3/fixes/fix_imports.py python/trunk/Lib/lib2to3/fixes/fix_input.py python/trunk/Lib/lib2to3/fixes/fix_intern.py python/trunk/Lib/lib2to3/fixes/fix_itertools.py python/trunk/Lib/lib2to3/fixes/fix_itertools_imports.py python/trunk/Lib/lib2to3/fixes/fix_long.py python/trunk/Lib/lib2to3/fixes/fix_map.py python/trunk/Lib/lib2to3/fixes/fix_metaclass.py python/trunk/Lib/lib2to3/fixes/fix_methodattrs.py python/trunk/Lib/lib2to3/fixes/fix_ne.py python/trunk/Lib/lib2to3/fixes/fix_next.py python/trunk/Lib/lib2to3/fixes/fix_nonzero.py python/trunk/Lib/lib2to3/fixes/fix_numliterals.py python/trunk/Lib/lib2to3/fixes/fix_paren.py python/trunk/Lib/lib2to3/fixes/fix_print.py python/trunk/Lib/lib2to3/fixes/fix_raise.py python/trunk/Lib/lib2to3/fixes/fix_raw_input.py python/trunk/Lib/lib2to3/fixes/fix_reduce.py python/trunk/Lib/lib2to3/fixes/fix_renames.py python/trunk/Lib/lib2to3/fixes/fix_repr.py python/trunk/Lib/lib2to3/fixes/fix_set_literal.py python/trunk/Lib/lib2to3/fixes/fix_standarderror.py python/trunk/Lib/lib2to3/fixes/fix_sys_exc.py python/trunk/Lib/lib2to3/fixes/fix_throw.py python/trunk/Lib/lib2to3/fixes/fix_tuple_params.py python/trunk/Lib/lib2to3/fixes/fix_types.py python/trunk/Lib/lib2to3/fixes/fix_unicode.py python/trunk/Lib/lib2to3/fixes/fix_ws_comma.py python/trunk/Lib/lib2to3/fixes/fix_xrange.py python/trunk/Lib/lib2to3/fixes/fix_xreadlines.py python/trunk/Lib/lib2to3/fixes/fix_zip.py python/trunk/Lib/lib2to3/main.py python/trunk/Lib/lib2to3/patcomp.py python/trunk/Lib/lib2to3/pgen2/driver.py python/trunk/Lib/lib2to3/pgen2/tokenize.py python/trunk/Lib/lib2to3/pytree.py python/trunk/Lib/lib2to3/refactor.py python/trunk/Lib/lib2to3/tests/support.py python/trunk/Lib/lib2to3/tests/test_all_fixers.py python/trunk/Lib/lib2to3/tests/test_fixers.py python/trunk/Lib/lib2to3/tests/test_parser.py python/trunk/Lib/lib2to3/tests/test_refactor.py Modified: python/trunk/Lib/lib2to3/fixer_base.py ============================================================================== --- python/trunk/Lib/lib2to3/fixer_base.py (original) +++ python/trunk/Lib/lib2to3/fixer_base.py Sat May 9 03:01:14 2009 @@ -94,14 +94,14 @@ """ raise NotImplementedError() - def new_name(self, template="xxx_todo_changeme"): + def new_name(self, template=u"xxx_todo_changeme"): """Return a string suitable for use as an identifier The new name is guaranteed not to conflict with other identifiers. """ name = template while name in self.used_names: - name = template + str(self.numbers.next()) + name = template + unicode(self.numbers.next()) self.used_names.add(name) return name @@ -120,7 +120,7 @@ """ lineno = node.get_lineno() for_output = node.clone() - for_output.set_prefix("") + for_output.set_prefix(u"") msg = "Line %d: could not convert: %s" self.log_message(msg % (lineno, for_output)) if reason: Modified: python/trunk/Lib/lib2to3/fixer_util.py ============================================================================== --- python/trunk/Lib/lib2to3/fixer_util.py (original) +++ python/trunk/Lib/lib2to3/fixer_util.py Sat May 9 03:01:14 2009 @@ -14,13 +14,13 @@ def KeywordArg(keyword, value): return Node(syms.argument, - [keyword, Leaf(token.EQUAL, '='), value]) + [keyword, Leaf(token.EQUAL, u'='), value]) def LParen(): - return Leaf(token.LPAR, "(") + return Leaf(token.LPAR, u"(") def RParen(): - return Leaf(token.RPAR, ")") + return Leaf(token.RPAR, u")") def Assign(target, source): """Build an assignment statement""" @@ -43,11 +43,11 @@ def Comma(): """A comma leaf""" - return Leaf(token.COMMA, ",") + return Leaf(token.COMMA, u",") def Dot(): """A period (.) leaf""" - return Leaf(token.DOT, ".") + return Leaf(token.DOT, u".") def ArgList(args, lparen=LParen(), rparen=RParen()): """A parenthesised argument list, used by Call()""" @@ -65,20 +65,20 @@ def Newline(): """A newline literal""" - return Leaf(token.NEWLINE, "\n") + return Leaf(token.NEWLINE, u"\n") def BlankLine(): """A blank line""" - return Leaf(token.NEWLINE, "") + return Leaf(token.NEWLINE, u"") def Number(n, prefix=None): return Leaf(token.NUMBER, n, prefix=prefix) def Subscript(index_node): """A numeric or string subscript""" - return Node(syms.trailer, [Leaf(token.LBRACE, '['), + return Node(syms.trailer, [Leaf(token.LBRACE, u'['), index_node, - Leaf(token.RBRACE, ']')]) + Leaf(token.RBRACE, u']')]) def String(string, prefix=None): """A string leaf""" @@ -89,24 +89,24 @@ If test is None, the "if test" part is omitted. """ - xp.set_prefix("") - fp.set_prefix(" ") - it.set_prefix(" ") - for_leaf = Leaf(token.NAME, "for") - for_leaf.set_prefix(" ") - in_leaf = Leaf(token.NAME, "in") - in_leaf.set_prefix(" ") + xp.set_prefix(u"") + fp.set_prefix(u" ") + it.set_prefix(u" ") + for_leaf = Leaf(token.NAME, u"for") + for_leaf.set_prefix(u" ") + in_leaf = Leaf(token.NAME, u"in") + in_leaf.set_prefix(u" ") inner_args = [for_leaf, fp, in_leaf, it] if test: - test.set_prefix(" ") - if_leaf = Leaf(token.NAME, "if") - if_leaf.set_prefix(" ") + test.set_prefix(u" ") + if_leaf = Leaf(token.NAME, u"if") + if_leaf.set_prefix(u" ") inner_args.append(Node(syms.comp_if, [if_leaf, test])) inner = Node(syms.listmaker, [xp, Node(syms.comp_for, inner_args)]) return Node(syms.atom, - [Leaf(token.LBRACE, "["), + [Leaf(token.LBRACE, u"["), inner, - Leaf(token.RBRACE, "]")]) + Leaf(token.RBRACE, u"]")]) def FromImport(package_name, name_leafs): """ Return an import statement in the form: @@ -120,9 +120,9 @@ # Pull the leaves out of their old tree leaf.remove() - children = [Leaf(token.NAME, 'from'), - Leaf(token.NAME, package_name, prefix=" "), - Leaf(token.NAME, 'import', prefix=" "), + children = [Leaf(token.NAME, u'from'), + Leaf(token.NAME, package_name, prefix=u" "), + Leaf(token.NAME, u'import', prefix=u" "), Node(syms.import_as_names, name_leafs)] imp = Node(syms.import_from, children) return imp @@ -141,8 +141,8 @@ and isinstance(node.children[0], Leaf) and isinstance(node.children[1], Node) and isinstance(node.children[2], Leaf) - and node.children[0].value == "(" - and node.children[2].value == ")") + and node.children[0].value == u"(" + and node.children[2].value == u")") def is_list(node): """Does the node represent a list literal?""" @@ -150,8 +150,8 @@ and len(node.children) > 1 and isinstance(node.children[0], Leaf) and isinstance(node.children[-1], Leaf) - and node.children[0].value == "[" - and node.children[-1].value == "]") + and node.children[0].value == u"[" + and node.children[-1].value == u"]") ########################################################### @@ -317,11 +317,11 @@ if package is None: import_ = Node(syms.import_name, [ - Leaf(token.NAME, 'import'), - Leaf(token.NAME, name, prefix=' ') + Leaf(token.NAME, u'import'), + Leaf(token.NAME, name, prefix=u' ') ]) else: - import_ = FromImport(package, [Leaf(token.NAME, name, prefix=' ')]) + import_ = FromImport(package, [Leaf(token.NAME, name, prefix=u' ')]) children = [import_, Newline()] if add_newline_before: @@ -409,7 +409,7 @@ if package and unicode(node.children[1]).strip() != package: return None n = node.children[3] - if package and _find('as', n): + if package and _find(u'as', n): # See test_from_import_as for explanation return None elif n.type == syms.import_as_names and _find(name, n): Modified: python/trunk/Lib/lib2to3/fixes/fix_apply.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_apply.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_apply.py Sat May 9 03:01:14 2009 @@ -46,12 +46,12 @@ if kwds is not None: kwds = kwds.clone() kwds.set_prefix("") - l_newargs = [pytree.Leaf(token.STAR, "*"), args] + l_newargs = [pytree.Leaf(token.STAR, u"*"), args] if kwds is not None: l_newargs.extend([Comma(), - pytree.Leaf(token.DOUBLESTAR, "**"), + pytree.Leaf(token.DOUBLESTAR, u"**"), kwds]) - l_newargs[-2].set_prefix(" ") # that's the ** token + l_newargs[-2].set_prefix(u" ") # that's the ** token # XXX Sometimes we could be cleverer, e.g. apply(f, (x, y) + t) # can be translated into f(x, y, *t) instead of f(*(x, y) + t) #new = pytree.Node(syms.power, (func, ArgList(l_newargs))) Modified: python/trunk/Lib/lib2to3/fixes/fix_basestring.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_basestring.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_basestring.py Sat May 9 03:01:14 2009 @@ -10,4 +10,4 @@ PATTERN = "'basestring'" def transform(self, node, results): - return Name("str", prefix=node.get_prefix()) + return Name(u"str", prefix=node.get_prefix()) Modified: python/trunk/Lib/lib2to3/fixes/fix_buffer.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_buffer.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_buffer.py Sat May 9 03:01:14 2009 @@ -18,4 +18,4 @@ def transform(self, node, results): name = results["name"] - name.replace(Name("memoryview", prefix=name.get_prefix())) + name.replace(Name(u"memoryview", prefix=name.get_prefix())) Modified: python/trunk/Lib/lib2to3/fixes/fix_callable.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_callable.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_callable.py Sat May 9 03:01:14 2009 @@ -27,5 +27,5 @@ def transform(self, node, results): func = results["func"] - args = [func.clone(), String(', '), String("'__call__'")] - return Call(Name("hasattr"), args, prefix=node.get_prefix()) + args = [func.clone(), String(u', '), String(u"'__call__'")] + return Call(Name(u"hasattr"), args, prefix=node.get_prefix()) Modified: python/trunk/Lib/lib2to3/fixes/fix_dict.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_dict.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_dict.py Sat May 9 03:01:14 2009 @@ -51,7 +51,7 @@ tail = results["tail"] syms = self.syms method_name = method.value - isiter = method_name.startswith("iter") + isiter = method_name.startswith(u"iter") if isiter: method_name = method_name[4:] assert method_name in ("keys", "items", "values"), repr(method) @@ -65,8 +65,8 @@ results["parens"].clone()] new = pytree.Node(syms.power, args) if not special: - new.set_prefix("") - new = Call(Name(isiter and "iter" or "list"), [new]) + new.set_prefix(u"") + new = Call(Name(isiter and u"iter" or u"list"), [new]) if tail: new = pytree.Node(syms.power, [new] + tail) new.set_prefix(node.get_prefix()) Modified: python/trunk/Lib/lib2to3/fixes/fix_except.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_except.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_except.py Sat May 9 03:01:14 2009 @@ -30,7 +30,7 @@ def find_excepts(nodes): for i, n in enumerate(nodes): if n.type == syms.except_clause: - if n.children[0].value == 'except': + if n.children[0].value == u'except': yield (n, nodes[i+2]) class FixExcept(fixer_base.BaseFix): @@ -52,13 +52,13 @@ for except_clause, e_suite in find_excepts(try_cleanup): if len(except_clause.children) == 4: (E, comma, N) = except_clause.children[1:4] - comma.replace(Name("as", prefix=" ")) + comma.replace(Name(u"as", prefix=u" ")) if N.type != token.NAME: # Generate a new N for the except clause - new_N = Name(self.new_name(), prefix=" ") + new_N = Name(self.new_name(), prefix=u" ") target = N.clone() - target.set_prefix("") + target.set_prefix(u"") N.replace(new_N) new_N = new_N.clone() @@ -74,7 +74,7 @@ # The assignment is different if old_N is a tuple or list # In that case, the assignment is old_N = new_N.args if is_tuple(N) or is_list(N): - assign = Assign(target, Attr(new_N, Name('args'))) + assign = Assign(target, Attr(new_N, Name(u'args'))) else: assign = Assign(target, new_N) @@ -82,10 +82,10 @@ for child in reversed(suite_stmts[:i]): e_suite.insert_child(0, child) e_suite.insert_child(i, assign) - elif N.get_prefix() == "": + elif N.get_prefix() == u"": # No space after a comma is legal; no space after "as", # not so much. - N.set_prefix(" ") + N.set_prefix(u" ") #TODO(cwinter) fix this when children becomes a smart list children = [c.clone() for c in node.children[:3]] + try_cleanup + tail Modified: python/trunk/Lib/lib2to3/fixes/fix_exec.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_exec.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_exec.py Sat May 9 03:01:14 2009 @@ -36,4 +36,4 @@ if c is not None: args.extend([Comma(), c.clone()]) - return Call(Name("exec"), args, prefix=node.get_prefix()) + return Call(Name(u"exec"), args, prefix=node.get_prefix()) Modified: python/trunk/Lib/lib2to3/fixes/fix_execfile.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_execfile.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_execfile.py Sat May 9 03:01:14 2009 @@ -31,21 +31,21 @@ execfile_paren = node.children[-1].children[-1].clone() # Construct open().read(). open_args = ArgList([filename.clone()], rparen=execfile_paren) - open_call = Node(syms.power, [Name("open"), open_args]) - read = [Node(syms.trailer, [Dot(), Name('read')]), + open_call = Node(syms.power, [Name(u"open"), open_args]) + read = [Node(syms.trailer, [Dot(), Name(u'read')]), Node(syms.trailer, [LParen(), RParen()])] open_expr = [open_call] + read # Wrap the open call in a compile call. This is so the filename will be # preserved in the execed code. filename_arg = filename.clone() - filename_arg.set_prefix(" ") - exec_str = String("'exec'", " ") + filename_arg.set_prefix(u" ") + exec_str = String(u"'exec'", u" ") compile_args = open_expr + [Comma(), filename_arg, Comma(), exec_str] - compile_call = Call(Name("compile"), compile_args, "") + compile_call = Call(Name(u"compile"), compile_args, u"") # Finally, replace the execfile call with an exec call. args = [compile_call] if globals is not None: args.extend([Comma(), globals.clone()]) if locals is not None: args.extend([Comma(), locals.clone()]) - return Call(Name("exec"), args, prefix=node.get_prefix()) + return Call(Name(u"exec"), args, prefix=node.get_prefix()) Modified: python/trunk/Lib/lib2to3/fixes/fix_filter.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_filter.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_filter.py Sat May 9 03:01:14 2009 @@ -60,16 +60,16 @@ results.get("xp").clone()) elif "none" in results: - new = ListComp(Name("_f"), - Name("_f"), + new = ListComp(Name(u"_f"), + Name(u"_f"), results["seq"].clone(), - Name("_f")) + Name(u"_f")) else: if in_special_context(node): return None new = node.clone() - new.set_prefix("") - new = Call(Name("list"), [new]) + new.set_prefix(u"") + new = Call(Name(u"list"), [new]) new.set_prefix(node.get_prefix()) return new Modified: python/trunk/Lib/lib2to3/fixes/fix_funcattrs.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_funcattrs.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_funcattrs.py Sat May 9 03:01:14 2009 @@ -15,5 +15,5 @@ def transform(self, node, results): attr = results["attr"][0] - attr.replace(Name(("__%s__" % attr.value[5:]), + attr.replace(Name((u"__%s__" % attr.value[5:]), prefix=attr.get_prefix())) Modified: python/trunk/Lib/lib2to3/fixes/fix_getcwdu.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_getcwdu.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_getcwdu.py Sat May 9 03:01:14 2009 @@ -15,4 +15,4 @@ def transform(self, node, results): name = results["name"] - name.replace(Name("getcwd", prefix=name.get_prefix())) + name.replace(Name(u"getcwd", prefix=name.get_prefix())) Modified: python/trunk/Lib/lib2to3/fixes/fix_has_key.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_has_key.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_has_key.py Sat May 9 03:01:14 2009 @@ -91,10 +91,10 @@ before = before[0] else: before = pytree.Node(syms.power, before) - before.set_prefix(" ") - n_op = Name("in", prefix=" ") + before.set_prefix(u" ") + n_op = Name(u"in", prefix=u" ") if negation: - n_not = Name("not", prefix=" ") + n_not = Name(u"not", prefix=u" ") n_op = pytree.Node(syms.comp_op, (n_not, n_op)) new = pytree.Node(syms.comparison, (arg, n_op, before)) if after: Modified: python/trunk/Lib/lib2to3/fixes/fix_idioms.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_idioms.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_idioms.py Sat May 9 03:01:14 2009 @@ -105,14 +105,14 @@ T.set_prefix(" ") test = Call(Name("isinstance"), [x, Comma(), T]) if "n" in results: - test.set_prefix(" ") - test = Node(syms.not_test, [Name("not"), test]) + test.set_prefix(u" ") + test = Node(syms.not_test, [Name(u"not"), test]) test.set_prefix(node.get_prefix()) return test def transform_while(self, node, results): one = results["while"] - one.replace(Name("True", prefix=one.get_prefix())) + one.replace(Name(u"True", prefix=one.get_prefix())) def transform_sort(self, node, results): sort_stmt = results["sort"] @@ -121,11 +121,11 @@ simple_expr = results.get("expr") if list_call: - list_call.replace(Name("sorted", prefix=list_call.get_prefix())) + list_call.replace(Name(u"sorted", prefix=list_call.get_prefix())) elif simple_expr: new = simple_expr.clone() - new.set_prefix("") - simple_expr.replace(Call(Name("sorted"), [new], + new.set_prefix(u"") + simple_expr.replace(Call(Name(u"sorted"), [new], prefix=simple_expr.get_prefix())) else: raise RuntimeError("should not have reached here") Modified: python/trunk/Lib/lib2to3/fixes/fix_import.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_import.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_import.py Sat May 9 03:01:14 2009 @@ -54,7 +54,7 @@ while not hasattr(imp, 'value'): imp = imp.children[0] if self.probably_a_local_import(imp.value): - imp.value = "." + imp.value + imp.value = u"." + imp.value imp.changed() return node else: Modified: python/trunk/Lib/lib2to3/fixes/fix_imports.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_imports.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_imports.py Sat May 9 03:01:14 2009 @@ -123,7 +123,7 @@ import_mod = results.get("module_name") if import_mod: mod_name = import_mod.value - new_name = self.mapping[mod_name] + new_name = unicode(self.mapping[mod_name]) import_mod.replace(Name(new_name, prefix=import_mod.get_prefix())) if "name_import" in results: # If it's not a "from x import x, y" or "import x as y" import, Modified: python/trunk/Lib/lib2to3/fixes/fix_input.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_input.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_input.py Sat May 9 03:01:14 2009 @@ -22,5 +22,5 @@ return new = node.clone() - new.set_prefix("") - return Call(Name("eval"), [new], prefix=node.get_prefix()) + new.set_prefix(u"") + return Call(Name(u"eval"), [new], prefix=node.get_prefix()) Modified: python/trunk/Lib/lib2to3/fixes/fix_intern.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_intern.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_intern.py Sat May 9 03:01:14 2009 @@ -34,11 +34,11 @@ if after: after = [n.clone() for n in after] new = pytree.Node(syms.power, - Attr(Name("sys"), Name("intern")) + + Attr(Name(u"sys"), Name(u"intern")) + [pytree.Node(syms.trailer, [results["lpar"].clone(), newarglist, results["rpar"].clone()])] + after) new.set_prefix(node.get_prefix()) - touch_import(None, 'sys', node) + touch_import(None, u'sys', node) return new Modified: python/trunk/Lib/lib2to3/fixes/fix_itertools.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_itertools.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_itertools.py Sat May 9 03:01:14 2009 @@ -27,7 +27,7 @@ def transform(self, node, results): prefix = None func = results['func'][0] - if 'it' in results and func.value != 'ifilterfalse': + if 'it' in results and func.value != u'ifilterfalse': dot, it = (results['dot'], results['it']) # Remove the 'itertools' prefix = it.get_prefix() Modified: python/trunk/Lib/lib2to3/fixes/fix_itertools_imports.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_itertools_imports.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_itertools_imports.py Sat May 9 03:01:14 2009 @@ -24,12 +24,12 @@ assert child.type == syms.import_as_name name_node = child.children[0] member_name = name_node.value - if member_name in ('imap', 'izip', 'ifilter'): + if member_name in (u'imap', u'izip', u'ifilter'): child.value = None child.remove() - elif member_name == 'ifilterfalse': + elif member_name == u'ifilterfalse': node.changed() - name_node.value = 'filterfalse' + name_node.value = u'filterfalse' # Make sure the import statement is still sane children = imports.children[:] or [imports] Modified: python/trunk/Lib/lib2to3/fixes/fix_long.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_long.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_long.py Sat May 9 03:01:14 2009 @@ -13,7 +13,7 @@ PATTERN = "'long'" - static_int = Name("int") + static_int = Name(u"int") def transform(self, node, results): if is_probably_builtin(node): Modified: python/trunk/Lib/lib2to3/fixes/fix_map.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_map.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_map.py Sat May 9 03:01:14 2009 @@ -63,8 +63,8 @@ if node.parent.type == syms.simple_stmt: self.warning(node, "You should use a for loop here") new = node.clone() - new.set_prefix("") - new = Call(Name("list"), [new]) + new.set_prefix(u"") + new = Call(Name(u"list"), [new]) elif "map_lambda" in results: new = ListComp(results.get("xp").clone(), results.get("fp").clone(), @@ -76,7 +76,7 @@ if in_special_context(node): return None new = node.clone() - new.set_prefix("") - new = Call(Name("list"), [new]) + new.set_prefix(u"") + new = Call(Name(u"list"), [new]) new.set_prefix(node.get_prefix()) return new Modified: python/trunk/Lib/lib2to3/fixes/fix_metaclass.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_metaclass.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_metaclass.py Sat May 9 03:01:14 2009 @@ -113,7 +113,7 @@ # Check if the expr_node is a simple assignment. left_node = expr_node.children[0] if isinstance(left_node, Leaf) and \ - left_node.value == '__metaclass__': + left_node.value == u'__metaclass__': # We found a assignment to __metaclass__. fixup_simple_stmt(node, i, simple_node) remove_trailing_newline(simple_node) @@ -182,9 +182,9 @@ # Node(classdef, ['class', 'name', ':', suite]) # 0 1 2 3 arglist = Node(syms.arglist, []) - node.insert_child(2, Leaf(token.RPAR, ')')) + node.insert_child(2, Leaf(token.RPAR, u')')) node.insert_child(2, arglist) - node.insert_child(2, Leaf(token.LPAR, '(')) + node.insert_child(2, Leaf(token.LPAR, u'(')) else: raise ValueError("Unexpected class definition") @@ -194,16 +194,16 @@ orig_meta_prefix = meta_txt.get_prefix() if arglist.children: - arglist.append_child(Leaf(token.COMMA, ',')) - meta_txt.set_prefix(' ') + arglist.append_child(Leaf(token.COMMA, u',')) + meta_txt.set_prefix(u' ') else: - meta_txt.set_prefix('') + meta_txt.set_prefix(u'') # compact the expression "metaclass = Meta" -> "metaclass=Meta" expr_stmt = last_metaclass.children[0] assert expr_stmt.type == syms.expr_stmt - expr_stmt.children[1].set_prefix('') - expr_stmt.children[2].set_prefix('') + expr_stmt.children[1].set_prefix(u'') + expr_stmt.children[2].set_prefix(u'') arglist.append_child(last_metaclass) @@ -213,15 +213,15 @@ if not suite.children: # one-liner that was just __metaclass_ suite.remove() - pass_leaf = Leaf(text_type, 'pass') + pass_leaf = Leaf(text_type, u'pass') pass_leaf.set_prefix(orig_meta_prefix) node.append_child(pass_leaf) - node.append_child(Leaf(token.NEWLINE, '\n')) + node.append_child(Leaf(token.NEWLINE, u'\n')) elif len(suite.children) > 1 and \ (suite.children[-2].type == token.INDENT and suite.children[-1].type == token.DEDENT): # there was only one line in the class body and it was __metaclass__ - pass_leaf = Leaf(text_type, 'pass') + pass_leaf = Leaf(text_type, u'pass') suite.insert_child(-1, pass_leaf) - suite.insert_child(-1, Leaf(token.NEWLINE, '\n')) + suite.insert_child(-1, Leaf(token.NEWLINE, u'\n')) Modified: python/trunk/Lib/lib2to3/fixes/fix_methodattrs.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_methodattrs.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_methodattrs.py Sat May 9 03:01:14 2009 @@ -19,5 +19,5 @@ def transform(self, node, results): attr = results["attr"][0] - new = MAP[attr.value] + new = unicode(MAP[attr.value]) attr.replace(Name(new, prefix=attr.get_prefix())) Modified: python/trunk/Lib/lib2to3/fixes/fix_ne.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_ne.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_ne.py Sat May 9 03:01:14 2009 @@ -14,9 +14,9 @@ def match(self, node): # Override - return node.type == token.NOTEQUAL and node.value == "<>" + return node.type == token.NOTEQUAL and node.value == u"<>" def transform(self, node, results): - new = pytree.Leaf(token.NOTEQUAL, "!=") + new = pytree.Leaf(token.NOTEQUAL, u"!=") new.set_prefix(node.get_prefix()) return new Modified: python/trunk/Lib/lib2to3/fixes/fix_next.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_next.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_next.py Sat May 9 03:01:14 2009 @@ -35,7 +35,7 @@ def start_tree(self, tree, filename): super(FixNext, self).start_tree(tree, filename) - n = find_binding('next', tree) + n = find_binding(u'next', tree) if n: self.warning(n, bind_warning) self.shadowed_next = True @@ -52,13 +52,13 @@ if base: if self.shadowed_next: - attr.replace(Name("__next__", prefix=attr.get_prefix())) + attr.replace(Name(u"__next__", prefix=attr.get_prefix())) else: base = [n.clone() for n in base] - base[0].set_prefix("") - node.replace(Call(Name("next", prefix=node.get_prefix()), base)) + base[0].set_prefix(u"") + node.replace(Call(Name(u"next", prefix=node.get_prefix()), base)) elif name: - n = Name("__next__", prefix=name.get_prefix()) + n = Name(u"__next__", prefix=name.get_prefix()) name.replace(n) elif attr: # We don't do this transformation if we're assigning to "x.next". @@ -66,10 +66,10 @@ # so it's being done here. if is_assign_target(node): head = results["head"] - if "".join([str(n) for n in head]).strip() == '__builtin__': + if "".join([str(n) for n in head]).strip() == u'__builtin__': self.warning(node, bind_warning) return - attr.replace(Name("__next__")) + attr.replace(Name(u"__next__")) elif "global" in results: self.warning(node, bind_warning) self.shadowed_next = True Modified: python/trunk/Lib/lib2to3/fixes/fix_nonzero.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_nonzero.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_nonzero.py Sat May 9 03:01:14 2009 @@ -16,5 +16,5 @@ def transform(self, node, results): name = results["name"] - new = Name("__bool__", prefix=name.get_prefix()) + new = Name(u"__bool__", prefix=name.get_prefix()) name.replace(new) Modified: python/trunk/Lib/lib2to3/fixes/fix_numliterals.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_numliterals.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_numliterals.py Sat May 9 03:01:14 2009 @@ -15,13 +15,13 @@ def match(self, node): # Override return (node.type == token.NUMBER and - (node.value.startswith("0") or node.value[-1] in "Ll")) + (node.value.startswith(u"0") or node.value[-1] in u"Ll")) def transform(self, node, results): val = node.value - if val[-1] in 'Ll': + if val[-1] in u'Ll': val = val[:-1] - elif val.startswith('0') and val.isdigit() and len(set(val)) > 1: - val = "0o" + val[1:] + elif val.startswith(u'0') and val.isdigit() and len(set(val)) > 1: + val = u"0o" + val[1:] return Number(val, prefix=node.get_prefix()) Modified: python/trunk/Lib/lib2to3/fixes/fix_paren.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_paren.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_paren.py Sat May 9 03:01:14 2009 @@ -37,6 +37,6 @@ lparen = LParen() lparen.set_prefix(target.get_prefix()) - target.set_prefix("") # Make it hug the parentheses + target.set_prefix(u"") # Make it hug the parentheses target.insert_child(0, lparen) target.append_child(RParen()) Modified: python/trunk/Lib/lib2to3/fixes/fix_print.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_print.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_print.py Sat May 9 03:01:14 2009 @@ -44,10 +44,10 @@ if bare_print: # Special-case print all by itself - bare_print.replace(Call(Name("print"), [], + bare_print.replace(Call(Name(u"print"), [], prefix=bare_print.get_prefix())) return - assert node.children[0] == Name("print") + assert node.children[0] == Name(u"print") args = node.children[1:] if len(args) == 1 and parend_expr.match(args[0]): # We don't want to keep sticking parens around an @@ -58,33 +58,33 @@ if args and args[-1] == Comma(): args = args[:-1] end = " " - if args and args[0] == pytree.Leaf(token.RIGHTSHIFT, ">>"): + if args and args[0] == pytree.Leaf(token.RIGHTSHIFT, u">>"): assert len(args) >= 2 file = args[1].clone() args = args[3:] # Strip a possible comma after the file expression # Now synthesize a print(args, sep=..., end=..., file=...) node. l_args = [arg.clone() for arg in args] if l_args: - l_args[0].set_prefix("") + l_args[0].set_prefix(u"") if sep is not None or end is not None or file is not None: if sep is not None: - self.add_kwarg(l_args, "sep", String(repr(sep))) + self.add_kwarg(l_args, u"sep", String(repr(sep))) if end is not None: - self.add_kwarg(l_args, "end", String(repr(end))) + self.add_kwarg(l_args, u"end", String(repr(end))) if file is not None: - self.add_kwarg(l_args, "file", file) - n_stmt = Call(Name("print"), l_args) + self.add_kwarg(l_args, u"file", file) + n_stmt = Call(Name(u"print"), l_args) n_stmt.set_prefix(node.get_prefix()) return n_stmt def add_kwarg(self, l_nodes, s_kwd, n_expr): # XXX All this prefix-setting may lose comments (though rarely) - n_expr.set_prefix("") + n_expr.set_prefix(u"") n_argument = pytree.Node(self.syms.argument, (Name(s_kwd), - pytree.Leaf(token.EQUAL, "="), + pytree.Leaf(token.EQUAL, u"="), n_expr)) if l_nodes: l_nodes.append(Comma()) - n_argument.set_prefix(" ") + n_argument.set_prefix(u" ") l_nodes.append(n_argument) Modified: python/trunk/Lib/lib2to3/fixes/fix_raise.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_raise.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_raise.py Sat May 9 03:01:14 2009 @@ -56,7 +56,7 @@ if "val" not in results: # One-argument raise - new = pytree.Node(syms.raise_stmt, [Name("raise"), exc]) + new = pytree.Node(syms.raise_stmt, [Name(u"raise"), exc]) new.set_prefix(node.get_prefix()) return new @@ -64,19 +64,19 @@ if is_tuple(val): args = [c.clone() for c in val.children[1:-1]] else: - val.set_prefix("") + val.set_prefix(u"") args = [val] if "tb" in results: tb = results["tb"].clone() - tb.set_prefix("") + tb.set_prefix(u"") e = Call(exc, args) - with_tb = Attr(e, Name('with_traceback')) + [ArgList([tb])] - new = pytree.Node(syms.simple_stmt, [Name("raise")] + with_tb) + with_tb = Attr(e, Name(u'with_traceback')) + [ArgList([tb])] + new = pytree.Node(syms.simple_stmt, [Name(u"raise")] + with_tb) new.set_prefix(node.get_prefix()) return new else: return pytree.Node(syms.raise_stmt, - [Name("raise"), Call(exc, args)], + [Name(u"raise"), Call(exc, args)], prefix=node.get_prefix()) Modified: python/trunk/Lib/lib2to3/fixes/fix_raw_input.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_raw_input.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_raw_input.py Sat May 9 03:01:14 2009 @@ -13,4 +13,4 @@ def transform(self, node, results): name = results["name"] - name.replace(Name("input", prefix=name.get_prefix())) + name.replace(Name(u"input", prefix=name.get_prefix())) Modified: python/trunk/Lib/lib2to3/fixes/fix_reduce.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_reduce.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_reduce.py Sat May 9 03:01:14 2009 @@ -30,4 +30,4 @@ """ def transform(self, node, results): - touch_import('functools', 'reduce', node) + touch_import(u'functools', u'reduce', node) Modified: python/trunk/Lib/lib2to3/fixes/fix_renames.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_renames.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_renames.py Sat May 9 03:01:14 2009 @@ -65,5 +65,5 @@ #import_mod = results.get("module") if mod_name and attr_name: - new_attr = LOOKUP[(mod_name.value, attr_name.value)] + new_attr = unicode(LOOKUP[(mod_name.value, attr_name.value)]) attr_name.replace(Name(new_attr, prefix=attr_name.get_prefix())) Modified: python/trunk/Lib/lib2to3/fixes/fix_repr.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_repr.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_repr.py Sat May 9 03:01:14 2009 @@ -19,4 +19,4 @@ if expr.type == self.syms.testlist1: expr = parenthesize(expr) - return Call(Name("repr"), [expr], prefix=node.get_prefix()) + return Call(Name(u"repr"), [expr], prefix=node.get_prefix()) Modified: python/trunk/Lib/lib2to3/fixes/fix_set_literal.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_set_literal.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_set_literal.py Sat May 9 03:01:14 2009 @@ -34,9 +34,9 @@ items = results["items"] # Build the contents of the literal - literal = [pytree.Leaf(token.LBRACE, "{")] + literal = [pytree.Leaf(token.LBRACE, u"{")] literal.extend(n.clone() for n in items.children) - literal.append(pytree.Leaf(token.RBRACE, "}")) + literal.append(pytree.Leaf(token.RBRACE, u"}")) # Set the prefix of the right brace to that of the ')' or ']' literal[-1].set_prefix(items.next_sibling.get_prefix()) maker = pytree.Node(syms.dictsetmaker, literal) Modified: python/trunk/Lib/lib2to3/fixes/fix_standarderror.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_standarderror.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_standarderror.py Sat May 9 03:01:14 2009 @@ -15,4 +15,4 @@ """ def transform(self, node, results): - return Name("Exception", prefix=node.get_prefix()) + return Name(u"Exception", prefix=node.get_prefix()) Modified: python/trunk/Lib/lib2to3/fixes/fix_sys_exc.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_sys_exc.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_sys_exc.py Sat May 9 03:01:14 2009 @@ -22,8 +22,8 @@ sys_attr = results["attribute"][0] index = Number(self.exc_info.index(sys_attr.value)) - call = Call(Name("exc_info"), prefix=sys_attr.get_prefix()) - attr = Attr(Name("sys"), call) + call = Call(Name(u"exc_info"), prefix=sys_attr.get_prefix()) + attr = Attr(Name(u"sys"), call) attr[1].children[0].set_prefix(results["dot"].get_prefix()) attr.append(Subscript(index)) return Node(syms.power, attr, prefix=node.get_prefix()) Modified: python/trunk/Lib/lib2to3/fixes/fix_throw.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_throw.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_throw.py Sat May 9 03:01:14 2009 @@ -32,7 +32,7 @@ return # Leave "g.throw(E)" alone - val = results.get("val") + val = results.get(u"val") if val is None: return @@ -40,17 +40,17 @@ if is_tuple(val): args = [c.clone() for c in val.children[1:-1]] else: - val.set_prefix("") + val.set_prefix(u"") args = [val] throw_args = results["args"] if "tb" in results: tb = results["tb"].clone() - tb.set_prefix("") + tb.set_prefix(u"") e = Call(exc, args) - with_tb = Attr(e, Name('with_traceback')) + [ArgList([tb])] + with_tb = Attr(e, Name(u'with_traceback')) + [ArgList([tb])] throw_args.replace(pytree.Node(syms.power, with_tb)) else: throw_args.replace(Call(exc, args)) Modified: python/trunk/Lib/lib2to3/fixes/fix_tuple_params.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_tuple_params.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_tuple_params.py Sat May 9 03:01:14 2009 @@ -55,7 +55,7 @@ else: start = 0 indent = "; " - end = pytree.Leaf(token.INDENT, "") + end = pytree.Leaf(token.INDENT, u"") # We need access to self for new_name(), and making this a method # doesn't feel right. Closing over self and new_lines makes the @@ -63,10 +63,10 @@ def handle_tuple(tuple_arg, add_prefix=False): n = Name(self.new_name()) arg = tuple_arg.clone() - arg.set_prefix("") + arg.set_prefix(u"") stmt = Assign(arg, n.clone()) if add_prefix: - n.set_prefix(" ") + n.set_prefix(u" ") tuple_arg.replace(n) new_lines.append(pytree.Node(syms.simple_stmt, [stmt, end.clone()])) @@ -91,7 +91,7 @@ # TODO(cwinter) suite-cleanup after = start if start == 0: - new_lines[0].set_prefix(" ") + new_lines[0].set_prefix(u" ") elif is_docstring(suite[0].children[start]): new_lines[0].set_prefix(indent) after = start + 1 @@ -109,7 +109,7 @@ # Replace lambda ((((x)))): x with lambda x: x if inner.type == token.NAME: inner = inner.clone() - inner.set_prefix(" ") + inner.set_prefix(u" ") args.replace(inner) return @@ -117,7 +117,7 @@ to_index = map_to_index(params) tup_name = self.new_name(tuple_name(params)) - new_param = Name(tup_name, prefix=" ") + new_param = Name(tup_name, prefix=u" ") args.replace(new_param.clone()) for n in body.post_order(): if n.type == token.NAME and n.value in to_index: @@ -166,4 +166,4 @@ l.append(tuple_name(obj)) else: l.append(obj) - return "_".join(l) + return u"_".join(l) Modified: python/trunk/Lib/lib2to3/fixes/fix_types.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_types.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_types.py Sat May 9 03:01:14 2009 @@ -56,7 +56,7 @@ PATTERN = '|'.join(_pats) def transform(self, node, results): - new_value = _TYPE_MAPPING.get(results["name"].value) + new_value = unicode(_TYPE_MAPPING.get(results["name"].value)) if new_value: return Name(new_value, prefix=node.get_prefix()) return None Modified: python/trunk/Lib/lib2to3/fixes/fix_unicode.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_unicode.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_unicode.py Sat May 9 03:01:14 2009 @@ -12,17 +12,17 @@ def transform(self, node, results): if node.type == token.NAME: - if node.value == "unicode": + if node.value == u"unicode": new = node.clone() - new.value = "str" + new.value = u"str" return new - if node.value == "unichr": + if node.value == u"unichr": new = node.clone() - new.value = "chr" + new.value = u"chr" return new # XXX Warn when __unicode__ found? elif node.type == token.STRING: - if re.match(r"[uU][rR]?[\'\"]", node.value): + if re.match(ur"[uU][rR]?[\'\"]", node.value): new = node.clone() new.value = new.value[1:] return new Modified: python/trunk/Lib/lib2to3/fixes/fix_ws_comma.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_ws_comma.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_ws_comma.py Sat May 9 03:01:14 2009 @@ -17,8 +17,8 @@ any<(not(',') any)+ ',' ((not(',') any)+ ',')* [not(',') any]> """ - COMMA = pytree.Leaf(token.COMMA, ",") - COLON = pytree.Leaf(token.COLON, ":") + COMMA = pytree.Leaf(token.COMMA, u",") + COLON = pytree.Leaf(token.COLON, u":") SEPS = (COMMA, COLON) def transform(self, node, results): @@ -27,13 +27,13 @@ for child in new.children: if child in self.SEPS: prefix = child.get_prefix() - if prefix.isspace() and "\n" not in prefix: - child.set_prefix("") + if prefix.isspace() and u"\n" not in prefix: + child.set_prefix(u"") comma = True else: if comma: prefix = child.get_prefix() if not prefix: - child.set_prefix(" ") + child.set_prefix(u" ") comma = False return new Modified: python/trunk/Lib/lib2to3/fixes/fix_xrange.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_xrange.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_xrange.py Sat May 9 03:01:14 2009 @@ -19,22 +19,22 @@ def transform(self, node, results): name = results["name"] - if name.value == "xrange": + if name.value == u"xrange": return self.transform_xrange(node, results) - elif name.value == "range": + elif name.value == u"range": return self.transform_range(node, results) else: raise ValueError(repr(name)) def transform_xrange(self, node, results): name = results["name"] - name.replace(Name("range", prefix=name.get_prefix())) + name.replace(Name(u"range", prefix=name.get_prefix())) def transform_range(self, node, results): if not self.in_special_context(node): - range_call = Call(Name("range"), [results["args"].clone()]) + range_call = Call(Name(u"range"), [results["args"].clone()]) # Encase the range call in list(). - list_call = Call(Name("list"), [range_call], + list_call = Call(Name(u"list"), [range_call], prefix=node.get_prefix()) # Put things that were after the range() call after the list call. for n in results["rest"]: Modified: python/trunk/Lib/lib2to3/fixes/fix_xreadlines.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_xreadlines.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_xreadlines.py Sat May 9 03:01:14 2009 @@ -19,6 +19,6 @@ no_call = results.get("no_call") if no_call: - no_call.replace(Name("__iter__", prefix=no_call.get_prefix())) + no_call.replace(Name(u"__iter__", prefix=no_call.get_prefix())) else: node.replace([x.clone() for x in results["call"]]) Modified: python/trunk/Lib/lib2to3/fixes/fix_zip.py ============================================================================== --- python/trunk/Lib/lib2to3/fixes/fix_zip.py (original) +++ python/trunk/Lib/lib2to3/fixes/fix_zip.py Sat May 9 03:01:14 2009 @@ -28,7 +28,7 @@ return None new = node.clone() - new.set_prefix("") - new = Call(Name("list"), [new]) + new.set_prefix(u"") + new = Call(Name(u"list"), [new]) new.set_prefix(node.get_prefix()) return new Modified: python/trunk/Lib/lib2to3/main.py ============================================================================== --- python/trunk/Lib/lib2to3/main.py (original) +++ python/trunk/Lib/lib2to3/main.py Sat May 9 03:01:14 2009 @@ -23,7 +23,7 @@ self.errors.append((msg, args, kwargs)) self.logger.error(msg, *args, **kwargs) - def write_file(self, new_text, filename, old_text): + def write_file(self, new_text, filename, old_text, encoding): if not self.nobackups: # Make backup backup = filename + ".bak" @@ -37,8 +37,8 @@ except os.error, err: self.log_message("Can't rename %s to %s", filename, backup) # Actually write the new file - super(StdoutRefactoringTool, self).write_file(new_text, - filename, old_text) + write = super(StdoutRefactoringTool, self).write_file + write(new_text, filename, old_text, encoding) if not self.nobackups: shutil.copymode(backup, filename) Modified: python/trunk/Lib/lib2to3/patcomp.py ============================================================================== --- python/trunk/Lib/lib2to3/patcomp.py (original) +++ python/trunk/Lib/lib2to3/patcomp.py Sat May 9 03:01:14 2009 @@ -133,7 +133,7 @@ assert len(nodes) >= 1 node = nodes[0] if node.type == token.STRING: - value = literals.evalString(node.value) + value = unicode(literals.evalString(node.value)) return pytree.LeafPattern(content=value) elif node.type == token.NAME: value = node.value Modified: python/trunk/Lib/lib2to3/pgen2/driver.py ============================================================================== --- python/trunk/Lib/lib2to3/pgen2/driver.py (original) +++ python/trunk/Lib/lib2to3/pgen2/driver.py Sat May 9 03:01:14 2009 @@ -16,6 +16,7 @@ __all__ = ["Driver", "load_grammar"] # Python imports +import codecs import os import logging import sys @@ -41,7 +42,7 @@ lineno = 1 column = 0 type = value = start = end = line_text = None - prefix = "" + prefix = u"" for quintuple in tokens: type, value, start, end, line_text = quintuple if start != (lineno, column): @@ -90,9 +91,9 @@ """Parse a stream and return the syntax tree.""" return self.parse_stream_raw(stream, debug) - def parse_file(self, filename, debug=False): + def parse_file(self, filename, encoding=None, debug=False): """Parse a file and return the syntax tree.""" - stream = open(filename) + stream = codecs.open(filename, "r", encoding) try: return self.parse_stream(stream, debug) finally: Modified: python/trunk/Lib/lib2to3/pgen2/tokenize.py ============================================================================== --- python/trunk/Lib/lib2to3/pgen2/tokenize.py (original) +++ python/trunk/Lib/lib2to3/pgen2/tokenize.py Sat May 9 03:01:14 2009 @@ -30,6 +30,7 @@ 'GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro' import string, re +from codecs import BOM_UTF8, lookup from lib2to3.pgen2.token import * from . import token @@ -226,6 +227,75 @@ startline = False toks_append(tokval) +cookie_re = re.compile("coding[:=]\s*([-\w.]+)") + +def detect_encoding(readline): + """ + The detect_encoding() function is used to detect the encoding that should + be used to decode a Python source file. It requires one argment, readline, + in the same way as the tokenize() generator. + + It will call readline a maximum of twice, and return the encoding used + (as a string) and a list of any lines (left as bytes) it has read + in. + + It detects the encoding from the presence of a utf-8 bom or an encoding + cookie as specified in pep-0263. If both a bom and a cookie are present, + but disagree, a SyntaxError will be raised. If the encoding cookie is an + invalid charset, raise a SyntaxError. + + If no encoding is specified, then the default of 'utf-8' will be returned. + """ + bom_found = False + encoding = None + def read_or_stop(): + try: + return readline() + except StopIteration: + return b'' + + def find_cookie(line): + try: + line_string = line.decode('ascii') + except UnicodeDecodeError: + return None + + matches = cookie_re.findall(line_string) + if not matches: + return None + encoding = matches[0] + try: + codec = lookup(encoding) + except LookupError: + # This behaviour mimics the Python interpreter + raise SyntaxError("unknown encoding: " + encoding) + + if bom_found and codec.name != 'utf-8': + # This behaviour mimics the Python interpreter + raise SyntaxError('encoding problem: utf-8') + return encoding + + first = read_or_stop() + if first.startswith(BOM_UTF8): + bom_found = True + first = first[3:] + if not first: + return 'utf-8', [] + + encoding = find_cookie(first) + if encoding: + return encoding, [first] + + second = read_or_stop() + if not second: + return 'utf-8', [first] + + encoding = find_cookie(second) + if encoding: + return encoding, [first, second] + + return 'utf-8', [first, second] + def untokenize(iterable): """Transform tokens back into Python source code. Modified: python/trunk/Lib/lib2to3/pytree.py ============================================================================== --- python/trunk/Lib/lib2to3/pytree.py (original) +++ python/trunk/Lib/lib2to3/pytree.py Sat May 9 03:01:14 2009 @@ -213,9 +213,13 @@ """ next_sib = self.next_sibling if next_sib is None: - return "" + return u"" return next_sib.get_prefix() + if sys.version_info < (3, 0): + def __str__(self): + return unicode(self).encode("ascii") + class Node(Base): @@ -245,13 +249,16 @@ type_repr(self.type), self.children) - def __str__(self): + def __unicode__(self): """ Return a pretty string representation. This reproduces the input source exactly. """ - return "".join(map(str, self.children)) + return u"".join(map(unicode, self.children)) + + if sys.version_info > (3, 0): + __str__ = __unicode__ def _eq(self, other): """Compare two nodes for equality.""" @@ -353,13 +360,16 @@ self.type, self.value) - def __str__(self): + def __unicode__(self): """ Return a pretty string representation. This reproduces the input source exactly. """ - return self.prefix + str(self.value) + return self.prefix + unicode(self.value) + + if sys.version_info > (3, 0): + __str__ = __unicode__ def _eq(self, other): """Compare two nodes for equality.""" Modified: python/trunk/Lib/lib2to3/refactor.py ============================================================================== --- python/trunk/Lib/lib2to3/refactor.py (original) +++ python/trunk/Lib/lib2to3/refactor.py Sat May 9 03:01:14 2009 @@ -22,8 +22,7 @@ from itertools import chain # Local imports -from .pgen2 import driver -from .pgen2 import tokenize +from .pgen2 import driver, tokenize from . import pytree from . import patcomp @@ -87,6 +86,25 @@ return [pkg_name + "." + fix_name for fix_name in get_all_fix_names(pkg_name, False)] +def _identity(obj): + return obj + +if sys.version_info < (3, 0): + import codecs + _open_with_encoding = codecs.open + # codecs.open doesn't translate newlines sadly. + def _from_system_newlines(input): + return input.replace(u"\r\n", u"\n") + def _to_system_newlines(input): + if os.linesep != "\n": + return input.replace(u"\n", os.linesep) + else: + return input +else: + _open_with_encoding = open + _from_system_newlines = _identity + _to_system_newlines = _identity + class FixerError(Exception): """A fixer could not be loaded.""" @@ -213,29 +231,42 @@ # Modify dirnames in-place to remove subdirs with leading dots dirnames[:] = [dn for dn in dirnames if not dn.startswith(".")] - def refactor_file(self, filename, write=False, doctests_only=False): - """Refactors a file.""" + def _read_python_source(self, filename): + """ + Do our best to decode a Python source file correctly. + """ try: - f = open(filename) + f = open(filename, "rb") except IOError, err: self.log_error("Can't open %s: %s", filename, err) - return + return None, None try: - input = f.read() + "\n" # Silence certain parse errors + encoding = tokenize.detect_encoding(f.readline)[0] finally: f.close() + with _open_with_encoding(filename, "r", encoding=encoding) as f: + return _from_system_newlines(f.read()), encoding + + def refactor_file(self, filename, write=False, doctests_only=False): + """Refactors a file.""" + input, encoding = self._read_python_source(filename) + if input is None: + # Reading the file failed. + return + input += u"\n" # Silence certain parse errors if doctests_only: self.log_debug("Refactoring doctests in %s", filename) output = self.refactor_docstring(input, filename) if output != input: - self.processed_file(output, filename, input, write=write) + self.processed_file(output, filename, input, write, encoding) else: self.log_debug("No doctest changes in %s", filename) else: tree = self.refactor_string(input, filename) if tree and tree.was_changed: # The [:-1] is to take off the \n we added earlier - self.processed_file(str(tree)[:-1], filename, write=write) + self.processed_file(unicode(tree)[:-1], filename, + write=write, encoding=encoding) else: self.log_debug("No changes in %s", filename) @@ -321,31 +352,26 @@ node.replace(new) node = new - def processed_file(self, new_text, filename, old_text=None, write=False): + def processed_file(self, new_text, filename, old_text=None, write=False, + encoding=None): """ Called when a file has been refactored, and there are changes. """ self.files.append(filename) if old_text is None: - try: - f = open(filename, "r") - except IOError, err: - self.log_error("Can't read %s: %s", filename, err) + old_text = self._read_python_source(filename)[0] + if old_text is None: return - try: - old_text = f.read() - finally: - f.close() if old_text == new_text: self.log_debug("No changes to %s", filename) return self.print_output(diff_texts(old_text, new_text, filename)) if write: - self.write_file(new_text, filename, old_text) + self.write_file(new_text, filename, old_text, encoding) else: self.log_debug("Not writing changes to %s", filename) - def write_file(self, new_text, filename, old_text): + def write_file(self, new_text, filename, old_text, encoding=None): """Writes a string to a file. It first shows a unified diff between the old text and the new text, and @@ -353,12 +379,12 @@ set. """ try: - f = open(filename, "w") + f = _open_with_encoding(filename, "w", encoding=encoding) except os.error, err: self.log_error("Can't create %s: %s", filename, err) return try: - f.write(new_text) + f.write(_to_system_newlines(new_text)) except os.error, err: self.log_error("Can't write %s: %s", filename, err) finally: @@ -398,7 +424,7 @@ indent = line[:i] elif (indent is not None and (line.startswith(indent + self.PS2) or - line == indent + self.PS2.rstrip() + "\n")): + line == indent + self.PS2.rstrip() + u"\n")): block.append(line) else: if block is not None: @@ -410,7 +436,7 @@ if block is not None: result.extend(self.refactor_doctest(block, block_lineno, indent, filename)) - return "".join(result) + return u"".join(result) def refactor_doctest(self, block, lineno, indent, filename): """Refactors one doctest. @@ -425,7 +451,7 @@ except Exception, err: if self.log.isEnabledFor(logging.DEBUG): for line in block: - self.log_debug("Source: %s", line.rstrip("\n")) + self.log_debug("Source: %s", line.rstrip(u"\n")) self.log_error("Can't parse docstring in %s line %s: %s: %s", filename, lineno, err.__class__.__name__, err) return block @@ -433,9 +459,9 @@ new = str(tree).splitlines(True) # Undo the adjustment of the line numbers in wrap_toks() below. clipped, new = new[:lineno-1], new[lineno-1:] - assert clipped == ["\n"] * (lineno-1), clipped - if not new[-1].endswith("\n"): - new[-1] += "\n" + assert clipped == [u"\n"] * (lineno-1), clipped + if not new[-1].endswith(u"\n"): + new[-1] += u"\n" block = [indent + self.PS1 + new.pop(0)] if new: block += [indent + self.PS2 + line for line in new] @@ -497,8 +523,8 @@ for line in block: if line.startswith(prefix): yield line[len(prefix):] - elif line == prefix.rstrip() + "\n": - yield "\n" + elif line == prefix.rstrip() + u"\n": + yield u"\n" else: raise AssertionError("line=%r, prefix=%r" % (line, prefix)) prefix = prefix2 Modified: python/trunk/Lib/lib2to3/tests/support.py ============================================================================== --- python/trunk/Lib/lib2to3/tests/support.py (original) +++ python/trunk/Lib/lib2to3/tests/support.py Sat May 9 03:01:14 2009 @@ -9,12 +9,9 @@ import re from textwrap import dedent -#sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) - # Local imports -from .. import pytree -from .. import refactor -from ..pgen2 import driver +from lib2to3 import pytree, refactor +from lib2to3.pgen2 import driver test_dir = os.path.dirname(__file__) proj_dir = os.path.normpath(os.path.join(test_dir, "..")) @@ -25,19 +22,13 @@ def parse_string(string): return driver.parse_string(reformat(string), debug=True) -# Python 2.3's TestSuite is not iter()-able -if sys.version_info < (2, 4): - def TestSuite_iter(self): - return iter(self._tests) - unittest.TestSuite.__iter__ = TestSuite_iter - def run_all_tests(test_mod=None, tests=None): if tests is None: tests = unittest.TestLoader().loadTestsFromModule(test_mod) unittest.TextTestRunner(verbosity=2).run(tests) def reformat(string): - return dedent(string) + "\n\n" + return dedent(string) + u"\n\n" def get_refactorer(fixers=None, options=None): """ Modified: python/trunk/Lib/lib2to3/tests/test_all_fixers.py ============================================================================== --- python/trunk/Lib/lib2to3/tests/test_all_fixers.py (original) +++ python/trunk/Lib/lib2to3/tests/test_all_fixers.py Sat May 9 03:01:14 2009 @@ -27,7 +27,7 @@ def test_all_project_files(self): for filepath in support.all_project_files(): print "Fixing %s..." % filepath - self.refactor.refactor_string(open(filepath).read(), filepath) + self.refactor.refactor_file(filepath) if __name__ == "__main__": Modified: python/trunk/Lib/lib2to3/tests/test_fixers.py ============================================================================== --- python/trunk/Lib/lib2to3/tests/test_fixers.py (original) +++ python/trunk/Lib/lib2to3/tests/test_fixers.py Sat May 9 03:01:14 2009 @@ -25,7 +25,7 @@ options = {"print_function" : False} self.refactor = support.get_refactorer(fix_list, options) self.fixer_log = [] - self.filename = "" + self.filename = u"" for fixer in chain(self.refactor.pre_order, self.refactor.post_order): @@ -35,7 +35,7 @@ before = support.reformat(before) after = support.reformat(after) tree = self.refactor.refactor_string(before, self.filename) - self.failUnlessEqual(after, str(tree)) + self.failUnlessEqual(after, unicode(tree)) return tree def check(self, before, after, ignore_warnings=False): Modified: python/trunk/Lib/lib2to3/tests/test_parser.py ============================================================================== --- python/trunk/Lib/lib2to3/tests/test_parser.py (original) +++ python/trunk/Lib/lib2to3/tests/test_parser.py Sat May 9 03:01:14 2009 @@ -14,9 +14,9 @@ # Python imports import os -import os.path # Local imports +from lib2to3.pgen2 import tokenize from ..pgen2.parse import ParseError @@ -150,13 +150,25 @@ def test_all_project_files(self): for filepath in support.all_project_files(): print "Parsing %s..." % filepath - tree = driver.parse_file(filepath, debug=True) - if diff(filepath, tree): + with open(filepath, "rb") as fp: + encoding = tokenize.detect_encoding(fp.readline)[0] + fp.seek(0) + source = fp.read() + if encoding: + source = source.decode(encoding) + tree = driver.parse_string(source) + new = unicode(tree) + if encoding: + new = new.encode(encoding) + if diff(filepath, new): self.fail("Idempotency failed: %s" % filepath) class TestLiterals(GrammarTest): + def validate(self, s): + driver.parse_string(support.dedent(s) + "\n\n") + def test_multiline_bytes_literals(self): s = """ md5test(b"\xaa" * 80, @@ -185,10 +197,10 @@ self.validate(s) -def diff(fn, tree): +def diff(fn, result): f = open("@", "w") try: - f.write(str(tree)) + f.write(result) finally: f.close() try: Modified: python/trunk/Lib/lib2to3/tests/test_refactor.py ============================================================================== --- python/trunk/Lib/lib2to3/tests/test_refactor.py (original) +++ python/trunk/Lib/lib2to3/tests/test_refactor.py Sat May 9 03:01:14 2009 @@ -14,7 +14,8 @@ from . import support -FIXER_DIR = os.path.join(os.path.dirname(__file__), "data/fixers") +TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), "data") +FIXER_DIR = os.path.join(TEST_DATA_DIR, "fixers") sys.path.append(FIXER_DIR) try: @@ -22,6 +23,8 @@ finally: sys.path.pop() +_2TO3_FIXERS = refactor.get_fixers_from_package("lib2to3.fixes") + class TestRefactoringTool(unittest.TestCase): def setUp(self): @@ -121,19 +124,40 @@ +def cheese(): pass""".splitlines() self.assertEqual(diff_lines[:-1], expected) - def test_refactor_file(self): - test_file = os.path.join(FIXER_DIR, "parrot_example.py") - old_contents = open(test_file, "r").read() - rt = self.rt() + def check_file_refactoring(self, test_file, fixers=_2TO3_FIXERS): + def read_file(): + with open(test_file, "rb") as fp: + return fp.read() + old_contents = read_file() + rt = self.rt(fixers=fixers) rt.refactor_file(test_file) - self.assertEqual(old_contents, open(test_file, "r").read()) + self.assertEqual(old_contents, read_file()) + + try: + rt.refactor_file(test_file, True) + self.assertNotEqual(old_contents, read_file()) + finally: + with open(test_file, "wb") as fp: + fp.write(old_contents) + + def test_refactor_file(self): + test_file = os.path.join(FIXER_DIR, "parrot_example.py") + self.check_file_refactoring(test_file, _DEFAULT_FIXERS) - rt.refactor_file(test_file, True) + def test_file_encoding(self): + fn = os.path.join(TEST_DATA_DIR, "different_encoding.py") + self.check_file_refactoring(fn) + + def test_crlf_newlines(self): + old_sep = os.linesep + os.linesep = "\r\n" try: - self.assertNotEqual(old_contents, open(test_file, "r").read()) + fn = os.path.join(TEST_DATA_DIR, "crlf.py") + fixes = refactor.get_fixers_from_package("lib2to3.fixes") + self.check_file_refactoring(fn, fixes) finally: - open(test_file, "w").write(old_contents) + os.linesep = old_sep def test_refactor_docstring(self): rt = self.rt() From python-checkins at python.org Sat May 9 04:07:04 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 04:07:04 +0200 (CEST) Subject: [Python-checkins] r72495 - in python/trunk: Lib/test/test_descr.py Objects/enumobject.c Message-ID: <20090509020704.9AAB91E4051@bag.python.org> Author: benjamin.peterson Date: Sat May 9 04:07:04 2009 New Revision: 72495 Log: lookup __reveresed__ correctly as a special method Modified: python/trunk/Lib/test/test_descr.py python/trunk/Objects/enumobject.c Modified: python/trunk/Lib/test/test_descr.py ============================================================================== --- python/trunk/Lib/test/test_descr.py (original) +++ python/trunk/Lib/test/test_descr.py Sat May 9 04:07:04 2009 @@ -1676,12 +1676,15 @@ return self def hello(self): return "hello" + def empty_seq(self): + return [] # It would be nice to have every special method tested here, but I'm # only listing the ones I can remember outside of typeobject.c, since it # does it right. specials = [ ("__unicode__", unicode, hello), + ("__reversed__", reversed, empty_seq), # These two fail because the compiler generates LOAD_ATTR to look # them up. We'd have to add a new opcode to fix this, and it's # probably not worth it. Modified: python/trunk/Objects/enumobject.c ============================================================================== --- python/trunk/Objects/enumobject.c (original) +++ python/trunk/Objects/enumobject.c Sat May 9 04:07:04 2009 @@ -222,7 +222,8 @@ reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { Py_ssize_t n; - PyObject *seq; + PyObject *seq, *reversed_meth; + static PyObject *reversed_cache = NULL; reversedobject *ro; if (type == &PyReversed_Type && !_PyArg_NoKeywords("reversed()", kwds)) @@ -231,8 +232,12 @@ if (!PyArg_UnpackTuple(args, "reversed", 1, 1, &seq) ) return NULL; - if (PyObject_HasAttrString(seq, "__reversed__")) - return PyObject_CallMethod(seq, "__reversed__", NULL); + reversed_meth = _PyObject_LookupSpecial(seq, "__reversed__", &reversed_cache); + if (reversed_meth != NULL) { + PyObject *res = PyObject_CallFunctionObjArgs(reversed_meth, NULL); + Py_DECREF(reversed_meth); + return res; + } if (!PySequence_Check(seq)) { PyErr_SetString(PyExc_TypeError, From buildbot at python.org Sat May 9 04:23:08 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 09 May 2009 02:23:08 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090509022309.54F101E402D@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/775 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: gregory.p.smith,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat May 9 04:43:18 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 04:43:18 +0200 (CEST) Subject: [Python-checkins] r72495 - svn:log Message-ID: <20090509024318.4D76A1E4023@bag.python.org> Author: benjamin.peterson Revision: 72495 Property Name: svn:log Action: modified Property diff: --- old property value +++ new property value @@ -1 +1 @@ -lookup __reveresed__ correctly as a special method \ No newline at end of file +lookup __reversed__ correctly as a special method \ No newline at end of file From buildbot at python.org Sat May 9 05:05:43 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 09 May 2009 03:05:43 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc trunk Message-ID: <20090509030543.6502F1E4023@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%20trunk/builds/397 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: gregory.p.smith,jeffrey.yasskin BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_os sincerely, -The Buildbot From buildbot at python.org Sat May 9 08:45:24 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 09 May 2009 06:45:24 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090509064524.832631E4010@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/550 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,gregory.p.smith,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 533, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' 1 test failed: test_import ====================================================================== ERROR: testImport (test.test_import.ImportTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 61, in test_with_extension mod = __import__(TESTFN) ImportError: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 533, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 533, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' sincerely, -The Buildbot From python-checkins at python.org Sat May 9 09:12:44 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 9 May 2009 09:12:44 +0200 (CEST) Subject: [Python-checkins] r72496 - python/branches/py3k/Lib/distutils/command/bdist_msi.py Message-ID: <20090509071244.48E6E1E4014@bag.python.org> Author: martin.v.loewis Date: Sat May 9 09:12:44 2009 New Revision: 72496 Log: Revert encoding error from r72309. Modified: python/branches/py3k/Lib/distutils/command/bdist_msi.py Modified: python/branches/py3k/Lib/distutils/command/bdist_msi.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/bdist_msi.py (original) +++ python/branches/py3k/Lib/distutils/command/bdist_msi.py Sat May 9 09:12:44 2009 @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2005, 2006 Martin v. L?wis +# Copyright (C) 2005, 2006 Martin von L??wis # Licensed to PSF under a Contributor Agreement. # The bdist_wininst command proper # based on bdist_wininst From python-checkins at python.org Sat May 9 10:28:53 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 9 May 2009 10:28:53 +0200 (CEST) Subject: [Python-checkins] r72497 - in python/trunk: Lib/distutils/tests/test_build_ext.py Lib/distutils/tests/test_unixccompiler.py Lib/distutils/unixccompiler.py Makefile.pre.in Misc/NEWS configure configure.in Message-ID: <20090509082853.8D5561E4014@bag.python.org> Author: tarek.ziade Date: Sat May 9 10:28:53 2009 New Revision: 72497 Log: Fixed Issue 5900: distutils.command.build_ext - Ensure RUNPATH is added to extension modules with RPATH if GNU ld is used Added: python/trunk/Lib/distutils/tests/test_unixccompiler.py (contents, props changed) Modified: python/trunk/Lib/distutils/tests/test_build_ext.py python/trunk/Lib/distutils/unixccompiler.py python/trunk/Makefile.pre.in python/trunk/Misc/NEWS python/trunk/configure python/trunk/configure.in Modified: python/trunk/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_build_ext.py (original) +++ python/trunk/Lib/distutils/tests/test_build_ext.py Sat May 9 10:28:53 2009 @@ -125,7 +125,7 @@ dist = Distribution({'name': 'xx'}) cmd = build_ext(dist) - # making sure the suer option is there + # making sure the user option is there options = [name for name, short, lable in cmd.user_options] self.assert_('user' in options) @@ -145,6 +145,7 @@ # see if include_dirs and library_dirs # were set self.assert_(lib in cmd.library_dirs) + self.assert_(lib in cmd.rpath) self.assert_(incl in cmd.include_dirs) def test_optional_extension(self): Added: python/trunk/Lib/distutils/tests/test_unixccompiler.py ============================================================================== --- (empty file) +++ python/trunk/Lib/distutils/tests/test_unixccompiler.py Sat May 9 10:28:53 2009 @@ -0,0 +1,93 @@ +"""Tests for distutils.unixccompiler.""" +import sys +import unittest + +from distutils import sysconfig +from distutils.unixccompiler import UnixCCompiler + +class UnixCCompilerTestCase(unittest.TestCase): + + def setUp(self): + self._backup_platform = sys.platform + self._backup_get_config_var = sysconfig.get_config_var + class CompilerWrapper(UnixCCompiler): + def rpath_foo(self): + return self.runtime_library_dir_option('/foo') + self.cc = CompilerWrapper() + + def tearDown(self): + sys.platform = self._backup_platform + sysconfig.get_config_var = self._backup_get_config_var + + def test_runtime_libdir_option(self): + + # not tested under windows + if sys.platform == 'win32': + return + + # Issue#5900 + # + # Ensure RUNPATH is added to extension modules with RPATH if + # GNU ld is used + + # darwin + sys.platform = 'darwin' + self.assertEqual(self.cc.rpath_foo(), '-L/foo') + + # hp-ux + sys.platform = 'hp-ux' + self.assertEqual(self.cc.rpath_foo(), '+s -L/foo') + + # irix646 + sys.platform = 'irix646' + self.assertEqual(self.cc.rpath_foo(), ['-rpath', '/foo']) + + # osf1V5 + sys.platform = 'osf1V5' + self.assertEqual(self.cc.rpath_foo(), ['-rpath', '/foo']) + + # GCC GNULD + sys.platform = 'bar' + def gcv(v): + if v == 'CC': + return 'gcc' + elif v == 'GNULD': + return 'yes' + sysconfig.get_config_var = gcv + self.assertEqual(self.cc.rpath_foo(), '-Wl,--enable-new-dtags,-R/foo') + + # GCC non-GNULD + sys.platform = 'bar' + def gcv(v): + if v == 'CC': + return 'gcc' + elif v == 'GNULD': + return 'no' + sysconfig.get_config_var = gcv + self.assertEqual(self.cc.rpath_foo(), '-Wl,-R/foo') + + # non-GCC GNULD + sys.platform = 'bar' + def gcv(v): + if v == 'CC': + return 'cc' + elif v == 'GNULD': + return 'yes' + sysconfig.get_config_var = gcv + self.assertEqual(self.cc.rpath_foo(), '-R/foo') + + # non-GCC non-GNULD + sys.platform = 'bar' + def gcv(v): + if v == 'CC': + return 'cc' + elif v == 'GNULD': + return 'no' + sysconfig.get_config_var = gcv + self.assertEqual(self.cc.rpath_foo(), '-R/foo') + +def test_suite(): + return unittest.makeSuite(UnixCCompilerTestCase) + +if __name__ == "__main__": + unittest.main(defaultTest="test_suite") Modified: python/trunk/Lib/distutils/unixccompiler.py ============================================================================== --- python/trunk/Lib/distutils/unixccompiler.py (original) +++ python/trunk/Lib/distutils/unixccompiler.py Sat May 9 10:28:53 2009 @@ -273,8 +273,9 @@ # Linkers on different platforms need different options to # specify that directories need to be added to the list of # directories searched for dependencies when a dynamic library - # is sought. GCC has to be told to pass the -R option through - # to the linker, whereas other compilers just know this. + # is sought. GCC on GNU systems (Linux, FreeBSD, ...) has to + # be told to pass the -R option through to the linker, whereas + # other compilers and gcc on other systems just know this. # Other compilers may need something slightly different. At # this time, there's no way to determine this information from # the configuration data stored in the Python installation, so @@ -287,10 +288,23 @@ return "+s -L" + dir elif sys.platform[:7] == "irix646" or sys.platform[:6] == "osf1V5": return ["-rpath", dir] - elif compiler[:3] == "gcc" or compiler[:3] == "g++": - return "-Wl,-R" + dir else: - return "-R" + dir + if compiler[:3] == "gcc" or compiler[:3] == "g++": + # gcc on non-GNU systems does not need -Wl, but can + # use it anyway. Since distutils has always passed in + # -Wl whenever gcc was used in the past it is probably + # safest to keep doing so. + if sysconfig.get_config_var("GNULD") == "yes": + # GNU ld needs an extra option to get a RUNPATH + # instead of just an RPATH. + return "-Wl,--enable-new-dtags,-R" + dir + else: + return "-Wl,-R" + dir + else: + # No idea how --enable-new-dtags would be passed on to + # ld if this system was using GNU ld. Don't know if a + # system like this even exists. + return "-R" + dir def library_option(self, lib): return "-l" + lib Modified: python/trunk/Makefile.pre.in ============================================================================== --- python/trunk/Makefile.pre.in (original) +++ python/trunk/Makefile.pre.in Sat May 9 10:28:53 2009 @@ -36,6 +36,8 @@ RANLIB= @RANLIB@ SVNVERSION= @SVNVERSION@ +GNULD= @GNULD@ + # Shell used by make (some versions default to the login shell, which is bad) SHELL= /bin/sh Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat May 9 10:28:53 2009 @@ -285,6 +285,9 @@ Library ------- +- Issue #5900: Ensure RUNPATH is added to extension modules with RPATH if GNU + ld is used. Original patch by Floris Bruynooghe. + - Issue #5941: Distutils build_clib command was not working anymore because of an incomplete costumization of the archiver command. Added ARFLAGS in the Makefile besides AR and make Distutils use it. Original patch by David Modified: python/trunk/configure ============================================================================== --- python/trunk/configure (original) +++ python/trunk/configure Sat May 9 10:28:53 2009 @@ -695,6 +695,7 @@ INSTSONAME RUNSHARED LINKCC +GNULD RANLIB AR ARFLAGS @@ -3998,6 +3999,27 @@ { echo "$as_me:$LINENO: result: $LINKCC" >&5 echo "${ECHO_T}$LINKCC" >&6; } +# GNULD is set to "yes" if the GNU linker is used. If this goes wrong +# make sure we default having it set to "no": this is used by +# distutils.unixccompiler to know if it should add --enable-new-dtags +# to linker command lines, and failing to detect GNU ld simply results +# in the same bahaviour as before. + +{ echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } +ac_prog=ld +if test "$GCC" = yes; then + ac_prog=`$CC -print-prog-name=ld` +fi +case `"$ac_prog" -V 2>&1 < /dev/null` in + *GNU*) + GNULD=yes;; + *) + GNULD=no;; +esac +{ echo "$as_me:$LINENO: result: $GNULD" >&5 +echo "${ECHO_T}$GNULD" >&6; } + { echo "$as_me:$LINENO: checking for --enable-shared" >&5 echo $ECHO_N "checking for --enable-shared... $ECHO_C" >&6; } # Check whether --enable-shared was given. @@ -26042,6 +26064,7 @@ INSTSONAME!$INSTSONAME$ac_delim RUNSHARED!$RUNSHARED$ac_delim LINKCC!$LINKCC$ac_delim +GNULD!$GNULD$ac_delim RANLIB!$RANLIB$ac_delim AR!$AR$ac_delim ARFLAGS!$ARFLAGS$ac_delim @@ -26059,7 +26082,6 @@ LDSHARED!$LDSHARED$ac_delim BLDSHARED!$BLDSHARED$ac_delim CCSHARED!$CCSHARED$ac_delim -LINKFORSHARED!$LINKFORSHARED$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -26101,6 +26123,7 @@ ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +LINKFORSHARED!$LINKFORSHARED$ac_delim CFLAGSFORSHARED!$CFLAGSFORSHARED$ac_delim SHLIBS!$SHLIBS$ac_delim USE_SIGNAL_MODULE!$USE_SIGNAL_MODULE$ac_delim @@ -26126,7 +26149,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 23; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 24; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 Modified: python/trunk/configure.in ============================================================================== --- python/trunk/configure.in (original) +++ python/trunk/configure.in Sat May 9 10:28:53 2009 @@ -647,6 +647,25 @@ fi AC_MSG_RESULT($LINKCC) +# GNULD is set to "yes" if the GNU linker is used. If this goes wrong +# make sure we default having it set to "no": this is used by +# distutils.unixccompiler to know if it should add --enable-new-dtags +# to linker command lines, and failing to detect GNU ld simply results +# in the same bahaviour as before. +AC_SUBST(GNULD) +AC_MSG_CHECKING(for GNU ld) +ac_prog=ld +if test "$GCC" = yes; then + ac_prog=`$CC -print-prog-name=ld` +fi +case `"$ac_prog" -V 2>&1 < /dev/null` in + *GNU*) + GNULD=yes;; + *) + GNULD=no;; +esac +AC_MSG_RESULT($GNULD) + AC_MSG_CHECKING(for --enable-shared) AC_ARG_ENABLE(shared, AC_HELP_STRING(--enable-shared, disable/enable building shared python library)) From python-checkins at python.org Sat May 9 10:31:35 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 9 May 2009 10:31:35 +0200 (CEST) Subject: [Python-checkins] r72498 - python/branches/release26-maint Message-ID: <20090509083135.13F5D1E4023@bag.python.org> Author: tarek.ziade Date: Sat May 9 10:31:34 2009 New Revision: 72498 Log: Blocked revisions 72497 via svnmerge ........ r72497 | tarek.ziade | 2009-05-09 10:28:53 +0200 (Sat, 09 May 2009) | 1 line Fixed Issue 5900: distutils.command.build_ext - Ensure RUNPATH is added to extension modules with RPATH if GNU ld is used ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sat May 9 11:28:05 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 9 May 2009 11:28:05 +0200 (CEST) Subject: [Python-checkins] r72499 - peps/trunk/pep-0382.txt Message-ID: <20090509092805.DC1361E4068@bag.python.org> Author: martin.v.loewis Date: Sat May 9 11:28:05 2009 New Revision: 72499 Log: Defer PEP 382 to Python 3.2. Modified: peps/trunk/pep-0382.txt Modified: peps/trunk/pep-0382.txt ============================================================================== --- peps/trunk/pep-0382.txt (original) +++ peps/trunk/pep-0382.txt Sat May 9 11:28:05 2009 @@ -7,7 +7,7 @@ Type: Standards Track Content-Type: text/x-rst Created: 02-Apr-2009 -Python-Version: 3.1 +Python-Version: 3.2 Post-History: Abstract From python-checkins at python.org Sat May 9 12:06:01 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 9 May 2009 12:06:01 +0200 (CEST) Subject: [Python-checkins] r72500 - in python/trunk: Lib/distutils/tests/test_util.py Misc/NEWS Message-ID: <20090509100601.1546E1E4014@bag.python.org> Author: tarek.ziade Date: Sat May 9 12:06:00 2009 New Revision: 72500 Log: #5976: fixed distutils test_check_environ Modified: python/trunk/Lib/distutils/tests/test_util.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/tests/test_util.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_util.py (original) +++ python/trunk/Lib/distutils/tests/test_util.py Sat May 9 12:06:00 2009 @@ -214,12 +214,17 @@ # posix without HOME if os.name == 'posix': # this test won't run on windows - os.environ = {} - check_environ() - - import pwd - self.assertEquals(os.environ['HOME'], - pwd.getpwuid(os.getuid())[5]) + old_home = os.environ.get('HOME') + try: + check_environ() + import pwd + self.assertEquals(os.environ['HOME'], + pwd.getpwuid(os.getuid())[5]) + finally: + if old_home is not None: + os.environ['HOME'] = old_home + else: + del os.environ['HOME'] else: check_environ() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat May 9 12:06:00 2009 @@ -285,6 +285,8 @@ Library ------- +- Issue #5976: Fixed Distutils test_check_environ. + - Issue #5900: Ensure RUNPATH is added to extension modules with RPATH if GNU ld is used. Original patch by Floris Bruynooghe. From python-checkins at python.org Sat May 9 12:07:00 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 9 May 2009 12:07:00 +0200 (CEST) Subject: [Python-checkins] r72501 - python/branches/release26-maint Message-ID: <20090509100700.BEDE41E4014@bag.python.org> Author: tarek.ziade Date: Sat May 9 12:06:59 2009 New Revision: 72501 Log: Blocked revisions 72500 via svnmerge ........ r72500 | tarek.ziade | 2009-05-09 12:06:00 +0200 (Sat, 09 May 2009) | 1 line #5976: fixed distutils test_check_environ ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sat May 9 12:09:11 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 9 May 2009 12:09:11 +0200 (CEST) Subject: [Python-checkins] r72502 - in python/branches/py3k: Lib/distutils/tests/test_util.py Misc/NEWS Message-ID: <20090509100912.014E91E4014@bag.python.org> Author: tarek.ziade Date: Sat May 9 12:09:11 2009 New Revision: 72502 Log: Merged revisions 72500 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72500 | tarek.ziade | 2009-05-09 12:06:00 +0200 (Sat, 09 May 2009) | 1 line #5976: fixed distutils test_check_environ ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_util.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/distutils/tests/test_util.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_util.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_util.py Sat May 9 12:09:11 2009 @@ -214,12 +214,17 @@ # posix without HOME if os.name == 'posix': # this test won't run on windows - os.environ = {} - check_environ() - - import pwd - self.assertEquals(os.environ['HOME'], - pwd.getpwuid(os.getuid())[5]) + old_home = os.environ.get('HOME') + try: + check_environ() + import pwd + self.assertEquals(os.environ['HOME'], + pwd.getpwuid(os.getuid())[5]) + finally: + if old_home is not None: + os.environ['HOME'] = old_home + else: + del os.environ['HOME'] else: check_environ() Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 9 12:09:11 2009 @@ -581,6 +581,8 @@ Library ------- +- Issue #5976: Fixed Distutils test_check_environ. + - Issue #5941: Distutils build_clib command was not working anymore because of an incomplete costumization of the archiver command. Added ARFLAGS in the Makefile besides AR and make Distutils use it. Original patch by David From python-checkins at python.org Sat May 9 12:10:13 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 9 May 2009 12:10:13 +0200 (CEST) Subject: [Python-checkins] r72503 - python/branches/release30-maint Message-ID: <20090509101013.83FE01E4014@bag.python.org> Author: tarek.ziade Date: Sat May 9 12:10:12 2009 New Revision: 72503 Log: Blocked revisions 72502 via svnmerge ................ r72502 | tarek.ziade | 2009-05-09 12:09:11 +0200 (Sat, 09 May 2009) | 9 lines Merged revisions 72500 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72500 | tarek.ziade | 2009-05-09 12:06:00 +0200 (Sat, 09 May 2009) | 1 line #5976: fixed distutils test_check_environ ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Sat May 9 13:16:24 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 09 May 2009 11:16:24 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090509111625.37E061E4014@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%202.6/builds/340 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-ubuntu-i386/build/Lib/test/test_signal.py", line 165, in test_main pickle.dump(None, done_w) File "/home/pybot/buildarea/2.6.klose-ubuntu-i386/build/Lib/contextlib.py", line 153, in __exit__ self.thing.close() IOError: [Errno 9] Bad file descriptor 1 test failed: test_signal make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat May 9 13:55:12 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 9 May 2009 13:55:12 +0200 (CEST) Subject: [Python-checkins] r72504 - in python/branches/py3k: Lib/distutils/tests/test_build_ext.py Lib/distutils/tests/test_unixccompiler.py Lib/distutils/unixccompiler.py Makefile.pre.in configure configure.in Message-ID: <20090509115512.9AE221E4023@bag.python.org> Author: tarek.ziade Date: Sat May 9 13:55:12 2009 New Revision: 72504 Log: Merged revisions 72497 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72497 | tarek.ziade | 2009-05-09 10:28:53 +0200 (Sat, 09 May 2009) | 1 line Fixed Issue 5900: distutils.command.build_ext - Ensure RUNPATH is added to extension modules with RPATH if GNU ld is used ........ Added: python/branches/py3k/Lib/distutils/tests/test_unixccompiler.py - copied unchanged from r72497, /python/trunk/Lib/distutils/tests/test_unixccompiler.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_build_ext.py python/branches/py3k/Lib/distutils/unixccompiler.py python/branches/py3k/Makefile.pre.in python/branches/py3k/configure python/branches/py3k/configure.in Modified: python/branches/py3k/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_build_ext.py Sat May 9 13:55:12 2009 @@ -125,7 +125,7 @@ dist = Distribution({'name': 'xx'}) cmd = build_ext(dist) - # making sure the suer option is there + # making sure the user option is there options = [name for name, short, lable in cmd.user_options] self.assert_('user' in options) @@ -145,6 +145,7 @@ # see if include_dirs and library_dirs # were set self.assert_(lib in cmd.library_dirs) + self.assert_(lib in cmd.rpath) self.assert_(incl in cmd.include_dirs) def test_optional_extension(self): Modified: python/branches/py3k/Lib/distutils/unixccompiler.py ============================================================================== --- python/branches/py3k/Lib/distutils/unixccompiler.py (original) +++ python/branches/py3k/Lib/distutils/unixccompiler.py Sat May 9 13:55:12 2009 @@ -271,8 +271,9 @@ # Linkers on different platforms need different options to # specify that directories need to be added to the list of # directories searched for dependencies when a dynamic library - # is sought. GCC has to be told to pass the -R option through - # to the linker, whereas other compilers just know this. + # is sought. GCC on GNU systems (Linux, FreeBSD, ...) has to + # be told to pass the -R option through to the linker, whereas + # other compilers and gcc on other systems just know this. # Other compilers may need something slightly different. At # this time, there's no way to determine this information from # the configuration data stored in the Python installation, so @@ -285,10 +286,23 @@ return "+s -L" + dir elif sys.platform[:7] == "irix646" or sys.platform[:6] == "osf1V5": return ["-rpath", dir] - elif compiler[:3] == "gcc" or compiler[:3] == "g++": - return "-Wl,-R" + dir else: - return "-R" + dir + if compiler[:3] == "gcc" or compiler[:3] == "g++": + # gcc on non-GNU systems does not need -Wl, but can + # use it anyway. Since distutils has always passed in + # -Wl whenever gcc was used in the past it is probably + # safest to keep doing so. + if sysconfig.get_config_var("GNULD") == "yes": + # GNU ld needs an extra option to get a RUNPATH + # instead of just an RPATH. + return "-Wl,--enable-new-dtags,-R" + dir + else: + return "-Wl,-R" + dir + else: + # No idea how --enable-new-dtags would be passed on to + # ld if this system was using GNU ld. Don't know if a + # system like this even exists. + return "-R" + dir def library_option(self, lib): return "-l" + lib Modified: python/branches/py3k/Makefile.pre.in ============================================================================== --- python/branches/py3k/Makefile.pre.in (original) +++ python/branches/py3k/Makefile.pre.in Sat May 9 13:55:12 2009 @@ -36,6 +36,8 @@ RANLIB= @RANLIB@ SVNVERSION= @SVNVERSION@ +GNULD= @GNULD@ + # Shell used by make (some versions default to the login shell, which is bad) SHELL= /bin/sh Modified: python/branches/py3k/configure ============================================================================== --- python/branches/py3k/configure (original) +++ python/branches/py3k/configure Sat May 9 13:55:12 2009 @@ -693,6 +693,7 @@ INSTSONAME RUNSHARED LINKCC +GNULD RANLIB AR ARFLAGS @@ -3949,6 +3950,27 @@ { echo "$as_me:$LINENO: result: $LINKCC" >&5 echo "${ECHO_T}$LINKCC" >&6; } +# GNULD is set to "yes" if the GNU linker is used. If this goes wrong +# make sure we default having it set to "no": this is used by +# distutils.unixccompiler to know if it should add --enable-new-dtags +# to linker command lines, and failing to detect GNU ld simply results +# in the same bahaviour as before. + +{ echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } +ac_prog=ld +if test "$GCC" = yes; then + ac_prog=`$CC -print-prog-name=ld` +fi +case `"$ac_prog" -V 2>&1 < /dev/null` in + *GNU*) + GNULD=yes;; + *) + GNULD=no;; +esac +{ echo "$as_me:$LINENO: result: $GNULD" >&5 +echo "${ECHO_T}$GNULD" >&6; } + { echo "$as_me:$LINENO: checking for --enable-shared" >&5 echo $ECHO_N "checking for --enable-shared... $ECHO_C" >&6; } # Check whether --enable-shared was given. @@ -26096,6 +26118,7 @@ INSTSONAME!$INSTSONAME$ac_delim RUNSHARED!$RUNSHARED$ac_delim LINKCC!$LINKCC$ac_delim +GNULD!$GNULD$ac_delim RANLIB!$RANLIB$ac_delim AR!$AR$ac_delim ARFLAGS!$ARFLAGS$ac_delim @@ -26115,7 +26138,6 @@ CCSHARED!$CCSHARED$ac_delim LINKFORSHARED!$LINKFORSHARED$ac_delim CFLAGSFORSHARED!$CFLAGSFORSHARED$ac_delim -SHLIBS!$SHLIBS$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -26157,6 +26179,7 @@ ac_delim='%!_!# ' for ac_last_try in false false false false false :; do cat >conf$$subs.sed <<_ACEOF +SHLIBS!$SHLIBS$ac_delim USE_SIGNAL_MODULE!$USE_SIGNAL_MODULE$ac_delim SIGNAL_OBJS!$SIGNAL_OBJS$ac_delim USE_THREAD_MODULE!$USE_THREAD_MODULE$ac_delim @@ -26179,7 +26202,7 @@ LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 20; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 21; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 Modified: python/branches/py3k/configure.in ============================================================================== --- python/branches/py3k/configure.in (original) +++ python/branches/py3k/configure.in Sat May 9 13:55:12 2009 @@ -606,6 +606,25 @@ fi AC_MSG_RESULT($LINKCC) +# GNULD is set to "yes" if the GNU linker is used. If this goes wrong +# make sure we default having it set to "no": this is used by +# distutils.unixccompiler to know if it should add --enable-new-dtags +# to linker command lines, and failing to detect GNU ld simply results +# in the same bahaviour as before. +AC_SUBST(GNULD) +AC_MSG_CHECKING(for GNU ld) +ac_prog=ld +if test "$GCC" = yes; then + ac_prog=`$CC -print-prog-name=ld` +fi +case `"$ac_prog" -V 2>&1 < /dev/null` in + *GNU*) + GNULD=yes;; + *) + GNULD=no;; +esac +AC_MSG_RESULT($GNULD) + AC_MSG_CHECKING(for --enable-shared) AC_ARG_ENABLE(shared, AC_HELP_STRING(--enable-shared, disable/enable building shared python library)) From python-checkins at python.org Sat May 9 13:57:12 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 9 May 2009 13:57:12 +0200 (CEST) Subject: [Python-checkins] r72505 - python/branches/release30-maint Message-ID: <20090509115712.0C0261E4023@bag.python.org> Author: tarek.ziade Date: Sat May 9 13:57:11 2009 New Revision: 72505 Log: Blocked revisions 72504 via svnmerge ................ r72504 | tarek.ziade | 2009-05-09 13:55:12 +0200 (Sat, 09 May 2009) | 9 lines Merged revisions 72497 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72497 | tarek.ziade | 2009-05-09 10:28:53 +0200 (Sat, 09 May 2009) | 1 line Fixed Issue 5900: distutils.command.build_ext - Ensure RUNPATH is added to extension modules with RPATH if GNU ld is used ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sat May 9 14:07:17 2009 From: python-checkins at python.org (vinay.sajip) Date: Sat, 9 May 2009 14:07:17 +0200 (CEST) Subject: [Python-checkins] r72506 - in python/trunk: Lib/logging/__init__.py Misc/NEWS Message-ID: <20090509120717.5666A1E4014@bag.python.org> Author: vinay.sajip Date: Sat May 9 14:07:17 2009 New Revision: 72506 Log: Issue #5971: StreamHandler.handleError now swallows IOErrors which occur when trying to print a traceback. Modified: python/trunk/Lib/logging/__init__.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/logging/__init__.py ============================================================================== --- python/trunk/Lib/logging/__init__.py (original) +++ python/trunk/Lib/logging/__init__.py Sat May 9 14:07:17 2009 @@ -720,8 +720,12 @@ """ if raiseExceptions: ei = sys.exc_info() - traceback.print_exception(ei[0], ei[1], ei[2], None, sys.stderr) - del ei + try: + traceback.print_exception(ei[0], ei[1], ei[2], None, sys.stderr) + except IOError: + pass # see issue 5971 + finally: + del ei class StreamHandler(Handler): """ Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat May 9 14:07:17 2009 @@ -28,7 +28,7 @@ - Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal sequences. Patch by Nick Barnes and Victor Stinner. -- Issue #1588: Add complex.__format__. For example, +- Issue #1588: Add complex.__format__. For example, format(complex(1, 2./3), '.5') now produces a sensible result. - Issue #5864: Fix empty format code formatting for floats so that it @@ -285,9 +285,12 @@ Library ------- +- Issue #5971: StreamHandler.handleError now swallows IOErrors which occur when + trying to print a traceback. + - Issue #5976: Fixed Distutils test_check_environ. -- Issue #5900: Ensure RUNPATH is added to extension modules with RPATH if GNU +- Issue #5900: Ensure RUNPATH is added to extension modules with RPATH if GNU ld is used. Original patch by Floris Bruynooghe. - Issue #5941: Distutils build_clib command was not working anymore because @@ -323,7 +326,7 @@ - Issue #2245: aifc now skips chunk types it doesn't recognize, per spec. -- Issue #5874: distutils.tests.test_config_cmd is not locale-sensitive +- Issue #5874: distutils.tests.test_config_cmd is not locale-sensitive anymore. - Issue #4305: ctypes should now build again on mipsel-linux-gnu @@ -899,7 +902,7 @@ linker, rather than always exit successfully. Patch by Floris Bruynooghe. - Issue #4587: Add configure option --with-dbmliborder=db1:db2:... to specify - the order that backends for the dbm extension are checked. + the order that backends for the dbm extension are checked. - Link the shared python library with $(MODLIBS). From python-checkins at python.org Sat May 9 14:11:30 2009 From: python-checkins at python.org (vinay.sajip) Date: Sat, 9 May 2009 14:11:30 +0200 (CEST) Subject: [Python-checkins] r72507 - in python/branches/release26-maint: Lib/logging/__init__.py Misc/NEWS Message-ID: <20090509121130.7D4D71E4014@bag.python.org> Author: vinay.sajip Date: Sat May 9 14:11:30 2009 New Revision: 72507 Log: Issue #5971: StreamHandler.handleError now swallows IOErrors which occur when trying to print a traceback. Modified: python/branches/release26-maint/Lib/logging/__init__.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/logging/__init__.py ============================================================================== --- python/branches/release26-maint/Lib/logging/__init__.py (original) +++ python/branches/release26-maint/Lib/logging/__init__.py Sat May 9 14:11:30 2009 @@ -720,8 +720,12 @@ """ if raiseExceptions: ei = sys.exc_info() - traceback.print_exception(ei[0], ei[1], ei[2], None, sys.stderr) - del ei + try: + traceback.print_exception(ei[0], ei[1], ei[2], None, sys.stderr) + except IOError: + pass # see issue 5971 + finally: + del ei class StreamHandler(Handler): """ Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sat May 9 14:11:30 2009 @@ -40,6 +40,9 @@ Library ------- +- Issue #5971: StreamHandler.handleError now swallows IOErrors which occur when + trying to print a traceback. + - Issue 5955: aifc's close method did not close the file it wrapped, now it does. This also means getfp method now returns the real fp. From buildbot at python.org Sat May 9 14:55:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 09 May 2009 12:55:22 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090509125522.E7DCA1E4014@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/777 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat May 9 17:22:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 09 May 2009 15:22:27 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090509152227.8D0D41E4014@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%202.6/builds/324 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: vinay.sajip BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat May 9 18:36:39 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 18:36:39 +0200 (CEST) Subject: [Python-checkins] r72508 - in python/trunk: Lib/test/test_descr.py Objects/abstract.c Python/sysmodule.c Message-ID: <20090509163639.8CF4F1E4014@bag.python.org> Author: benjamin.peterson Date: Sat May 9 18:36:39 2009 New Revision: 72508 Log: convert some more special methods to use _PyObject_LookupSpecial Modified: python/trunk/Lib/test/test_descr.py python/trunk/Objects/abstract.c python/trunk/Python/sysmodule.c Modified: python/trunk/Lib/test/test_descr.py ============================================================================== --- python/trunk/Lib/test/test_descr.py (original) +++ python/trunk/Lib/test/test_descr.py Sat May 9 18:36:39 2009 @@ -1,4 +1,5 @@ import __builtin__ +import sys import types import unittest import warnings @@ -1678,13 +1679,20 @@ return "hello" def empty_seq(self): return [] + def zero(self): + return 0 + def stop(self): + raise StopIteration # It would be nice to have every special method tested here, but I'm # only listing the ones I can remember outside of typeobject.c, since it # does it right. specials = [ - ("__unicode__", unicode, hello), - ("__reversed__", reversed, empty_seq), + ("__unicode__", unicode, hello, {}), + ("__reversed__", reversed, empty_seq, {}), + ("__length_hint__", list, zero, + {"__iter__" : iden, "next" : stop}), + ("__sizeof__", sys.getsizeof, zero, {}), # These two fail because the compiler generates LOAD_ATTR to look # them up. We'd have to add a new opcode to fix this, and it's # probably not worth it. @@ -1705,15 +1713,19 @@ return self.impl.__get__(obj, owner) - for name, runner, meth_impl in specials: + for name, runner, meth_impl, env in specials: class X(Checker): pass + for attr, obj in env.iteritems(): + setattr(X, attr, obj) setattr(X, name, meth_impl) runner(X()) record = [] class X(Checker): pass + for attr, obj in env.iteritems(): + setattr(X, attr, obj) setattr(X, name, SpecialDescr(meth_impl)) runner(X()) self.assertEqual(record, [1], name) Modified: python/trunk/Objects/abstract.c ============================================================================== --- python/trunk/Objects/abstract.c (original) +++ python/trunk/Objects/abstract.c Sat May 9 18:36:39 2009 @@ -93,7 +93,7 @@ _PyObject_LengthHint(PyObject *o, Py_ssize_t defaultvalue) { static PyObject *hintstrobj = NULL; - PyObject *ro; + PyObject *ro, *hintmeth; Py_ssize_t rv; /* try o.__len__() */ @@ -107,20 +107,15 @@ PyErr_Clear(); } - /* cache a hashed version of the attribute string */ - if (hintstrobj == NULL) { - hintstrobj = PyString_InternFromString("__length_hint__"); - if (hintstrobj == NULL) - return -1; - } - /* try o.__length_hint__() */ - ro = PyObject_CallMethodObjArgs(o, hintstrobj, NULL); + hintmeth = _PyObject_LookupSpecial(o, "__length_hint__", &hintstrobj); + if (hintmeth == NULL) + return defaultvalue; + ro = PyObject_CallFunctionObjArgs(hintmeth, NULL); + Py_DECREF(hintmeth); if (ro == NULL) { - if (!PyErr_ExceptionMatches(PyExc_TypeError) && - !PyErr_ExceptionMatches(PyExc_AttributeError)) - return -1; - PyErr_Clear(); + if (!PyErr_ExceptionMatches(PyExc_TypeError)) + return -1; return defaultvalue; } rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue; Modified: python/trunk/Python/sysmodule.c ============================================================================== --- python/trunk/Python/sysmodule.c (original) +++ python/trunk/Python/sysmodule.c Sat May 9 18:36:39 2009 @@ -643,7 +643,7 @@ sys_getsizeof(PyObject *self, PyObject *args, PyObject *kwds) { PyObject *res = NULL; - static PyObject *str__sizeof__, *gc_head_size = NULL; + static PyObject *str__sizeof__ = NULL, *gc_head_size = NULL; static char *kwlist[] = {"object", "default", 0}; PyObject *o, *dflt = NULL; @@ -651,13 +651,6 @@ kwlist, &o, &dflt)) return NULL; - /* Initialize static variable needed by _PyType_Lookup */ - if (str__sizeof__ == NULL) { - str__sizeof__ = PyString_InternFromString("__sizeof__"); - if (str__sizeof__ == NULL) - return NULL; - } - /* Initialize static variable for GC head size */ if (gc_head_size == NULL) { gc_head_size = PyInt_FromSsize_t(sizeof(PyGC_Head)); @@ -674,14 +667,16 @@ res = PyInt_FromSsize_t(PyInstance_Type.tp_basicsize); /* all other objects */ else { - PyObject *method = _PyType_Lookup(Py_TYPE(o), - str__sizeof__); + PyObject *method = _PyObject_LookupSpecial(o, "__sizeof__", + &str__sizeof__); if (method == NULL) PyErr_Format(PyExc_TypeError, "Type %.100s doesn't define __sizeof__", Py_TYPE(o)->tp_name); - else - res = PyObject_CallFunctionObjArgs(method, o, NULL); + else { + res = PyObject_CallFunctionObjArgs(method, NULL); + Py_DECREF(method); + } } /* Has a default value been given? */ From buildbot at python.org Sat May 9 18:38:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 09 May 2009 16:38:07 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090509163807.9B09C1E4014@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%202.6/builds/325 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: vinay.sajip BUILD FAILED: failed test Excerpt from the test logfile: ======= Backtrace: ========= /lib/libc.so.6.1[0x200000000025ade0] /lib/libc.so.6.1(cfree-0x3b5da30)[0x200000000025f460] /usr/lib/libdb-4.7.so(__os_free-0x80d00)[0x2000000003d3c1a0] /usr/lib/libdb-4.7.so(__os_closehandle-0x7e7c0)[0x2000000003d3e6f0] /usr/lib/libdb-4.7.so(__fop_file_setup-0xbfed0)[0x2000000003cfcff0] /usr/lib/libdb-4.7.so(__db_open-0x11c670)[0x2000000003ca0860] /usr/lib/libdb-4.7.so(__db_open_pp-0x144a9270)[0x2000000003c911f0] /home/pybot/buildarea/2.6.klose-debian-ia64/build/build/lib.linux-ia64-2.6-pydebug/_bsddb.so[0x2000000003a5e6f0] ./python(PyCFunction_Call+0x20000000003ccb40)[0x40000000004174d0] ./python[0x400000000027c450] ./python(PyEval_EvalFrameEx+0x1ffffffffc4af570)[0x400000000026c450] ./python(PyEval_EvalCodeEx+0x1ffffffffc4b70c0)[0x4000000000273fb0] ./python[0x400000000027d6e0] ./python[0x400000000027ca40] ./python(PyEval_EvalFrameEx+0x1ffffffffc4af570)[0x400000000026c450] ./python(PyEval_EvalCodeEx+0x1ffffffffc4b70c0)[0x4000000000273fb0] ./python[0x400000000027d6e0] ./python[0x400000000027ca40] ./python(PyEval_EvalFrameEx+0x1ffffffffc4af570)[0x400000000026c450] ./python(PyEval_EvalCodeEx+0x1ffffffffc4b70c0)[0x4000000000273fb0] ./python[0x400000000027d6e0] ./python[0x400000000027ca40] ./python(PyEval_EvalFrameEx+0x1ffffffffc4af570)[0x400000000026c450] ./python(PyEval_EvalCodeEx+0x1ffffffffc4b70c0)[0x4000000000273fb0] ./python[0x4000000000414f50] ./python(PyObject_Call+0x1ffffffffc2865f0)[0x40000000000434f0] ./python[0x4000000000066280] ./python(PyObject_Call+0x1ffffffffc2865f0)[0x40000000000434f0] ./python(PyEval_CallObjectWithKeywords+0x1ffffffffc4bd8f0)[0x400000000027a800] ./python(PyInstance_New+0x2000000000004400)[0x400000000004eb80] ./python(PyObject_Call+0x1ffffffffc2865f0)[0x40000000000434f0] ./python[0x400000000027ed60] ./python[0x400000000027caa0] ./python(PyEval_EvalFrameEx+0x1ffffffffc4af570)[0x400000000026c450] ./python(PyEval_EvalCodeEx+0x1ffffffffc4b70c0)[0x4000000000273fb0] ./python[0x4000000000414f50] ./python(PyObject_Call+0x1ffffffffc2865f0)[0x40000000000434f0] ./python[0x400000000027fc40] ./python(PyEval_EvalFrameEx+0x1ffffffffc4afd50)[0x400000000026cc30] ./python[0x400000000027d360] ./python[0x400000000027ca40] ./python(PyEval_EvalFrameEx+0x1ffffffffc4af570)[0x400000000026c450] ./python(PyEval_EvalCodeEx+0x1ffffffffc4b70c0)[0x4000000000273fb0] ./python[0x400000000027d6e0] ./python[0x400000000027ca40] ./python(PyEval_EvalFrameEx+0x1ffffffffc4af570)[0x400000000026c450] ./python(PyEval_EvalCodeEx+0x1ffffffffc4b70c0)[0x4000000000273fb0] ./python[0x4000000000414f50] ./python(PyObject_Call+0x1ffffffffc2865f0)[0x40000000000434f0] ./python[0x400000000027fc40] ./python(PyEval_EvalFrameEx+0x1ffffffffc4afd50)[0x400000000026cc30] ./python(PyEval_EvalCodeEx+0x1ffffffffc4b70c0)[0x4000000000273fb0] ./python[0x4000000000414f50] ./python(PyObject_Call+0x1ffffffffc2865f0)[0x40000000000434f0] ./python[0x4000000000066280] ./python(PyObject_Call+0x1ffffffffc2865f0)[0x40000000000434f0] ./python[0x40000000001bd500] ./python(PyObject_Call+0x1ffffffffc2865f0)[0x40000000000434f0] ./python[0x400000000027ed60] ./python[0x400000000027caa0] ./python(PyEval_EvalFrameEx+0x1ffffffffc4af570)[0x400000000026c450] ./python(PyEval_EvalCodeEx+0x1ffffffffc4b70c0)[0x4000000000273fb0] ./python[0x4000000000414f50] ======= Memory map: ======== 00000000-00004000 r--p 00000000 00:00 0 2000000000000000-200000000003c000 r-xp 00000000 03:05 2420685 /lib/ld-2.8.so 2000000000048000-2000000000050000 rw-p 00038000 03:05 2420685 /lib/ld-2.8.so 2000000000050000-2000000000078000 r-xp 00000000 03:05 2420667 /lib/libpthread-2.8.so 2000000000078000-2000000000084000 ---p 00028000 03:05 2420667 /lib/libpthread-2.8.so 2000000000084000-200000000008c000 rw-p 00024000 03:05 2420667 /lib/libpthread-2.8.so 200000000008c000-2000000000094000 rw-p 200000000008c000 00:00 0 2000000000094000-200000000009c000 r-xp 00000000 03:05 2420682 /lib/libdl-2.8.so 200000000009c000-20000000000a8000 ---p 00008000 03:0make: *** [buildbottest] Aborted sincerely, -The Buildbot From python-checkins at python.org Sat May 9 18:51:51 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 18:51:51 +0200 (CEST) Subject: [Python-checkins] r72509 - python/trunk/Objects/abstract.c Message-ID: <20090509165151.611991E4014@bag.python.org> Author: benjamin.peterson Date: Sat May 9 18:51:51 2009 New Revision: 72509 Log: ignore classic classes Modified: python/trunk/Objects/abstract.c Modified: python/trunk/Objects/abstract.c ============================================================================== --- python/trunk/Objects/abstract.c (original) +++ python/trunk/Objects/abstract.c Sat May 9 18:51:51 2009 @@ -107,6 +107,8 @@ PyErr_Clear(); } + if (PyInstance_Check(o)) + return defaultvalue; /* try o.__length_hint__() */ hintmeth = _PyObject_LookupSpecial(o, "__length_hint__", &hintstrobj); if (hintmeth == NULL) From python-checkins at python.org Sat May 9 19:13:11 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 19:13:11 +0200 (CEST) Subject: [Python-checkins] r72510 - python/trunk/Objects/typeobject.c Message-ID: <20090509171311.0FF5B1E4014@bag.python.org> Author: benjamin.peterson Date: Sat May 9 19:13:10 2009 New Revision: 72510 Log: can't handle classic classes here Modified: python/trunk/Objects/typeobject.c Modified: python/trunk/Objects/typeobject.c ============================================================================== --- python/trunk/Objects/typeobject.c (original) +++ python/trunk/Objects/typeobject.c Sat May 9 19:13:10 2009 @@ -1216,6 +1216,7 @@ PyObject * _PyObject_LookupSpecial(PyObject *self, char *attrstr, PyObject **attrobj) { + assert(!PyInstance_Check(self)); return lookup_maybe(self, attrstr, attrobj); } From python-checkins at python.org Sat May 9 19:21:13 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 19:21:13 +0200 (CEST) Subject: [Python-checkins] r72511 - in python/branches/py3k: Lib/test/test_descr.py Objects/enumobject.c Message-ID: <20090509172113.504B91E4014@bag.python.org> Author: benjamin.peterson Date: Sat May 9 19:21:13 2009 New Revision: 72511 Log: Merged revisions 72495 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72495 | benjamin.peterson | 2009-05-08 21:07:04 -0500 (Fri, 08 May 2009) | 1 line lookup __reversed__ correctly as a special method ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_descr.py python/branches/py3k/Objects/enumobject.c Modified: python/branches/py3k/Lib/test/test_descr.py ============================================================================== --- python/branches/py3k/Lib/test/test_descr.py (original) +++ python/branches/py3k/Lib/test/test_descr.py Sat May 9 19:21:13 2009 @@ -1549,12 +1549,15 @@ return self def hello(self): return b"hello" + def empty_seq(self): + return [] # It would be nice to have every special method tested here, but I'm # only listing the ones I can remember outside of typeobject.c, since it # does it right. specials = [ ("__bytes__", bytes, hello), + ("__reversed__", reversed, empty_seq), # These two fail because the compiler generates LOAD_ATTR to look # them up. We'd have to add a new opcode to fix this, and it's # probably not worth it. Modified: python/branches/py3k/Objects/enumobject.c ============================================================================== --- python/branches/py3k/Objects/enumobject.c (original) +++ python/branches/py3k/Objects/enumobject.c Sat May 9 19:21:13 2009 @@ -222,7 +222,8 @@ reversed_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { Py_ssize_t n; - PyObject *seq; + PyObject *seq, *reversed_meth; + static PyObject *reversed_cache = NULL; reversedobject *ro; if (type == &PyReversed_Type && !_PyArg_NoKeywords("reversed()", kwds)) @@ -231,8 +232,12 @@ if (!PyArg_UnpackTuple(args, "reversed", 1, 1, &seq) ) return NULL; - if (PyObject_HasAttrString(seq, "__reversed__")) - return PyObject_CallMethod(seq, "__reversed__", NULL); + reversed_meth = _PyObject_LookupSpecial(seq, "__reversed__", &reversed_cache); + if (reversed_meth != NULL) { + PyObject *res = PyObject_CallFunctionObjArgs(reversed_meth, NULL); + Py_DECREF(reversed_meth); + return res; + } if (!PySequence_Check(seq)) { PyErr_SetString(PyExc_TypeError, From python-checkins at python.org Sat May 9 19:23:03 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 19:23:03 +0200 (CEST) Subject: [Python-checkins] r72512 - in python/trunk: Lib/test/test_enumerate.py Objects/enumobject.c Message-ID: <20090509172303.83BB21E4014@bag.python.org> Author: benjamin.peterson Date: Sat May 9 19:23:03 2009 New Revision: 72512 Log: *sigh* deal with instances correctly Modified: python/trunk/Lib/test/test_enumerate.py python/trunk/Objects/enumobject.c Modified: python/trunk/Lib/test/test_enumerate.py ============================================================================== --- python/trunk/Lib/test/test_enumerate.py (original) +++ python/trunk/Lib/test/test_enumerate.py Sat May 9 19:23:03 2009 @@ -141,6 +141,12 @@ # don't allow keyword arguments self.assertRaises(TypeError, reversed, [], a=1) + def test_class_class(self): + class A: + def __reversed__(self): + return [2, 1] + self.assertEqual(list(reversed(A())), [2, 1]) + def test_xrange_optimization(self): x = xrange(1) self.assertEqual(type(reversed(x)), type(iter(x))) Modified: python/trunk/Objects/enumobject.c ============================================================================== --- python/trunk/Objects/enumobject.c (original) +++ python/trunk/Objects/enumobject.c Sat May 9 19:23:03 2009 @@ -232,7 +232,18 @@ if (!PyArg_UnpackTuple(args, "reversed", 1, 1, &seq) ) return NULL; - reversed_meth = _PyObject_LookupSpecial(seq, "__reversed__", &reversed_cache); + if (PyInstance_Check(seq)) { + reversed_meth = PyObject_GetAttrString(seq, "__reversed__"); + if (reversed_meth == NULL) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) + PyErr_Clear(); + else + return NULL; + } + } + else + reversed_meth = _PyObject_LookupSpecial(seq, "__reversed__", + &reversed_cache); if (reversed_meth != NULL) { PyObject *res = PyObject_CallFunctionObjArgs(reversed_meth, NULL); Py_DECREF(reversed_meth); From python-checkins at python.org Sat May 9 19:27:24 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 19:27:24 +0200 (CEST) Subject: [Python-checkins] r72513 - python/branches/py3k Message-ID: <20090509172724.A513D1E4014@bag.python.org> Author: benjamin.peterson Date: Sat May 9 19:27:24 2009 New Revision: 72513 Log: Blocked revisions 72509-72510,72512 via svnmerge ........ r72509 | benjamin.peterson | 2009-05-09 11:51:51 -0500 (Sat, 09 May 2009) | 1 line ignore classic classes ........ r72510 | benjamin.peterson | 2009-05-09 12:13:10 -0500 (Sat, 09 May 2009) | 1 line can't handle classic classes here ........ r72512 | benjamin.peterson | 2009-05-09 12:23:03 -0500 (Sat, 09 May 2009) | 1 line *sigh* deal with instances correctly ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat May 9 20:10:53 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 20:10:53 +0200 (CEST) Subject: [Python-checkins] r72514 - in python/branches/py3k: Include/Python.h Include/bltinmodule.h Makefile.pre.in Objects/object.c Python/bltinmodule.c Message-ID: <20090509181054.0D2581E4014@bag.python.org> Author: benjamin.peterson Date: Sat May 9 20:10:51 2009 New Revision: 72514 Log: these builtins have to initialized Added: python/branches/py3k/Include/bltinmodule.h (contents, props changed) Modified: python/branches/py3k/Include/Python.h python/branches/py3k/Makefile.pre.in python/branches/py3k/Objects/object.c python/branches/py3k/Python/bltinmodule.c Modified: python/branches/py3k/Include/Python.h ============================================================================== --- python/branches/py3k/Include/Python.h (original) +++ python/branches/py3k/Include/Python.h Sat May 9 20:10:51 2009 @@ -113,6 +113,7 @@ #include "import.h" #include "abstract.h" +#include "bltinmodule.h" #include "compile.h" #include "eval.h" Added: python/branches/py3k/Include/bltinmodule.h ============================================================================== --- (empty file) +++ python/branches/py3k/Include/bltinmodule.h Sat May 9 20:10:51 2009 @@ -0,0 +1,14 @@ +#ifndef Py_BLTINMODULE_H +#define Py_BLTINMODULE_H +#ifdef __cplusplus +extern "C" { +#endif + +PyAPI_DATA(PyTypeObject) PyFilter_Type; +PyAPI_DATA(PyTypeObject) PyMap_Type; +PyAPI_DATA(PyTypeObject) PyZip_Type; + +#ifdef __cplusplus +} +#endif +#endif /* !Py_BLTINMODULE_H */ Modified: python/branches/py3k/Makefile.pre.in ============================================================================== --- python/branches/py3k/Makefile.pre.in (original) +++ python/branches/py3k/Makefile.pre.in Sat May 9 20:10:51 2009 @@ -612,6 +612,7 @@ Include/abstract.h \ Include/asdl.h \ Include/ast.h \ + Include/bltinmodule.h \ Include/bitset.h \ Include/boolobject.h \ Include/bytes_methods.h \ Modified: python/branches/py3k/Objects/object.c ============================================================================== --- python/branches/py3k/Objects/object.c (original) +++ python/branches/py3k/Objects/object.c Sat May 9 20:10:51 2009 @@ -1595,6 +1595,15 @@ if (PyType_Ready(&PyMemberDescr_Type) < 0) Py_FatalError("Can't initialize member descriptor type"); + + if (PyType_Ready(&PyFilter_Type) < 0) + Py_FatalError("Can't initialize filter type"); + + if (PyType_Ready(&PyMap_Type) < 0) + Py_FatalError("Can't initialize map type"); + + if (PyType_Ready(&PyZip_Type) < 0) + Py_FatalError("Can't initialize zip type"); } Modified: python/branches/py3k/Python/bltinmodule.c ============================================================================== --- python/branches/py3k/Python/bltinmodule.c (original) +++ python/branches/py3k/Python/bltinmodule.c Sat May 9 20:10:51 2009 @@ -317,8 +317,6 @@ PyObject *it; } filterobject; -PyTypeObject PyFilter_Type; - static PyObject * filter_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { @@ -913,8 +911,6 @@ PyObject *func; } mapobject; -PyTypeObject PyMap_Type; - static PyObject * map_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { @@ -2031,8 +2027,6 @@ PyObject *result; } zipobject; -PyTypeObject PyZip_Type; - static PyObject * zip_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { From python-checkins at python.org Sat May 9 20:12:59 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 20:12:59 +0200 (CEST) Subject: [Python-checkins] r72514 - svn:log Message-ID: <20090509181259.E13AA1E4013@bag.python.org> Author: benjamin.peterson Revision: 72514 Property Name: svn:log Action: modified Property diff: --- old property value +++ new property value @@ -1 +1 @@ -these builtins have to initialized \ No newline at end of file +these builtins have to be initialized \ No newline at end of file From python-checkins at python.org Sat May 9 20:15:04 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 20:15:04 +0200 (CEST) Subject: [Python-checkins] r72515 - in python/branches/py3k: Lib/test/test_descr.py Objects/abstract.c Python/sysmodule.c Message-ID: <20090509181504.EE69B1E4013@bag.python.org> Author: benjamin.peterson Date: Sat May 9 20:15:04 2009 New Revision: 72515 Log: Merged revisions 72508 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72508 | benjamin.peterson | 2009-05-09 11:36:39 -0500 (Sat, 09 May 2009) | 1 line convert some more special methods to use _PyObject_LookupSpecial ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_descr.py python/branches/py3k/Objects/abstract.c python/branches/py3k/Python/sysmodule.c Modified: python/branches/py3k/Lib/test/test_descr.py ============================================================================== --- python/branches/py3k/Lib/test/test_descr.py (original) +++ python/branches/py3k/Lib/test/test_descr.py Sat May 9 20:15:04 2009 @@ -1,4 +1,5 @@ import builtins +import sys import types import unittest import warnings @@ -1551,13 +1552,20 @@ return b"hello" def empty_seq(self): return [] + def zero(self): + return 0 + def stop(self): + raise StopIteration # It would be nice to have every special method tested here, but I'm # only listing the ones I can remember outside of typeobject.c, since it # does it right. specials = [ - ("__bytes__", bytes, hello), - ("__reversed__", reversed, empty_seq), + ("__bytes__", bytes, hello, {}), + ("__reversed__", reversed, empty_seq, {}), + ("__length_hint__", list, zero, + {"__iter__" : iden, "__next__" : stop}), + ("__sizeof__", sys.getsizeof, zero, {}), # These two fail because the compiler generates LOAD_ATTR to look # them up. We'd have to add a new opcode to fix this, and it's # probably not worth it. @@ -1578,15 +1586,19 @@ return self.impl.__get__(obj, owner) - for name, runner, meth_impl in specials: + for name, runner, meth_impl, env in specials: class X(Checker): pass + for attr, obj in env.items(): + setattr(X, attr, obj) setattr(X, name, meth_impl) runner(X()) record = [] class X(Checker): pass + for attr, obj in env.items(): + setattr(X, attr, obj) setattr(X, name, SpecialDescr(meth_impl)) runner(X()) self.assertEqual(record, [1], name) Modified: python/branches/py3k/Objects/abstract.c ============================================================================== --- python/branches/py3k/Objects/abstract.c (original) +++ python/branches/py3k/Objects/abstract.c Sat May 9 20:15:04 2009 @@ -75,7 +75,7 @@ _PyObject_LengthHint(PyObject *o, Py_ssize_t defaultvalue) { static PyObject *hintstrobj = NULL; - PyObject *ro; + PyObject *ro, *hintmeth; Py_ssize_t rv; /* try o.__len__() */ @@ -89,20 +89,15 @@ PyErr_Clear(); } - /* cache a hashed version of the attribute string */ - if (hintstrobj == NULL) { - hintstrobj = PyUnicode_InternFromString("__length_hint__"); - if (hintstrobj == NULL) - return -1; - } - /* try o.__length_hint__() */ - ro = PyObject_CallMethodObjArgs(o, hintstrobj, NULL); + hintmeth = _PyObject_LookupSpecial(o, "__length_hint__", &hintstrobj); + if (hintmeth == NULL) + return defaultvalue; + ro = PyObject_CallFunctionObjArgs(hintmeth, NULL); + Py_DECREF(hintmeth); if (ro == NULL) { - if (!PyErr_ExceptionMatches(PyExc_TypeError) && - !PyErr_ExceptionMatches(PyExc_AttributeError)) - return -1; - PyErr_Clear(); + if (!PyErr_ExceptionMatches(PyExc_TypeError)) + return -1; return defaultvalue; } rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue; Modified: python/branches/py3k/Python/sysmodule.c ============================================================================== --- python/branches/py3k/Python/sysmodule.c (original) +++ python/branches/py3k/Python/sysmodule.c Sat May 9 20:15:04 2009 @@ -630,7 +630,7 @@ sys_getsizeof(PyObject *self, PyObject *args, PyObject *kwds) { PyObject *res = NULL; - static PyObject *str__sizeof__, *gc_head_size = NULL; + static PyObject *str__sizeof__ = NULL, *gc_head_size = NULL; static char *kwlist[] = {"object", "default", 0}; PyObject *o, *dflt = NULL; PyObject *method; @@ -639,13 +639,6 @@ kwlist, &o, &dflt)) return NULL; - /* Initialize static variable needed by _PyType_Lookup */ - if (str__sizeof__ == NULL) { - str__sizeof__ = PyUnicode_InternFromString("__sizeof__"); - if (str__sizeof__ == NULL) - return NULL; - } - /* Initialize static variable for GC head size */ if (gc_head_size == NULL) { gc_head_size = PyLong_FromSsize_t(sizeof(PyGC_Head)); @@ -656,14 +649,17 @@ /* Make sure the type is initialized. float gets initialized late */ if (PyType_Ready(Py_TYPE(o)) < 0) return NULL; - - method = _PyType_Lookup(Py_TYPE(o), str__sizeof__); + + method = _PyObject_LookupSpecial(o, "__sizeof__", + &str__sizeof__); if (method == NULL) PyErr_Format(PyExc_TypeError, "Type %.100s doesn't define __sizeof__", Py_TYPE(o)->tp_name); - else - res = PyObject_CallFunctionObjArgs(method, o, NULL); + else { + res = PyObject_CallFunctionObjArgs(method, NULL); + Py_DECREF(method); + } /* Has a default value been given */ if ((res == NULL) && (dflt != NULL) && From python-checkins at python.org Sat May 9 21:03:05 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 21:03:05 +0200 (CEST) Subject: [Python-checkins] r72516 - python/trunk/Objects/abstract.c Message-ID: <20090509190305.EF6791E4013@bag.python.org> Author: benjamin.peterson Date: Sat May 9 21:03:05 2009 New Revision: 72516 Log: ignore AttributeErrors for classic classes Modified: python/trunk/Objects/abstract.c Modified: python/trunk/Objects/abstract.c ============================================================================== --- python/trunk/Objects/abstract.c (original) +++ python/trunk/Objects/abstract.c Sat May 9 21:03:05 2009 @@ -116,7 +116,8 @@ ro = PyObject_CallFunctionObjArgs(hintmeth, NULL); Py_DECREF(hintmeth); if (ro == NULL) { - if (!PyErr_ExceptionMatches(PyExc_TypeError)) + if (!PyErr_ExceptionMatches(PyExc_TypeError) && + !PyErr_ExceptionMatches(PyExc_AttributeError)) return -1; return defaultvalue; } From python-checkins at python.org Sat May 9 21:18:26 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 21:18:26 +0200 (CEST) Subject: [Python-checkins] r72517 - python/trunk/Python/bltinmodule.c Message-ID: <20090509191826.093D51E4013@bag.python.org> Author: benjamin.peterson Date: Sat May 9 21:17:59 2009 New Revision: 72517 Log: don't ignore exceptions from _PyObject_LengthHint Modified: python/trunk/Python/bltinmodule.c Modified: python/trunk/Python/bltinmodule.c ============================================================================== --- python/trunk/Python/bltinmodule.c (original) +++ python/trunk/Python/bltinmodule.c Sat May 9 21:17:59 2009 @@ -2383,8 +2383,10 @@ len = -1; /* unknown */ for (i = 0; i < itemsize; ++i) { PyObject *item = PyTuple_GET_ITEM(args, i); - Py_ssize_t thislen = _PyObject_LengthHint(item, -1); + Py_ssize_t thislen = _PyObject_LengthHint(item, -2); if (thislen < 0) { + if (thislen == -1) + return NULL; len = -1; break; } From python-checkins at python.org Sat May 9 21:18:36 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 21:18:36 +0200 (CEST) Subject: [Python-checkins] r72518 - python/trunk/Objects/abstract.c Message-ID: <20090509191836.721351E4013@bag.python.org> Author: benjamin.peterson Date: Sat May 9 21:18:36 2009 New Revision: 72518 Log: clear error state properly Modified: python/trunk/Objects/abstract.c Modified: python/trunk/Objects/abstract.c ============================================================================== --- python/trunk/Objects/abstract.c (original) +++ python/trunk/Objects/abstract.c Sat May 9 21:18:36 2009 @@ -119,6 +119,7 @@ if (!PyErr_ExceptionMatches(PyExc_TypeError) && !PyErr_ExceptionMatches(PyExc_AttributeError)) return -1; + PyErr_Clear(); return defaultvalue; } rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue; From python-checkins at python.org Sat May 9 21:22:46 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 21:22:46 +0200 (CEST) Subject: [Python-checkins] r72519 - python/branches/py3k Message-ID: <20090509192246.76F851E4013@bag.python.org> Author: benjamin.peterson Date: Sat May 9 21:22:46 2009 New Revision: 72519 Log: Blocked revisions 72516-72517 via svnmerge ........ r72516 | benjamin.peterson | 2009-05-09 14:03:05 -0500 (Sat, 09 May 2009) | 1 line ignore AttributeErrors for classic classes ........ r72517 | benjamin.peterson | 2009-05-09 14:17:59 -0500 (Sat, 09 May 2009) | 1 line don't ignore exceptions from _PyObject_LengthHint ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sat May 9 21:24:36 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 21:24:36 +0200 (CEST) Subject: [Python-checkins] r72520 - in python/branches/py3k: Objects/abstract.c Message-ID: <20090509192436.CDF3A1E4013@bag.python.org> Author: benjamin.peterson Date: Sat May 9 21:24:36 2009 New Revision: 72520 Log: Merged revisions 72518 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72518 | benjamin.peterson | 2009-05-09 14:18:36 -0500 (Sat, 09 May 2009) | 1 line clear error state properly ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Objects/abstract.c Modified: python/branches/py3k/Objects/abstract.c ============================================================================== --- python/branches/py3k/Objects/abstract.c (original) +++ python/branches/py3k/Objects/abstract.c Sat May 9 21:24:36 2009 @@ -98,6 +98,7 @@ if (ro == NULL) { if (!PyErr_ExceptionMatches(PyExc_TypeError)) return -1; + PyErr_Clear(); return defaultvalue; } rv = PyLong_Check(ro) ? PyLong_AsSsize_t(ro) : defaultvalue; From python-checkins at python.org Sat May 9 21:30:46 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 21:30:46 +0200 (CEST) Subject: [Python-checkins] r72521 - python/branches/py3k/Objects/abstract.c Message-ID: <20090509193046.63B791E4013@bag.python.org> Author: benjamin.peterson Date: Sat May 9 21:30:46 2009 New Revision: 72521 Log: only need to catch an TypeError here Modified: python/branches/py3k/Objects/abstract.c Modified: python/branches/py3k/Objects/abstract.c ============================================================================== --- python/branches/py3k/Objects/abstract.c (original) +++ python/branches/py3k/Objects/abstract.c Sat May 9 21:30:46 2009 @@ -83,9 +83,8 @@ if (rv >= 0) return rv; if (PyErr_Occurred()) { - if (!PyErr_ExceptionMatches(PyExc_TypeError) && - !PyErr_ExceptionMatches(PyExc_AttributeError)) - return -1; + if (!PyErr_ExceptionMatches(PyExc_TypeError)) + return -1; PyErr_Clear(); } From python-checkins at python.org Sat May 9 21:42:24 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 21:42:24 +0200 (CEST) Subject: [Python-checkins] r72522 - in python/branches/py3k: Lib/lib2to3/fixes/fix_imports.py Lib/lib2to3/fixes/fix_methodattrs.py Lib/lib2to3/fixes/fix_renames.py Lib/lib2to3/fixes/fix_types.py Lib/lib2to3/main.py Lib/lib2to3/patcomp.py Lib/lib2to3/pgen2/driver.py Lib/lib2to3/pgen2/tokenize.py Lib/lib2to3/pytree.py Lib/lib2to3/refactor.py Lib/lib2to3/tests/data/crlf.py Lib/lib2to3/tests/data/different_encoding.py Lib/lib2to3/tests/support.py Lib/lib2to3/tests/test_all_fixers.py Lib/lib2to3/tests/test_parser.py Lib/lib2to3/tests/test_refactor.py Message-ID: <20090509194224.2EED91E4013@bag.python.org> Author: benjamin.peterson Date: Sat May 9 21:42:23 2009 New Revision: 72522 Log: Merged revisions 72494 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ................ r72494 | benjamin.peterson | 2009-05-08 20:01:14 -0500 (Fri, 08 May 2009) | 21 lines Merged revisions 72491-72493 via svnmerge from svn+ssh://pythondev at svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r72491 | benjamin.peterson | 2009-05-08 19:33:27 -0500 (Fri, 08 May 2009) | 7 lines make 2to3 use unicode internally on 2.x This started out as a fix for #2660, but became this large refactoring when I realized the dire state this was in. 2to3 now uses tokenize.detect_encoding to decode the files correctly into unicode. ........ r72492 | benjamin.peterson | 2009-05-08 19:35:38 -0500 (Fri, 08 May 2009) | 1 line remove compat code ........ r72493 | benjamin.peterson | 2009-05-08 19:54:15 -0500 (Fri, 08 May 2009) | 1 line add a test for \r\n newlines ........ ................ Added: python/branches/py3k/Lib/lib2to3/tests/data/crlf.py - copied unchanged from r72494, /python/trunk/Lib/lib2to3/tests/data/crlf.py python/branches/py3k/Lib/lib2to3/tests/data/different_encoding.py - copied unchanged from r72494, /python/trunk/Lib/lib2to3/tests/data/different_encoding.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py python/branches/py3k/Lib/lib2to3/fixes/fix_methodattrs.py python/branches/py3k/Lib/lib2to3/fixes/fix_renames.py python/branches/py3k/Lib/lib2to3/fixes/fix_types.py python/branches/py3k/Lib/lib2to3/main.py python/branches/py3k/Lib/lib2to3/patcomp.py python/branches/py3k/Lib/lib2to3/pgen2/driver.py python/branches/py3k/Lib/lib2to3/pgen2/tokenize.py python/branches/py3k/Lib/lib2to3/pytree.py python/branches/py3k/Lib/lib2to3/refactor.py python/branches/py3k/Lib/lib2to3/tests/support.py python/branches/py3k/Lib/lib2to3/tests/test_all_fixers.py python/branches/py3k/Lib/lib2to3/tests/test_parser.py python/branches/py3k/Lib/lib2to3/tests/test_refactor.py Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py Sat May 9 21:42:23 2009 @@ -123,7 +123,7 @@ import_mod = results.get("module_name") if import_mod: mod_name = import_mod.value - new_name = self.mapping[mod_name] + new_name = str(self.mapping[mod_name]) import_mod.replace(Name(new_name, prefix=import_mod.get_prefix())) if "name_import" in results: # If it's not a "from x import x, y" or "import x as y" import, Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_methodattrs.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_methodattrs.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_methodattrs.py Sat May 9 21:42:23 2009 @@ -19,5 +19,5 @@ def transform(self, node, results): attr = results["attr"][0] - new = MAP[attr.value] + new = str(MAP[attr.value]) attr.replace(Name(new, prefix=attr.get_prefix())) Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_renames.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_renames.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_renames.py Sat May 9 21:42:23 2009 @@ -65,5 +65,5 @@ #import_mod = results.get("module") if mod_name and attr_name: - new_attr = LOOKUP[(mod_name.value, attr_name.value)] + new_attr = str(LOOKUP[(mod_name.value, attr_name.value)]) attr_name.replace(Name(new_attr, prefix=attr_name.get_prefix())) Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_types.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_types.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_types.py Sat May 9 21:42:23 2009 @@ -56,7 +56,7 @@ PATTERN = '|'.join(_pats) def transform(self, node, results): - new_value = _TYPE_MAPPING.get(results["name"].value) + new_value = str(_TYPE_MAPPING.get(results["name"].value)) if new_value: return Name(new_value, prefix=node.get_prefix()) return None Modified: python/branches/py3k/Lib/lib2to3/main.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/main.py (original) +++ python/branches/py3k/Lib/lib2to3/main.py Sat May 9 21:42:23 2009 @@ -23,7 +23,7 @@ self.errors.append((msg, args, kwargs)) self.logger.error(msg, *args, **kwargs) - def write_file(self, new_text, filename, old_text): + def write_file(self, new_text, filename, old_text, encoding): if not self.nobackups: # Make backup backup = filename + ".bak" @@ -37,8 +37,8 @@ except os.error as err: self.log_message("Can't rename %s to %s", filename, backup) # Actually write the new file - super(StdoutRefactoringTool, self).write_file(new_text, - filename, old_text) + write = super(StdoutRefactoringTool, self).write_file + write(new_text, filename, old_text, encoding) if not self.nobackups: shutil.copymode(backup, filename) Modified: python/branches/py3k/Lib/lib2to3/patcomp.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/patcomp.py (original) +++ python/branches/py3k/Lib/lib2to3/patcomp.py Sat May 9 21:42:23 2009 @@ -133,7 +133,7 @@ assert len(nodes) >= 1 node = nodes[0] if node.type == token.STRING: - value = literals.evalString(node.value) + value = str(literals.evalString(node.value)) return pytree.LeafPattern(content=value) elif node.type == token.NAME: value = node.value Modified: python/branches/py3k/Lib/lib2to3/pgen2/driver.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/pgen2/driver.py (original) +++ python/branches/py3k/Lib/lib2to3/pgen2/driver.py Sat May 9 21:42:23 2009 @@ -16,6 +16,7 @@ __all__ = ["Driver", "load_grammar"] # Python imports +import codecs import os import logging import sys @@ -90,9 +91,9 @@ """Parse a stream and return the syntax tree.""" return self.parse_stream_raw(stream, debug) - def parse_file(self, filename, debug=False): + def parse_file(self, filename, encoding=None, debug=False): """Parse a file and return the syntax tree.""" - stream = open(filename) + stream = codecs.open(filename, "r", encoding) try: return self.parse_stream(stream, debug) finally: Modified: python/branches/py3k/Lib/lib2to3/pgen2/tokenize.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/pgen2/tokenize.py (original) +++ python/branches/py3k/Lib/lib2to3/pgen2/tokenize.py Sat May 9 21:42:23 2009 @@ -30,6 +30,7 @@ 'GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro' import string, re +from codecs import BOM_UTF8, lookup from lib2to3.pgen2.token import * from . import token @@ -228,6 +229,75 @@ startline = False toks_append(tokval) +cookie_re = re.compile("coding[:=]\s*([-\w.]+)") + +def detect_encoding(readline): + """ + The detect_encoding() function is used to detect the encoding that should + be used to decode a Python source file. It requires one argment, readline, + in the same way as the tokenize() generator. + + It will call readline a maximum of twice, and return the encoding used + (as a string) and a list of any lines (left as bytes) it has read + in. + + It detects the encoding from the presence of a utf-8 bom or an encoding + cookie as specified in pep-0263. If both a bom and a cookie are present, + but disagree, a SyntaxError will be raised. If the encoding cookie is an + invalid charset, raise a SyntaxError. + + If no encoding is specified, then the default of 'utf-8' will be returned. + """ + bom_found = False + encoding = None + def read_or_stop(): + try: + return readline() + except StopIteration: + return b'' + + def find_cookie(line): + try: + line_string = line.decode('ascii') + except UnicodeDecodeError: + return None + + matches = cookie_re.findall(line_string) + if not matches: + return None + encoding = matches[0] + try: + codec = lookup(encoding) + except LookupError: + # This behaviour mimics the Python interpreter + raise SyntaxError("unknown encoding: " + encoding) + + if bom_found and codec.name != 'utf-8': + # This behaviour mimics the Python interpreter + raise SyntaxError('encoding problem: utf-8') + return encoding + + first = read_or_stop() + if first.startswith(BOM_UTF8): + bom_found = True + first = first[3:] + if not first: + return 'utf-8', [] + + encoding = find_cookie(first) + if encoding: + return encoding, [first] + + second = read_or_stop() + if not second: + return 'utf-8', [first] + + encoding = find_cookie(second) + if encoding: + return encoding, [first, second] + + return 'utf-8', [first, second] + def untokenize(iterable): """Transform tokens back into Python source code. Modified: python/branches/py3k/Lib/lib2to3/pytree.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/pytree.py (original) +++ python/branches/py3k/Lib/lib2to3/pytree.py Sat May 9 21:42:23 2009 @@ -216,6 +216,10 @@ return "" return next_sib.get_prefix() + if sys.version_info < (3, 0): + def __str__(self): + return str(self).encode("ascii") + class Node(Base): @@ -245,7 +249,7 @@ type_repr(self.type), self.children) - def __str__(self): + def __unicode__(self): """ Return a pretty string representation. @@ -253,6 +257,9 @@ """ return "".join(map(str, self.children)) + if sys.version_info > (3, 0): + __str__ = __unicode__ + def _eq(self, other): """Compare two nodes for equality.""" return (self.type, self.children) == (other.type, other.children) @@ -353,7 +360,7 @@ self.type, self.value) - def __str__(self): + def __unicode__(self): """ Return a pretty string representation. @@ -361,6 +368,9 @@ """ return self.prefix + str(self.value) + if sys.version_info > (3, 0): + __str__ = __unicode__ + def _eq(self, other): """Compare two nodes for equality.""" return (self.type, self.value) == (other.type, other.value) Modified: python/branches/py3k/Lib/lib2to3/refactor.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/refactor.py (original) +++ python/branches/py3k/Lib/lib2to3/refactor.py Sat May 9 21:42:23 2009 @@ -22,8 +22,7 @@ from itertools import chain # Local imports -from .pgen2 import driver -from .pgen2 import tokenize +from .pgen2 import driver, tokenize from . import pytree from . import patcomp @@ -87,6 +86,25 @@ return [pkg_name + "." + fix_name for fix_name in get_all_fix_names(pkg_name, False)] +def _identity(obj): + return obj + +if sys.version_info < (3, 0): + import codecs + _open_with_encoding = codecs.open + # codecs.open doesn't translate newlines sadly. + def _from_system_newlines(input): + return input.replace("\r\n", "\n") + def _to_system_newlines(input): + if os.linesep != "\n": + return input.replace("\n", os.linesep) + else: + return input +else: + _open_with_encoding = open + _from_system_newlines = _identity + _to_system_newlines = _identity + class FixerError(Exception): """A fixer could not be loaded.""" @@ -213,29 +231,42 @@ # Modify dirnames in-place to remove subdirs with leading dots dirnames[:] = [dn for dn in dirnames if not dn.startswith(".")] - def refactor_file(self, filename, write=False, doctests_only=False): - """Refactors a file.""" + def _read_python_source(self, filename): + """ + Do our best to decode a Python source file correctly. + """ try: - f = open(filename) + f = open(filename, "rb") except IOError as err: self.log_error("Can't open %s: %s", filename, err) - return + return None, None try: - input = f.read() + "\n" # Silence certain parse errors + encoding = tokenize.detect_encoding(f.readline)[0] finally: f.close() + with _open_with_encoding(filename, "r", encoding=encoding) as f: + return _from_system_newlines(f.read()), encoding + + def refactor_file(self, filename, write=False, doctests_only=False): + """Refactors a file.""" + input, encoding = self._read_python_source(filename) + if input is None: + # Reading the file failed. + return + input += "\n" # Silence certain parse errors if doctests_only: self.log_debug("Refactoring doctests in %s", filename) output = self.refactor_docstring(input, filename) if output != input: - self.processed_file(output, filename, input, write=write) + self.processed_file(output, filename, input, write, encoding) else: self.log_debug("No doctest changes in %s", filename) else: tree = self.refactor_string(input, filename) if tree and tree.was_changed: # The [:-1] is to take off the \n we added earlier - self.processed_file(str(tree)[:-1], filename, write=write) + self.processed_file(str(tree)[:-1], filename, + write=write, encoding=encoding) else: self.log_debug("No changes in %s", filename) @@ -321,31 +352,26 @@ node.replace(new) node = new - def processed_file(self, new_text, filename, old_text=None, write=False): + def processed_file(self, new_text, filename, old_text=None, write=False, + encoding=None): """ Called when a file has been refactored, and there are changes. """ self.files.append(filename) if old_text is None: - try: - f = open(filename, "r") - except IOError as err: - self.log_error("Can't read %s: %s", filename, err) + old_text = self._read_python_source(filename)[0] + if old_text is None: return - try: - old_text = f.read() - finally: - f.close() if old_text == new_text: self.log_debug("No changes to %s", filename) return self.print_output(diff_texts(old_text, new_text, filename)) if write: - self.write_file(new_text, filename, old_text) + self.write_file(new_text, filename, old_text, encoding) else: self.log_debug("Not writing changes to %s", filename) - def write_file(self, new_text, filename, old_text): + def write_file(self, new_text, filename, old_text, encoding=None): """Writes a string to a file. It first shows a unified diff between the old text and the new text, and @@ -353,12 +379,12 @@ set. """ try: - f = open(filename, "w") + f = _open_with_encoding(filename, "w", encoding=encoding) except os.error as err: self.log_error("Can't create %s: %s", filename, err) return try: - f.write(new_text) + f.write(_to_system_newlines(new_text)) except os.error as err: self.log_error("Can't write %s: %s", filename, err) finally: Modified: python/branches/py3k/Lib/lib2to3/tests/support.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/tests/support.py (original) +++ python/branches/py3k/Lib/lib2to3/tests/support.py Sat May 9 21:42:23 2009 @@ -9,12 +9,9 @@ import re from textwrap import dedent -#sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) - # Local imports -from .. import pytree -from .. import refactor -from ..pgen2 import driver +from lib2to3 import pytree, refactor +from lib2to3.pgen2 import driver test_dir = os.path.dirname(__file__) proj_dir = os.path.normpath(os.path.join(test_dir, "..")) @@ -25,12 +22,6 @@ def parse_string(string): return driver.parse_string(reformat(string), debug=True) -# Python 2.3's TestSuite is not iter()-able -if sys.version_info < (2, 4): - def TestSuite_iter(self): - return iter(self._tests) - unittest.TestSuite.__iter__ = TestSuite_iter - def run_all_tests(test_mod=None, tests=None): if tests is None: tests = unittest.TestLoader().loadTestsFromModule(test_mod) Modified: python/branches/py3k/Lib/lib2to3/tests/test_all_fixers.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/tests/test_all_fixers.py (original) +++ python/branches/py3k/Lib/lib2to3/tests/test_all_fixers.py Sat May 9 21:42:23 2009 @@ -28,7 +28,7 @@ def test_all_project_files(self): for filepath in support.all_project_files(): print("Fixing %s..." % filepath) - self.refactor.refactor_string(open(filepath).read(), filepath) + self.refactor.refactor_file(filepath) if __name__ == "__main__": Modified: python/branches/py3k/Lib/lib2to3/tests/test_parser.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/tests/test_parser.py (original) +++ python/branches/py3k/Lib/lib2to3/tests/test_parser.py Sat May 9 21:42:23 2009 @@ -14,9 +14,9 @@ # Python imports import os -import os.path # Local imports +from lib2to3.pgen2 import tokenize from ..pgen2.parse import ParseError @@ -150,13 +150,25 @@ def test_all_project_files(self): for filepath in support.all_project_files(): print("Parsing %s..." % filepath) - tree = driver.parse_file(filepath, debug=True) - if diff(filepath, tree): + with open(filepath, "rb") as fp: + encoding = tokenize.detect_encoding(fp.readline)[0] + fp.seek(0) + source = fp.read() + if encoding: + source = source.decode(encoding) + tree = driver.parse_string(source) + new = str(tree) + if encoding: + new = new.encode(encoding) + if diff(filepath, new): self.fail("Idempotency failed: %s" % filepath) class TestLiterals(GrammarTest): + def validate(self, s): + driver.parse_string(support.dedent(s) + "\n\n") + def test_multiline_bytes_literals(self): s = """ md5test(b"\xaa" * 80, @@ -185,10 +197,10 @@ self.validate(s) -def diff(fn, tree): +def diff(fn, result): f = open("@", "w") try: - f.write(str(tree)) + f.write(result) finally: f.close() try: Modified: python/branches/py3k/Lib/lib2to3/tests/test_refactor.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/tests/test_refactor.py (original) +++ python/branches/py3k/Lib/lib2to3/tests/test_refactor.py Sat May 9 21:42:23 2009 @@ -14,7 +14,8 @@ from . import support -FIXER_DIR = os.path.join(os.path.dirname(__file__), "data/fixers") +TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), "data") +FIXER_DIR = os.path.join(TEST_DATA_DIR, "fixers") sys.path.append(FIXER_DIR) try: @@ -22,6 +23,8 @@ finally: sys.path.pop() +_2TO3_FIXERS = refactor.get_fixers_from_package("lib2to3.fixes") + class TestRefactoringTool(unittest.TestCase): def setUp(self): @@ -121,19 +124,40 @@ +def cheese(): pass""".splitlines() self.assertEqual(diff_lines[:-1], expected) - def test_refactor_file(self): - test_file = os.path.join(FIXER_DIR, "parrot_example.py") - old_contents = open(test_file, "r").read() - rt = self.rt() + def check_file_refactoring(self, test_file, fixers=_2TO3_FIXERS): + def read_file(): + with open(test_file, "rb") as fp: + return fp.read() + old_contents = read_file() + rt = self.rt(fixers=fixers) rt.refactor_file(test_file) - self.assertEqual(old_contents, open(test_file, "r").read()) + self.assertEqual(old_contents, read_file()) + + try: + rt.refactor_file(test_file, True) + self.assertNotEqual(old_contents, read_file()) + finally: + with open(test_file, "wb") as fp: + fp.write(old_contents) + + def test_refactor_file(self): + test_file = os.path.join(FIXER_DIR, "parrot_example.py") + self.check_file_refactoring(test_file, _DEFAULT_FIXERS) - rt.refactor_file(test_file, True) + def test_file_encoding(self): + fn = os.path.join(TEST_DATA_DIR, "different_encoding.py") + self.check_file_refactoring(fn) + + def test_crlf_newlines(self): + old_sep = os.linesep + os.linesep = "\r\n" try: - self.assertNotEqual(old_contents, open(test_file, "r").read()) + fn = os.path.join(TEST_DATA_DIR, "crlf.py") + fixes = refactor.get_fixers_from_package("lib2to3.fixes") + self.check_file_refactoring(fn, fixes) finally: - open(test_file, "w").write(old_contents) + os.linesep = old_sep def test_refactor_docstring(self): rt = self.rt() From python-checkins at python.org Sat May 9 21:42:26 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 21:42:26 +0200 (CEST) Subject: [Python-checkins] r72523 - sandbox/trunk/2to3/lib2to3/tests/data/different_encoding.py Message-ID: <20090509194226.777001E4013@bag.python.org> Author: benjamin.peterson Date: Sat May 9 21:42:26 2009 New Revision: 72523 Log: remove parenthesis Modified: sandbox/trunk/2to3/lib2to3/tests/data/different_encoding.py Modified: sandbox/trunk/2to3/lib2to3/tests/data/different_encoding.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/data/different_encoding.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/data/different_encoding.py Sat May 9 21:42:26 2009 @@ -1,4 +1,4 @@ #!/usr/bin/env python # -*- coding: iso-8859-1 -*- -print(u'??????????????????????????????????????????????????????????????') +print u'??????????????????????????????????????????????????????????????' From python-checkins at python.org Sat May 9 21:44:56 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 9 May 2009 21:44:56 +0200 (CEST) Subject: [Python-checkins] r72524 - in python/branches/py3k/Lib/lib2to3/fixes: fix_imports.py fix_methodattrs.py fix_renames.py fix_types.py Message-ID: <20090509194456.E4C301E4013@bag.python.org> Author: benjamin.peterson Date: Sat May 9 21:44:56 2009 New Revision: 72524 Log: remove unneeded uses of str() Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py python/branches/py3k/Lib/lib2to3/fixes/fix_methodattrs.py python/branches/py3k/Lib/lib2to3/fixes/fix_renames.py python/branches/py3k/Lib/lib2to3/fixes/fix_types.py Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py Sat May 9 21:44:56 2009 @@ -123,7 +123,7 @@ import_mod = results.get("module_name") if import_mod: mod_name = import_mod.value - new_name = str(self.mapping[mod_name]) + new_name = self.mapping[mod_name] import_mod.replace(Name(new_name, prefix=import_mod.get_prefix())) if "name_import" in results: # If it's not a "from x import x, y" or "import x as y" import, Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_methodattrs.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_methodattrs.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_methodattrs.py Sat May 9 21:44:56 2009 @@ -19,5 +19,5 @@ def transform(self, node, results): attr = results["attr"][0] - new = str(MAP[attr.value]) + new = MAP[attr.value] attr.replace(Name(new, prefix=attr.get_prefix())) Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_renames.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_renames.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_renames.py Sat May 9 21:44:56 2009 @@ -65,5 +65,5 @@ #import_mod = results.get("module") if mod_name and attr_name: - new_attr = str(LOOKUP[(mod_name.value, attr_name.value)]) + new_attr = LOOKUP[(mod_name.value, attr_name.value)] attr_name.replace(Name(new_attr, prefix=attr_name.get_prefix())) Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_types.py ============================================================================== --- python/branches/py3k/Lib/lib2to3/fixes/fix_types.py (original) +++ python/branches/py3k/Lib/lib2to3/fixes/fix_types.py Sat May 9 21:44:56 2009 @@ -56,7 +56,7 @@ PATTERN = '|'.join(_pats) def transform(self, node, results): - new_value = str(_TYPE_MAPPING.get(results["name"].value)) + new_value = _TYPE_MAPPING.get(results["name"].value) if new_value: return Name(new_value, prefix=node.get_prefix()) return None From python-checkins at python.org Sun May 10 03:38:02 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 10 May 2009 03:38:02 +0200 (CEST) Subject: [Python-checkins] r72525 - python/trunk/Lib/gettext.py Message-ID: <20090510013802.B8ECB1E4013@bag.python.org> Author: benjamin.peterson Date: Sun May 10 03:38:02 2009 New Revision: 72525 Log: close file explicitly Modified: python/trunk/Lib/gettext.py Modified: python/trunk/Lib/gettext.py ============================================================================== --- python/trunk/Lib/gettext.py (original) +++ python/trunk/Lib/gettext.py Sun May 10 03:38:02 2009 @@ -467,7 +467,6 @@ if fallback: return NullTranslations() raise IOError(ENOENT, 'No translation file found for domain', domain) - # TBD: do we need to worry about the file pointer getting collected? # Avoid opening, reading, and parsing the .mo file after it's been done # once. result = None @@ -475,7 +474,8 @@ key = os.path.abspath(mofile) t = _translations.get(key) if t is None: - t = _translations.setdefault(key, class_(open(mofile, 'rb'))) + with open(mofile, 'rb') as fp: + t = _translations.setdefault(key, class_(fp)) # Copy the translation object to allow setting fallbacks and # output charset. All other instance data is shared with the # cached object. From python-checkins at python.org Sun May 10 04:29:00 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 10 May 2009 04:29:00 +0200 (CEST) Subject: [Python-checkins] r72526 - python/trunk/Lib/zipfile.py Message-ID: <20090510022900.BD4EF1E4013@bag.python.org> Author: benjamin.peterson Date: Sun May 10 04:29:00 2009 New Revision: 72526 Log: make sure files are closed using the with statement Modified: python/trunk/Lib/zipfile.py Modified: python/trunk/Lib/zipfile.py ============================================================================== --- python/trunk/Lib/zipfile.py (original) +++ python/trunk/Lib/zipfile.py Sun May 10 04:29:00 2009 @@ -1047,28 +1047,27 @@ self.fp.write(zinfo.FileHeader()) return - fp = open(filename, "rb") - # Must overwrite CRC and sizes with correct data later - zinfo.CRC = CRC = 0 - zinfo.compress_size = compress_size = 0 - zinfo.file_size = file_size = 0 - self.fp.write(zinfo.FileHeader()) - if zinfo.compress_type == ZIP_DEFLATED: - cmpr = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION, - zlib.DEFLATED, -15) - else: - cmpr = None - while 1: - buf = fp.read(1024 * 8) - if not buf: - break - file_size = file_size + len(buf) - CRC = crc32(buf, CRC) & 0xffffffff - if cmpr: - buf = cmpr.compress(buf) - compress_size = compress_size + len(buf) - self.fp.write(buf) - fp.close() + with open(filename, "rb") as fp: + # Must overwrite CRC and sizes with correct data later + zinfo.CRC = CRC = 0 + zinfo.compress_size = compress_size = 0 + zinfo.file_size = file_size = 0 + self.fp.write(zinfo.FileHeader()) + if zinfo.compress_type == ZIP_DEFLATED: + cmpr = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION, + zlib.DEFLATED, -15) + else: + cmpr = None + while 1: + buf = fp.read(1024 * 8) + if not buf: + break + file_size = file_size + len(buf) + CRC = crc32(buf, CRC) & 0xffffffff + if cmpr: + buf = cmpr.compress(buf) + compress_size = compress_size + len(buf) + self.fp.write(buf) if cmpr: buf = cmpr.flush() compress_size = compress_size + len(buf) @@ -1388,9 +1387,8 @@ tgtdir = os.path.dirname(tgt) if not os.path.exists(tgtdir): os.makedirs(tgtdir) - fp = open(tgt, 'wb') - fp.write(zf.read(path)) - fp.close() + with open(tgt, 'wb') as fp: + fp.write(zf.read(path)) zf.close() elif args[0] == '-c': From buildbot at python.org Sun May 10 05:18:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 10 May 2009 03:18:15 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090510031815.2BC1E1E41FC@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/497 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun May 10 09:53:40 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 10 May 2009 09:53:40 +0200 (CEST) Subject: [Python-checkins] r72527 - peps/trunk/pep-0383.txt Message-ID: <20090510075340.41D221E401B@bag.python.org> Author: martin.v.loewis Date: Sun May 10 09:53:39 2009 New Revision: 72527 Log: utf8b -> surrogateescape. Modified: peps/trunk/pep-0383.txt Modified: peps/trunk/pep-0383.txt ============================================================================== --- peps/trunk/pep-0383.txt (original) +++ peps/trunk/pep-0383.txt Sun May 10 09:53:39 2009 @@ -72,11 +72,12 @@ represented as lone surrogate codes U+DC80..U+DCFF. Bytes below 128 will produce exceptions; see the discussion below. -To convert non-decodable bytes, a new error handler ([2]) "utf8b" is -introduced, which produces these surrogates. On encoding, the error -handler converts the surrogate back to the corresponding byte. This -error handler will be used in any API that receives or produces file -names, command line arguments, or environment variables. +To convert non-decodable bytes, a new error handler ([2]) +"surrogateescape" is introduced, which produces these surrogates. On +encoding, the error handler converts the surrogate back to the +corresponding byte. This error handler will be used in any API that +receives or produces file names, command line arguments, or +environment variables. The error handler interface is extended to allow the encode error handler to return byte strings immediately, in addition to returning @@ -95,7 +96,7 @@ While providing a uniform API to non-decodable bytes, this interface has the limitation that chosen representation only "works" if the data -get converted back to bytes with the utf8b error handler +get converted back to bytes with the surrogateescape error handler also. Encoding the data with the locale's encoding and the (default) strict error handler will raise an exception, encoding them with UTF-8 will produce non-sensical data. @@ -115,28 +116,28 @@ open(), which then encodes them back into their original byte representation. Applications that need to process the original byte strings can obtain them by encoding the character strings with the -file system encoding, passing "utf8b" as the error handler name. For -example, a function that works like os.listdir, except for accepting -and returning bytes, would be written as:: +file system encoding, passing "surrogateescape" as the error handler +name. For example, a function that works like os.listdir, except for +accepting and returning bytes, would be written as:: def listdir_b(dirname): fse = sys.getfilesystemencoding() - dirname = dirname.decode(fse, "utf8b") + dirname = dirname.decode(fse, "surrogateescape") for fn in os.listdir(dirname): # fn is now a str object - yield fn.encode(fse, "utf8b") + yield fn.encode(fse, "surrogateescape") The extension to the encode error handler interface proposed by this -PEP is necessary to implement the 'utf8b' error handler, because there -are required byte sequences which cannot be generated from replacement -Unicode. However, the encode error handler interface presently -requires replacement Unicode to be provided in lieu of the +PEP is necessary to implement the 'surrogateescape' error handler, +because there are required byte sequences which cannot be generated +from replacement Unicode. However, the encode error handler interface +presently requires replacement Unicode to be provided in lieu of the non-encodable Unicode from the source string. Then it promptly encodes that replacement Unicode. In some error handlers, such as the -'utf8b' proposed here, it is also simpler and more efficient for the -error handler to provide a pre-encoded replacement byte string, rather -than forcing it to calculating Unicode from which the encoder would -create the desired bytes. +'surrogateescape' proposed here, it is also simpler and more efficient +for the error handler to provide a pre-encoded replacement byte +string, rather than forcing it to calculating Unicode from which the +encoder would create the desired bytes. A few alternative approaches have been proposed: From python-checkins at python.org Sun May 10 10:08:56 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 10 May 2009 10:08:56 +0200 (CEST) Subject: [Python-checkins] r72528 - in python/branches/py3k: Doc/library/codecs.rst Lib/test/test_codecs.py Lib/test/test_unicode.py Misc/NEWS Python/codecs.c Python/marshal.c Message-ID: <20090510080856.B13601E4104@bag.python.org> Author: martin.v.loewis Date: Sun May 10 10:08:56 2009 New Revision: 72528 Log: Rename the surrogates error handler to surrogatepass. Modified: python/branches/py3k/Doc/library/codecs.rst python/branches/py3k/Lib/test/test_codecs.py python/branches/py3k/Lib/test/test_unicode.py python/branches/py3k/Misc/NEWS python/branches/py3k/Python/codecs.c python/branches/py3k/Python/marshal.c Modified: python/branches/py3k/Doc/library/codecs.rst ============================================================================== --- python/branches/py3k/Doc/library/codecs.rst (original) +++ python/branches/py3k/Doc/library/codecs.rst Sun May 10 10:08:56 2009 @@ -327,15 +327,15 @@ In addition, the following error handlers are specific to a single codec: -+------------------+---------+--------------------------------------------+ -| Value | Codec | Meaning | -+==================+=========+============================================+ -| ``'surrogates'`` | utf-8 | Allow encoding and decoding of surrogate | -| | | codes in UTF-8. | -+------------------+---------+--------------------------------------------+ ++-------------------+---------+-------------------------------------------+ +| Value | Codec | Meaning | ++===================+=========+===========================================+ +|``'surrogatepass'``| utf-8 | Allow encoding and decoding of surrogate | +| | | codes in UTF-8. | ++-------------------+---------+-------------------------------------------+ .. versionadded:: 3.1 - The ``'utf8b'`` and ``'surrogates'`` error handlers. + The ``'utf8b'`` and ``'surrogatepass'`` error handlers. The set of allowed values can be extended via :meth:`register_error`. Modified: python/branches/py3k/Lib/test/test_codecs.py ============================================================================== --- python/branches/py3k/Lib/test/test_codecs.py (original) +++ python/branches/py3k/Lib/test/test_codecs.py Sun May 10 10:08:56 2009 @@ -545,12 +545,12 @@ self.assertRaises(UnicodeEncodeError, "\ud800".encode, "utf-8") self.assertRaises(UnicodeDecodeError, b"\xed\xa0\x80".decode, "utf-8") - def test_surrogates_handler(self): - self.assertEquals("abc\ud800def".encode("utf-8", "surrogates"), + def test_surrogatepass_handler(self): + self.assertEquals("abc\ud800def".encode("utf-8", "surrogatepass"), b"abc\xed\xa0\x80def") - self.assertEquals(b"abc\xed\xa0\x80def".decode("utf-8", "surrogates"), + self.assertEquals(b"abc\xed\xa0\x80def".decode("utf-8", "surrogatepass"), "abc\ud800def") - self.assertTrue(codecs.lookup_error("surrogates")) + self.assertTrue(codecs.lookup_error("surrogatepass")) class UTF7Test(ReadTest): encoding = "utf-7" @@ -1040,12 +1040,12 @@ # Skipped continue # The Unicode strings are given in UTF-8 - orig = str(orig, "utf-8", "surrogates") + orig = str(orig, "utf-8", "surrogatepass") if prepped is None: # Input contains prohibited characters self.assertRaises(UnicodeError, nameprep, orig) else: - prepped = str(prepped, "utf-8", "surrogates") + prepped = str(prepped, "utf-8", "surrogatepass") try: self.assertEquals(nameprep(orig), prepped) except Exception as e: Modified: python/branches/py3k/Lib/test/test_unicode.py ============================================================================== --- python/branches/py3k/Lib/test/test_unicode.py (original) +++ python/branches/py3k/Lib/test/test_unicode.py Sun May 10 10:08:56 2009 @@ -906,10 +906,10 @@ self.assertEqual('\u20ac'.encode('utf-8'), b'\xe2\x82\xac') self.assertEqual('\ud800\udc02'.encode('utf-8'), b'\xf0\x90\x80\x82') self.assertEqual('\ud84d\udc56'.encode('utf-8'), b'\xf0\xa3\x91\x96') - self.assertEqual('\ud800'.encode('utf-8', 'surrogates'), b'\xed\xa0\x80') - self.assertEqual('\udc00'.encode('utf-8', 'surrogates'), b'\xed\xb0\x80') + self.assertEqual('\ud800'.encode('utf-8', 'surrogatepass'), b'\xed\xa0\x80') + self.assertEqual('\udc00'.encode('utf-8', 'surrogatepass'), b'\xed\xb0\x80') self.assertEqual( - ('\ud800\udc02'*1000).encode('utf-8', 'surrogates'), + ('\ud800\udc02'*1000).encode('utf-8', 'surrogatepass'), b'\xf0\x90\x80\x82'*1000 ) self.assertEqual( Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun May 10 10:08:56 2009 @@ -56,7 +56,7 @@ - Issue #4426: The UTF-7 decoder was too strict and didn't accept some legal sequences. Patch by Nick Barnes and Victor Stinner. -- Issue #3672: Reject surrogates in utf-8 codec; add surrogates error handler. +- Issue #3672: Reject surrogates in utf-8 codec; add surrogatepass error handler. - Issue #5883: In the io module, the BufferedIOBase and TextIOBase ABCs have received a new method, detach(). detach() disconnects the underlying stream Modified: python/branches/py3k/Python/codecs.c ============================================================================== --- python/branches/py3k/Python/codecs.c (original) +++ python/branches/py3k/Python/codecs.c Sun May 10 10:08:56 2009 @@ -751,7 +751,7 @@ /* This handler is declared static until someone demonstrates a need to call it directly. */ static PyObject * -PyCodec_SurrogateErrors(PyObject *exc) +PyCodec_SurrogatePassErrors(PyObject *exc) { PyObject *restuple; PyObject *object; @@ -935,9 +935,9 @@ return PyCodec_BackslashReplaceErrors(exc); } -static PyObject *surrogates_errors(PyObject *self, PyObject *exc) +static PyObject *surrogatepass_errors(PyObject *self, PyObject *exc) { - return PyCodec_SurrogateErrors(exc); + return PyCodec_SurrogatePassErrors(exc); } static PyObject *utf8b_errors(PyObject *self, PyObject *exc) @@ -993,10 +993,10 @@ } }, { - "surrogates", + "surrogatepass", { - "surrogates", - surrogates_errors, + "surrogatepass", + surrogatepass_errors, METH_O } }, Modified: python/branches/py3k/Python/marshal.c ============================================================================== --- python/branches/py3k/Python/marshal.c (original) +++ python/branches/py3k/Python/marshal.c Sun May 10 10:08:56 2009 @@ -314,7 +314,7 @@ PyObject *utf8; utf8 = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(v), PyUnicode_GET_SIZE(v), - "surrogates"); + "surrogatepass"); if (utf8 == NULL) { p->depth--; p->error = WFERR_UNMARSHALLABLE; @@ -809,7 +809,7 @@ retval = NULL; break; } - v = PyUnicode_DecodeUTF8(buffer, n, "surrogates"); + v = PyUnicode_DecodeUTF8(buffer, n, "surrogatepass"); PyMem_DEL(buffer); retval = v; break; From python-checkins at python.org Sun May 10 10:15:24 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 10 May 2009 10:15:24 +0200 (CEST) Subject: [Python-checkins] r72529 - in python/branches/py3k: Doc/library/codecs.rst Doc/library/os.rst Lib/test/test_codecs.py Lib/test/test_os.py Modules/_io/fileio.c Modules/posixmodule.c Modules/python.c Objects/unicodeobject.c Python/codecs.c Message-ID: <20090510081524.A3A111E401A@bag.python.org> Author: martin.v.loewis Date: Sun May 10 10:15:24 2009 New Revision: 72529 Log: Rename utf8b error handler to surrogateescape. Modified: python/branches/py3k/Doc/library/codecs.rst python/branches/py3k/Doc/library/os.rst python/branches/py3k/Lib/test/test_codecs.py python/branches/py3k/Lib/test/test_os.py python/branches/py3k/Modules/_io/fileio.c python/branches/py3k/Modules/posixmodule.c python/branches/py3k/Modules/python.c python/branches/py3k/Objects/unicodeobject.c python/branches/py3k/Python/codecs.c Modified: python/branches/py3k/Doc/library/codecs.rst ============================================================================== --- python/branches/py3k/Doc/library/codecs.rst (original) +++ python/branches/py3k/Doc/library/codecs.rst Sun May 10 10:15:24 2009 @@ -322,7 +322,7 @@ | ``'backslashreplace'`` | Replace with backslashed escape sequences | | | (only for encoding). | +-------------------------+-----------------------------------------------+ -| ``'utf8b'`` | Replace byte with surrogate U+DCxx. | +| ``'surrogateescape'`` | Replace byte with surrogate U+DCxx. | +-------------------------+-----------------------------------------------+ In addition, the following error handlers are specific to a single codec: @@ -335,7 +335,7 @@ +-------------------+---------+-------------------------------------------+ .. versionadded:: 3.1 - The ``'utf8b'`` and ``'surrogatepass'`` error handlers. + The ``'surrogateescape'`` and ``'surrogatepass'`` error handlers. The set of allowed values can be extended via :meth:`register_error`. Modified: python/branches/py3k/Doc/library/os.rst ============================================================================== --- python/branches/py3k/Doc/library/os.rst (original) +++ python/branches/py3k/Doc/library/os.rst Sun May 10 10:15:24 2009 @@ -64,8 +64,8 @@ .. versionchanged:: 3.1 On some systems, conversion using the file system encoding may - fail. In this case, Python uses the ``utf8b`` encoding error - handler, which means that undecodable bytes are replaced by a + fail. In this case, Python uses the ``surrogateescape`` encoding + error handler, which means that undecodable bytes are replaced by a Unicode character U+DCxx on decoding, and these are again translated to the original byte on encoding. Modified: python/branches/py3k/Lib/test/test_codecs.py ============================================================================== --- python/branches/py3k/Lib/test/test_codecs.py (original) +++ python/branches/py3k/Lib/test/test_codecs.py Sun May 10 10:15:24 2009 @@ -1521,32 +1521,32 @@ self.assertEquals(codecs.raw_unicode_escape_decode(r"\u1234"), ("\u1234", 6)) self.assertEquals(codecs.raw_unicode_escape_decode(br"\u1234"), ("\u1234", 6)) -class Utf8bTest(unittest.TestCase): +class SurrogateEscapeTest(unittest.TestCase): def test_utf8(self): # Bad byte - self.assertEqual(b"foo\x80bar".decode("utf-8", "utf8b"), + self.assertEqual(b"foo\x80bar".decode("utf-8", "surrogateescape"), "foo\udc80bar") - self.assertEqual("foo\udc80bar".encode("utf-8", "utf8b"), + self.assertEqual("foo\udc80bar".encode("utf-8", "surrogateescape"), b"foo\x80bar") # bad-utf-8 encoded surrogate - self.assertEqual(b"\xed\xb0\x80".decode("utf-8", "utf8b"), + self.assertEqual(b"\xed\xb0\x80".decode("utf-8", "surrogateescape"), "\udced\udcb0\udc80") - self.assertEqual("\udced\udcb0\udc80".encode("utf-8", "utf8b"), + self.assertEqual("\udced\udcb0\udc80".encode("utf-8", "surrogateescape"), b"\xed\xb0\x80") def test_ascii(self): # bad byte - self.assertEqual(b"foo\x80bar".decode("ascii", "utf8b"), + self.assertEqual(b"foo\x80bar".decode("ascii", "surrogateescape"), "foo\udc80bar") - self.assertEqual("foo\udc80bar".encode("ascii", "utf8b"), + self.assertEqual("foo\udc80bar".encode("ascii", "surrogateescape"), b"foo\x80bar") def test_charmap(self): # bad byte: \xa5 is unmapped in iso-8859-3 - self.assertEqual(b"foo\xa5bar".decode("iso-8859-3", "utf8b"), + self.assertEqual(b"foo\xa5bar".decode("iso-8859-3", "surrogateescape"), "foo\udca5bar") - self.assertEqual("foo\udca5bar".encode("iso-8859-3", "utf8b"), + self.assertEqual("foo\udca5bar".encode("iso-8859-3", "surrogateescape"), b"foo\xa5bar") @@ -1576,7 +1576,7 @@ CharmapTest, WithStmtTest, TypesTest, - Utf8bTest, + SurrogateEscapeTest, ) Modified: python/branches/py3k/Lib/test/test_os.py ============================================================================== --- python/branches/py3k/Lib/test/test_os.py (original) +++ python/branches/py3k/Lib/test/test_os.py Sun May 10 10:15:24 2009 @@ -708,13 +708,13 @@ self.fsencoding = sys.getfilesystemencoding() sys.setfilesystemencoding("utf-8") self.dir = support.TESTFN - self.bdir = self.dir.encode("utf-8", "utf8b") + self.bdir = self.dir.encode("utf-8", "surrogateescape") os.mkdir(self.dir) self.unicodefn = [] for fn in self.filenames: f = open(os.path.join(self.bdir, fn), "w") f.close() - self.unicodefn.append(fn.decode("utf-8", "utf8b")) + self.unicodefn.append(fn.decode("utf-8", "surrogateescape")) def tearDown(self): shutil.rmtree(self.dir) Modified: python/branches/py3k/Modules/_io/fileio.c ============================================================================== --- python/branches/py3k/Modules/_io/fileio.c (original) +++ python/branches/py3k/Modules/_io/fileio.c Sun May 10 10:15:24 2009 @@ -245,7 +245,7 @@ return -1; stringobj = PyUnicode_AsEncodedString( - u, Py_FileSystemDefaultEncoding, "utf8b"); + u, Py_FileSystemDefaultEncoding, "surrogateescape"); Py_DECREF(u); if (stringobj == NULL) return -1; Modified: python/branches/py3k/Modules/posixmodule.c ============================================================================== --- python/branches/py3k/Modules/posixmodule.c (original) +++ python/branches/py3k/Modules/posixmodule.c Sun May 10 10:15:24 2009 @@ -494,13 +494,13 @@ if (p == NULL) continue; k = PyUnicode_Decode(*e, (int)(p-*e), - Py_FileSystemDefaultEncoding, "utf8b"); + Py_FileSystemDefaultEncoding, "surrogateescape"); if (k == NULL) { PyErr_Clear(); continue; } v = PyUnicode_Decode(p+1, strlen(p+1), - Py_FileSystemDefaultEncoding, "utf8b"); + Py_FileSystemDefaultEncoding, "surrogateescape"); if (v == NULL) { PyErr_Clear(); Py_DECREF(k); @@ -2167,7 +2167,7 @@ return posix_error(); if (use_bytes) return PyBytes_FromStringAndSize(buf, strlen(buf)); - return PyUnicode_Decode(buf, strlen(buf), Py_FileSystemDefaultEncoding,"utf8b"); + return PyUnicode_Decode(buf, strlen(buf), Py_FileSystemDefaultEncoding,"surrogateescape"); } PyDoc_STRVAR(posix_getcwd__doc__, @@ -2513,7 +2513,7 @@ w = PyUnicode_FromEncodedObject(v, Py_FileSystemDefaultEncoding, - "utf8b"); + "surrogateescape"); Py_DECREF(v); if (w != NULL) v = w; @@ -4695,7 +4695,7 @@ w = PyUnicode_FromEncodedObject(v, Py_FileSystemDefaultEncoding, - "utf8b"); + "surrogateescape"); if (w != NULL) { Py_DECREF(v); v = w; Modified: python/branches/py3k/Modules/python.c ============================================================================== --- python/branches/py3k/Modules/python.c (original) +++ python/branches/py3k/Modules/python.c Sun May 10 10:15:24 2009 @@ -42,7 +42,7 @@ return res; PyMem_Free(res); } - /* Conversion failed. Fall back to escaping with utf8b. */ + /* Conversion failed. Fall back to escaping with surrogateescape. */ #ifdef HAVE_MBRTOWC /* Try conversion with mbrtwoc (C99), and escape non-decodable bytes. */ Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Sun May 10 10:15:24 2009 @@ -1549,7 +1549,7 @@ return 0; output = PyUnicode_AsEncodedObject(arg, Py_FileSystemDefaultEncoding, - "utf8b"); + "surrogateescape"); Py_DECREF(arg); if (!output) return 0; Modified: python/branches/py3k/Python/codecs.c ============================================================================== --- python/branches/py3k/Python/codecs.c (original) +++ python/branches/py3k/Python/codecs.c Sun May 10 10:15:24 2009 @@ -830,7 +830,7 @@ } static PyObject * -PyCodec_UTF8bErrors(PyObject *exc) +PyCodec_SurrogateEscapeErrors(PyObject *exc) { PyObject *restuple; PyObject *object; @@ -940,9 +940,9 @@ return PyCodec_SurrogatePassErrors(exc); } -static PyObject *utf8b_errors(PyObject *self, PyObject *exc) +static PyObject *surrogateescape_errors(PyObject *self, PyObject *exc) { - return PyCodec_UTF8bErrors(exc); + return PyCodec_SurrogateEscapeErrors(exc); } static int _PyCodecRegistry_Init(void) @@ -1001,10 +1001,10 @@ } }, { - "utf8b", + "surrogateescape", { - "utf8b", - utf8b_errors, + "surrogateescape", + surrogateescape_errors, METH_O } } From buildbot at python.org Sun May 10 10:26:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 10 May 2009 08:26:34 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090510082634.DCD411E401A@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/943 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_unicodedata ====================================================================== ERROR: test_method_checksum (test.test_unicodedata.UnicodeMethodsTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/test/test_unicodedata.py", line 65, in test_method_checksum h.update(''.join(data).encode(encoding, errors)) LookupError: unknown error handler name 'surrogates' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun May 10 10:51:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 10 May 2009 08:51:09 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090510085109.B0F7A1E40CA@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/731 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_unicodedata ====================================================================== ERROR: test_method_checksum (test.test_unicodedata.UnicodeMethodsTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_unicodedata.py", line 65, in test_method_checksum h.update(''.join(data).encode(encoding, errors)) LookupError: unknown error handler name 'surrogates' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun May 10 10:51:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 10 May 2009 08:51:57 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090510085157.BA0631E40CA@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/782 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_unicodedata ====================================================================== ERROR: test_method_checksum (test.test_unicodedata.UnicodeMethodsTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/test/test_unicodedata.py", line 65, in test_method_checksum h.update(''.join(data).encode(encoding, errors)) LookupError: unknown error handler name 'surrogates' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun May 10 11:00:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 10 May 2009 09:00:45 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090510090045.C3B2F1E401A@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/666 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_importlib test_posix test_unicodedata Traceback (most recent call last): File "./Lib/test/regrtest.py", line 620, in runtest_inner File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_importlib.py", line 6, in test_main run_unittest(importlib.test.test_suite('importlib.test')) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/__init__.py", line 22, in test_suite package_tests = getattr(sys.modules[package_name], 'test_suite')() File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/source/__init__.py", line 8, in test_suite return importlib.test.test_suite('importlib.test.source', directory) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/__init__.py", line 16, in test_suite __import__(module_name, level=0) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/source/test_case_sensitivity.py", line 12, in class CaseSensitivityTest(unittest.TestCase): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/importlib/test/util.py", line 13, in case_insensitive_tests original_name = os.listdir('.')[0] IndexError: list index out of range ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== ERROR: test_method_checksum (test.test_unicodedata.UnicodeMethodsTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_unicodedata.py", line 65, in test_method_checksum h.update(''.join(data).encode(encoding, errors)) LookupError: unknown error handler name 'surrogates' sincerely, -The Buildbot From python-checkins at python.org Sun May 10 11:33:21 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 10 May 2009 11:33:21 +0200 (CEST) Subject: [Python-checkins] r72530 - python/branches/py3k/Lib/test/test_unicodedata.py Message-ID: <20090510093321.AF58E1E401A@bag.python.org> Author: martin.v.loewis Date: Sun May 10 11:33:21 2009 New Revision: 72530 Log: Rename the surrogates handler to surrogatepass. Modified: python/branches/py3k/Lib/test/test_unicodedata.py Modified: python/branches/py3k/Lib/test/test_unicodedata.py ============================================================================== --- python/branches/py3k/Lib/test/test_unicodedata.py (original) +++ python/branches/py3k/Lib/test/test_unicodedata.py Sun May 10 11:33:21 2009 @@ -13,7 +13,7 @@ import test.support encoding = 'utf-8' -errors = 'surrogates' +errors = 'surrogatepass' ### Run tests From python-checkins at python.org Sun May 10 12:12:08 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 12:12:08 +0200 (CEST) Subject: [Python-checkins] r72531 - in python/trunk: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090510101208.3B6111E401A@bag.python.org> Author: tarek.ziade Date: Sun May 10 12:12:08 2009 New Revision: 72531 Log: fixed #5984 and improved test coverage Modified: python/trunk/Lib/distutils/command/build_ext.py python/trunk/Lib/distutils/tests/test_build_ext.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/command/build_ext.py ============================================================================== --- python/trunk/Lib/distutils/command/build_ext.py (original) +++ python/trunk/Lib/distutils/command/build_ext.py Sun May 10 12:12:08 2009 @@ -136,7 +136,7 @@ self.swig_opts = None self.user = None - def finalize_options (self): + def finalize_options(self): from distutils import sysconfig self.set_undefined_options('build', @@ -153,15 +153,14 @@ self.extensions = self.distribution.ext_modules - # Make sure Python's include directories (for Python.h, pyconfig.h, # etc.) are in the include search path. py_include = sysconfig.get_python_inc() plat_py_include = sysconfig.get_python_inc(plat_specific=1) if self.include_dirs is None: self.include_dirs = self.distribution.include_dirs or [] - if type(self.include_dirs) is StringType: - self.include_dirs = string.split(self.include_dirs, os.pathsep) + if isinstance(self.include_dirs, str): + self.include_dirs = self.include_dirs.split(os.pathsep) # Put the Python "system" include dir at the end, so that # any local include dirs take precedence. @@ -169,7 +168,7 @@ if plat_py_include != py_include: self.include_dirs.append(plat_py_include) - if type(self.libraries) is StringType: + if isinstance(self.libraries, str): self.libraries = [self.libraries] # Life is easier if we're not forever checking for None, so @@ -260,14 +259,14 @@ # symbols can be separated with commas. if self.define: - defines = string.split(self.define, ',') + defines = self.define.split(',') self.define = map(lambda symbol: (symbol, '1'), defines) # The option for macros to undefine is also a string from the # option parsing, but has to be a list. Multiple symbols can also # be separated with commas here. if self.undef: - self.undef = string.split(self.undef, ',') + self.undef = self.undef.split(',') if self.swig_opts is None: self.swig_opts = [] @@ -284,11 +283,7 @@ self.library_dirs.append(user_lib) self.rpath.append(user_lib) - # finalize_options () - - - def run (self): - + def run(self): from distutils.ccompiler import new_compiler # 'self.extensions', as supplied by setup.py, is a list of @@ -335,7 +330,7 @@ self.compiler.set_include_dirs(self.include_dirs) if self.define is not None: # 'define' option is a list of (name,value) tuples - for (name,value) in self.define: + for (name, value) in self.define: self.compiler.define_macro(name, value) if self.undef is not None: for macro in self.undef: @@ -352,10 +347,7 @@ # Now actually compile and link everything. self.build_extensions() - # run () - - - def check_extensions_list (self, extensions): + def check_extensions_list(self, extensions): """Ensure that the list of extensions (presumably provided as a command option 'extensions') is valid, i.e. it is a list of Extension objects. We also support the old-style list of 2-tuples, @@ -365,32 +357,33 @@ Raise DistutilsSetupError if the structure is invalid anywhere; just returns otherwise. """ - if type(extensions) is not ListType: + if not isinstance(extensions, list): raise DistutilsSetupError, \ "'ext_modules' option must be a list of Extension instances" - for i in range(len(extensions)): - ext = extensions[i] + for i, ext in enumerate(extensions): if isinstance(ext, Extension): continue # OK! (assume type-checking done # by Extension constructor) - (ext_name, build_info) = ext - log.warn(("old-style (ext_name, build_info) tuple found in " - "ext_modules for extension '%s'" - "-- please convert to Extension instance" % ext_name)) - if type(ext) is not TupleType and len(ext) != 2: + if not isinstance(ext, tuple) or len(ext) != 2: raise DistutilsSetupError, \ ("each element of 'ext_modules' option must be an " "Extension instance or 2-tuple") - if not (type(ext_name) is StringType and + ext_name, build_info = ext + + log.warn(("old-style (ext_name, build_info) tuple found in " + "ext_modules for extension '%s'" + "-- please convert to Extension instance" % ext_name)) + + if not (isinstance(ext_name, str) and extension_name_re.match(ext_name)): raise DistutilsSetupError, \ ("first element of each tuple in 'ext_modules' " "must be the extension name (a string)") - if type(build_info) is not DictionaryType: + if not isinstance(build_info, dict): raise DistutilsSetupError, \ ("second element of each tuple in 'ext_modules' " "must be a dictionary (build info)") @@ -401,11 +394,8 @@ # Easy stuff: one-to-one mapping from dict elements to # instance attributes. - for key in ('include_dirs', - 'library_dirs', - 'libraries', - 'extra_objects', - 'extra_compile_args', + for key in ('include_dirs', 'library_dirs', 'libraries', + 'extra_objects', 'extra_compile_args', 'extra_link_args'): val = build_info.get(key) if val is not None: @@ -424,8 +414,7 @@ ext.define_macros = [] ext.undef_macros = [] for macro in macros: - if not (type(macro) is TupleType and - 1 <= len(macro) <= 2): + if not (isinstance(macro, tuple) and len(macro) in (1, 2)): raise DistutilsSetupError, \ ("'macros' element of build info dict " "must be 1- or 2-tuple") @@ -436,12 +425,7 @@ extensions[i] = ext - # for extensions - - # check_extensions_list () - - - def get_source_files (self): + def get_source_files(self): self.check_extensions_list(self.extensions) filenames = [] @@ -451,9 +435,7 @@ return filenames - - def get_outputs (self): - + def get_outputs(self): # Sanity check the 'extensions' list -- can't assume this is being # done in the same run as a 'build_extensions()' call (in fact, we # can probably assume that it *isn't*!). @@ -469,8 +451,6 @@ self.get_ext_filename(fullname))) return outputs - # get_outputs () - def build_extensions(self): # First, sanity-check the 'extensions' list self.check_extensions_list(self.extensions) Modified: python/trunk/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_build_ext.py (original) +++ python/trunk/Lib/distutils/tests/test_build_ext.py Sun May 10 12:12:08 2009 @@ -9,8 +9,8 @@ from distutils import sysconfig from distutils.tests import support from distutils.extension import Extension -from distutils.errors import UnknownFileError -from distutils.errors import CompileError +from distutils.errors import (UnknownFileError, DistutilsSetupError, + CompileError) import unittest from test import test_support @@ -165,6 +165,130 @@ cmd.ensure_finalized() cmd.run() # should pass + def test_finalize_options(self): + # Make sure Python's include directories (for Python.h, pyconfig.h, + # etc.) are in the include search path. + modules = [Extension('foo', ['xxx'], optional=False)] + dist = Distribution({'name': 'xx', 'ext_modules': modules}) + cmd = build_ext(dist) + cmd.finalize_options() + + from distutils import sysconfig + py_include = sysconfig.get_python_inc() + self.assert_(py_include in cmd.include_dirs) + + plat_py_include = sysconfig.get_python_inc(plat_specific=1) + self.assert_(plat_py_include in cmd.include_dirs) + + # make sure cmd.libraries is turned into a list + # if it's a string + cmd = build_ext(dist) + cmd.libraries = 'my_lib' + cmd.finalize_options() + self.assertEquals(cmd.libraries, ['my_lib']) + + # make sure cmd.library_dirs is turned into a list + # if it's a string + cmd = build_ext(dist) + cmd.library_dirs = 'my_lib_dir' + cmd.finalize_options() + self.assertEquals(cmd.library_dirs, ['my_lib_dir']) + + # make sure rpath is turned into a list + # if it's a list of os.pathsep's paths + cmd = build_ext(dist) + cmd.rpath = os.pathsep.join(['one', 'two']) + cmd.finalize_options() + self.assertEquals(cmd.rpath, ['one', 'two']) + + # XXX more tests to perform for win32 + + # make sure define is turned into 2-tuples + # strings if they are ','-separated strings + cmd = build_ext(dist) + cmd.define = 'one,two' + cmd.finalize_options() + self.assertEquals(cmd.define, [('one', '1'), ('two', '1')]) + + # make sure undef is turned into a list of + # strings if they are ','-separated strings + cmd = build_ext(dist) + cmd.undef = 'one,two' + cmd.finalize_options() + self.assertEquals(cmd.undef, ['one', 'two']) + + # make sure swig_opts is turned into a list + cmd = build_ext(dist) + cmd.swig_opts = None + cmd.finalize_options() + self.assertEquals(cmd.swig_opts, []) + + cmd = build_ext(dist) + cmd.swig_opts = '1 2' + cmd.finalize_options() + self.assertEquals(cmd.swig_opts, ['1', '2']) + + def test_check_extensions_list(self): + dist = Distribution() + cmd = build_ext(dist) + cmd.finalize_options() + + #'extensions' option must be a list of Extension instances + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, 'foo') + + # each element of 'ext_modules' option must be an + # Extension instance or 2-tuple + exts = [('bar', 'foo', 'bar'), 'foo'] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + # first element of each tuple in 'ext_modules' + # must be the extension name (a string) and match + # a python dotted-separated name + exts = [('foo-bar', '')] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + # second element of each tuple in 'ext_modules' + # must be a ary (build info) + exts = [('foo.bar', '')] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + # ok this one should pass + exts = [('foo.bar', {'sources': [''], 'libraries': 'foo', + 'some': 'bar'})] + cmd.check_extensions_list(exts) + ext = exts[0] + self.assert_(isinstance(ext, Extension)) + + # check_extensions_list adds in ext the values passed + # when they are in ('include_dirs', 'library_dirs', 'libraries' + # 'extra_objects', 'extra_compile_args', 'extra_link_args') + self.assertEquals(ext.libraries, 'foo') + self.assert_(not hasattr(ext, 'some')) + + # 'macros' element of build info dict must be 1- or 2-tuple + exts = [('foo.bar', {'sources': [''], 'libraries': 'foo', + 'some': 'bar', 'macros': [('1', '2', '3'), 'foo']})] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + exts[0][1]['macros'] = [('1', '2'), ('3',)] + cmd.check_extensions_list(exts) + self.assertEquals(exts[0].undef_macros, ['3']) + self.assertEquals(exts[0].define_macros, [('1', '2')]) + + def test_get_source_files(self): + modules = [Extension('foo', ['xxx'], optional=False)] + dist = Distribution({'name': 'xx', 'ext_modules': modules}) + cmd = build_ext(dist) + cmd.ensure_finalized() + self.assertEquals(cmd.get_source_files(), ['xxx']) + + def test_get_outputs(self): + modules = [Extension('foo', ['xxx'], optional=False)] + dist = Distribution({'name': 'xx', 'ext_modules': modules}) + cmd = build_ext(dist) + cmd.ensure_finalized() + self.assertEquals(len(cmd.get_outputs()), 1) + def test_suite(): src = _get_source_filename() if not os.path.exists(src): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun May 10 12:12:08 2009 @@ -285,6 +285,9 @@ Library ------- +- Issue #5984: distutils.command.build_ext.check_extensions_list checks were broken + for old-style extensions. + - Issue #5971: StreamHandler.handleError now swallows IOErrors which occur when trying to print a traceback. From python-checkins at python.org Sun May 10 12:24:16 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 12:24:16 +0200 (CEST) Subject: [Python-checkins] r72532 - in python/branches/release26-maint: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090510102416.600801E401A@bag.python.org> Author: tarek.ziade Date: Sun May 10 12:24:16 2009 New Revision: 72532 Log: Merged revisions 72531 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72531 | tarek.ziade | 2009-05-10 12:12:08 +0200 (Sun, 10 May 2009) | 1 line fixed #5984 and improved test coverage ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/command/build_ext.py python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/distutils/command/build_ext.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/command/build_ext.py (original) +++ python/branches/release26-maint/Lib/distutils/command/build_ext.py Sun May 10 12:24:16 2009 @@ -128,7 +128,7 @@ self.swig_opts = None self.user = None - def finalize_options (self): + def finalize_options(self): from distutils import sysconfig self.set_undefined_options('build', @@ -145,15 +145,14 @@ self.extensions = self.distribution.ext_modules - # Make sure Python's include directories (for Python.h, pyconfig.h, # etc.) are in the include search path. py_include = sysconfig.get_python_inc() plat_py_include = sysconfig.get_python_inc(plat_specific=1) if self.include_dirs is None: self.include_dirs = self.distribution.include_dirs or [] - if type(self.include_dirs) is StringType: - self.include_dirs = string.split(self.include_dirs, os.pathsep) + if isinstance(self.include_dirs, str): + self.include_dirs = self.include_dirs.split(os.pathsep) # Put the Python "system" include dir at the end, so that # any local include dirs take precedence. @@ -161,7 +160,7 @@ if plat_py_include != py_include: self.include_dirs.append(plat_py_include) - if type(self.libraries) is StringType: + if isinstance(self.libraries, str): self.libraries = [self.libraries] # Life is easier if we're not forever checking for None, so @@ -252,14 +251,14 @@ # symbols can be separated with commas. if self.define: - defines = string.split(self.define, ',') + defines = self.define.split(',') self.define = map(lambda symbol: (symbol, '1'), defines) # The option for macros to undefine is also a string from the # option parsing, but has to be a list. Multiple symbols can also # be separated with commas here. if self.undef: - self.undef = string.split(self.undef, ',') + self.undef = self.undef.split(',') if self.swig_opts is None: self.swig_opts = [] @@ -276,11 +275,7 @@ self.library_dirs.append(user_lib) self.rpath.append(user_lib) - # finalize_options () - - - def run (self): - + def run(self): from distutils.ccompiler import new_compiler # 'self.extensions', as supplied by setup.py, is a list of @@ -327,7 +322,7 @@ self.compiler.set_include_dirs(self.include_dirs) if self.define is not None: # 'define' option is a list of (name,value) tuples - for (name,value) in self.define: + for (name, value) in self.define: self.compiler.define_macro(name, value) if self.undef is not None: for macro in self.undef: @@ -344,10 +339,7 @@ # Now actually compile and link everything. self.build_extensions() - # run () - - - def check_extensions_list (self, extensions): + def check_extensions_list(self, extensions): """Ensure that the list of extensions (presumably provided as a command option 'extensions') is valid, i.e. it is a list of Extension objects. We also support the old-style list of 2-tuples, @@ -357,32 +349,33 @@ Raise DistutilsSetupError if the structure is invalid anywhere; just returns otherwise. """ - if type(extensions) is not ListType: + if not isinstance(extensions, list): raise DistutilsSetupError, \ "'ext_modules' option must be a list of Extension instances" - for i in range(len(extensions)): - ext = extensions[i] + for i, ext in enumerate(extensions): if isinstance(ext, Extension): continue # OK! (assume type-checking done # by Extension constructor) - (ext_name, build_info) = ext - log.warn(("old-style (ext_name, build_info) tuple found in " - "ext_modules for extension '%s'" - "-- please convert to Extension instance" % ext_name)) - if type(ext) is not TupleType and len(ext) != 2: + if not isinstance(ext, tuple) or len(ext) != 2: raise DistutilsSetupError, \ ("each element of 'ext_modules' option must be an " "Extension instance or 2-tuple") - if not (type(ext_name) is StringType and + ext_name, build_info = ext + + log.warn(("old-style (ext_name, build_info) tuple found in " + "ext_modules for extension '%s'" + "-- please convert to Extension instance" % ext_name)) + + if not (isinstance(ext_name, str) and extension_name_re.match(ext_name)): raise DistutilsSetupError, \ ("first element of each tuple in 'ext_modules' " "must be the extension name (a string)") - if type(build_info) is not DictionaryType: + if not isinstance(build_info, dict): raise DistutilsSetupError, \ ("second element of each tuple in 'ext_modules' " "must be a dictionary (build info)") @@ -393,11 +386,8 @@ # Easy stuff: one-to-one mapping from dict elements to # instance attributes. - for key in ('include_dirs', - 'library_dirs', - 'libraries', - 'extra_objects', - 'extra_compile_args', + for key in ('include_dirs', 'library_dirs', 'libraries', + 'extra_objects', 'extra_compile_args', 'extra_link_args'): val = build_info.get(key) if val is not None: @@ -416,8 +406,7 @@ ext.define_macros = [] ext.undef_macros = [] for macro in macros: - if not (type(macro) is TupleType and - 1 <= len(macro) <= 2): + if not (isinstance(macro, tuple) and len(macro) in (1, 2)): raise DistutilsSetupError, \ ("'macros' element of build info dict " "must be 1- or 2-tuple") @@ -428,12 +417,7 @@ extensions[i] = ext - # for extensions - - # check_extensions_list () - - - def get_source_files (self): + def get_source_files(self): self.check_extensions_list(self.extensions) filenames = [] @@ -443,9 +427,7 @@ return filenames - - def get_outputs (self): - + def get_outputs(self): # Sanity check the 'extensions' list -- can't assume this is being # done in the same run as a 'build_extensions()' call (in fact, we # can probably assume that it *isn't*!). @@ -461,8 +443,6 @@ self.get_ext_filename(fullname))) return outputs - # get_outputs () - def build_extensions(self): # First, sanity-check the 'extensions' list self.check_extensions_list(self.extensions) Modified: python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py Sun May 10 12:24:16 2009 @@ -7,6 +7,8 @@ from distutils.core import Extension, Distribution from distutils.command.build_ext import build_ext from distutils import sysconfig +from distutils.tests import support +from distutils.errors import DistutilsSetupError import unittest from test import test_support @@ -15,10 +17,13 @@ # Don't load the xx module more than once. ALREADY_TESTED = False -class BuildExtTestCase(unittest.TestCase): +class BuildExtTestCase(support.TempdirManager, + support.LoggingSilencer, + unittest.TestCase): def setUp(self): # Create a simple test environment # Note that we're making changes to sys.path + super(BuildExtTestCase, self).setUp() self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_") self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) @@ -74,6 +79,7 @@ sys.path = self.sys_path # XXX on Windows the test leaves a directory with xx module in TEMP shutil.rmtree(self.tmp_dir, os.name == 'nt' or sys.platform == 'cygwin') + super(BuildExtTestCase, self).tearDown() def test_solaris_enable_shared(self): dist = Distribution({'name': 'xx'}) @@ -96,6 +102,130 @@ # make sur we get some lobrary dirs under solaris self.assert_(len(cmd.library_dirs) > 0) + def test_finalize_options(self): + # Make sure Python's include directories (for Python.h, pyconfig.h, + # etc.) are in the include search path. + modules = [Extension('foo', ['xxx'])] + dist = Distribution({'name': 'xx', 'ext_modules': modules}) + cmd = build_ext(dist) + cmd.finalize_options() + + from distutils import sysconfig + py_include = sysconfig.get_python_inc() + self.assert_(py_include in cmd.include_dirs) + + plat_py_include = sysconfig.get_python_inc(plat_specific=1) + self.assert_(plat_py_include in cmd.include_dirs) + + # make sure cmd.libraries is turned into a list + # if it's a string + cmd = build_ext(dist) + cmd.libraries = 'my_lib' + cmd.finalize_options() + self.assertEquals(cmd.libraries, ['my_lib']) + + # make sure cmd.library_dirs is turned into a list + # if it's a string + cmd = build_ext(dist) + cmd.library_dirs = 'my_lib_dir' + cmd.finalize_options() + self.assertEquals(cmd.library_dirs, ['my_lib_dir']) + + # make sure rpath is turned into a list + # if it's a list of os.pathsep's paths + cmd = build_ext(dist) + cmd.rpath = os.pathsep.join(['one', 'two']) + cmd.finalize_options() + self.assertEquals(cmd.rpath, ['one', 'two']) + + # XXX more tests to perform for win32 + + # make sure define is turned into 2-tuples + # strings if they are ','-separated strings + cmd = build_ext(dist) + cmd.define = 'one,two' + cmd.finalize_options() + self.assertEquals(cmd.define, [('one', '1'), ('two', '1')]) + + # make sure undef is turned into a list of + # strings if they are ','-separated strings + cmd = build_ext(dist) + cmd.undef = 'one,two' + cmd.finalize_options() + self.assertEquals(cmd.undef, ['one', 'two']) + + # make sure swig_opts is turned into a list + cmd = build_ext(dist) + cmd.swig_opts = None + cmd.finalize_options() + self.assertEquals(cmd.swig_opts, []) + + cmd = build_ext(dist) + cmd.swig_opts = '1 2' + cmd.finalize_options() + self.assertEquals(cmd.swig_opts, ['1', '2']) + + def test_check_extensions_list(self): + dist = Distribution() + cmd = build_ext(dist) + cmd.finalize_options() + + #'extensions' option must be a list of Extension instances + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, 'foo') + + # each element of 'ext_modules' option must be an + # Extension instance or 2-tuple + exts = [('bar', 'foo', 'bar'), 'foo'] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + # first element of each tuple in 'ext_modules' + # must be the extension name (a string) and match + # a python dotted-separated name + exts = [('foo-bar', '')] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + # second element of each tuple in 'ext_modules' + # must be a ary (build info) + exts = [('foo.bar', '')] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + # ok this one should pass + exts = [('foo.bar', {'sources': [''], 'libraries': 'foo', + 'some': 'bar'})] + cmd.check_extensions_list(exts) + ext = exts[0] + self.assert_(isinstance(ext, Extension)) + + # check_extensions_list adds in ext the values passed + # when they are in ('include_dirs', 'library_dirs', 'libraries' + # 'extra_objects', 'extra_compile_args', 'extra_link_args') + self.assertEquals(ext.libraries, 'foo') + self.assert_(not hasattr(ext, 'some')) + + # 'macros' element of build info dict must be 1- or 2-tuple + exts = [('foo.bar', {'sources': [''], 'libraries': 'foo', + 'some': 'bar', 'macros': [('1', '2', '3'), 'foo']})] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + exts[0][1]['macros'] = [('1', '2'), ('3',)] + cmd.check_extensions_list(exts) + self.assertEquals(exts[0].undef_macros, ['3']) + self.assertEquals(exts[0].define_macros, [('1', '2')]) + + def test_get_source_files(self): + modules = [Extension('foo', ['xxx'])] + dist = Distribution({'name': 'xx', 'ext_modules': modules}) + cmd = build_ext(dist) + cmd.ensure_finalized() + self.assertEquals(cmd.get_source_files(), ['xxx']) + + def test_get_outputs(self): + modules = [Extension('foo', ['xxx'])] + dist = Distribution({'name': 'xx', 'ext_modules': modules}) + cmd = build_ext(dist) + cmd.ensure_finalized() + self.assertEquals(len(cmd.get_outputs()), 1) + def test_suite(): if not sysconfig.python_build: if test_support.verbose: Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sun May 10 12:24:16 2009 @@ -187,6 +187,9 @@ Library ------- +- Issue #5984: distutils.command.build_ext.check_extensions_list checks were broken + for old-style extensions. + - Issue #5854: Updated __all__ to include some missing names and remove some names which should not be exported. From python-checkins at python.org Sun May 10 12:34:03 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 12:34:03 +0200 (CEST) Subject: [Python-checkins] r72533 - in python/branches/py3k: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090510103403.06F431E401A@bag.python.org> Author: tarek.ziade Date: Sun May 10 12:34:01 2009 New Revision: 72533 Log: Merged revisions 72531 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72531 | tarek.ziade | 2009-05-10 12:12:08 +0200 (Sun, 10 May 2009) | 1 line fixed #5984 and improved test coverage ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/command/build_ext.py python/branches/py3k/Lib/distutils/tests/test_build_ext.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/distutils/command/build_ext.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/build_ext.py (original) +++ python/branches/py3k/Lib/distutils/command/build_ext.py Sun May 10 12:34:01 2009 @@ -329,7 +329,7 @@ self.compiler.set_include_dirs(self.include_dirs) if self.define is not None: # 'define' option is a list of (name,value) tuples - for (name,value) in self.define: + for (name, value) in self.define: self.compiler.define_macro(name, value) if self.undef is not None: for macro in self.undef: @@ -365,22 +365,24 @@ continue # OK! (assume type-checking done # by Extension constructor) - (ext_name, build_info) = ext - log.warn("old-style (ext_name, build_info) tuple found in " - "ext_modules for extension '%s'" - "-- please convert to Extension instance" % ext_name) - if not isinstance(ext, tuple) and len(ext) != 2: + if not isinstance(ext, tuple) or len(ext) != 2: raise DistutilsSetupError( "each element of 'ext_modules' option must be an " "Extension instance or 2-tuple") + ext_name, build_info = ext + + log.warn(("old-style (ext_name, build_info) tuple found in " + "ext_modules for extension '%s'" + "-- please convert to Extension instance" % ext_name)) + if not (isinstance(ext_name, str) and extension_name_re.match(ext_name)): raise DistutilsSetupError( "first element of each tuple in 'ext_modules' " "must be the extension name (a string)") - if not instance(build_info, DictionaryType): + if not isinstance(build_info, dict): raise DistutilsSetupError( "second element of each tuple in 'ext_modules' " "must be a dictionary (build info)") @@ -391,11 +393,8 @@ # Easy stuff: one-to-one mapping from dict elements to # instance attributes. - for key in ('include_dirs', - 'library_dirs', - 'libraries', - 'extra_objects', - 'extra_compile_args', + for key in ('include_dirs', 'library_dirs', 'libraries', + 'extra_objects', 'extra_compile_args', 'extra_link_args'): val = build_info.get(key) if val is not None: Modified: python/branches/py3k/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_build_ext.py Sun May 10 12:34:01 2009 @@ -10,8 +10,8 @@ from distutils.tests.support import TempdirManager from distutils.tests.support import LoggingSilencer from distutils.extension import Extension -from distutils.errors import UnknownFileError -from distutils.errors import CompileError +from distutils.errors import (UnknownFileError, DistutilsSetupError, + CompileError) import unittest from test import support @@ -165,6 +165,130 @@ cmd.ensure_finalized() cmd.run() # should pass + def test_finalize_options(self): + # Make sure Python's include directories (for Python.h, pyconfig.h, + # etc.) are in the include search path. + modules = [Extension('foo', ['xxx'], optional=False)] + dist = Distribution({'name': 'xx', 'ext_modules': modules}) + cmd = build_ext(dist) + cmd.finalize_options() + + from distutils import sysconfig + py_include = sysconfig.get_python_inc() + self.assert_(py_include in cmd.include_dirs) + + plat_py_include = sysconfig.get_python_inc(plat_specific=1) + self.assert_(plat_py_include in cmd.include_dirs) + + # make sure cmd.libraries is turned into a list + # if it's a string + cmd = build_ext(dist) + cmd.libraries = 'my_lib' + cmd.finalize_options() + self.assertEquals(cmd.libraries, ['my_lib']) + + # make sure cmd.library_dirs is turned into a list + # if it's a string + cmd = build_ext(dist) + cmd.library_dirs = 'my_lib_dir' + cmd.finalize_options() + self.assertEquals(cmd.library_dirs, ['my_lib_dir']) + + # make sure rpath is turned into a list + # if it's a list of os.pathsep's paths + cmd = build_ext(dist) + cmd.rpath = os.pathsep.join(['one', 'two']) + cmd.finalize_options() + self.assertEquals(cmd.rpath, ['one', 'two']) + + # XXX more tests to perform for win32 + + # make sure define is turned into 2-tuples + # strings if they are ','-separated strings + cmd = build_ext(dist) + cmd.define = 'one,two' + cmd.finalize_options() + self.assertEquals(cmd.define, [('one', '1'), ('two', '1')]) + + # make sure undef is turned into a list of + # strings if they are ','-separated strings + cmd = build_ext(dist) + cmd.undef = 'one,two' + cmd.finalize_options() + self.assertEquals(cmd.undef, ['one', 'two']) + + # make sure swig_opts is turned into a list + cmd = build_ext(dist) + cmd.swig_opts = None + cmd.finalize_options() + self.assertEquals(cmd.swig_opts, []) + + cmd = build_ext(dist) + cmd.swig_opts = '1 2' + cmd.finalize_options() + self.assertEquals(cmd.swig_opts, ['1', '2']) + + def test_check_extensions_list(self): + dist = Distribution() + cmd = build_ext(dist) + cmd.finalize_options() + + #'extensions' option must be a list of Extension instances + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, 'foo') + + # each element of 'ext_modules' option must be an + # Extension instance or 2-tuple + exts = [('bar', 'foo', 'bar'), 'foo'] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + # first element of each tuple in 'ext_modules' + # must be the extension name (a string) and match + # a python dotted-separated name + exts = [('foo-bar', '')] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + # second element of each tuple in 'ext_modules' + # must be a ary (build info) + exts = [('foo.bar', '')] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + # ok this one should pass + exts = [('foo.bar', {'sources': [''], 'libraries': 'foo', + 'some': 'bar'})] + cmd.check_extensions_list(exts) + ext = exts[0] + self.assert_(isinstance(ext, Extension)) + + # check_extensions_list adds in ext the values passed + # when they are in ('include_dirs', 'library_dirs', 'libraries' + # 'extra_objects', 'extra_compile_args', 'extra_link_args') + self.assertEquals(ext.libraries, 'foo') + self.assert_(not hasattr(ext, 'some')) + + # 'macros' element of build info dict must be 1- or 2-tuple + exts = [('foo.bar', {'sources': [''], 'libraries': 'foo', + 'some': 'bar', 'macros': [('1', '2', '3'), 'foo']})] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + exts[0][1]['macros'] = [('1', '2'), ('3',)] + cmd.check_extensions_list(exts) + self.assertEquals(exts[0].undef_macros, ['3']) + self.assertEquals(exts[0].define_macros, [('1', '2')]) + + def test_get_source_files(self): + modules = [Extension('foo', ['xxx'], optional=False)] + dist = Distribution({'name': 'xx', 'ext_modules': modules}) + cmd = build_ext(dist) + cmd.ensure_finalized() + self.assertEquals(cmd.get_source_files(), ['xxx']) + + def test_get_outputs(self): + modules = [Extension('foo', ['xxx'], optional=False)] + dist = Distribution({'name': 'xx', 'ext_modules': modules}) + cmd = build_ext(dist) + cmd.ensure_finalized() + self.assertEquals(len(cmd.get_outputs()), 1) + def test_suite(): src = _get_source_filename() if not os.path.exists(src): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun May 10 12:34:01 2009 @@ -581,6 +581,9 @@ Library ------- +- Issue #5984: distutils.command.build_ext.check_extensions_list checks were broken + for old-style extensions. + - Issue #5976: Fixed Distutils test_check_environ. - Issue #5941: Distutils build_clib command was not working anymore because From python-checkins at python.org Sun May 10 12:40:27 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 12:40:27 +0200 (CEST) Subject: [Python-checkins] r72534 - in python/branches/release30-maint: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090510104027.A994D1E401A@bag.python.org> Author: tarek.ziade Date: Sun May 10 12:40:27 2009 New Revision: 72534 Log: Merged revisions 72533 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72533 | tarek.ziade | 2009-05-10 12:34:01 +0200 (Sun, 10 May 2009) | 9 lines Merged revisions 72531 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72531 | tarek.ziade | 2009-05-10 12:12:08 +0200 (Sun, 10 May 2009) | 1 line fixed #5984 and improved test coverage ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/command/build_ext.py python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/distutils/command/build_ext.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/command/build_ext.py (original) +++ python/branches/release30-maint/Lib/distutils/command/build_ext.py Sun May 10 12:40:27 2009 @@ -319,7 +319,7 @@ self.compiler.set_include_dirs(self.include_dirs) if self.define is not None: # 'define' option is a list of (name,value) tuples - for (name,value) in self.define: + for (name, value) in self.define: self.compiler.define_macro(name, value) if self.undef is not None: for macro in self.undef: @@ -355,22 +355,24 @@ continue # OK! (assume type-checking done # by Extension constructor) - (ext_name, build_info) = ext - log.warn("old-style (ext_name, build_info) tuple found in " - "ext_modules for extension '%s'" - "-- please convert to Extension instance" % ext_name) - if not isinstance(ext, tuple) and len(ext) != 2: + if not isinstance(ext, tuple) or len(ext) != 2: raise DistutilsSetupError( "each element of 'ext_modules' option must be an " "Extension instance or 2-tuple") + ext_name, build_info = ext + + log.warn(("old-style (ext_name, build_info) tuple found in " + "ext_modules for extension '%s'" + "-- please convert to Extension instance" % ext_name)) + if not (isinstance(ext_name, str) and extension_name_re.match(ext_name)): raise DistutilsSetupError( "first element of each tuple in 'ext_modules' " "must be the extension name (a string)") - if not instance(build_info, DictionaryType): + if not isinstance(build_info, dict): raise DistutilsSetupError( "second element of each tuple in 'ext_modules' " "must be a dictionary (build info)") @@ -381,11 +383,8 @@ # Easy stuff: one-to-one mapping from dict elements to # instance attributes. - for key in ('include_dirs', - 'library_dirs', - 'libraries', - 'extra_objects', - 'extra_compile_args', + for key in ('include_dirs', 'library_dirs', 'libraries', + 'extra_objects', 'extra_compile_args', 'extra_link_args'): val = build_info.get(key) if val is not None: Modified: python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py Sun May 10 12:40:27 2009 @@ -7,6 +7,9 @@ from distutils.core import Extension, Distribution from distutils.command.build_ext import build_ext from distutils import sysconfig +from distutils.tests.support import TempdirManager +from distutils.tests.support import LoggingSilencer +from distutils.errors import DistutilsSetupError import unittest from test import support @@ -15,10 +18,13 @@ # Don't load the xx module more than once. ALREADY_TESTED = False -class BuildExtTestCase(unittest.TestCase): +class BuildExtTestCase(TempdirManager, + LoggingSilencer, + unittest.TestCase): def setUp(self): # Create a simple test environment # Note that we're making changes to sys.path + super(BuildExtTestCase, self).setUp() self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_") self.sys_path = sys.path[:] sys.path.append(self.tmp_dir) @@ -74,6 +80,7 @@ sys.path = self.sys_path # XXX on Windows the test leaves a directory with xx module in TEMP shutil.rmtree(self.tmp_dir, os.name == 'nt' or sys.platform == 'cygwin') + super(BuildExtTestCase, self).tearDown() def test_solaris_enable_shared(self): dist = Distribution({'name': 'xx'}) @@ -96,6 +103,130 @@ # make sur we get some lobrary dirs under solaris self.assert_(len(cmd.library_dirs) > 0) + def test_finalize_options(self): + # Make sure Python's include directories (for Python.h, pyconfig.h, + # etc.) are in the include search path. + modules = [Extension('foo', ['xxx'])] + dist = Distribution({'name': 'xx', 'ext_modules': modules}) + cmd = build_ext(dist) + cmd.finalize_options() + + from distutils import sysconfig + py_include = sysconfig.get_python_inc() + self.assert_(py_include in cmd.include_dirs) + + plat_py_include = sysconfig.get_python_inc(plat_specific=1) + self.assert_(plat_py_include in cmd.include_dirs) + + # make sure cmd.libraries is turned into a list + # if it's a string + cmd = build_ext(dist) + cmd.libraries = 'my_lib' + cmd.finalize_options() + self.assertEquals(cmd.libraries, ['my_lib']) + + # make sure cmd.library_dirs is turned into a list + # if it's a string + cmd = build_ext(dist) + cmd.library_dirs = 'my_lib_dir' + cmd.finalize_options() + self.assertEquals(cmd.library_dirs, ['my_lib_dir']) + + # make sure rpath is turned into a list + # if it's a list of os.pathsep's paths + cmd = build_ext(dist) + cmd.rpath = os.pathsep.join(['one', 'two']) + cmd.finalize_options() + self.assertEquals(cmd.rpath, ['one', 'two']) + + # XXX more tests to perform for win32 + + # make sure define is turned into 2-tuples + # strings if they are ','-separated strings + cmd = build_ext(dist) + cmd.define = 'one,two' + cmd.finalize_options() + self.assertEquals(cmd.define, [('one', '1'), ('two', '1')]) + + # make sure undef is turned into a list of + # strings if they are ','-separated strings + cmd = build_ext(dist) + cmd.undef = 'one,two' + cmd.finalize_options() + self.assertEquals(cmd.undef, ['one', 'two']) + + # make sure swig_opts is turned into a list + cmd = build_ext(dist) + cmd.swig_opts = None + cmd.finalize_options() + self.assertEquals(cmd.swig_opts, []) + + cmd = build_ext(dist) + cmd.swig_opts = '1 2' + cmd.finalize_options() + self.assertEquals(cmd.swig_opts, ['1', '2']) + + def test_check_extensions_list(self): + dist = Distribution() + cmd = build_ext(dist) + cmd.finalize_options() + + #'extensions' option must be a list of Extension instances + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, 'foo') + + # each element of 'ext_modules' option must be an + # Extension instance or 2-tuple + exts = [('bar', 'foo', 'bar'), 'foo'] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + # first element of each tuple in 'ext_modules' + # must be the extension name (a string) and match + # a python dotted-separated name + exts = [('foo-bar', '')] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + # second element of each tuple in 'ext_modules' + # must be a ary (build info) + exts = [('foo.bar', '')] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + # ok this one should pass + exts = [('foo.bar', {'sources': [''], 'libraries': 'foo', + 'some': 'bar'})] + cmd.check_extensions_list(exts) + ext = exts[0] + self.assert_(isinstance(ext, Extension)) + + # check_extensions_list adds in ext the values passed + # when they are in ('include_dirs', 'library_dirs', 'libraries' + # 'extra_objects', 'extra_compile_args', 'extra_link_args') + self.assertEquals(ext.libraries, 'foo') + self.assert_(not hasattr(ext, 'some')) + + # 'macros' element of build info dict must be 1- or 2-tuple + exts = [('foo.bar', {'sources': [''], 'libraries': 'foo', + 'some': 'bar', 'macros': [('1', '2', '3'), 'foo']})] + self.assertRaises(DistutilsSetupError, cmd.check_extensions_list, exts) + + exts[0][1]['macros'] = [('1', '2'), ('3',)] + cmd.check_extensions_list(exts) + self.assertEquals(exts[0].undef_macros, ['3']) + self.assertEquals(exts[0].define_macros, [('1', '2')]) + + def test_get_source_files(self): + modules = [Extension('foo', ['xxx'])] + dist = Distribution({'name': 'xx', 'ext_modules': modules}) + cmd = build_ext(dist) + cmd.ensure_finalized() + self.assertEquals(cmd.get_source_files(), ['xxx']) + + def test_get_outputs(self): + modules = [Extension('foo', ['xxx'])] + dist = Distribution({'name': 'xx', 'ext_modules': modules}) + cmd = build_ext(dist) + cmd.ensure_finalized() + self.assertEquals(len(cmd.get_outputs()), 1) + def test_suite(): if not sysconfig.python_build: if support.verbose: Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sun May 10 12:40:27 2009 @@ -278,6 +278,9 @@ Library ------- +- Issue #5984: distutils.command.build_ext.check_extensions_list checks were broken + for old-style extensions. + - Issue #5810: Fixed Distutils test_build_scripts so it uses sysconfig.get_config_vars. From python-checkins at python.org Sun May 10 13:42:47 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 13:42:47 +0200 (CEST) Subject: [Python-checkins] r72535 - in python/trunk/Lib/distutils: command/install_lib.py tests/test_install_lib.py Message-ID: <20090510114249.209231E401A@bag.python.org> Author: tarek.ziade Date: Sun May 10 13:42:46 2009 New Revision: 72535 Log: Added tests form install_lib and pep8-fied the module Added: python/trunk/Lib/distutils/tests/test_install_lib.py (contents, props changed) Modified: python/trunk/Lib/distutils/command/install_lib.py Modified: python/trunk/Lib/distutils/command/install_lib.py ============================================================================== --- python/trunk/Lib/distutils/command/install_lib.py (original) +++ python/trunk/Lib/distutils/command/install_lib.py Sun May 10 13:42:46 2009 @@ -6,7 +6,6 @@ __revision__ = "$Id$" import os -from types import IntType from distutils.core import Command from distutils.errors import DistutilsOptionError @@ -17,7 +16,7 @@ else: PYTHON_SOURCE_EXTENSION = ".py" -class install_lib (Command): +class install_lib(Command): description = "install all Python modules (extensions and pure Python)" @@ -51,8 +50,7 @@ boolean_options = ['force', 'compile', 'skip-build'] negative_opt = {'no-compile' : 'compile'} - - def initialize_options (self): + def initialize_options(self): # let the 'install' command dictate our installation directory self.install_dir = None self.build_dir = None @@ -61,8 +59,7 @@ self.optimize = None self.skip_build = None - def finalize_options (self): - + def finalize_options(self): # Get all the information we need to install pure Python modules # from the umbrella 'install' command -- build (source) directory, # install (target) directory, and whether to compile .py files. @@ -80,15 +77,14 @@ if self.optimize is None: self.optimize = 0 - if type(self.optimize) is not IntType: + if not isinstance(self.optimize, int): try: self.optimize = int(self.optimize) - assert 0 <= self.optimize <= 2 + assert self.optimize in (0, 1, 2) except (ValueError, AssertionError): raise DistutilsOptionError, "optimize must be 0, 1, or 2" - def run (self): - + def run(self): # Make sure we have built everything we need first self.build() @@ -101,20 +97,17 @@ if outfiles is not None and self.distribution.has_pure_modules(): self.byte_compile(outfiles) - # run () - - # -- Top-level worker functions ------------------------------------ # (called from 'run()') - def build (self): + def build(self): if not self.skip_build: if self.distribution.has_pure_modules(): self.run_command('build_py') if self.distribution.has_ext_modules(): self.run_command('build_ext') - def install (self): + def install(self): if os.path.isdir(self.build_dir): outfiles = self.copy_tree(self.build_dir, self.install_dir) else: @@ -123,7 +116,7 @@ return return outfiles - def byte_compile (self, files): + def byte_compile(self, files): from distutils.util import byte_compile # Get the "--root" directory supplied to the "install" command, @@ -144,8 +137,7 @@ # -- Utility methods ----------------------------------------------- - def _mutate_outputs (self, has_any, build_cmd, cmd_option, output_dir): - + def _mutate_outputs(self, has_any, build_cmd, cmd_option, output_dir): if not has_any: return [] @@ -160,9 +152,7 @@ return outputs - # _mutate_outputs () - - def _bytecode_filenames (self, py_filenames): + def _bytecode_filenames(self, py_filenames): bytecode_files = [] for py_file in py_filenames: # Since build_py handles package data installation, the @@ -182,7 +172,7 @@ # -- External interface -------------------------------------------- # (called by outsiders) - def get_outputs (self): + def get_outputs(self): """Return the list of files that would be installed if this command were actually run. Not affected by the "dry-run" flag or whether modules have actually been built yet. @@ -203,9 +193,7 @@ return pure_outputs + bytecode_outputs + ext_outputs - # get_outputs () - - def get_inputs (self): + def get_inputs(self): """Get the list of files that are input to this command, ie. the files that get installed as they are named in the build tree. The files in this list correspond one-to-one to the output @@ -222,5 +210,3 @@ inputs.extend(build_ext.get_outputs()) return inputs - -# class install_lib Added: python/trunk/Lib/distutils/tests/test_install_lib.py ============================================================================== --- (empty file) +++ python/trunk/Lib/distutils/tests/test_install_lib.py Sun May 10 13:42:46 2009 @@ -0,0 +1,84 @@ +"""Tests for distutils.command.install_data.""" +import sys +import os +import unittest + +from distutils.command.install_lib import install_lib +from distutils.extension import Extension +from distutils.tests import support +from distutils.errors import DistutilsOptionError + +class InstallLibTestCase(support.TempdirManager, + support.LoggingSilencer, + unittest.TestCase): + + + def test_finalize_options(self): + pkg_dir, dist = self.create_dist() + cmd = install_lib(dist) + + cmd.finalize_options() + self.assertEquals(cmd.compile, 1) + self.assertEquals(cmd.optimize, 0) + + # optimize must be 0, 1, or 2 + cmd.optimize = 'foo' + self.assertRaises(DistutilsOptionError, cmd.finalize_options) + cmd.optimize = '4' + self.assertRaises(DistutilsOptionError, cmd.finalize_options) + + cmd.optimize = '2' + cmd.finalize_options() + self.assertEquals(cmd.optimize, 2) + + def test_byte_compile(self): + pkg_dir, dist = self.create_dist() + cmd = install_lib(dist) + cmd.compile = cmd.optimize = 1 + + f = os.path.join(pkg_dir, 'foo.py') + self.write_file(f, '# python file') + cmd.byte_compile([f]) + self.assert_(os.path.exists(os.path.join(pkg_dir, 'foo.pyc'))) + self.assert_(os.path.exists(os.path.join(pkg_dir, 'foo.pyo'))) + + def test_get_outputs(self): + pkg_dir, dist = self.create_dist() + cmd = install_lib(dist) + + # setting up a dist environment + cmd.compile = cmd.optimize = 1 + cmd.install_dir = pkg_dir + f = os.path.join(pkg_dir, 'foo.py') + self.write_file(f, '# python file') + cmd.distribution.py_modules = [pkg_dir] + cmd.distribution.ext_modules = [Extension('foo', ['xxx'])] + cmd.distribution.packages = [pkg_dir] + cmd.distribution.script_name = 'setup.py' + + # get_output should return 4 elements + self.assertEquals(len(cmd.get_outputs()), 4) + + def test_get_inputs(self): + pkg_dir, dist = self.create_dist() + cmd = install_lib(dist) + + # setting up a dist environment + cmd.compile = cmd.optimize = 1 + cmd.install_dir = pkg_dir + f = os.path.join(pkg_dir, 'foo.py') + self.write_file(f, '# python file') + cmd.distribution.py_modules = [pkg_dir] + cmd.distribution.ext_modules = [Extension('foo', ['xxx'])] + cmd.distribution.packages = [pkg_dir] + cmd.distribution.script_name = 'setup.py' + + # get_input should return 2 elements + self.assertEquals(len(cmd.get_inputs()), 2) + + +def test_suite(): + return unittest.makeSuite(InstallLibTestCase) + +if __name__ == "__main__": + unittest.main(defaultTest="test_suite") From python-checkins at python.org Sun May 10 13:43:45 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 13:43:45 +0200 (CEST) Subject: [Python-checkins] r72536 - python/branches/release26-maint Message-ID: <20090510114345.DA77E1E401A@bag.python.org> Author: tarek.ziade Date: Sun May 10 13:43:45 2009 New Revision: 72536 Log: Blocked revisions 72535 via svnmerge ........ r72535 | tarek.ziade | 2009-05-10 13:42:46 +0200 (Sun, 10 May 2009) | 1 line Added tests form install_lib and pep8-fied the module ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun May 10 13:45:41 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 13:45:41 +0200 (CEST) Subject: [Python-checkins] r72537 - in python/branches/py3k: Lib/distutils/command/install_lib.py Lib/distutils/tests/test_install_lib.py Message-ID: <20090510114541.923D21E4015@bag.python.org> Author: tarek.ziade Date: Sun May 10 13:45:41 2009 New Revision: 72537 Log: Merged revisions 72535 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72535 | tarek.ziade | 2009-05-10 13:42:46 +0200 (Sun, 10 May 2009) | 1 line Added tests form install_lib and pep8-fied the module ........ Added: python/branches/py3k/Lib/distutils/tests/test_install_lib.py - copied unchanged from r72535, /python/trunk/Lib/distutils/tests/test_install_lib.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/command/install_lib.py Modified: python/branches/py3k/Lib/distutils/command/install_lib.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/install_lib.py (original) +++ python/branches/py3k/Lib/distutils/command/install_lib.py Sun May 10 13:45:41 2009 @@ -5,7 +5,7 @@ __revision__ = "$Id$" -import sys, os +import os from distutils.core import Command from distutils.errors import DistutilsOptionError @@ -57,7 +57,6 @@ self.skip_build = None def finalize_options(self): - # Get all the information we need to install pure Python modules # from the umbrella 'install' command -- build (source) directory, # install (target) directory, and whether to compile .py files. @@ -78,7 +77,7 @@ if not isinstance(self.optimize, int): try: self.optimize = int(self.optimize) - assert 0 <= self.optimize <= 2 + assert self.optimize in (0, 1, 2) except (ValueError, AssertionError): raise DistutilsOptionError("optimize must be 0, 1, or 2") @@ -95,7 +94,6 @@ if outfiles is not None and self.distribution.has_pure_modules(): self.byte_compile(outfiles) - # -- Top-level worker functions ------------------------------------ # (called from 'run()') From python-checkins at python.org Sun May 10 13:46:59 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 13:46:59 +0200 (CEST) Subject: [Python-checkins] r72538 - python/branches/release30-maint Message-ID: <20090510114659.E73661E4015@bag.python.org> Author: tarek.ziade Date: Sun May 10 13:46:59 2009 New Revision: 72538 Log: Blocked revisions 72537 via svnmerge ................ r72537 | tarek.ziade | 2009-05-10 13:45:41 +0200 (Sun, 10 May 2009) | 9 lines Merged revisions 72535 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72535 | tarek.ziade | 2009-05-10 13:42:46 +0200 (Sun, 10 May 2009) | 1 line Added tests form install_lib and pep8-fied the module ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun May 10 13:59:30 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 13:59:30 +0200 (CEST) Subject: [Python-checkins] r72539 - in python/trunk/Lib/distutils/tests: support.py test_sysconfig.py Message-ID: <20090510115930.EFDBE1E4015@bag.python.org> Author: tarek.ziade Date: Sun May 10 13:59:30 2009 New Revision: 72539 Log: refactored test_sysconfig so it uses test.test_support.EnvironmentVarGuard Modified: python/trunk/Lib/distutils/tests/support.py python/trunk/Lib/distutils/tests/test_sysconfig.py Modified: python/trunk/Lib/distutils/tests/support.py ============================================================================== --- python/trunk/Lib/distutils/tests/support.py (original) +++ python/trunk/Lib/distutils/tests/support.py Sun May 10 13:59:30 2009 @@ -5,6 +5,7 @@ from distutils import log from distutils.core import Distribution +from test.test_support import EnvironmentVarGuard class LoggingSilencer(object): @@ -82,3 +83,13 @@ def ensure_finalized(self): pass + +class EnvironGuard(object): + + def setUp(self): + super(EnvironGuard, self).setUp() + self.environ = EnvironmentVarGuard() + + def tearDown(self): + self.environ.__exit__() + super(EnvironGuard, self).tearDown() Modified: python/trunk/Lib/distutils/tests/test_sysconfig.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_sysconfig.py (original) +++ python/trunk/Lib/distutils/tests/test_sysconfig.py Sun May 10 13:59:30 2009 @@ -1,25 +1,14 @@ -"""Tests for distutils.dist.""" - -from distutils import sysconfig -from distutils.ccompiler import get_default_compiler - +"""Tests for distutils.sysconfig.""" import os import unittest +from distutils import sysconfig +from distutils.ccompiler import get_default_compiler +from distutils.tests import support from test.test_support import TESTFN -class SysconfigTestCase(unittest.TestCase): - - def setUp(self): - self.old_flags = [('AR', os.environ.get('AR')), - ('ARFLAGS', os.environ.get('ARFLAGS'))] - - def tearDown(self): - for name, value in self.old_flags: - if value is not None: - os.environ[name] = value - elif name in os.environ: - del os.environ[name] +class SysconfigTestCase(support.EnvironGuard, + unittest.TestCase): def test_get_config_h_filename(self): config_h = sysconfig.get_config_h_filename() @@ -53,8 +42,8 @@ if get_default_compiler() != 'unix': return - os.environ['AR'] = 'my_ar' - os.environ['ARFLAGS'] = '-arflags' + self.environ['AR'] = 'my_ar' + self.environ['ARFLAGS'] = '-arflags' # make sure AR gets caught class compiler: From python-checkins at python.org Sun May 10 14:00:14 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 14:00:14 +0200 (CEST) Subject: [Python-checkins] r72540 - python/branches/release26-maint Message-ID: <20090510120014.317D81E4015@bag.python.org> Author: tarek.ziade Date: Sun May 10 14:00:14 2009 New Revision: 72540 Log: Blocked revisions 72539 via svnmerge ........ r72539 | tarek.ziade | 2009-05-10 13:59:30 +0200 (Sun, 10 May 2009) | 1 line refactored test_sysconfig so it uses test.test_support.EnvironmentVarGuard ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun May 10 14:02:36 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 14:02:36 +0200 (CEST) Subject: [Python-checkins] r72541 - in python/branches/py3k: Lib/distutils/tests/support.py Lib/distutils/tests/test_sysconfig.py Message-ID: <20090510120236.036BD1E4015@bag.python.org> Author: tarek.ziade Date: Sun May 10 14:02:35 2009 New Revision: 72541 Log: Merged revisions 72539 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72539 | tarek.ziade | 2009-05-10 13:59:30 +0200 (Sun, 10 May 2009) | 1 line refactored test_sysconfig so it uses test.test_support.EnvironmentVarGuard ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/support.py python/branches/py3k/Lib/distutils/tests/test_sysconfig.py Modified: python/branches/py3k/Lib/distutils/tests/support.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/support.py (original) +++ python/branches/py3k/Lib/distutils/tests/support.py Sun May 10 14:02:35 2009 @@ -5,6 +5,7 @@ from distutils import log from distutils.core import Distribution +from test.support import EnvironmentVarGuard class LoggingSilencer(object): @@ -82,3 +83,13 @@ def ensure_finalized(self): pass + +class EnvironGuard(object): + + def setUp(self): + super(EnvironGuard, self).setUp() + self.environ = EnvironmentVarGuard() + + def tearDown(self): + self.environ.__exit__() + super(EnvironGuard, self).tearDown() Modified: python/branches/py3k/Lib/distutils/tests/test_sysconfig.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_sysconfig.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_sysconfig.py Sun May 10 14:02:35 2009 @@ -1,25 +1,14 @@ -"""Tests for distutils.dist.""" - -from distutils import sysconfig -from distutils.ccompiler import get_default_compiler - +"""Tests for distutils.sysconfig.""" import os import unittest +from distutils import sysconfig +from distutils.ccompiler import get_default_compiler +from distutils.tests import support from test.support import TESTFN -class SysconfigTestCase(unittest.TestCase): - - def setUp(self): - self.old_flags = [('AR', os.environ.get('AR')), - ('ARFLAGS', os.environ.get('ARFLAGS'))] - - def tearDown(self): - for name, value in self.old_flags: - if value is not None: - os.environ[name] = value - elif name in os.environ: - del os.environ[name] +class SysconfigTestCase(support.EnvironGuard, + unittest.TestCase): def test_get_config_h_filename(self): config_h = sysconfig.get_config_h_filename() @@ -53,8 +42,8 @@ if get_default_compiler() != 'unix': return - os.environ['AR'] = 'my_ar' - os.environ['ARFLAGS'] = '-arflags' + self.environ['AR'] = 'my_ar' + self.environ['ARFLAGS'] = '-arflags' # make sure AR gets caught class compiler: From python-checkins at python.org Sun May 10 14:04:07 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 14:04:07 +0200 (CEST) Subject: [Python-checkins] r72542 - python/branches/release30-maint Message-ID: <20090510120407.7BBB91E4015@bag.python.org> Author: tarek.ziade Date: Sun May 10 14:04:07 2009 New Revision: 72542 Log: Blocked revisions 72541 via svnmerge ................ r72541 | tarek.ziade | 2009-05-10 14:02:35 +0200 (Sun, 10 May 2009) | 9 lines Merged revisions 72539 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72539 | tarek.ziade | 2009-05-10 13:59:30 +0200 (Sun, 10 May 2009) | 1 line refactored test_sysconfig so it uses test.test_support.EnvironmentVarGuard ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Sun May 10 14:06:42 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 10 May 2009 12:06:42 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090510120643.05D0D1E401B@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1297 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_distutils ====================================================================== FAIL: test_get_outputs (distutils.tests.test_install_lib.InstallLibTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/distutils/tests/test_install_lib.py", line 60, in test_get_outputs self.assertEquals(len(cmd.get_outputs()), 4) AssertionError: 2 != 4 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun May 10 14:08:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 10 May 2009 12:08:27 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090510120827.597F11E4015@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/4982 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_distutils ====================================================================== FAIL: test_get_outputs (distutils.tests.test_install_lib.InstallLibTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/distutils/tests/test_install_lib.py", line 60, in test_get_outputs self.assertEquals(len(cmd.get_outputs()), 4) AssertionError: 2 != 4 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun May 10 14:17:31 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 14:17:31 +0200 (CEST) Subject: [Python-checkins] r72543 - in python/trunk/Lib/distutils/tests: test_config.py test_dist.py test_util.py Message-ID: <20090510121731.3D1031E401A@bag.python.org> Author: tarek.ziade Date: Sun May 10 14:17:30 2009 New Revision: 72543 Log: now using EnvironGuard everywhere Modified: python/trunk/Lib/distutils/tests/test_config.py python/trunk/Lib/distutils/tests/test_dist.py python/trunk/Lib/distutils/tests/test_util.py Modified: python/trunk/Lib/distutils/tests/test_config.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_config.py (original) +++ python/trunk/Lib/distutils/tests/test_config.py Sun May 10 14:17:30 2009 @@ -49,18 +49,14 @@ class PyPIRCCommandTestCase(support.TempdirManager, support.LoggingSilencer, + support.EnvironGuard, unittest.TestCase): def setUp(self): """Patches the environment.""" super(PyPIRCCommandTestCase, self).setUp() - - if os.environ.has_key('HOME'): - self._old_home = os.environ['HOME'] - else: - self._old_home = None self.tmp_dir = self.mkdtemp() - os.environ['HOME'] = self.tmp_dir + self.environ['HOME'] = self.tmp_dir self.rc = os.path.join(self.tmp_dir, '.pypirc') self.dist = Distribution() @@ -76,10 +72,6 @@ def tearDown(self): """Removes the patch.""" - if self._old_home is None: - del os.environ['HOME'] - else: - os.environ['HOME'] = self._old_home set_threshold(self.old_threshold) super(PyPIRCCommandTestCase, self).tearDown() @@ -89,12 +81,7 @@ # 2. handle the old format # new format - f = open(self.rc, 'w') - try: - f.write(PYPIRC) - finally: - f.close() - + self.write_file(self.rc, PYPIRC) cmd = self._cmd(self.dist) config = cmd._read_pypirc() @@ -106,10 +93,7 @@ self.assertEquals(config, waited) # old format - f = open(self.rc, 'w') - f.write(PYPIRC_OLD) - f.close() - + self.write_file(self.rc, PYPIRC_OLD) config = cmd._read_pypirc() config = config.items() config.sort() @@ -119,19 +103,14 @@ self.assertEquals(config, waited) def test_server_empty_registration(self): - cmd = self._cmd(self.dist) rc = cmd._get_rc_file() self.assert_(not os.path.exists(rc)) - cmd._store_pypirc('tarek', 'xxx') - self.assert_(os.path.exists(rc)) content = open(rc).read() - self.assertEquals(content, WANTED) - def test_suite(): return unittest.makeSuite(PyPIRCCommandTestCase) Modified: python/trunk/Lib/distutils/tests/test_dist.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_dist.py (original) +++ python/trunk/Lib/distutils/tests/test_dist.py Sun May 10 14:17:30 2009 @@ -39,13 +39,13 @@ class DistributionTestCase(support.TempdirManager, unittest.TestCase): def setUp(self): - support.TempdirManager.setUp(self) + super(DistributionTestCase, self).setUp() self.argv = sys.argv[:] del sys.argv[1:] def tearDown(self): sys.argv[:] = self.argv - support.TempdirManager.tearDown(self) + super(DistributionTestCase, self).tearDown() def create_distribution(self, configfiles=()): d = TestDistribution() @@ -151,7 +151,8 @@ self.assertEquals(len(warns), 0) -class MetadataTestCase(support.TempdirManager, unittest.TestCase): +class MetadataTestCase(support.TempdirManager, support.EnvironGuard, + unittest.TestCase): def test_simple_metadata(self): attrs = {"name": "package", @@ -238,13 +239,6 @@ def test_custom_pydistutils(self): # fixes #2166 # make sure pydistutils.cfg is found - old = {} - for env in ('HOME', 'HOMEPATH', 'HOMEDRIVE'): - value = os.environ.get(env) - old[env] = value - if value is not None: - del os.environ[env] - if os.name == 'posix': user_filename = ".pydistutils.cfg" else: @@ -261,22 +255,18 @@ # linux-style if sys.platform in ('linux', 'darwin'): - os.environ['HOME'] = temp_dir + self.environ['HOME'] = temp_dir files = dist.find_config_files() self.assert_(user_filename in files) # win32-style if sys.platform == 'win32': # home drive should be found - os.environ['HOME'] = temp_dir + self.environ['HOME'] = temp_dir files = dist.find_config_files() self.assert_(user_filename in files, '%r not found in %r' % (user_filename, files)) finally: - for key, value in old.items(): - if value is None: - continue - os.environ[key] = value os.remove(user_filename) def test_suite(): Modified: python/trunk/Lib/distutils/tests/test_util.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_util.py (original) +++ python/trunk/Lib/distutils/tests/test_util.py Sun May 10 14:17:30 2009 @@ -8,28 +8,23 @@ from copy import copy from distutils.errors import DistutilsPlatformError - -from distutils.util import get_platform -from distutils.util import convert_path -from distutils.util import change_root -from distutils.util import check_environ -from distutils.util import split_quoted -from distutils.util import strtobool -from distutils.util import rfc822_escape - +from distutils.util import (get_platform, convert_path, change_root, + check_environ, split_quoted, strtobool, + rfc822_escape) from distutils import util # used to patch _environ_checked from distutils.sysconfig import get_config_vars from distutils import sysconfig +from distutils.tests import support -class utilTestCase(unittest.TestCase): +class UtilTestCase(support.EnvironGuard, unittest.TestCase): def setUp(self): + super(UtilTestCase, self).setUp() # saving the environment self.name = os.name self.platform = sys.platform self.version = sys.version self.sep = os.sep - self.environ = dict(os.environ) self.join = os.path.join self.isabs = os.path.isabs self.splitdrive = os.path.splitdrive @@ -51,10 +46,6 @@ sys.platform = self.platform sys.version = self.version os.sep = self.sep - for k, v in self.environ.items(): - os.environ[k] = v - for k in set(os.environ) - set(self.environ): - del os.environ[k] os.path.join = self.join os.path.isabs = self.isabs os.path.splitdrive = self.splitdrive @@ -63,6 +54,7 @@ else: del os.uname sysconfig._config_vars = copy(self._config_vars) + super(UtilTestCase, self).tearDown() def _set_uname(self, uname): self._uname = uname @@ -102,7 +94,7 @@ ('Darwin Kernel Version 8.11.1: ' 'Wed Oct 10 18:23:28 PDT 2007; ' 'root:xnu-792.25.20~1/RELEASE_I386'), 'i386')) - os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.3' + self.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.3' get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g ' '-fwrapv -O3 -Wall -Wstrict-prototypes') @@ -110,7 +102,7 @@ self.assertEquals(get_platform(), 'macosx-10.3-i386') # macbook with fat binaries (fat, universal or fat64) - os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.4' + self.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.4' get_config_vars()['CFLAGS'] = ('-arch ppc -arch i386 -isysroot ' '/Developer/SDKs/MacOSX10.4u.sdk ' '-fno-strict-aliasing -fno-common ' @@ -214,21 +206,14 @@ # posix without HOME if os.name == 'posix': # this test won't run on windows - old_home = os.environ.get('HOME') - try: - check_environ() - import pwd - self.assertEquals(os.environ['HOME'], - pwd.getpwuid(os.getuid())[5]) - finally: - if old_home is not None: - os.environ['HOME'] = old_home - else: - del os.environ['HOME'] + check_environ() + import pwd + self.assertEquals(self.environ['HOME'], + pwd.getpwuid(os.getuid())[5]) else: check_environ() - self.assertEquals(os.environ['PLAT'], get_platform()) + self.assertEquals(self.environ['PLAT'], get_platform()) self.assertEquals(util._environ_checked, 1) def test_split_quoted(self): @@ -253,7 +238,7 @@ self.assertEquals(res, wanted) def test_suite(): - return unittest.makeSuite(utilTestCase) + return unittest.makeSuite(UtilTestCase) if __name__ == "__main__": unittest.main(defaultTest="test_suite") From python-checkins at python.org Sun May 10 14:18:32 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 14:18:32 +0200 (CEST) Subject: [Python-checkins] r72544 - python/branches/release26-maint Message-ID: <20090510121832.1C30C1E4015@bag.python.org> Author: tarek.ziade Date: Sun May 10 14:18:31 2009 New Revision: 72544 Log: Blocked revisions 72543 via svnmerge ........ r72543 | tarek.ziade | 2009-05-10 14:17:30 +0200 (Sun, 10 May 2009) | 1 line now using EnvironGuard everywhere ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun May 10 14:20:45 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 14:20:45 +0200 (CEST) Subject: [Python-checkins] r72545 - in python/branches/py3k: Lib/distutils/tests/test_config.py Lib/distutils/tests/test_dist.py Lib/distutils/tests/test_util.py Message-ID: <20090510122045.1FF0D1E4015@bag.python.org> Author: tarek.ziade Date: Sun May 10 14:20:44 2009 New Revision: 72545 Log: Merged revisions 72543 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72543 | tarek.ziade | 2009-05-10 14:17:30 +0200 (Sun, 10 May 2009) | 1 line now using EnvironGuard everywhere ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_config.py python/branches/py3k/Lib/distutils/tests/test_dist.py python/branches/py3k/Lib/distutils/tests/test_util.py Modified: python/branches/py3k/Lib/distutils/tests/test_config.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_config.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_config.py Sun May 10 14:20:44 2009 @@ -48,18 +48,14 @@ class PyPIRCCommandTestCase(support.TempdirManager, support.LoggingSilencer, + support.EnvironGuard, unittest.TestCase): def setUp(self): """Patches the environment.""" super(PyPIRCCommandTestCase, self).setUp() - - if 'HOME' in os.environ: - self._old_home = os.environ['HOME'] - else: - self._old_home = None self.tmp_dir = self.mkdtemp() - os.environ['HOME'] = self.tmp_dir + self.environ['HOME'] = self.tmp_dir self.rc = os.path.join(self.tmp_dir, '.pypirc') self.dist = Distribution() @@ -75,10 +71,6 @@ def tearDown(self): """Removes the patch.""" - if self._old_home is None: - del os.environ['HOME'] - else: - os.environ['HOME'] = self._old_home set_threshold(self.old_threshold) super(PyPIRCCommandTestCase, self).tearDown() @@ -88,12 +80,7 @@ # 2. handle the old format # new format - f = open(self.rc, 'w') - try: - f.write(PYPIRC) - finally: - f.close() - + self.write_file(self.rc, PYPIRC) cmd = self._cmd(self.dist) config = cmd._read_pypirc() @@ -104,10 +91,7 @@ self.assertEquals(config, waited) # old format - f = open(self.rc, 'w') - f.write(PYPIRC_OLD) - f.close() - + self.write_file(self.rc, PYPIRC_OLD) config = cmd._read_pypirc() config = list(sorted(config.items())) waited = [('password', 'secret'), ('realm', 'pypi'), @@ -116,19 +100,14 @@ self.assertEquals(config, waited) def test_server_empty_registration(self): - cmd = self._cmd(self.dist) rc = cmd._get_rc_file() self.assert_(not os.path.exists(rc)) - cmd._store_pypirc('tarek', 'xxx') - self.assert_(os.path.exists(rc)) content = open(rc).read() - self.assertEquals(content, WANTED) - def test_suite(): return unittest.makeSuite(PyPIRCCommandTestCase) Modified: python/branches/py3k/Lib/distutils/tests/test_dist.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_dist.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_dist.py Sun May 10 14:20:44 2009 @@ -38,11 +38,13 @@ class DistributionTestCase(unittest.TestCase): def setUp(self): + super(DistributionTestCase, self).setUp() self.argv = sys.argv[:] del sys.argv[1:] def tearDown(self): sys.argv[:] = self.argv + super(DistributionTestCase, self).tearDown() def create_distribution(self, configfiles=()): d = TestDistribution() @@ -121,7 +123,8 @@ self.assertEquals(len(warns), 0) -class MetadataTestCase(support.TempdirManager, unittest.TestCase): +class MetadataTestCase(support.TempdirManager, support.EnvironGuard, + unittest.TestCase): def test_simple_metadata(self): attrs = {"name": "package", @@ -208,13 +211,6 @@ def test_custom_pydistutils(self): # fixes #2166 # make sure pydistutils.cfg is found - old = {} - for env in ('HOME', 'HOMEPATH', 'HOMEDRIVE'): - value = os.environ.get(env) - old[env] = value - if value is not None: - del os.environ[env] - if os.name == 'posix': user_filename = ".pydistutils.cfg" else: @@ -231,22 +227,18 @@ # linux-style if sys.platform in ('linux', 'darwin'): - os.environ['HOME'] = temp_dir + self.environ['HOME'] = temp_dir files = dist.find_config_files() self.assert_(user_filename in files) # win32-style if sys.platform == 'win32': # home drive should be found - os.environ['HOME'] = temp_dir + self.environ['HOME'] = temp_dir files = dist.find_config_files() self.assert_(user_filename in files, '%r not found in %r' % (user_filename, files)) finally: - for key, value in old.items(): - if value is None: - continue - os.environ[key] = value os.remove(user_filename) def test_suite(): Modified: python/branches/py3k/Lib/distutils/tests/test_util.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_util.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_util.py Sun May 10 14:20:44 2009 @@ -8,28 +8,23 @@ from copy import copy from distutils.errors import DistutilsPlatformError - -from distutils.util import get_platform -from distutils.util import convert_path -from distutils.util import change_root -from distutils.util import check_environ -from distutils.util import split_quoted -from distutils.util import strtobool -from distutils.util import rfc822_escape - +from distutils.util import (get_platform, convert_path, change_root, + check_environ, split_quoted, strtobool, + rfc822_escape) from distutils import util # used to patch _environ_checked from distutils.sysconfig import get_config_vars from distutils import sysconfig +from distutils.tests import support -class utilTestCase(unittest.TestCase): +class UtilTestCase(support.EnvironGuard, unittest.TestCase): def setUp(self): + super(UtilTestCase, self).setUp() # saving the environment self.name = os.name self.platform = sys.platform self.version = sys.version self.sep = os.sep - self.environ = dict(os.environ) self.join = os.path.join self.isabs = os.path.isabs self.splitdrive = os.path.splitdrive @@ -51,10 +46,6 @@ sys.platform = self.platform sys.version = self.version os.sep = self.sep - for k, v in self.environ.items(): - os.environ[k] = v - for k in set(os.environ) - set(self.environ): - del os.environ[k] os.path.join = self.join os.path.isabs = self.isabs os.path.splitdrive = self.splitdrive @@ -63,6 +54,7 @@ else: del os.uname sysconfig._config_vars = copy(self._config_vars) + super(UtilTestCase, self).tearDown() def _set_uname(self, uname): self._uname = uname @@ -102,7 +94,7 @@ ('Darwin Kernel Version 8.11.1: ' 'Wed Oct 10 18:23:28 PDT 2007; ' 'root:xnu-792.25.20~1/RELEASE_I386'), 'i386')) - os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.3' + self.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.3' get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g ' '-fwrapv -O3 -Wall -Wstrict-prototypes') @@ -110,7 +102,7 @@ self.assertEquals(get_platform(), 'macosx-10.3-i386') # macbook with fat binaries (fat, universal or fat64) - os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.4' + self.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.4' get_config_vars()['CFLAGS'] = ('-arch ppc -arch i386 -isysroot ' '/Developer/SDKs/MacOSX10.4u.sdk ' '-fno-strict-aliasing -fno-common ' @@ -214,21 +206,14 @@ # posix without HOME if os.name == 'posix': # this test won't run on windows - old_home = os.environ.get('HOME') - try: - check_environ() - import pwd - self.assertEquals(os.environ['HOME'], - pwd.getpwuid(os.getuid())[5]) - finally: - if old_home is not None: - os.environ['HOME'] = old_home - else: - del os.environ['HOME'] + check_environ() + import pwd + self.assertEquals(self.environ['HOME'], + pwd.getpwuid(os.getuid())[5]) else: check_environ() - self.assertEquals(os.environ['PLAT'], get_platform()) + self.assertEquals(self.environ['PLAT'], get_platform()) self.assertEquals(util._environ_checked, 1) def test_split_quoted(self): @@ -253,7 +238,7 @@ self.assertEquals(res, wanted) def test_suite(): - return unittest.makeSuite(utilTestCase) + return unittest.makeSuite(UtilTestCase) if __name__ == "__main__": unittest.main(defaultTest="test_suite") From python-checkins at python.org Sun May 10 14:24:24 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 14:24:24 +0200 (CEST) Subject: [Python-checkins] r72546 - python/branches/release30-maint Message-ID: <20090510122424.DBE6B1E4015@bag.python.org> Author: tarek.ziade Date: Sun May 10 14:24:24 2009 New Revision: 72546 Log: Blocked revisions 72545 via svnmerge ................ r72545 | tarek.ziade | 2009-05-10 14:20:44 +0200 (Sun, 10 May 2009) | 9 lines Merged revisions 72543 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72543 | tarek.ziade | 2009-05-10 14:17:30 +0200 (Sun, 10 May 2009) | 1 line now using EnvironGuard everywhere ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Sun May 10 14:34:55 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 10 May 2009 12:34:55 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090510123456.4650D1E4015@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/947 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_distutils ====================================================================== FAIL: test_get_outputs (distutils.tests.test_install_lib.InstallLibTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-ubuntu-i386/build/Lib/distutils/tests/test_install_lib.py", line 60, in test_get_outputs self.assertEquals(len(cmd.get_outputs()), 4) AssertionError: 2 != 4 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun May 10 14:36:48 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 14:36:48 +0200 (CEST) Subject: [Python-checkins] r72547 - python/trunk/Lib/distutils/tests/test_install_lib.py Message-ID: <20090510123648.D045C1E4015@bag.python.org> Author: tarek.ziade Date: Sun May 10 14:36:48 2009 New Revision: 72547 Log: fixed test for all platforms Modified: python/trunk/Lib/distutils/tests/test_install_lib.py Modified: python/trunk/Lib/distutils/tests/test_install_lib.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_install_lib.py (original) +++ python/trunk/Lib/distutils/tests/test_install_lib.py Sun May 10 14:36:48 2009 @@ -57,7 +57,7 @@ cmd.distribution.script_name = 'setup.py' # get_output should return 4 elements - self.assertEquals(len(cmd.get_outputs()), 4) + self.assert_(len(cmd.get_outputs()) >= 2) def test_get_inputs(self): pkg_dir, dist = self.create_dist() From python-checkins at python.org Sun May 10 14:37:25 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 14:37:25 +0200 (CEST) Subject: [Python-checkins] r72548 - python/branches/release26-maint Message-ID: <20090510123725.D21B31E4015@bag.python.org> Author: tarek.ziade Date: Sun May 10 14:37:25 2009 New Revision: 72548 Log: Blocked revisions 72547 via svnmerge ........ r72547 | tarek.ziade | 2009-05-10 14:36:48 +0200 (Sun, 10 May 2009) | 1 line fixed test for all platforms ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun May 10 14:38:16 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 14:38:16 +0200 (CEST) Subject: [Python-checkins] r72549 - in python/branches/py3k: Lib/distutils/tests/test_install_lib.py Message-ID: <20090510123816.D3BFA1E4015@bag.python.org> Author: tarek.ziade Date: Sun May 10 14:38:16 2009 New Revision: 72549 Log: Merged revisions 72547 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72547 | tarek.ziade | 2009-05-10 14:36:48 +0200 (Sun, 10 May 2009) | 1 line fixed test for all platforms ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_install_lib.py Modified: python/branches/py3k/Lib/distutils/tests/test_install_lib.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_install_lib.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_install_lib.py Sun May 10 14:38:16 2009 @@ -57,7 +57,7 @@ cmd.distribution.script_name = 'setup.py' # get_output should return 4 elements - self.assertEquals(len(cmd.get_outputs()), 4) + self.assert_(len(cmd.get_outputs()) >= 2) def test_get_inputs(self): pkg_dir, dist = self.create_dist() From python-checkins at python.org Sun May 10 14:39:33 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 14:39:33 +0200 (CEST) Subject: [Python-checkins] r72550 - python/branches/release30-maint Message-ID: <20090510123933.C7A6D1E4015@bag.python.org> Author: tarek.ziade Date: Sun May 10 14:39:33 2009 New Revision: 72550 Log: Blocked revisions 72549 via svnmerge ................ r72549 | tarek.ziade | 2009-05-10 14:38:16 +0200 (Sun, 10 May 2009) | 9 lines Merged revisions 72547 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72547 | tarek.ziade | 2009-05-10 14:36:48 +0200 (Sun, 10 May 2009) | 1 line fixed test for all platforms ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Sun May 10 15:51:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 10 May 2009 13:51:06 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090510135106.83FC91E4015@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/499 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sun May 10 15:52:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 10 May 2009 13:52:52 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090510135252.F1A1F1E4015@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/351 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Sun May 10 16:15:01 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 10 May 2009 14:15:01 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 2.6 Message-ID: <20090510141502.05E7C1E4015@bag.python.org> The Buildbot has detected a new failure of x86 gentoo 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%202.6/builds/312 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Killed sincerely, -The Buildbot From python-checkins at python.org Sun May 10 16:16:48 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 10 May 2009 16:16:48 +0200 (CEST) Subject: [Python-checkins] r72551 - python/trunk/Lib/dis.py Message-ID: <20090510141648.02BA31E4015@bag.python.org> Author: benjamin.peterson Date: Sun May 10 16:16:47 2009 New Revision: 72551 Log: use isinstance Modified: python/trunk/Lib/dis.py Modified: python/trunk/Lib/dis.py ============================================================================== --- python/trunk/Lib/dis.py (original) +++ python/trunk/Lib/dis.py Sun May 10 16:16:47 2009 @@ -19,7 +19,7 @@ if x is None: distb() return - if type(x) is types.InstanceType: + if isinstance(x, types.InstanceType): x = x.__class__ if hasattr(x, 'im_func'): x = x.im_func @@ -29,10 +29,10 @@ items = x.__dict__.items() items.sort() for name, x1 in items: - if type(x1) in (types.MethodType, - types.FunctionType, - types.CodeType, - types.ClassType): + if isinstance(x1, (types.MethodType, + types.FunctionType, + types.CodeType, + types.ClassType)): print "Disassembly of %s:" % name try: dis(x1) From buildbot at python.org Sun May 10 16:52:12 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 10 May 2009 14:52:12 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc trunk Message-ID: <20090510145212.AAFA21E4012@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%20trunk/builds/408 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_distutils ====================================================================== FAIL: test_get_outputs (distutils.tests.test_install_lib.InstallLibTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/distutils/tests/test_install_lib.py", line 60, in test_get_outputs self.assertEquals(len(cmd.get_outputs()), 4) AssertionError: 2 != 4 sincerely, -The Buildbot From buildbot at python.org Sun May 10 17:25:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 10 May 2009 15:25:07 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090510152508.04ECB1E4012@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/786 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_distutils test_mailbox ====================================================================== FAIL: test_get_outputs (distutils.tests.test_install_lib.InstallLibTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ppc/build/Lib/distutils/tests/test_install_lib.py", line 60, in test_get_outputs self.assertEquals(len(cmd.get_outputs()), 4) AssertionError: 2 != 4 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun May 10 18:26:20 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 10 May 2009 16:26:20 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090510162620.91F9F1E4012@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/670 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Sun May 10 19:03:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 10 May 2009 17:03:00 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090510170300.797DA1E4012@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/735 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From nnorwitz at gmail.com Sun May 10 22:20:03 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 10 May 2009 16:20:03 -0400 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090510202003.GA6246@python.psfb.org> 337 tests OK. 1 test failed: test_distutils 35 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 6 skips unexpected on linux2: test_multiprocessing test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aetypes test_aifc test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named MacOS test_array test_ascii_formatd test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 test_bsddb3 skipped -- Use of the `bsddb' resource not enabled test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compileall test_compiler test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_curses test_curses skipped -- Use of the `curses' resource not enabled test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils [19526 refs] /tmp/tmp8L3fSU/foo/foo.c:1:28: warning: no newline at end of file [19526 refs] [19526 refs] [19523 refs] test test_distutils failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/distutils/tests/test_install_lib.py", line 28, in test_finalize_options self.assertRaises(DistutilsOptionError, cmd.finalize_options) AssertionError: DistutilsOptionError not raised test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future5 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [15401 refs] [15401 refs] [15401 refs] [25327 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_importlib test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_ipaddr test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_linecache test_linuxaudiodev test_linuxaudiodev skipped -- Use of the `audio' resource not enabled test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named MacOS test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_memoryview test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os test_ossaudiodev test_ossaudiodev skipped -- Use of the `audio' resource not enabled test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_pdb test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 /tmp/python-test/local/lib/python2.7/test/test_pep352.py:31: PendingDeprecationWarning: Please use assertTrue instead. (ins.__class__.__name__, attr)) /tmp/python-test/local/lib/python2.7/test/test_pep352.py:92: PendingDeprecationWarning: Please use assertEqual instead. given, expected)) test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [17001 refs] [17001 refs] test_plistlib test_poll test_popen [15406 refs] [15406 refs] [15406 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [20870 refs] test_pyexpat test_queue test_quopri [17926 refs] [17926 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [15401 refs] [15401 refs] [15404 refs] [15401 refs] test_slice test_smtplib test_socket test_socketserver test_socketserver skipped -- Use of the `network' resource not enabled test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- module os has no attribute startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [17246 refs] [15616 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] . [15401 refs] [15401 refs] this bit of output is from a test of stdout in a different process ... [15401 refs] [15401 refs] [15616 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry test_symtable test_syntax test_sys [15401 refs] [15401 refs] [15630 refs] [15424 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [15404 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [18664 refs] [21074 refs] [20051 refs] [20051 refs] [20051 refs] [20051 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tk test_tk skipped -- No module named _tkinter test_tokenize test_trace test_traceback test_transformer test_ttk_guionly test_ttk_guionly skipped -- No module named _tkinter test_ttk_textonly test_ttk_textonly skipped -- No module named _tkinter test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllib2net skipped -- Use of the `network' resource not enabled test_urllibnet test_urllibnet skipped -- Use of the `network' resource not enabled test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib /tmp/python-test/local/lib/python2.7/test/test_xmllib.py:24: DeprecationWarning: The xmllib module is obsolete. Use xml.sax instead. import xmllib test_xmlrpc test_xpickle test_xpickle -- skipping backwards compat tests. Use 'regrtest.py -u xpickle' to run them. test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zipimport_support test_zlib 337 tests OK. 1 test failed: test_distutils 35 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 6 skips unexpected on linux2: test_multiprocessing test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [756543 refs] From python-checkins at python.org Sun May 10 23:27:55 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 23:27:55 +0200 (CEST) Subject: [Python-checkins] r72552 - python/trunk/Lib/distutils/tests/test_build_ext.py Message-ID: <20090510212755.C0E601E401D@bag.python.org> Author: tarek.ziade Date: Sun May 10 23:27:55 2009 New Revision: 72552 Log: fixed test_build_ext for win32 Modified: python/trunk/Lib/distutils/tests/test_build_ext.py Modified: python/trunk/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_build_ext.py (original) +++ python/trunk/Lib/distutils/tests/test_build_ext.py Sun May 10 23:27:55 2009 @@ -192,7 +192,7 @@ cmd = build_ext(dist) cmd.library_dirs = 'my_lib_dir' cmd.finalize_options() - self.assertEquals(cmd.library_dirs, ['my_lib_dir']) + self.assert_('my_lib_dir' in cmd.library_dirs) # make sure rpath is turned into a list # if it's a list of os.pathsep's paths From nnorwitz at gmail.com Sun May 10 23:28:08 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 10 May 2009 17:28:08 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090510212808.GA25189@python.psfb.org> More important issues: ---------------------- test_softspace leaked [0, 0, -80] references, sum=-80 Less important issues: ---------------------- test_cmd_line leaked [0, 0, -25] references, sum=-25 test_file leaked [0, 0, 80] references, sum=80 test_hashlib leaked [-4, 4, 0] references, sum=0 test_smtplib leaked [-84, 179, -179] references, sum=-84 test_socketserver leaked [0, 0, 80] references, sum=80 test_sys leaked [42, -21, 0] references, sum=21 test_threading leaked [48, 53, 43] references, sum=144 test_threadsignals leaked [0, -8, 8] references, sum=0 test_urllib2_localnet leaked [3, 3, 285] references, sum=291 From python-checkins at python.org Sun May 10 23:31:23 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 23:31:23 +0200 (CEST) Subject: [Python-checkins] r72553 - in python/branches/py3k: Lib/distutils/tests/test_build_ext.py Message-ID: <20090510213123.5CA501E401D@bag.python.org> Author: tarek.ziade Date: Sun May 10 23:31:23 2009 New Revision: 72553 Log: Merged revisions 72552 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72552 | tarek.ziade | 2009-05-10 23:27:55 +0200 (Sun, 10 May 2009) | 1 line fixed test_build_ext for win32 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_build_ext.py Modified: python/branches/py3k/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_build_ext.py Sun May 10 23:31:23 2009 @@ -192,7 +192,7 @@ cmd = build_ext(dist) cmd.library_dirs = 'my_lib_dir' cmd.finalize_options() - self.assertEquals(cmd.library_dirs, ['my_lib_dir']) + self.assert_('my_lib_dir' in cmd.library_dirs) # make sure rpath is turned into a list # if it's a list of os.pathsep's paths From python-checkins at python.org Sun May 10 23:33:10 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 23:33:10 +0200 (CEST) Subject: [Python-checkins] r72554 - in python/branches/release26-maint: Lib/distutils/tests/test_build_ext.py Message-ID: <20090510213310.16AD81E401D@bag.python.org> Author: tarek.ziade Date: Sun May 10 23:33:09 2009 New Revision: 72554 Log: Merged revisions 72552 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72552 | tarek.ziade | 2009-05-10 23:27:55 +0200 (Sun, 10 May 2009) | 1 line fixed test_build_ext for win32 ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py Modified: python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py Sun May 10 23:33:09 2009 @@ -129,7 +129,7 @@ cmd = build_ext(dist) cmd.library_dirs = 'my_lib_dir' cmd.finalize_options() - self.assertEquals(cmd.library_dirs, ['my_lib_dir']) + self.assert_('my_lib_dir' in cmd.library_dirs) # make sure rpath is turned into a list # if it's a list of os.pathsep's paths From python-checkins at python.org Sun May 10 23:34:41 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 10 May 2009 23:34:41 +0200 (CEST) Subject: [Python-checkins] r72555 - in python/branches/release30-maint: Lib/distutils/tests/test_build_ext.py Message-ID: <20090510213441.B64A61E401D@bag.python.org> Author: tarek.ziade Date: Sun May 10 23:34:41 2009 New Revision: 72555 Log: Merged revisions 72553 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72553 | tarek.ziade | 2009-05-10 23:31:23 +0200 (Sun, 10 May 2009) | 9 lines Merged revisions 72552 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72552 | tarek.ziade | 2009-05-10 23:27:55 +0200 (Sun, 10 May 2009) | 1 line fixed test_build_ext for win32 ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py Modified: python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py Sun May 10 23:34:41 2009 @@ -130,7 +130,7 @@ cmd = build_ext(dist) cmd.library_dirs = 'my_lib_dir' cmd.finalize_options() - self.assertEquals(cmd.library_dirs, ['my_lib_dir']) + self.assert_('my_lib_dir' in cmd.library_dirs) # make sure rpath is turned into a list # if it's a list of os.pathsep's paths From buildbot at python.org Mon May 11 00:15:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 10 May 2009 22:15:23 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090510221523.72A621E401D@bag.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/4986 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Mon May 11 00:27:00 2009 From: python-checkins at python.org (antoine.pitrou) Date: Mon, 11 May 2009 00:27:00 +0200 (CEST) Subject: [Python-checkins] r72556 - python/branches/py3k/Modules/posixmodule.c Message-ID: <20090510222700.6A74E1E401D@bag.python.org> Author: antoine.pitrou Date: Mon May 11 00:27:00 2009 New Revision: 72556 Log: Issue #5990: fix memory leak introduced by PEP 383 commits Modified: python/branches/py3k/Modules/posixmodule.c Modified: python/branches/py3k/Modules/posixmodule.c ============================================================================== --- python/branches/py3k/Modules/posixmodule.c (original) +++ python/branches/py3k/Modules/posixmodule.c Mon May 11 00:27:00 2009 @@ -784,13 +784,16 @@ char *format, int (*func)(const char *, const char *)) { - PyObject *opath1, *opath2; + PyObject *opath1 = NULL, *opath2 = NULL; char *path1, *path2; int res; if (!PyArg_ParseTuple(args, format, PyUnicode_FSConverter, &opath1, - PyUnicode_FSConverter, &opath2)) + PyUnicode_FSConverter, &opath2)) { + Py_XDECREF(opath1); + Py_XDECREF(opath2); return NULL; + } path1 = bytes2str(opath1, 1); path2 = bytes2str(opath2, 1); Py_BEGIN_ALLOW_THREADS From python-checkins at python.org Mon May 11 01:43:14 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 11 May 2009 01:43:14 +0200 (CEST) Subject: [Python-checkins] r72557 - python/branches/py3k/Python/pythonrun.c Message-ID: <20090510234314.8CE3E1E4026@bag.python.org> Author: benjamin.peterson Date: Mon May 11 01:43:14 2009 New Revision: 72557 Log: bytes -> bytearray Modified: python/branches/py3k/Python/pythonrun.c Modified: python/branches/py3k/Python/pythonrun.c ============================================================================== --- python/branches/py3k/Python/pythonrun.c (original) +++ python/branches/py3k/Python/pythonrun.c Mon May 11 01:43:14 2009 @@ -212,7 +212,7 @@ Py_FatalError("Py_Initialize: can't init longs"); if (!PyByteArray_Init()) - Py_FatalError("Py_Initialize: can't init bytes"); + Py_FatalError("Py_Initialize: can't init bytearray"); _PyFloat_Init(); From python-checkins at python.org Mon May 11 01:52:09 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 11 May 2009 01:52:09 +0200 (CEST) Subject: [Python-checkins] r72558 - python/trunk/Doc/library/exceptions.rst Message-ID: <20090510235209.E8FB31E4028@bag.python.org> Author: benjamin.peterson Date: Mon May 11 01:52:09 2009 New Revision: 72558 Log: sys.setdefaultencoding() strikes me as a bad example Modified: python/trunk/Doc/library/exceptions.rst Modified: python/trunk/Doc/library/exceptions.rst ============================================================================== --- python/trunk/Doc/library/exceptions.rst (original) +++ python/trunk/Doc/library/exceptions.rst Mon May 11 01:52:09 2009 @@ -84,9 +84,9 @@ .. exception:: LookupError - The base class for the exceptions that are raised when a key or index used on a - mapping or sequence is invalid: :exc:`IndexError`, :exc:`KeyError`. This can be - raised directly by :func:`sys.setdefaultencoding`. + The base class for the exceptions that are raised when a key or index used on + a mapping or sequence is invalid: :exc:`IndexError`, :exc:`KeyError`. This + can be raised directly by :func:`codecs.lookup`. .. exception:: EnvironmentError From buildbot at python.org Mon May 11 03:00:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 11 May 2009 01:00:56 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090511010057.0AA761E4026@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/353 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Mon May 11 03:26:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 11 May 2009 01:26:47 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090511012648.01BE71E4026@bag.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/557 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 533, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' 1 test failed: test_import ====================================================================== ERROR: testImport (test.test_import.ImportTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 61, in test_with_extension mod = __import__(TESTFN) ImportError: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 533, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 533, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' sincerely, -The Buildbot From buildbot at python.org Mon May 11 03:44:42 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 11 May 2009 01:44:42 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090511014442.E27C51E4026@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/673 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Mon May 11 03:47:12 2009 From: python-checkins at python.org (brett.cannon) Date: Mon, 11 May 2009 03:47:12 +0200 (CEST) Subject: [Python-checkins] r72559 - in python/branches/py3k: Lib/importlib/test/extension/test_case_sensitivity.py Lib/importlib/test/source/test_abc_loader.py Lib/importlib/test/source/test_case_sensitivity.py Lib/importlib/test/source/test_file_loader.py Lib/importlib/test/source/util.py Lib/importlib/test/util.py Misc/NEWS Message-ID: <20090511014712.39A7C1E4026@bag.python.org> Author: brett.cannon Date: Mon May 11 03:47:11 2009 New Revision: 72559 Log: Tests for case-senstivity were not being skipped for darwin when installed on a case-sensitive filesystems -- which is not the default case. Along the way also fixed the skipping of tests when sys.dont_write_bytecode is true. Closes issue #5442 again. Modified: python/branches/py3k/Lib/importlib/test/extension/test_case_sensitivity.py python/branches/py3k/Lib/importlib/test/source/test_abc_loader.py python/branches/py3k/Lib/importlib/test/source/test_case_sensitivity.py python/branches/py3k/Lib/importlib/test/source/test_file_loader.py python/branches/py3k/Lib/importlib/test/source/util.py python/branches/py3k/Lib/importlib/test/util.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/importlib/test/extension/test_case_sensitivity.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/extension/test_case_sensitivity.py (original) +++ python/branches/py3k/Lib/importlib/test/extension/test_case_sensitivity.py Mon May 11 03:47:11 2009 @@ -20,13 +20,13 @@ with support.EnvironmentVarGuard() as env: env.unset('PYTHONCASEOK') loader = self.find_module() - self.assert_(loader is None) + self.assertIsNone(loader) def test_case_insensitivity(self): with support.EnvironmentVarGuard() as env: env.set('PYTHONCASEOK', '1') loader = self.find_module() - self.assert_(hasattr(loader, 'load_module')) + self.assertTrue(hasattr(loader, 'load_module')) Modified: python/branches/py3k/Lib/importlib/test/source/test_abc_loader.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_abc_loader.py (original) +++ python/branches/py3k/Lib/importlib/test/source/test_abc_loader.py Mon May 11 03:47:11 2009 @@ -157,10 +157,10 @@ mock = self.mocker({name: path}) with util.uncache(name): module = mock.load_module(name) - self.assert_(name in sys.modules) + self.assertIn(name, sys.modules) self.eq_attrs(module, __name__=name, __file__=path, __package__='pkg', __loader__=mock) - self.assert_(not hasattr(module, '__path__')) + self.assertFalse(hasattr(module, '__path__')) return mock, name def test_module_reuse(self): @@ -247,16 +247,16 @@ mocker = PyPycLoaderMock - @source_util.writes_bytecode + @source_util.writes_bytecode_files def verify_bytecode(self, mock, name): assert name in mock.module_paths - self.assert_(name in mock.module_bytecode) + self.assertIn(name, mock.module_bytecode) magic = mock.module_bytecode[name][:4] self.assertEqual(magic, imp.get_magic()) mtime = importlib._r_long(mock.module_bytecode[name][4:8]) self.assertEqual(mtime, 1) bc = mock.module_bytecode[name][8:] - + self.assertEqual(bc, mock.compile_bc(name)) def test_module(self): mock, name = super().test_module() @@ -286,7 +286,7 @@ """Test that bytecode is properly handled based on sys.dont_write_bytecode.""" - @source_util.writes_bytecode + @source_util.writes_bytecode_files def run_test(self, dont_write_bytecode): name = 'mod' mock = PyPycLoaderMock({name: os.path.join('path', 'to', 'mod')}) @@ -307,7 +307,7 @@ """Test that bytecode is regenerated as expected.""" - @source_util.writes_bytecode + @source_util.writes_bytecode_files def test_different_magic(self): # A different magic number should lead to new bytecode. name = 'mod' @@ -323,7 +323,7 @@ magic = mock.module_bytecode[name][:4] self.assertEqual(magic, imp.get_magic()) - @source_util.writes_bytecode + @source_util.writes_bytecode_files def test_old_mtime(self): # Bytecode with an older mtime should be regenerated. name = 'mod' Modified: python/branches/py3k/Lib/importlib/test/source/test_case_sensitivity.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_case_sensitivity.py (original) +++ python/branches/py3k/Lib/importlib/test/source/test_case_sensitivity.py Mon May 11 03:47:11 2009 @@ -36,18 +36,18 @@ with test_support.EnvironmentVarGuard() as env: env.unset('PYTHONCASEOK') sensitive, insensitive = self.sensitivity_test() - self.assert_(hasattr(sensitive, 'load_module')) - self.assert_(self.name in sensitive._base_path) - self.assert_(insensitive is None) + self.assertTrue(hasattr(sensitive, 'load_module')) + self.assertIn(self.name, sensitive._base_path) + self.assertIsNone(insensitive) def test_insensitive(self): with test_support.EnvironmentVarGuard() as env: env.set('PYTHONCASEOK', '1') sensitive, insensitive = self.sensitivity_test() - self.assert_(hasattr(sensitive, 'load_module')) - self.assert_(self.name in sensitive._base_path) - self.assert_(hasattr(insensitive, 'load_module')) - self.assert_(self.name in insensitive._base_path) + self.assertTrue(hasattr(sensitive, 'load_module')) + self.assertIn(self.name, sensitive._base_path) + self.assertTrue(hasattr(insensitive, 'load_module')) + self.assertIn(self.name, insensitive._base_path) def test_main(): Modified: python/branches/py3k/Lib/importlib/test/source/test_file_loader.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/test_file_loader.py (original) +++ python/branches/py3k/Lib/importlib/test/source/test_file_loader.py Mon May 11 03:47:11 2009 @@ -127,7 +127,7 @@ self.assert_(module_name in sys.modules) # [bad magic] - @source_util.writes_bytecode + @source_util.writes_bytecode_files def test_bad_magic(self): with source_util.create_modules('_temp') as mapping: py_compile.compile(mapping['_temp']) @@ -140,7 +140,7 @@ self.assertEqual(bytecode_file.read(4), imp.get_magic()) # [bad timestamp] - @source_util.writes_bytecode + @source_util.writes_bytecode_files def test_bad_bytecode(self): zeros = b'\x00\x00\x00\x00' with source_util.create_modules('_temp') as mapping: Modified: python/branches/py3k/Lib/importlib/test/source/util.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/source/util.py (original) +++ python/branches/py3k/Lib/importlib/test/source/util.py Mon May 11 03:47:11 2009 @@ -9,32 +9,23 @@ from test import support -def writes_bytecode(fxn): - """Decorator to protect sys.dont_write_bytecode from mutation.""" +def writes_bytecode_files(fxn): + """Decorator to protect sys.dont_write_bytecode from mutation and to skip + tests that require it to be set to False.""" + if sys.dont_write_bytecode: + return lambda *args, **kwargs: None @functools.wraps(fxn) def wrapper(*args, **kwargs): original = sys.dont_write_bytecode sys.dont_write_bytecode = False - to_return = fxn(*args, **kwargs) - sys.dont_write_bytecode = original + try: + to_return = fxn(*args, **kwargs) + finally: + sys.dont_write_bytecode = original return to_return return wrapper -def writes_bytecode_files(fxn): - """Decorator that returns the function if writing bytecode is enabled, else - a stub function that accepts anything and simply returns None.""" - if sys.dont_write_bytecode: - return lambda *args, **kwargs: None - else: - @functools.wraps(fxn) - def wrapper(*args, **kwargs): - to_return = fxn(*args, **kwargs) - sys.dont_write_bytecode = False - return to_return - return wrapper - - def bytecode_path(source_path): for suffix, _, type_ in imp.get_suffixes(): if type_ == imp.PY_COMPILED: Modified: python/branches/py3k/Lib/importlib/test/util.py ============================================================================== --- python/branches/py3k/Lib/importlib/test/util.py (original) +++ python/branches/py3k/Lib/importlib/test/util.py Mon May 11 03:47:11 2009 @@ -7,17 +7,18 @@ def case_insensitive_tests(class_): - """Class decorator that nullifies tests that require a case-insensitive + """Class decorator that nullifies tests requiring a case-insensitive file system.""" - if sys.platform not in ('win32', 'darwin', 'cygwin'): - original_name = os.listdir('.')[0] - if original_name.upper() != original_name: - changed_name = original_name.upper() - else: - changed_name = original_name.lower() + # Windows is the only OS that is *always* case-insensitive + # (OS X *can* be case-sensitive). + if sys.platform not in ('win32', 'cygwin'): + changed_name = __file__.upper() + if changed_name == __file__: + changed_name = __file__.lower() if os.path.exists(changed_name): return class_ - return unittest.TestCase + else: + return unittest.TestCase else: return class_ Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon May 11 03:47:11 2009 @@ -19,6 +19,15 @@ now it does. This also means getfp method now returns the real fp. +Tests +----- + +- Issue 5442: Tests for importlib were not properly skipping case-sensitivity + tests on darwin even when the OS was installed on a case-sensitive + filesystem. Also fixed tests that should not be run when + sys.dont_write_bytecode is true. + + What's New in Python 3.1 beta 1? ================================ From buildbot at python.org Mon May 11 04:17:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 11 May 2009 02:17:27 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090511021727.559451E4026@bag.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/737 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_urllibnet.py", line 39, in testURLread f = _open_with_retry(urllib.request.urlopen, "http://www.python.org/") File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_urllibnet.py", line 25, in _open_with_retry raise last_exc File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_urllibnet.py", line 19, in _open_with_retry return func(host, *args, **kwargs) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 119, in urlopen return _opener.open(url, data, timeout) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 342, in open response = self._open(req, data) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 360, in _open '_open', req) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 320, in _call_chain result = func(*args) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 1063, in http_open return self.do_open(http.client.HTTPConnection, req) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 1048, in do_open raise URLError(err) urllib.error.URLError: 1 test failed: test_urllibnet make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon May 11 05:15:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 11 May 2009 03:15:06 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090511031506.B9B4E1E4026@bag.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/675 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: brett.cannon BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From nnorwitz at gmail.com Mon May 11 10:19:53 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 11 May 2009 04:19:53 -0400 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090511081953.GA12796@python.psfb.org> 337 tests OK. 1 test failed: test_distutils 35 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 6 skips unexpected on linux2: test_multiprocessing test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aetypes test_aifc test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named MacOS test_array test_ascii_formatd test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 test_bsddb3 skipped -- Use of the `bsddb' resource not enabled test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compileall test_compiler test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_curses test_curses skipped -- Use of the `curses' resource not enabled test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils [19526 refs] /tmp/tmpOG4xQa/foo/foo.c:1:28: warning: no newline at end of file [19526 refs] [19526 refs] [19523 refs] test test_distutils failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/distutils/tests/test_install_lib.py", line 28, in test_finalize_options self.assertRaises(DistutilsOptionError, cmd.finalize_options) AssertionError: DistutilsOptionError not raised test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future5 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [15401 refs] [15401 refs] [15401 refs] [25327 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_importlib test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_ipaddr test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_linecache test_linuxaudiodev test_linuxaudiodev skipped -- Use of the `audio' resource not enabled test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named MacOS test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_memoryview test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os test_ossaudiodev test_ossaudiodev skipped -- Use of the `audio' resource not enabled test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_pdb test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 /tmp/python-test/local/lib/python2.7/test/test_pep352.py:31: PendingDeprecationWarning: Please use assertTrue instead. (ins.__class__.__name__, attr)) /tmp/python-test/local/lib/python2.7/test/test_pep352.py:92: PendingDeprecationWarning: Please use assertEqual instead. given, expected)) test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [17001 refs] [17001 refs] test_plistlib test_poll test_popen [15406 refs] [15406 refs] [15406 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [20870 refs] test_pyexpat test_queue test_quopri [17926 refs] [17926 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [15401 refs] [15401 refs] [15404 refs] [15401 refs] test_slice test_smtplib test_socket test_socketserver test_socketserver skipped -- Use of the `network' resource not enabled test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- module os has no attribute startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [17246 refs] [15616 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] . [15401 refs] [15401 refs] this bit of output is from a test of stdout in a different process ... [15401 refs] [15401 refs] [15616 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry test_symtable test_syntax test_sys [15401 refs] [15401 refs] [15630 refs] [15424 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [15404 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [18664 refs] [21074 refs] [20051 refs] [20051 refs] [20051 refs] [20051 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tk test_tk skipped -- No module named _tkinter test_tokenize test_trace test_traceback test_transformer test_ttk_guionly test_ttk_guionly skipped -- No module named _tkinter test_ttk_textonly test_ttk_textonly skipped -- No module named _tkinter test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllib2net skipped -- Use of the `network' resource not enabled test_urllibnet test_urllibnet skipped -- Use of the `network' resource not enabled test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib /tmp/python-test/local/lib/python2.7/test/test_xmllib.py:24: DeprecationWarning: The xmllib module is obsolete. Use xml.sax instead. import xmllib test_xmlrpc test_xpickle test_xpickle -- skipping backwards compat tests. Use 'regrtest.py -u xpickle' to run them. test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zipimport_support test_zlib 337 tests OK. 1 test failed: test_distutils 35 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 6 skips unexpected on linux2: test_multiprocessing test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [756542 refs] From python-checkins at python.org Mon May 11 10:45:17 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 11 May 2009 10:45:17 +0200 (CEST) Subject: [Python-checkins] r72560 - python/trunk/Lib/distutils/tests/test_build_clib.py Message-ID: <20090511084517.7F7FE1E4002@bag.python.org> Author: tarek.ziade Date: Mon May 11 10:45:17 2009 New Revision: 72560 Log: distutils.test_build_clib added a new line at the end of the file, to avoid a warning with some compilers Modified: python/trunk/Lib/distutils/tests/test_build_clib.py Modified: python/trunk/Lib/distutils/tests/test_build_clib.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_build_clib.py (original) +++ python/trunk/Lib/distutils/tests/test_build_clib.py Mon May 11 10:45:17 2009 @@ -109,7 +109,7 @@ cmd = build_clib(dist) foo_c = os.path.join(pkg_dir, 'foo.c') - self.write_file(foo_c, 'int main(void) { return 1;}') + self.write_file(foo_c, 'int main(void) { return 1;}\n') cmd.libraries = [('foo', {'sources': [foo_c]})] build_temp = os.path.join(pkg_dir, 'build') From python-checkins at python.org Mon May 11 10:47:34 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 11 May 2009 10:47:34 +0200 (CEST) Subject: [Python-checkins] r72561 - python/branches/release26-maint Message-ID: <20090511084734.F157F1E4002@bag.python.org> Author: tarek.ziade Date: Mon May 11 10:47:34 2009 New Revision: 72561 Log: Blocked revisions 72560 via svnmerge ........ r72560 | tarek.ziade | 2009-05-11 10:45:17 +0200 (Mon, 11 May 2009) | 1 line distutils.test_build_clib added a new line at the end of the file, to avoid a warning with some compilers ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Mon May 11 10:49:17 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 11 May 2009 10:49:17 +0200 (CEST) Subject: [Python-checkins] r72562 - in python/branches/py3k: Lib/distutils/tests/test_build_clib.py Message-ID: <20090511084917.988561E4002@bag.python.org> Author: tarek.ziade Date: Mon May 11 10:49:17 2009 New Revision: 72562 Log: Merged revisions 72560 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72560 | tarek.ziade | 2009-05-11 10:45:17 +0200 (Mon, 11 May 2009) | 1 line distutils.test_build_clib added a new line at the end of the file, to avoid a warning with some compilers ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_build_clib.py Modified: python/branches/py3k/Lib/distutils/tests/test_build_clib.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_build_clib.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_build_clib.py Mon May 11 10:49:17 2009 @@ -109,7 +109,7 @@ cmd = build_clib(dist) foo_c = os.path.join(pkg_dir, 'foo.c') - self.write_file(foo_c, 'int main(void) { return 1;}') + self.write_file(foo_c, 'int main(void) { return 1;}\n') cmd.libraries = [('foo', {'sources': [foo_c]})] build_temp = os.path.join(pkg_dir, 'build') From buildbot at python.org Mon May 11 11:27:01 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 11 May 2009 09:27:01 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090511092701.907F91E4002@bag.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1302 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson,tarek.ziade BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Mon May 11 11:34:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 11 May 2009 09:34:30 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090511093430.EF6361E4002@bag.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/503 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/threading.py", line 524, in __bootstrap_inner self.run() File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/bsddb/test/test_thread.py", line 306, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/bsddb/dbutils.py", line 68, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30994, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon May 11 14:50:03 2009 From: python-checkins at python.org (dirkjan.ochtman) Date: Mon, 11 May 2009 14:50:03 +0200 (CEST) Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt Message-ID: <20090511125003.BF2F31E4012@bag.python.org> Author: dirkjan.ochtman Date: Mon May 11 14:50:03 2009 New Revision: 72563 Log: Remove DVCS comparison from PEP 374 and talk about hg migration instead. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Mon May 11 14:50:03 2009 @@ -1,11 +1,9 @@ PEP: 374 -Title: Migrating from svn to a distributed VCS +Title: Migrating from svn to Mercurial Version: $Revision$ Last-Modified: $Date$ Author: Brett Cannon , - Stephen J. Turnbull , - Alexandre Vassalotti , - Barry Warsaw + Dirkjan Ochtman Status: Active Type: Process Content-Type: text/x-rst @@ -19,8 +17,8 @@ chosen DVCS. -Rationale -========= +Motivation +========== Python has been using a centralized version control system (VCS; first CVS, now Subversion) for years to great effect. Having a master @@ -101,1371 +99,177 @@ the future as the state of DVCSs evolves. -Terminology -=========== - -Agreeing on a common terminology is surprisingly difficult, -primarily because each VCS uses these terms when describing subtly -different tasks, objects, and concepts. Where possible, we try to -provide a generic definition of the concepts, but you should consult -the individual system's glossaries for details. Here are some basic -references for terminology, from some of the standard web-based -references on each VCS. You can also refer to glossaries for each -DVCS: - -* Subversion : http://svnbook.red-bean.com/en/1.5/svn.basic.html -* Bazaar : http://bazaar-vcs.org/BzrGlossary -* Mercurial : http://www.selenic.com/mercurial/wiki/index.cgi/UnderstandingMercurial -* git : http://book.git-scm.com/1_the_git_object_model.html - - -branch - A line of development; a collection of revisions, ordered by - time. - -checkout/working copy/working tree - A tree of code the developer can edit, linked to a branch. - -index - A "staging area" where a revision is built (unique to git). - -repository - A collection of revisions, organized into branches. - -clone - A complete copy of a branch or repository. - -commit - To record a revision in a repository. - -merge - Applying all the changes and history from one branch/repository - to another. - -pull - To update a checkout/clone from the original branch/repository, - which can be remote or local - -push/publish - To copy a revision, and all revisions it depends on, from a one - repository to another. - -cherry-pick - To merge one or more specific revisions from one branch to - another, possibly in a different repository, possibly without its - dependent revisions. - -rebase - To "detach" a branch, and move it to a new branch point; move - commits to the beginning of a branch instead of where they - happened in time. - - -Typical Workflow -================ - -At the moment, the typical workflow for a Python core developer is: - +Choice of DVCS +============== -* Edit code in a checkout until it is stable enough to commit/push. -* Commit to the master repository. +This PEP included a thorough investigation of three DVCSs as options for +migration, with substantial work from Barry Warsaw, Alexandre Vassalotti and +Stephen Turnbull. That comparison has been moved to `DvcsComparison`_, and +this PEP now includes more information on the migration to Mercurial. -It is a rather simple workflow, but it has drawbacks. For one, -because any work that involves the repository takes time thanks to -the network, commits/pushes tend to not necessarily be as atomic as -possible. There is also the drawback of there not being a -necessarily cheap way to create new checkouts beyond a recursive -copy of the checkout directory. +.. _DvcsComparison: http://wiki.python.org/moin/DvcsComparison -A DVCS would lead to a workflow more like this: +At PyCon 2009, a `decision +`_ +was made to go with Mercurial. -* Branch off of a local clone of the master repository. -* Edit code, committing in atomic pieces. -* Merge the branch into the mainline, and -* Push all commits to the master repository. +The choice to go with Mercurial was made for three important reasons: -While there are more possible steps, the workflow is much more -independent of the master repository than is currently possible. By -being able to commit locally at the speed of your disk, a core -developer is able to do atomic commits much more frequently, -minimizing having commits that do multiple things to the code. Also -by using a branch, the changes are isolated (if desired) from other -changes being made by other developers. Because branches are cheap, -it is easy to create and maintain many smaller branches that address -one specific issue, e.g. one bug or one new feature. More -sophisticated features of DVCSs allow the developer to more easily -track long running development branches as the official mainline -progresses. +* According to a small survey, Python developers are more interested in + using Mercurial than in Bazaar or Git. +* Mercurial is written in Python, which is congruent with the python-dev + tendency to 'eat their own dogfood'. -Contenders -========== +* Mercurial is significantly faster than bzr (it's slower than git, though + by a much smaller difference). -========== ========== ======= =================================== ========================================== -Name Short Name Version 2.x Trunk Mirror 3.x Trunk Mirror ----------- ---------- ------- ----------------------------------- ------------------------------------------ -Bazaar_ bzr 1.12 http://code.python.org/python/trunk http://code.python.org/python/3.0 -Mercurial_ hg 1.2.0 http://code.python.org/hg/trunk/ http://code.python.org/hg/branches/py3k/ -git_ N/A 1.6.1 git://code.python.org/python/trunk git://code.python.org/python/branches/py3k -========== ========== ======= =================================== ========================================== - -.. _Bazaar: http://bazaar-vcs.org/ -.. _Mercurial: http://www.selenic.com/mercurial/ -.. _git: http://www.git-scm.com/ - -This PEP does not consider darcs, arch, or monotone. The main -problem with these DVCSs is that they are simply not popular enough -to bother supporting when they do not provide some very compelling -features that the other DVCSs provide. Arch and darcs also have -significant performance problems which seem unlikely to be addressed -in the near future. - - -Interoperability -================ - -For those who have already decided which DVCSs they want to use, and -are willing to maintain local mirrors themselves, all three DVCSs -support interchange via the git "fast-import" changeset format. git -does so natively, of course, and native support for Bazaar is under -active development, and getting good early reviews as of mid-February -2009. Mercurial has idiosyncratic support for importing via its *hg -convert* command, and `third-party fast-import support`_ is available -for exporting. Also, the Tailor_ tool supports automatic maintenance -of mirrors based on an official repository in any of the candidate -formats with a local mirror in any format. +* Mercurial is easier to learn for SVN users than bzr. -.. _third-party fast-import support: http://repo.or.cz/r/fast-export.git/.git/description -.. _Tailor: http://progetti.arstecnica.it/tailor/ +Although all of these points can be debated, in the end a pronouncement from +the BDFL was made to go with hg as the chosen DVCS for the Python project. -Usage Scenarios +Transition Plan =============== -Probably the best way to help decide on whether/which DVCS should -replace Subversion is to see what it takes to perform some -real-world usage scenarios that developers (core and non-core) have -to work with. Each usage scenario outlines what it is, a bullet list -of what the basic steps are (which can vary slightly per VCS), and -how to perform the usage scenario in the various VCSs -(including Subversion). - -Each VCS had a single author in charge of writing implementations -for each scenario (unless otherwise noted). - -========= === -Name VCS ---------- --- -Brett svn -Barry bzr -Alexandre hg -Stephen git -========= === - - -Initial Setup -------------- - -Some DVCSs have some perks if you do some initial setup upfront. -This section covers what can be done before any of the usage -scenarios are run in order to take better advantage of the tools. - -All of the DVCSs support configuring your project identification. -Unlike the centralized systems, they use your email address to -identify your commits. (Access control is generally done by -mechanisms external to the DVCS, such as ssh or console login). -This identity may be associated with a full name. - -All of the DVCSs will query the system to get some approximation to -this information, but that may not be what you want. They also -support setting this information on a per-user basis, and on a per- -project basis. Convenience commands to set these attributes vary, -but all allow direct editing of configuration files. - -Some VCSs support end-of-line (EOL) conversions on checkout/checkin. - - -svn -''' - -None required, but it is recommended you follow the -`guidelines `_ -in the dev FAQ. - - -bzr -''' - -No setup is required, but for much quicker and space-efficient local -branching, you should create a shared repository to hold all your -Python branches. A shared repository is really just a parent -directory containing a .bzr directory. When bzr commits a revision, -it searches from the local directory on up the file system for a .bzr -directory to hold the revision. By sharing revisions across multiple -branches, you cut down on the amount of disk space used. Do this:: - - cd ~/projects - bzr init-repo python - cd python - -Now, all your Python branches should be created inside of -``~/projects/python``. - -There are also some settings you can put in your -``~/.bzr/bazaar.conf`` -and ``~/.bzr/locations.conf`` file to set up defaults for interacting -with Python code. None of them are required, although some are -recommended. E.g. I would suggest gpg signing all commits, but that -might be too high a barrier for developers. Also, you can set up -default push locations depending on where you want to push branches -by default. If you have write access to the master branches, that -push location could be code.python.org. Otherwise, it might be a -free Bazaar code hosting service such as Launchpad. If Bazaar is -chosen, we should decide what the policies and recommendations are. - -At a minimum, I would set up your email address:: - - bzr whoami "Firstname Lastname " - -As with hg and git below, there are ways to set your email address (or really, -just about any parameter) on a -per-repository basis. You do this with settings in your -``$HOME/.bazaar/locations.conf`` file, which has an ini-style format as does -the other DVCSs. See the Bazaar documentation for details, -which mostly aren't relevant for this discussion. - - -hg -'' - -Minimally, you should set your user name. To do so, create the file -``.hgrc`` in your home directory and add the following:: - - [ui] - username = Firstname Lastname - -If you are using Windows and your tools do not support Unix-style newlines, -you can enable automatic newline translation by adding to your configuration:: - - [extensions] - win32text = - -These options can also be set locally to a given repository by -customizing ``/.hg/hgrc``, instead of ``~/.hgrc``. - - -git -''' - -None needed. However, git supports a number of features that can -smooth your work, with a little preparation. git supports setting -defaults at the workspace, user, and system levels. The system -level is out of scope of this PEP. The user configuration file is -``$HOME/.gitconfig`` on Unix-like systems, and the workspace -configuration file is ``$REPOSITORY/.git/config``. - -You can use the ``git-config`` tool to set preferences for user.name and -user.email either globally (for your system login account) or -locally (to a given git working copy), or you can edit the -configuration files (which have the same format as shown in the -Mercurial section above).:: - - # my full name doesn't change - # note "--global" flag means per user - # (system-wide configuration is set with "--system") - git config --global user.name 'Firstname Lastname' - # but use my Pythonic email address - cd /path/to/python/repository - git config user.email email.address at python.example.com - -If you are using Windows, you probably want to set the core.autocrlf -and core.safecrlf preferences to true using ``git-config``.:: - - # check out files with CRLF line endings rather than Unix-style LF only - git config --global core.autocrlf true - # scream if a transformation would be ambiguous - # (eg, a working file contains both naked LF and CRLF) - # and check them back in with the reverse transformation - git config --global core.safecrlf true - -Although the repository will usually contain a .gitignore file -specifying file names that rarely if ever should be registered in the -VCS, you may have personal conventions (e.g., always editing log -messages in a temporary file named ".msg") that you may wish to -specify.:: - - # tell git where my personal ignores are - git config --global core.excludesfile ~/.gitignore - # I use .msg for my long commit logs, and Emacs makes backups in - # files ending with ~ - # these are globs, not regular expressions - echo '*~' >> ~/.gitignore - echo '.msg' >> ~/.gitignore - -If you use multiple branches, as with the other VCSes, you can save a -lot of space by putting all objects in a common object store. This -also can save download time, if the origins of the branches were in -different repositories, because objects are shared across branches in -your repository even if they were not present in the upstream -repositories. git is very space- and time-efficient and applies a -number of optimizations automatically, so this configuration is -optional. (Examples are omitted.) - - -One-Off Checkout ----------------- - -As a non-core developer, I want to create and publish a one-off patch -that fixes a bug, so that a core developer can review it for -inclusion in the mainline. - -* Checkout/branch/clone trunk. -* Edit some code. -* Generate a patch (based on what is best supported by the VCS, e.g. - branch history). -* Receive reviewer comments and address the issues. -* Generate a second patch for the core developer to commit. - - -svn -''' -:: - - svn checkout http://svn.python.org/projects/python/trunk - cd trunk - # Edit some code. - echo "The cake is a lie!" > README - # Since svn lacks support for local commits, we fake it with patches. - svn diff >> commit-1.diff - svn diff >> patch-1.diff - # Upload the patch-1 to bugs.python.org. - # Receive reviewer comments. - # Edit some code. - echo "The cake is real!" > README - # Since svn lacks support for local commits, we fake it with patches. - svn diff >> commit-2.diff - svn diff >> patch-2.diff - # Upload patch-2 to bugs.python.org - - -bzr -''' -:: - - bzr branch http://code.python.org/python/trunk - cd trunk - # Edit some code. - bzr commit -m 'Stuff I did' - bzr send -o bundle - # Upload bundle to bugs.python.org - # Receive reviewer comments - # Edit some code - bzr commit -m 'Respond to reviewer comments' - bzr send -o bundle - # Upload updated bundle to bugs.python.org - -The ``bundle`` file is like a super-patch. It can be read by ``patch(1)`` but -it contains additional metadata so that it can be fed to ``bzr merge`` to -produce a fully usable branch completely with history. See `Patch Review`_ -section below. - - -hg -'' -:: - - hg clone http://code.python.org/hg/trunk - cd trunk - # Edit some code. - hg commit -m "Stuff I did" - hg outgoing -p > fixes.patch - # Upload patch to bugs.python.org - # Receive reviewer comments - # Edit some code - hg commit -m "Address reviewer comments." - hg outgoing -p > additional-fixes.patch - # Upload patch to bugs.python.org - -While ``hg outgoing`` does not have the flag for it, most Mercurial -commands support git's extended patch format through a ``--git`` -command. This can be set in one's ``.hgrc`` file so that all commands -that generate a patch use the extended format. - - -git -''' - -The patches could be created with -``git diff master > stuff-i-did.patch``, too, but -``git format-patch | git am`` knows some tricks -(empty files, renames, etc) that ordinary patch can't handle. git -grabs "Stuff I did" out of the the commit message to create the file -name 0001-Stuff-I-did.patch. See Patch Review below for a -description of the git-format-patch format. -:: - - # Get the mainline code. - git clone git://code.python.org/python/trunk - cd trunk - # Edit some code. - git commit -a -m 'Stuff I did.' - # Create patch for my changes (i.e, relative to master). - git format-patch master - git tag stuff-v1 - # Upload 0001-Stuff-I-did.patch to bugs.python.org. - # Time passes ... receive reviewer comments. - # Edit more code. - git commit -a -m 'Address reviewer comments.' - # Make an add-on patch to apply on top of the original. - git format-patch stuff-v1 - # Upload 0001-Address-reviewer-comments.patch to bugs.python.org. - - -Backing Out Changes -------------------- - -As a core developer, I want to undo a change that was not ready for -inclusion in the mainline. - -* Back out the unwanted change. -* Push patch to server. - - -svn -''' -:: - # Assume the change to revert is in revision 40 - svn merge -c -40 . - # Resolve conflicts, if any. - svn commit -m "Reverted revision 40" - - -bzr -''' -:: - - # Assume the change to revert is in revision 40 - bzr merge -r 40..39 - # Resolve conflicts, if any. - bzr commit -m "Reverted revision 40" - -Note that if the change you want revert is the last one that was -made, you can just use ``bzr uncommit``. - - -hg -'' -:: - - # Assume the change to revert is in revision 9150dd9c6d30 - hg backout --merge -r 9150dd9c6d30 - # Resolve conflicts, if any. - hg commit -m "Reverted changeset 9150dd9c6d30" - hg push - -Note, you can use "hg rollback" and "hg strip" to revert changes you committed -in your local repository, but did not yet push to other repositories. - -git -''' -:: - - # Assume the change to revert is the grandfather of a revision tagged "newhotness". - git revert newhotness~2 - # Resolve conflicts if any. If there are no conflicts, the commit - # will be done automatically by "git revert", which prompts for a log. - git commit -m "Reverted changeset 9150dd9c6d30." - git push - - -Patch Review +Introduction ------------ -As a core developer, I want to review patches submitted by other -people, so that I can make sure that only approved changes are added -to Python. - -Core developers have to review patches as submitted by other people. -This requires applying the patch, testing it, and then tossing away -the changes. The assumption can be made that a core developer already -has a checkout/branch/clone of the trunk. - -* Branch off of trunk. -* Apply patch w/o any comments as generated by the patch submitter. -* Push patch to server. -* Delete now-useless branch. - - -svn -''' - -Subversion does not exactly fit into this development style very well -as there are no such thing as a "branch" as has been defined in this -PEP. Instead a developer either needs to create another checkout for -testing a patch or create a branch on the server. Up to this point, -core developers have not taken the "branch on the server" approach to -dealing with individual patches. For this scenario the assumption -will be the developer creates a local checkout of the trunk to work -with.:: - - cp -r trunk issue0000 - cd issue0000 - patch -p0 < __patch__ - # Review patch. - svn commit -m "Some patch." - cd .. - rm -r issue0000 - -Another option is to only have a single checkout running at any one -time and use ``svn diff`` along with ``svn revert -R`` to store away -independent changes you may have made. - - -bzr -''' -:: - - bzr branch trunk issueNNNN - # Download `patch` bundle from Roundup - bzr merge patch - # Review patch - bzr commit -m'Patch NNN by So N. So' --fixes python:NNNN - bzr push bzr+ssh://me at code.python.org/trunk - rm -rf ../issueNNNN - -Alternatively, since you're probably going to commit these changes to -the trunk, you could just do a checkout. That would give you a local -working tree while the branch (i.e. all revisions) would continue to -live on the server. This is similar to the svn model and might allow -you to more quickly review the patch. There's no need for the push -in this case.:: - - bzr checkout trunk issueNNNN - # Download `patch` bundle from Roundup - bzr merge patch - # Review patch - bzr commit -m'Patch NNNN by So N. So' --fixes python:NNNN - rm -rf ../issueNNNN - - -hg -'' -:: - - hg clone trunk issue0000 - cd issue0000 - # If the patch was generated using hg export, the user name of the - # submitter is automatically recorded. Otherwise, - # use hg import --no-commit submitted.diff and commit with - # hg commit -u "Firstname Lastname " - hg import submitted.diff - # Review patch. - hg push ssh://alexandre at code.python.org/hg/trunk/ - - -git -''' -We assume a patch created by git-format-patch. This is a Unix mbox -file containing one or more patches, each formatted as an RFC 2822 -message. git-am interprets each message as a commit as follows. The -author of the patch is taken from the From: header, the date from the -Date header. The commit log is created by concatenating the content -of the subject line, a blank line, and the message body up to the -start of the patch.:: - - cd trunk - # Create a branch in case we don't like the patch. - # This checkout takes zero time, since the workspace is left in - # the same state as the master branch. - git checkout -b patch-review - # Download patch from bugs.python.org to submitted.patch. - git am < submitted.patch - # Review and approve patch. - # Merge into master and push. - git checkout master - git merge patch-review - git push - - -Backport --------- - -As a core developer, I want to apply a patch to 2.6, 2.7, 3.0, and 3.1 -so that I can fix a problem in all three versions. +To make the most of hg, I (Dirkjan) want to make a high-fidelity conversion, +such that (a) as much of the svn metadata as possible is retained, and (b) all +metadata is converted to formats that are common in Mercurial. This way, tools +written for Mercurial can be optimally used. In order to do this, I want to use +the `hgsubversion `_ software to do +an initial conversion. This hg extension is focused on providing high-quality +conversion from Subversion to Mercurial for use in two-way correspondence, +meaning it doesn't throw away as much available metadata as other solutions. + +Such a conversion also seems like a good time to reconsider the contents of +the repository and determine if some things are still valuable. In this spirit, +in the following sections I propose discarding some of the older metadata. + +Branch strategy +--------------- + +Mercurial has two basic ways of using branches: cloned branches, where each +branch is kept in a separate directory, and named branches, where each revision +keeps metadata to note on which branch it belongs. The former makes it easier +to distinguish branches, at the expense of requiring more disk space on the +client. The latter makes it a little easier to switch between branches, but +often has somewhat unintuitive results for people (though this has been +getting better in recent versions of Mercurial). + +For Python, I think it would work well to have cloned branches and keep most +things separate. This is predicated on the assumption that most people work on +just one (or maybe two) branches at a time. Branches can be exposed separately, +though I would advocate merging old (and tagged!) branches into mainline so +that people can easily revert to older releases. At what age of a release this +should be done can be debated (a natural point might be when the branch gets +unsupported, e.g. 2.4 at the release of 2.6). -Thanks to always having the cutting-edge and the latest release -version under development, Python currently has four branches being -worked on simultaneously. That makes it important for a change to -propagate easily through various branches. - -svn -''' - -Because of Python's use of svnmerge, changes start with the trunk -(2.7) and then get merged to the release version of 2.6. To get the -change into the 3.x series, the change is merged into 3.1, fixed up, -and then merged into 3.0 (2.7 -> 2.6; 2.7 -> 3.1 -> 3.0). - -This is in contrast to a port-forward strategy where the patch would -have been added to 2.6 and then pulled forward into newer versions -(2.6 -> 2.7 -> 3.0 -> 3.1). - -:: - - # Assume patch applied to 2.7 in revision 0000. - cd release26-maint - svnmerge merge -r 0000 - # Resolve merge conflicts and make sure patch works. - svn commit -F svnmerge-commit-message.txt # revision 0001. - cd ../py3k - svnmerge merge -r 0000 - # Same as for 2.6, except Misc/NEWS changes are reverted. - svn revert Misc/NEWS - svn commit -F svnmerge-commit-message.txt # revision 0002. - cd ../release30-maint - svnmerge merge -r 0002 - svn commit -F svnmerge-commit-message.txt # revision 0003. - - -bzr -''' - -Bazaar is pretty straightforward here, since it supports cherry -picking revisions manually. In the example below, we could have -given a revision id instead of a revision number, but that's usually -not necessary. Martin Pool suggests "We'd generally recommend doing -the fix first in the oldest supported branch, and then merging it -forward to the later releases.":: - - # Assume patch applied to 2.7 in revision 0000 - cd release26-maint - bzr merge ../trunk -c 0000 - # Resolve conflicts and make sure patch works - bzr commit -m 'Back port patch NNNN' - bzr push bzr+ssh://me at code.python.org/trunk - cd ../py3k - bzr merge ../trunk -r 0000 - # Same as for 2.6 except Misc/NEWS changes are reverted - bzr revert Misc/NEWS - bzr commit -m 'Forward port patch NNNN' - bzr push bzr+ssh://me at code.python.org/py3k - - -hg -'' - -Mercurial, like other DVCS, does not well support the current -workflow used by Python core developers to backport patches. Right -now, bug fixes are first applied to the development mainline -(i.e., trunk), then back-ported to the maintenance branches and -forward-ported, as necessary, to the py3k branch. This workflow -requires the ability to cherry-pick individual changes. Mercurial's -transplant extension provides this ability. Here is an example of -the scenario using this workflow:: - - cd release26-maint - # Assume patch applied to 2.7 in revision 0000 - hg transplant -s ../trunk 0000 - # Resolve conflicts, if any. - cd ../py3k - hg pull ../trunk - hg merge - hg revert Misc/NEWS - hg commit -m "Merged trunk" - hg push - -In the above example, transplant acts much like the current svnmerge -command. When transplant is invoked without the revision, the command -launches an interactive loop useful for transplanting multiple -changes. Another useful feature is the --filter option which can be -used to modify changesets programmatically (e.g., it could be used -for removing changes to Misc/NEWS automatically). - -Alternatively to the traditional workflow, we could avoid -transplanting changesets by committing bug fixes to the oldest -supported release, then merge these fixes upward to the more recent -branches. -:: - - cd release25-maint - hg import fix_some_bug.diff - # Review patch and run test suite. Revert if failure. - hg push - cd ../release26-maint - hg pull ../release25-maint - hg merge - # Resolve conflicts, if any. Then, review patch and run test suite. - hg commit -m "Merged patches from release25-maint." - hg push - cd ../trunk - hg pull ../release26-maint - hg merge - # Resolve conflicts, if any, then review. - hg commit -m "Merged patches from release26-maint." - hg push - -Although this approach makes the history non-linear and slightly -more difficult to follow, it encourages fixing bugs across all -supported releases. Furthermore, it scales better when there is many -changes to backport, because we do not need to seek the specific -revision IDs to merge. - - -git -''' - -In git I would have a workspace which contains all of -the relevant master repository branches. git cherry-pick doesn't -work across repositories; you need to have the branches in the same -repository. -:: - - # Assume patch applied to 2.7 in revision release27~3 (4th patch back from tip). - cd integration - git checkout release26 - git cherry-pick release27~3 - # If there are conflicts, resolve them, and commit those changes. - # git commit -a -m "Resolve conflicts." - # Run test suite. If fixes are necessary, record as a separate commit. - # git commit -a -m "Fix code causing test failures." - git checkout master - git cherry-pick release27~3 - # Do any conflict resolution and test failure fixups. - # Revert Misc/NEWS changes. - git checkout HEAD^ -- Misc/NEWS - git commit -m 'Revert cherry-picked Misc/NEWS changes.' Misc/NEWS - # Push both ports. - git push release26 master - -If you are regularly merging (rather than cherry-picking) from a -given branch, then you can block a given commit from being -accidentally merged in the future by merging, then reverting it. -This does not prevent a cherry-pick from pulling in the unwanted -patch, and this technique requires blocking everything that you don't -want merged. I'm not sure if this differs from svn on this point. -:: - - cd trunk - # Merge in the alpha tested code. - git merge experimental-branch - # We don't want the 3rd-to-last commit from the experimental-branch, - # and we don't want it to ever be merged. - # The notation "^N" means Nth parent of the current commit. Thus HEAD^2^1^1 - # means the first parent of the first parent of the second parent of HEAD. - git revert HEAD^2^1^1 - # Propagate the merge and the prohibition to the public repository. - git push - - -Coordinated Development of a New Feature ----------------------------------------- - -Sometimes core developers end up working on a major feature with -several developers. As a core developer, I want to be able to -publish feature branches to a common public location so that I can -collaborate with other developers. - -This requires creating a branch on a server that other developers -can access. All of the DVCSs support creating new repositories on -hosts where the developer is already able to commit, with -appropriate configuration of the repository host. This is -similar in concept to the existing sandbox in svn, although details -of repository initialization may differ. - -For non-core developers, there are various more-or-less public-access -repository-hosting services. -Bazaar has -Launchpad_, -Mercurial has -`bitbucket.org`_, -and git has -GitHub_. -All also have easy-to-use -CGI interfaces for developers who maintain their own servers. - - -.. _Launchpad: http://www.launchpad.net/ -.. _bitbucket.org: http://www.bitbucket.org/ -.. _GitHub: http://www.github.com/ - -* Branch trunk. -* Pull from branch on the server. -* Pull from trunk. -* Push merge to trunk. - - -svn -''' -:: - - # Create branch. - svn copy svn+ssh://pythondev at svn.python.org/python/trunk svn+ssh://pythondev at svn.python.org/python/branches/NewHotness - svn checkout svn+ssh://pythondev at svn.python.org/python/branches/NewHotness - cd NewHotness - svnmerge init - svn commit -m "Initialize svnmerge." - # Pull in changes from other developers. - svn update - # Pull in trunk and merge to the branch. - svnmerge merge - svn commit -F svnmerge-commit-message.txt - - -bzr -''' -:: - - XXX To be done by Brett as a test of knowledge and online documentation/community. - - -hg -'' -:: - - XXX To be done by Brett as a test of knowledge and online documentation/community. - - -git -''' -:: - - XXX To be done by Brett as a test of knowledge and online documentation/community. - - -Separation of Issue Dependencies --------------------------------- - -Sometimes, while working on an issue, it becomes apparent that the -problem being worked on is actually a compound issue of various -smaller issues. Being able to take the current work and then begin -working on a separate issue is very helpful to separate out issues -into individual units of work instead of compounding them into a -single, large unit. - -* Create a branch A (e.g. urllib has a bug). -* Edit some code. -* Create a new branch B that branch A depends on (e.g. the urllib - bug exposes a socket bug). -* Edit some code in branch B. -* Commit branch B. -* Edit some code in branch A. -* Commit branch A. -* Clean up. - - -svn -''' - -To make up for svn's lack of cheap branching, it has a changelist -option to associate a file with a single changelist. This is not as -powerful as being able to associate at the commit level. There is -also no way to express dependencies between changelists. -:: - - cp -r trunk issue0000 - cd issue0000 - # Edit some code. - echo "The cake is a lie!" > README - svn changelist A README - # Edit some other code. - echo "I own Python!" . LICENSE - svn changelist B LICENSE - svn ci -m "Tell it how it is." --changelist B - # Edit changelist A some more. - svn ci -m "Speak the truth." --changelist A - cd .. - rm -rf issue0000 - - -bzr -''' -Here's an approach that uses bzr shelf (now a standard part of bzr) -to squirrel away some changes temporarily while you take a detour to -fix the socket bugs. -:: - - bzr branch trunk bug-0000 - cd bug-0000 - # Edit some code. Dang, we need to fix the socket module. - bzr shelve --all - # Edit some code. - bzr commit -m "Socket module fixes" - # Detour over, now resume fixing urllib - bzr unshelve - # Edit some code - -Another approach uses the loom plugin. Looms can -greatly simplify working on dependent branches because they -automatically take care of the stacking dependencies for you. -Imagine looms as a stack of dependent branches (called "threads" in -loom parlance), with easy ways to move up and down the stack of -threads, merge changes up the stack to descendant threads, create -diffs between threads, etc. Occasionally, you may need or want to -export your loom threads into separate branches, either for review -or commit. Higher threads incorporate all the changes in the lower -threads, automatically. -:: - - bzr branch trunk bug-0000 - cd bug-0000 - bzr loomify --base trunk - bzr create-thread fix-urllib - # Edit some code. Dang, we need to fix the socket module first. - bzr commit -m "Checkpointing my work so far" - bzr down-thread - bzr create-thread fix-socket - # Edit some code - bzr commit -m "Socket module fixes" - bzr up-thread - # Manually resolve conflicts if necessary - bzr commit -m 'Merge in socket fixes' - # Edit me some more code - bzr commit -m "Now that socket is fixed, complete the urllib fixes" - bzr record done - -For bonus points, let's say someone else fixes the socket module in -exactly the same way you just did. Perhaps this person even grabbed your -fix-socket thread and applied just that to the trunk. You'd like to -be able to merge their changes into your loom and delete your -now-redundant fix-socket thread. -:: - - bzr down-thread trunk - # Get all new revisions to the trunk. If you've done things - # correctly, this will succeed without conflict. - bzr pull - bzr up-thread - # See? The fix-socket thread is now identical to the trunk - bzr commit -m 'Merge in trunk changes' - bzr diff -r thread: | wc -l # returns 0 - bzr combine-thread - bzr up-thread - # Resolve any conflicts - bzr commit -m 'Merge trunk' - # Now our top-thread has an up-to-date trunk and just the urllib fix. - - -hg -'' - -One approach is to use the shelve extension; this extension is not included -with Mercurial, but it is easy to install. With shelve, you can select changes -to put temporarily aside. -:: - - hg clone trunk issue0000 - cd issue0000 - # Edit some code (e.g. urllib). - hg shelve - # Select changes to put aside - # Edit some other code (e.g. socket). - hg commit - hg unshelve - # Complete initial fix. - hg commit - cd ../trunk - hg pull ../issue0000 - hg merge - hg commit - rm -rf ../issue0000 - -Several other way to approach this scenario with Mercurial. Alexander Solovyov -presented a few `alternative approaches`_ on Mercurial's mailing list. - -.. _alternative approaches: http://selenic.com/pipermail/mercurial/2009-January/023710.html - -git -''' -:: - - cd trunk - # Edit some code in urllib. - # Discover a bug in socket, want to fix that first. - # So save away our current work. - git stash - # Edit some code, commit some changes. - git commit -a -m "Completed fix of socket." - # Restore the in-progress work on urllib. - git stash apply - # Edit me some more code, commit some more fixes. - git commit -a -m "Complete urllib fixes." - # And push both patches to the public repository. - git push - -Bonus points: suppose you took your time, and someone else fixes -socket in the same way you just did, and landed that in the trunk. In -that case, your push will fail because your branch is not up-to-date. -If the fix was a one-liner, there's a very good chance that it's -*exactly* the same, character for character. git would notice that, -and you are done; git will silently merge them. - -Suppose we're not so lucky:: - - # Update your branch. - git pull git://code.python.org/public/trunk master - - # git has fetched all the necessary data, but reports that the - # merge failed. We discover the nearly-duplicated patch. - # Neither our version of the master branch nor the workspace has - # been touched. Revert our socket patch and pull again: - git revert HEAD^ - git pull git://code.python.org/public/trunk master - -Like Bazaar and Mercurial, git has extensions to manage stacks of -patches. You can use the original Quilt by Andrew Morton, or there is -StGit ("stacked git") which integrates patch-tracking for large sets -of patches into the VCS in a way similar to Mercurial Queues or Bazaar -looms. - - -Doing a Python Release ----------------------- - -How does PEP 101 change when using a DVCS? - - -bzr -''' - -It will change, but not substantially so. When doing the -maintenance branch, we'll just push to the new location instead of -doing an svn cp. Tags are totally different, since in svn they are -directory copies, but in bzr (and I'm guessing hg), they are just -symbolic names for revisions on a particular branch. The release.py -script will have to change to use bzr commands instead. It's -possible that because DVCS (in particular, bzr) does cherry picking -and merging well enough that we'll be able to create the maint -branches sooner. It would be a useful exercise to try to do a -release off the bzr/hg mirrors. - - -hg -'' - -Clearly, details specific to Subversion in PEP 101 and in the -release script will need to be updated. In particular, release -tagging and maintenance branches creation process will have to be -modified to use Mercurial's features; this will simplify and -streamline certain aspects of the release process. For example, -tagging and re-tagging a release will become a trivial operation -since a tag, in Mercurial, is simply a symbolic name for a given -revision. - - -git -''' - -It will change, but not substantially so. When doing the -maintenance branch, we'll just git push to the new location instead -of doing an svn cp. Tags are totally different, since in svn they -are directory copies, but in git they are just symbolic names for -revisions, as are branches. (The difference between a tag and a -branch is that tags refer to a particular commit, and will never -change unless you use git tag -f to force them to move. The -checked-out branch, on the other hand, is automatically updated by -git commit.) The release.py script will have to change to use git -commands instead. With git I would create a (local) maintenance -branch as soon as the release engineer is chosen. Then I'd "git -pull" until I didn't like a patch, when it would be "git pull; git -revert ugly-patch", until it started to look like the sensible thing -is to fork off, and start doing "git cherry-pick" on the good -patches. +Converting branches +------------------- +There are quite a lot of branches in SVN's branches directory. I propose to +clean this up a bit, by employing the following the strategy: -Platform/Tool Support -===================== +* Keep all release (maintenance) branches +* Discard branches that haven't been touched in 18 months, unless somone + indicates there's still interest in such a branch +* Keep branches that have been touched in the last 18 months, unless someone + indicates the branch can be deprecated + +Converting tags +--------------- + +The SVN tags directory contains a lot of old stuff. Some of these are not, in +fact, full tags, but contain only a smaller subset of the repository. I think +we should keep all release tags, and consider other tags for inclusion based +on requests from the developer community. I'd like to consider unifying the +release tag naming scheme to make some things more consistent, if people feel +that won't create too many problems. + +Author map +---------- + +In order to provide user names the way they are common in hg (in the 'First Last +' format), we need an author map to map cvs and svn user +names to real names and their email addresses. I have a complete version of such +a map in my `migration tools repository`_. The email addresses in it might be +out of date; that's bound to happen, although it would be nice to try and +have as many people as possible review it for addresses that are out of date. +The current version also still seems to contain some encoding problems. + +.. _migration tools repository: http://hg.xavamedia.nl/cpython/pymigr/ + +Generating .hgignore +-------------------- + +The .hgignore file can be used in Mercurial repositories to help ignore files +that are not eligible for version control. It does this by employing several +possible forms of pattern matching. The current Python repository already +includes a rudimentary .hgignore file to help with using the hg mirrors. + +It might be useful to have the .hgignore be generated automatically from +svn:ignore properties. This would make sure all historic revisions also have +useful ignore information (though one could argue ignoring isn't really +relevant to just checking out an old revision). -Operating Systems +Revlog reordering ----------------- -==== ======================================= ============================================= ============================= -DVCS Windows OS X UNIX ----- --------------------------------------- --------------------------------------------- ----------------------------- -bzr yes (installer) w/ tortoise yes (installer, fink or MacPorts) yes (various package formats) -hg yes (third-party installer) w/ tortoise yes (third-party installer, fink or MacPorts) yes (various package formats) -git yes (third-party installer) yes (third-party installer, fink or MacPorts) yes (.deb or .rpm) -==== ======================================= ============================================= ============================= - -As the above table shows, all three DVCSs are available on all three -major OS platforms. But what it also shows is that Bazaar is the -only DVCS that directly supports Windows with a binary installer -while Mercurial and git require you to rely on a third-party for -binaries. Both bzr and hg have a tortoise version while git does not. -Bazaar and Mercurial also has the benefit of being available in pure -Python with optional extensions available for performance. +As an optional optimization technique, we should consider trying a reordering +pass on the revlogs (internal Mercurial files) resulting from the conversion. +In some cases this results in dramatic decreases in on-disk repository size. - -CRLF -> LF Support +Other repositories ------------------ -bzr - My understanding is that support for this is being worked on as - I type, landing in a version RSN. I will try to dig up details. - -hg - Supported via the win32text extension. - -git - I can't say from personal experience, but it looks like there's - pretty good support via the core.autocrlf and core.safecrlf - configuration attributes. - - -Case-insensitive filesystem support ------------------------------------ - -bzr - Should be OK. I share branches between Linux and OS X all the - time. I've done case changes (e.g. ``bzr mv Mailman mailman``) and - as long as I did it on Linux (obviously), when I pulled in the - changes on OS X everything was hunky dory. - -hg - Mercurial uses a case safe repository mechanism and detects case - folding collisions. - -git - Since OS X preserves case, you can do case changes there too. - git does not have a problem with renames in either direction. - However, case-insensitive filesystem support is usually taken - to mean complaining about collisions on case-sensitive files - systems. git does not do that. - - -Tools ------ - -In terms of code review tools such as `Review Board`_ and Rietveld_, -the former supports all three while the latter supports hg and git but -not bzr. Bazaar does not yet have an online review board, but it -has several ways to manage email based reviews and trunk merging. -There's `Bundle Buggy`_, `Patch Queue Manager`_ (PQM), and -`Launchpad's code reviews `_. - -.. _Review Board: http://www.review-board.org/ -.. _Rietveld: http://code.google.com/p/rietveld/ +Richard Tew has indicated that he'd like the Stackless repository to also be +converted. What other projects in the svn.python.org repository should be +converted? Do we want to convert the peps repository? distutils? others? -.. _Bundle Buggy: http://code.aaronbentley.com/bundlebuggy/ -.. _Patch Queue Manager: http://bazaar-vcs.org/PatchQueueManager -All three have some web site online that provides basic hosting -support for people who want to put a repository online. Bazaar has -Launchpad, Mercurial has bitbucket.org, and git has GitHub. Google -Code also has instructions on how to use git with the service, both -to hold a repository and how to act as a read-only mirror. - -All three also `appear to be supported -`_ -by Buildbot_. - -.. _Buildbot: http://buildbot.net - - -Usage On Top Of Subversion -========================== - -==== ============ -DVCS svn support ----- ------------ -bzr bzr-svn_ (third-party) -hg `multiple third-parties `__ -git git-svn_ -==== ============ - -.. _bzr-svn: http://bazaar-vcs.org/BzrForeignBranches/Subversion -.. _git-svn: http://www.kernel.org/pub/software/scm/git/docs/git-svn.html - -All three DVCSs have svn support, although git is the only one to -come with that support out-of-the-box. - - -Server Support +Infrastructure ============== -==== ================== -DVCS Web page interface ----- ------------------ -bzr loggerhead_ -hg hgweb_ -git gitweb_ -==== ================== - -.. _loggerhead: https://launchpad.net/loggerhead -.. _hgweb: http://www.selenic.com/mercurial/wiki/index.cgi/HgWebDirStepByStep -.. _gitweb: http://git.or.cz/gitwiki/Gitweb - -All three DVCSs support various hooks on the client and server side -for e.g. pre/post-commit verifications. - - -Development -=========== - -All three projects are under active development. Git seems to be on a -monthly release schedule. Bazaar is on a time-released monthly -schedule. Mercurial is on a 4-month, timed release schedule. - - -Special Features -================ - -bzr ---- - -Martin Pool adds: "bzr has a stable Python scripting interface, with -a distinction between public and private interfaces and a -deprecation window for APIs that are changing. Some plugins are -listed in https://edge.launchpad.net/bazaar and -http://bazaar-vcs.org/Documentation". - - -hg --- - -Alexander Solovyov comments: - - Mercurial has easy to use extensive API with hooks for main events - and ability to extend commands. Also there is the mq (mercurial - queues) extension, distributed with Mercurial, which simplifies - work with patches. - - -git ---- - -git has a cvsserver mode, ie, you can check out a tree from git -using CVS. You can even commit to the tree, but features like -merging are absent, and branches are handled as CVS modules, which -is likely to shock a veteran CVS user. - - -Tests/Impressions -================= - -As I (Brett Cannon) am left with the task of of making the final -decision of which/any DVCS to go with and not my co-authors, I felt -it only fair to write down what tests I ran and my impressions as I -evaluate the various tools so as to be as transparent as possible. - - -Barrier to Entry ----------------- +hg-ssh +------ -The amount of time and effort it takes to get a checkout of Python's -repository is critical. If the difficulty or time is too great then a -person wishing to contribute to Python may very well give up. That -cannot be allowed to happen. +Developers should access the repositories through ssh, similar to the current +setup. Public keys can be used to grant people access to a shared hg@ account. +A hgwebdir instance should also be set up for easy browsing and read-only +access. Some facility for sandboxes/incubator repositories could be discussed. -I measured the checking out of the 2.x trunk as if I was a non-core -developer. Timings were done using the ``time`` command in zsh and -space was calculated with ``du -c -h``. - -======= ================ ========= ===== -DVCS San Francisco Vancouver Space -------- ---------------- --------- ----- -svn 1:04 2:59 139 M -bzr 10:45 16:04 276 M -hg 2:30 5:24 171 M -git 2:54 5:28 134 M -======= ================ ========= ===== - -When comparing these numbers to svn, it is important to realize that -it is not a 1:1 comparison. Svn does not pull down the entire revision -history like all of the DVCSs do. That means svn can perform an -initial checkout much faster than the DVCS purely based on the fact -that it has less information to download for the network. - - -Performance of basic information functionality ----------------------------------------------- - -To see how the tools did for performing a command that required -querying the history, the log for the ``README`` file was timed. - -==== ===== -DVCS Time ----- ----- -bzr 4.5 s -hg 1.1 s -git 1.5 s -==== ===== - -One thing of note during this test was that git took longer than the -other three tools to figure out how to get the log without it using a -pager. While the pager use is a nice touch in general, not having it -automatically turn on took some time (turns out the main ``git`` -command has a ``--no-pager`` flag to disable use of the pager). - - -Figuring out what command to use from built-in help ----------------------------------------------------- - -I ended up trying to find out what the command was to see what URL the -repository was cloned from. To do this I used nothing more than the -help provided by the tool itself or its man pages. - -Bzr was the easiest: ``bzr info``. Running ``bzr help`` didn't show -what I wanted, but mentioned ``bzr help commands``. That list had the -command with a description that made sense. - -Git was the second easiest. The command ``git help`` didn't show much -and did not have a way of listing all commands. That is when I viewed -the man page. Reading through the various commands I discovered ``git -remote``. The command itself spit out nothing more than ``origin``. -Trying ``git remote origin`` said it was an error and printed out the -command usage. That is when I noticed ``git remote show``. Running -``git remote show origin`` gave me the information I wanted. - -For hg, I never found the information I wanted on my own. It turns out -I wanted ``hg paths``, but that was not obvious from the description -of "show definition of symbolic path names" as printed by ``hg help`` -(it should be noted that reporting this in the PEP did lead to the -Mercurial developers to clarify the wording to make the use of the -``hg paths`` command clearer). - - -Updating a checkout ---------------------- - -To see how long it takes to update an outdated repository I timed both -updating a repository 700 commits behind and 50 commits behind (three -weeks stale and 1 week stale, respectively). - -==== =========== ========== -DVCS 700 commits 50 commits ----- ----------- ---------- -bzr 39 s 7 s -hg 17 s 3 s -git N/A 4 s -==== =========== ========== - -.. note:: - Git lacks a value for the *700 commits* scenario as it does - not seem to allow checking out a repository at a specific - revision. - -Git deserves special mention for its output from ``git pull``. It -not only lists the delta change information for each file but also -color-codes the information. - - -XXX ... usage on top of svn, filling in `Coordinated Development of a -New Feature`_ scenario - - - -Chosen DVCS -=========== - -The `decision -`_ -was made at PyCon 2009 to go with Mercurial_. +Hooks +----- -XXX details as to why +A number of hooks is currently in use. The hg equivalents for these should be +developed and deployed. The following hooks are being used: +* check whitespace: a hook to reject commits in case the whitespace doesn't + match the rules for the Python codebase. Should be straightforward to + re-implement from the current version. Open issue: do we check only the tip + after each push, or do we check every commit in a changegroup? + +* commit mails: we can leverage the notify extension for this + +* buildbots: both the regular and the community build masters must be notified. + Fortunately buildbot includes support for hg. I've also implemented this for + Mercurial itself, so I don't expect problems here. + +* check contributors: in the current setup, all changesets bear the username of + committers, who must have signed the contributor agreement. In a DVCS, the + committers are not necessarily the same people who push, and so we can't + check if the committer is a contributor. We could use a hook to check if the + committer is a contributor if we keep a list of registered contributors. -Transition Plan -=============== +hgwebdir +-------- -XXX +A more or less stock hgwebdir installation should be set up. We might want to +come up with a style to match the Python website. It may also be useful to +build a quick extension to augment the URL rev parser so that it can also take +r[0-9]+ args and come up with the matching hg revision. From python-checkins at python.org Mon May 11 18:09:39 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 11 May 2009 18:09:39 +0200 (CEST) Subject: [Python-checkins] r72566 - in python/branches/release26-maint: Lib/test/test_float.py Misc/NEWS Objects/floatobject.c Message-ID: <20090511160939.637A4D28A@mail.python.org> Author: mark.dickinson Date: Mon May 11 18:09:39 2009 New Revision: 72566 Log: Merged revisions 72564 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72564 | mark.dickinson | 2009-05-11 16:33:08 +0100 (Mon, 11 May 2009) | 2 lines Issue #5981: Fix some float.fromhex bugs related to inf and nan handling. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_float.py python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Objects/floatobject.c Modified: python/branches/release26-maint/Lib/test/test_float.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_float.py (original) +++ python/branches/release26-maint/Lib/test/test_float.py Mon May 11 18:09:39 2009 @@ -391,6 +391,11 @@ 'snan', 'NaNs', 'nna', + 'an', + 'nf', + 'nfinity', + 'inity', + 'iinity', '0xnan', '', ' ', @@ -439,6 +444,32 @@ 'got %r instead' % (x, result)) + def test_whitespace(self): + value_pairs = [ + ('inf', INF), + ('-Infinity', -INF), + ('nan', NAN), + ('1.0', 1.0), + ('-0x.2', -0.125), + ('-0.0', -0.0) + ] + whitespace = [ + '', + ' ', + '\t', + '\n', + '\n \t', + '\f', + '\v', + '\r' + ] + for inp, expected in value_pairs: + for lead in whitespace: + for trail in whitespace: + got = fromHex(lead + inp + trail) + self.identical(got, expected) + + def test_from_hex(self): MIN = self.MIN; MAX = self.MAX; Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Mon May 11 18:09:39 2009 @@ -12,6 +12,11 @@ Core and Builtins ----------------- +- Issue #5981: Fix two minor inf/nan issues in float.fromhex: (1) inf + and nan strings with trailing whitespace were incorrectly rejected + and (2) the interpretation of fromhex('-nan') didn't match that of + float('-nan'). + - Issue #5890: in subclasses of 'property' the __doc__ attribute was shadowed by classtype's, even if it was None. property now inserts the __doc__ into the subclass instance __dict__. Modified: python/branches/release26-maint/Objects/floatobject.c ============================================================================== --- python/branches/release26-maint/Objects/floatobject.c (original) +++ python/branches/release26-maint/Objects/floatobject.c Mon May 11 18:09:39 2009 @@ -1263,6 +1263,20 @@ >>> 3.14159.hex()\n\ '0x1.921f9f01b866ep+1'"); +/* Case-insensitive string match used for nan and inf detection. t should be + lower-case and null-terminated. Return a nonzero result if the first + strlen(t) characters of s match t and 0 otherwise. */ + +static int +case_insensitive_match(const char *s, const char *t) +{ + while(*t && tolower(*s) == *t) { + s++; + t++; + } + return *t ? 0 : 1; +} + /* Convert a hexadecimal string to a float. */ static PyObject * @@ -1329,7 +1343,7 @@ ********************/ /* leading whitespace and optional sign */ - while (isspace(*s)) + while (*s && isspace(Py_CHARMASK(*s))) s++; if (*s == '-') { s++; @@ -1339,13 +1353,20 @@ s++; /* infinities and nans */ - if (PyOS_strnicmp(s, "nan", 4) == 0) { - x = Py_NAN; + if (*s == 'i' || *s == 'I') { + if (!case_insensitive_match(s+1, "nf")) + goto parse_error; + s += 3; + x = Py_HUGE_VAL; + if (case_insensitive_match(s, "inity")) + s += 5; goto finished; } - if (PyOS_strnicmp(s, "inf", 4) == 0 || - PyOS_strnicmp(s, "infinity", 9) == 0) { - x = sign*Py_HUGE_VAL; + if (*s == 'n' || *s == 'N') { + if (!case_insensitive_match(s+1, "an")) + goto parse_error; + s += 3; + x = Py_NAN; goto finished; } @@ -1398,12 +1419,6 @@ else exp = 0; - /* optional trailing whitespace leading to the end of the string */ - while (isspace(*s)) - s++; - if (s != s_end) - goto parse_error; - /* for 0 <= j < ndigits, HEX_DIGIT(j) gives the jth most significant digit */ #define HEX_DIGIT(j) hex_from_char(*((j) < fdigits ? \ coeff_end-(j) : \ @@ -1417,7 +1432,7 @@ while (ndigits > 0 && HEX_DIGIT(ndigits-1) == 0) ndigits--; if (ndigits == 0 || exp < LONG_MIN/2) { - x = sign * 0.0; + x = 0.0; goto finished; } if (exp > LONG_MAX/2) @@ -1433,7 +1448,7 @@ /* catch almost all nonextreme cases of overflow and underflow here */ if (top_exp < DBL_MIN_EXP - DBL_MANT_DIG) { - x = sign * 0.0; + x = 0.0; goto finished; } if (top_exp > DBL_MAX_EXP) @@ -1448,7 +1463,7 @@ /* no rounding required */ for (i = ndigits-1; i >= 0; i--) x = 16.0*x + HEX_DIGIT(i); - x = sign * ldexp(x, (int)(exp)); + x = ldexp(x, (int)(exp)); goto finished; } /* rounding required. key_digit is the index of the hex digit @@ -1482,10 +1497,15 @@ goto overflow_error; } } - x = sign * ldexp(x, (int)(exp+4*key_digit)); + x = ldexp(x, (int)(exp+4*key_digit)); finished: - result_as_float = Py_BuildValue("(d)", x); + /* optional trailing whitespace leading to the end of the string */ + while (*s && isspace(Py_CHARMASK(*s))) + s++; + if (s != s_end) + goto parse_error; + result_as_float = Py_BuildValue("(d)", sign * x); if (result_as_float == NULL) return NULL; result = PyObject_CallObject(cls, result_as_float); From python-checkins at python.org Mon May 11 18:27:53 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 11 May 2009 18:27:53 +0200 (CEST) Subject: [Python-checkins] r72567 - in python/branches/release30-maint: Lib/test/test_float.py Misc/NEWS Objects/floatobject.c Message-ID: <20090511162753.C549FD2D5@mail.python.org> Author: mark.dickinson Date: Mon May 11 18:27:53 2009 New Revision: 72567 Log: Merged revisions 72565 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72565 | mark.dickinson | 2009-05-11 16:45:15 +0100 (Mon, 11 May 2009) | 9 lines Merged revisions 72564 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72564 | mark.dickinson | 2009-05-11 16:33:08 +0100 (Mon, 11 May 2009) | 2 lines Issue #5981: Fix some float.fromhex bugs related to inf and nan handling. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_float.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Objects/floatobject.c Modified: python/branches/release30-maint/Lib/test/test_float.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_float.py (original) +++ python/branches/release30-maint/Lib/test/test_float.py Mon May 11 18:27:53 2009 @@ -442,6 +442,11 @@ 'snan', 'NaNs', 'nna', + 'an', + 'nf', + 'nfinity', + 'inity', + 'iinity', '0xnan', '', ' ', @@ -490,6 +495,32 @@ 'got %r instead' % (x, result)) + def test_whitespace(self): + value_pairs = [ + ('inf', INF), + ('-Infinity', -INF), + ('nan', NAN), + ('1.0', 1.0), + ('-0x.2', -0.125), + ('-0.0', -0.0) + ] + whitespace = [ + '', + ' ', + '\t', + '\n', + '\n \t', + '\f', + '\v', + '\r' + ] + for inp, expected in value_pairs: + for lead in whitespace: + for trail in whitespace: + got = fromHex(lead + inp + trail) + self.identical(got, expected) + + def test_from_hex(self): MIN = self.MIN; MAX = self.MAX; Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Mon May 11 18:27:53 2009 @@ -12,6 +12,11 @@ Core and Builtins ----------------- +- Issue #5981: Fix two minor inf/nan issues in float.fromhex: (1) inf + and nan strings with trailing whitespace were incorrectly rejected + and (2) the interpretation of fromhex('-nan') didn't match that of + float('-nan'). + - Issue #5890: in subclasses of 'property' the __doc__ attribute was shadowed by classtype's, even if it was None. property now inserts the __doc__ into the subclass instance __dict__. Modified: python/branches/release30-maint/Objects/floatobject.c ============================================================================== --- python/branches/release30-maint/Objects/floatobject.c (original) +++ python/branches/release30-maint/Objects/floatobject.c Mon May 11 18:27:53 2009 @@ -1171,6 +1171,20 @@ >>> 3.14159.hex()\n\ '0x1.921f9f01b866ep+1'"); +/* Case-insensitive string match used for nan and inf detection. t should be + lower-case and null-terminated. Return a nonzero result if the first + strlen(t) characters of s match t and 0 otherwise. */ + +static int +case_insensitive_match(const char *s, const char *t) +{ + while(*t && tolower(*s) == *t) { + s++; + t++; + } + return *t ? 0 : 1; +} + /* Convert a hexadecimal string to a float. */ static PyObject * @@ -1238,7 +1252,7 @@ ********************/ /* leading whitespace and optional sign */ - while (isspace(Py_CHARMASK(*s))) + while (*s && isspace(Py_CHARMASK(*s))) s++; if (*s == '-') { s++; @@ -1248,13 +1262,20 @@ s++; /* infinities and nans */ - if (PyOS_strnicmp(s, "nan", 4) == 0) { - x = Py_NAN; + if (*s == 'i' || *s == 'I') { + if (!case_insensitive_match(s+1, "nf")) + goto parse_error; + s += 3; + x = Py_HUGE_VAL; + if (case_insensitive_match(s, "inity")) + s += 5; goto finished; } - if (PyOS_strnicmp(s, "inf", 4) == 0 || - PyOS_strnicmp(s, "infinity", 9) == 0) { - x = sign*Py_HUGE_VAL; + if (*s == 'n' || *s == 'N') { + if (!case_insensitive_match(s+1, "an")) + goto parse_error; + s += 3; + x = Py_NAN; goto finished; } @@ -1307,12 +1328,6 @@ else exp = 0; - /* optional trailing whitespace leading to the end of the string */ - while (isspace(Py_CHARMASK(*s))) - s++; - if (s != s_end) - goto parse_error; - /* for 0 <= j < ndigits, HEX_DIGIT(j) gives the jth most significant digit */ #define HEX_DIGIT(j) hex_from_char(*((j) < fdigits ? \ coeff_end-(j) : \ @@ -1326,7 +1341,7 @@ while (ndigits > 0 && HEX_DIGIT(ndigits-1) == 0) ndigits--; if (ndigits == 0 || exp < LONG_MIN/2) { - x = sign * 0.0; + x = 0.0; goto finished; } if (exp > LONG_MAX/2) @@ -1342,7 +1357,7 @@ /* catch almost all nonextreme cases of overflow and underflow here */ if (top_exp < DBL_MIN_EXP - DBL_MANT_DIG) { - x = sign * 0.0; + x = 0.0; goto finished; } if (top_exp > DBL_MAX_EXP) @@ -1357,7 +1372,7 @@ /* no rounding required */ for (i = ndigits-1; i >= 0; i--) x = 16.0*x + HEX_DIGIT(i); - x = sign * ldexp(x, (int)(exp)); + x = ldexp(x, (int)(exp)); goto finished; } /* rounding required. key_digit is the index of the hex digit @@ -1391,10 +1406,15 @@ goto overflow_error; } } - x = sign * ldexp(x, (int)(exp+4*key_digit)); + x = ldexp(x, (int)(exp+4*key_digit)); finished: - result_as_float = Py_BuildValue("(d)", x); + /* optional trailing whitespace leading to the end of the string */ + while (*s && isspace(Py_CHARMASK(*s))) + s++; + if (s != s_end) + goto parse_error; + result_as_float = Py_BuildValue("(d)", sign * x); if (result_as_float == NULL) return NULL; result = PyObject_CallObject(cls, result_as_float); From python-checkins at python.org Mon May 11 18:41:34 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 11 May 2009 18:41:34 +0200 (CEST) Subject: [Python-checkins] r72568 - python/branches/py3k/Misc/NEWS Message-ID: <20090511164134.6B97FD37B@mail.python.org> Author: mark.dickinson Date: Mon May 11 18:41:34 2009 New Revision: 72568 Log: typo: candiate -> candidate Modified: python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon May 11 18:41:34 2009 @@ -4,8 +4,8 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) -What's New in Python 3.1 release candiate 1? -============================================ +What's New in Python 3.1 release candidate 1? +============================================= *Release date: XXXX-XX-XX* From python-checkins at python.org Mon May 11 18:42:15 2009 From: python-checkins at python.org (mark.dickinson) Date: Mon, 11 May 2009 18:42:15 +0200 (CEST) Subject: [Python-checkins] r72569 - python/branches/release30-maint Message-ID: <20090511164215.6815FC2B8@mail.python.org> Author: mark.dickinson Date: Mon May 11 18:42:15 2009 New Revision: 72569 Log: Blocked revisions 72568 via svnmerge ........ r72568 | mark.dickinson | 2009-05-11 17:41:34 +0100 (Mon, 11 May 2009) | 2 lines typo: candiate -> candidate ........ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Mon May 11 19:22:24 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 11 May 2009 17:22:24 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090511172224.4E004C2EB@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/677 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Mon May 11 19:51:49 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 11 May 2009 17:51:49 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090511175149.E97B1D2D0@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/740 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_urllibnet.py", line 108, in test_getcode open_url = urllib.request.FancyURLopener().open(URL) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 1430, in open raise IOError('socket error', msg).with_traceback(sys.exc_info()[2]) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 1426, in open return getattr(self, name)(url) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 1600, in open_http return self._open_generic_http(http.client.HTTPConnection, url, data) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/urllib/request.py", line 1583, in _open_generic_http response = http_conn.getresponse() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/http/client.py", line 977, in getresponse response.begin() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/http/client.py", line 347, in begin version, status, reason = self._read_status() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/http/client.py", line 303, in _read_status line = str(self.fp.readline(), "iso-8859-1") File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/socket.py", line 214, in readinto return self._sock.recv_into(b) IOError: [Errno socket error] [Errno 110] Connection timed out 1 test failed: test_urllibnet make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon May 11 19:59:43 2009 From: python-checkins at python.org (michael.foord) Date: Mon, 11 May 2009 19:59:43 +0200 (CEST) Subject: [Python-checkins] r72570 - in python/trunk: Doc/library/unittest.rst Lib/test/test_unittest.py Lib/unittest.py Misc/NEWS Message-ID: <20090511175943.5A861C30A@mail.python.org> Author: michael.foord Date: Mon May 11 19:59:43 2009 New Revision: 72570 Log: Adds a verbosity keyword argument to unittest.main plus a minor fix allowing you to specify test modules / classes from the command line. Closes issue 5995. Michael Foord Modified: python/trunk/Doc/library/unittest.rst python/trunk/Lib/test/test_unittest.py python/trunk/Lib/unittest.py python/trunk/Misc/NEWS Modified: python/trunk/Doc/library/unittest.rst ============================================================================== --- python/trunk/Doc/library/unittest.rst (original) +++ python/trunk/Doc/library/unittest.rst Mon May 11 19:59:43 2009 @@ -91,6 +91,31 @@ `python-mock `_ and `minimock `_ Tools for creating mock test objects (objects simulating external resources). +Command Line Interface +---------------------- + +The unittest module can be used from the command line to run tests from +modules, classes or even individual test methods:: + + python -m unittest test_module1 test_module2 + python -m unittest test_module.TestClass + python -m unittest test_module.TestClass.test_method + +You can pass in a list with any combination of module names, and fully qualified class or +method names. + +You can run tests with more detail (higher verbosity) by passing in the -v flag:: + + python-m unittest -v test_module + +For a list of all the command line options:: + + python -m unittest -h + +.. versionchanged:: 27 + In earlier versions it was only possible to run individual test methods and not modules + or classes. + .. _unittest-minimal-example: Basic example @@ -178,7 +203,6 @@ are sufficient to meet many everyday testing needs. The remainder of the documentation explores the full feature set from first principles. - .. _organizing-tests: Organizing test code @@ -1408,7 +1432,7 @@ subclasses to provide a custom ``TestResult``. -.. function:: main([module[, defaultTest[, argv[, testRunner[, testLoader[, exit]]]]]]) +.. function:: main([module[, defaultTest[, argv[, testRunner[, testLoader[, exit, [verbosity]]]]]]]) A command-line program that runs a set of tests; this is primarily for making test modules conveniently executable. The simplest use for this function is to @@ -1417,6 +1441,12 @@ if __name__ == '__main__': unittest.main() + You can run tests with more detailed information by passing in the verbosity + argument:: + + if __name__ == '__main__': + unittest.main(verbosity=2) + The *testRunner* argument can either be a test runner class or an already created instance of it. By default ``main`` calls :func:`sys.exit` with an exit code indicating success or failure of the tests run. @@ -1432,4 +1462,4 @@ This stores the result of the tests run as the ``result`` attribute. .. versionchanged:: 2.7 - The ``exit`` parameter was added. + The ``exit`` and ``verbosity`` parameters were added. Modified: python/trunk/Lib/test/test_unittest.py ============================================================================== --- python/trunk/Lib/test/test_unittest.py (original) +++ python/trunk/Lib/test/test_unittest.py Mon May 11 19:59:43 2009 @@ -3280,19 +3280,22 @@ runner = FakeRunner() - try: - oldParseArgs = TestProgram.parseArgs - TestProgram.parseArgs = lambda *args: None - TestProgram.test = test + oldParseArgs = TestProgram.parseArgs + def restoreParseArgs(): + TestProgram.parseArgs = oldParseArgs + TestProgram.parseArgs = lambda *args: None + self.addCleanup(restoreParseArgs) - program = TestProgram(testRunner=runner, exit=False) + def removeTest(): + del TestProgram.test + TestProgram.test = test + self.addCleanup(removeTest) - self.assertEqual(program.result, result) - self.assertEqual(runner.test, test) + program = TestProgram(testRunner=runner, exit=False, verbosity=2) - finally: - TestProgram.parseArgs = oldParseArgs - del TestProgram.test + self.assertEqual(program.result, result) + self.assertEqual(runner.test, test) + self.assertEqual(program.verbosity, 2) class FooBar(unittest.TestCase): Modified: python/trunk/Lib/unittest.py ============================================================================== --- python/trunk/Lib/unittest.py (original) +++ python/trunk/Lib/unittest.py Mon May 11 19:59:43 2009 @@ -1524,7 +1524,8 @@ """ def __init__(self, module='__main__', defaultTest=None, argv=None, testRunner=TextTestRunner, - testLoader=defaultTestLoader, exit=True): + testLoader=defaultTestLoader, exit=True, + verbosity=1): if isinstance(module, basestring): self.module = __import__(module) for part in module.split('.')[1:]: @@ -1535,7 +1536,7 @@ argv = sys.argv self.exit = exit - self.verbosity = 1 + self.verbosity = verbosity self.defaultTest = defaultTest self.testRunner = testRunner self.testLoader = testLoader @@ -1566,6 +1567,7 @@ return if len(args) > 0: self.testNames = args + self.module = None else: self.testNames = (self.defaultTest,) self.createTests() @@ -1598,4 +1600,5 @@ ############################################################################## if __name__ == "__main__": + sys.modules['unittest'] = sys.modules['__main__'] main(module=None) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon May 11 19:59:43 2009 @@ -428,6 +428,12 @@ - Issue #3379: unittest.main now takes an optional exit argument. If False main doesn't call sys.exit allowing it to be used from the interactive interpreter. + +- Issue #5995: unittest.main now takes an optional verbosity argument allowing + test modules to be run with a higher than default verbosity. + +- Issue 5995: A fix to allow you to run "python -m unittest test_module" or + "python -m unittest test_module.TestClass" from the command line. - Issue #5728: unittest.TestResult has new startTestRun and stopTestRun methods; called immediately before and after a test run. From python-checkins at python.org Mon May 11 20:01:45 2009 From: python-checkins at python.org (michael.foord) Date: Mon, 11 May 2009 20:01:45 +0200 (CEST) Subject: [Python-checkins] r72571 - python/trunk/Misc/NEWS Message-ID: <20090511180145.B007DC2F2@mail.python.org> Author: michael.foord Date: Mon May 11 20:01:45 2009 New Revision: 72571 Log: Add missing # to NEWS Modified: python/trunk/Misc/NEWS Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon May 11 20:01:45 2009 @@ -432,7 +432,7 @@ - Issue #5995: unittest.main now takes an optional verbosity argument allowing test modules to be run with a higher than default verbosity. -- Issue 5995: A fix to allow you to run "python -m unittest test_module" or +- Issue #5995: A fix to allow you to run "python -m unittest test_module" or "python -m unittest test_module.TestClass" from the command line. - Issue #5728: unittest.TestResult has new startTestRun and stopTestRun methods; From buildbot at python.org Mon May 11 20:20:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 11 May 2009 18:20:09 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 trunk Message-ID: <20090511182009.66C04C320@mail.python.org> The Buildbot has detected a new failure of x86 XP-4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%20trunk/builds/2130 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test__locale test_bsddb3 test_float Traceback (most recent call last): File "../lib/test/regrtest.py", line 569, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\test\test__locale.py", line 2, in from _locale import (setlocale, LC_NUMERIC, RADIXCHAR, THOUSEP, nl_langinfo, ImportError: cannot import name RADIXCHAR ====================================================================== ERROR: test01_basic_replication (bsddb.test.test_replication.DBReplicationManager) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\test\test_replication.py", line 170, in test01_basic_replication mode=0666, txn=txn) DBNoSuchFileError: (2, 'No such file or directory -- connection closed: Successful return: 0') ====================================================================== ERROR: test01_basic_replication (bsddb.test.test_replication.DBReplicationManager) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\test\test_replication.py", line 58, in tearDown if self.dbClient : DBError: (0, 'DB object has been closed') ====================================================================== FAIL: test01_basic_replication (bsddb.test.test_replication.DBBaseReplication) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\bsddb\test\test_replication.py", line 315, in test01_basic_replication self.assertTrue(time.time() The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/4989 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: michael.foord BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From nnorwitz at gmail.com Mon May 11 22:20:07 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 11 May 2009 16:20:07 -0400 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090511202007.GA21875@python.psfb.org> 337 tests OK. 1 test failed: test_distutils 35 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 6 skips unexpected on linux2: test_multiprocessing test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aetypes test_aifc test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named MacOS test_array test_ascii_formatd test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 test_bsddb3 skipped -- Use of the `bsddb' resource not enabled test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compileall test_compiler test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_curses test_curses skipped -- Use of the `curses' resource not enabled test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils [19526 refs] [19526 refs] [19526 refs] [19523 refs] test test_distutils failed -- Traceback (most recent call last): File "/tmp/python-test/local/lib/python2.7/distutils/tests/test_install_lib.py", line 28, in test_finalize_options self.assertRaises(DistutilsOptionError, cmd.finalize_options) AssertionError: DistutilsOptionError not raised test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future5 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [15401 refs] [15401 refs] [15401 refs] [25327 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_importlib test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_ipaddr test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_linecache test_linuxaudiodev test_linuxaudiodev skipped -- Use of the `audio' resource not enabled test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named MacOS test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_memoryview test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os test_ossaudiodev test_ossaudiodev skipped -- Use of the `audio' resource not enabled test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_pdb test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 /tmp/python-test/local/lib/python2.7/test/test_pep352.py:31: PendingDeprecationWarning: Please use assertTrue instead. (ins.__class__.__name__, attr)) /tmp/python-test/local/lib/python2.7/test/test_pep352.py:92: PendingDeprecationWarning: Please use assertEqual instead. given, expected)) test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [17001 refs] [17001 refs] test_plistlib test_poll test_popen [15406 refs] [15406 refs] [15406 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [20870 refs] test_pyexpat test_queue test_quopri [17926 refs] [17926 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [15401 refs] [15401 refs] [15404 refs] [15401 refs] test_slice test_smtplib test_socket test_socketserver test_socketserver skipped -- Use of the `network' resource not enabled test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- module os has no attribute startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [17246 refs] [15616 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] . [15401 refs] [15401 refs] this bit of output is from a test of stdout in a different process ... [15401 refs] [15401 refs] [15616 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry test_symtable test_syntax test_sys [15401 refs] [15401 refs] [15630 refs] [15424 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [15404 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [18664 refs] [21074 refs] [20051 refs] [20051 refs] [20051 refs] [20051 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tk test_tk skipped -- No module named _tkinter test_tokenize test_trace test_traceback test_transformer test_ttk_guionly test_ttk_guionly skipped -- No module named _tkinter test_ttk_textonly test_ttk_textonly skipped -- No module named _tkinter test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllib2net skipped -- Use of the `network' resource not enabled test_urllibnet test_urllibnet skipped -- Use of the `network' resource not enabled test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib /tmp/python-test/local/lib/python2.7/test/test_xmllib.py:24: DeprecationWarning: The xmllib module is obsolete. Use xml.sax instead. import xmllib test_xmlrpc test_xpickle test_xpickle -- skipping backwards compat tests. Use 'regrtest.py -u xpickle' to run them. test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zipimport_support test_zlib 337 tests OK. 1 test failed: test_distutils 35 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 6 skips unexpected on linux2: test_multiprocessing test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [756656 refs] From buildbot at python.org Mon May 11 23:15:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 11 May 2009 21:15:27 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090511211527.B3B57E8E8@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/355 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 45, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/Include ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From nnorwitz at gmail.com Mon May 11 23:28:09 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 11 May 2009 17:28:09 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (2) Message-ID: <20090511212809.GA8387@python.psfb.org> More important issues: ---------------------- test_hashlib leaked [83, 2, 0] references, sum=85 test_ssl leaked [0, 322, 322] references, sum=644 Less important issues: ---------------------- test_cmd_line leaked [-25, 0, 0] references, sum=-25 test_file leaked [83, -83, 0] references, sum=0 test_smtplib leaked [0, 92, 26] references, sum=118 test_socketserver leaked [-80, 0, 0] references, sum=-80 test_sys leaked [0, 42, -21] references, sum=21 test_threading leaked [48, 53, 43] references, sum=144 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 From alexandre at peadrop.com Mon May 11 23:47:59 2009 From: alexandre at peadrop.com (Alexandre Vassalotti) Date: Mon, 11 May 2009 17:47:59 -0400 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: <20090511125003.BF2F31E4012@bag.python.org> References: <20090511125003.BF2F31E4012@bag.python.org> Message-ID: On Mon, May 11, 2009 at 8:50 AM, dirkjan.ochtman wrote: > Author: dirkjan.ochtman > Date: Mon May 11 14:50:03 2009 > New Revision: 72563 > > Log: > Remove DVCS comparison from PEP 374 and talk about hg migration instead. > > Modified: > ? peps/trunk/pep-0374.txt > > Modified: peps/trunk/pep-0374.txt > Didn't we decide to not remove the DVCS PEP? Brett et al. put a lot of effort into this PEP and it would be sad to just throw the PEP away. I think it would be much better to create a brand new PEP, instead. BTW, I am finishing up another project for this week and then I will be free to work on the Mercurial transition. I would appreciate if we could work together on this. Thanks, -- Alexandre From martin at v.loewis.de Tue May 12 00:10:39 2009 From: martin at v.loewis.de (=?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?=) Date: Tue, 12 May 2009 00:10:39 +0200 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: References: <20090511125003.BF2F31E4012@bag.python.org> Message-ID: <4A08A25F.1070508@v.loewis.de> > Didn't we decide to not remove the DVCS PEP? Brett et al. put a lot of > effort into this PEP and it would be sad to just throw the PEP away. See reference [1] in the PEP. It isn't thrown away. > I think it would be much better to create a brand new PEP, instead. I disagree. The original objective of PEP 374 still hasn't been achieved; the PEP needs further refinement to be actually implementable. Regards, Martin From alexandre at peadrop.com Tue May 12 00:26:06 2009 From: alexandre at peadrop.com (Alexandre Vassalotti) Date: Mon, 11 May 2009 18:26:06 -0400 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: <4A08A25F.1070508@v.loewis.de> References: <20090511125003.BF2F31E4012@bag.python.org> <4A08A25F.1070508@v.loewis.de> Message-ID: On Mon, May 11, 2009 at 6:10 PM, "Martin v. L?wis" wrote: >> Didn't we decide to not remove the DVCS PEP? Brett et al. put a lot of >> effort into this PEP and it would be sad to just throw the PEP away. > > See reference [1] in the PEP. It isn't thrown away. > Ah, I missed that. Thanks. Then, I don't have any objection with reusing PEP 374 for the transition plan. -- Alexandre From g.brandl at gmx.net Tue May 12 00:07:07 2009 From: g.brandl at gmx.net (Georg Brandl) Date: Tue, 12 May 2009 00:07:07 +0200 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: References: <20090511125003.BF2F31E4012@bag.python.org> Message-ID: Alexandre Vassalotti schrieb: > On Mon, May 11, 2009 at 8:50 AM, dirkjan.ochtman > wrote: >> Author: dirkjan.ochtman >> Date: Mon May 11 14:50:03 2009 >> New Revision: 72563 >> >> Log: >> Remove DVCS comparison from PEP 374 and talk about hg migration instead. >> >> Modified: >> peps/trunk/pep-0374.txt >> >> Modified: peps/trunk/pep-0374.txt >> > > Didn't we decide to not remove the DVCS PEP? Brett et al. put a lot of > effort into this PEP and it would be sad to just throw the PEP away. I > think it would be much better to create a brand new PEP, instead. I also think it would be better if you reverted this, leaving PEP 374 as-is, and started a new one for Hg conversion. Georg From benjamin at python.org Tue May 12 01:10:14 2009 From: benjamin at python.org (Benjamin Peterson) Date: Mon, 11 May 2009 18:10:14 -0500 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: References: <20090511125003.BF2F31E4012@bag.python.org> Message-ID: <1afaf6160905111610o167554a4j50e07161b702888e@mail.gmail.com> 2009/5/11 Georg Brandl : > Alexandre Vassalotti schrieb: >> Didn't we decide to not remove the DVCS PEP? Brett et al. put a lot of >> effort into this PEP and it would be sad to just throw the PEP away. I >> think it would be much better to create a brand new PEP, instead. > > I also think it would be better if you reverted this, leaving PEP 374 as-is, > and started a new one for Hg conversion. FWIW, +1 also. Certainly, people can look back in the SVN history, but that's rather annoying for outsiders. Also, it seems to be two different tasks. "Changing to a DVCS" and "Transition to Mercurial" -- Regards, Benjamin From python-checkins at python.org Tue May 12 03:36:57 2009 From: python-checkins at python.org (r.david.murray) Date: Tue, 12 May 2009 03:36:57 +0200 (CEST) Subject: [Python-checkins] r72572 - python/trunk/Doc/library/shelve.rst Message-ID: <20090512013657.E71F4D511@mail.python.org> Author: r.david.murray Date: Tue May 12 03:36:57 2009 New Revision: 72572 Log: Make it clear up front that shelve only records changes when objects are assigned back to it when writeback is False. Modified: python/trunk/Doc/library/shelve.rst Modified: python/trunk/Doc/library/shelve.rst ============================================================================== --- python/trunk/Doc/library/shelve.rst (original) +++ python/trunk/Doc/library/shelve.rst Tue May 12 03:36:57 2009 @@ -28,13 +28,15 @@ .. versionchanged:: 2.3 The *protocol* parameter was added. - By default, mutations to persistent-dictionary mutable entries are not - automatically written back. If the optional *writeback* parameter is set to - *True*, all entries accessed are cached in memory, and written back at close - time; this can make it handier to mutate mutable entries in the persistent - dictionary, but, if many entries are accessed, it can consume vast amounts of - memory for the cache, and it can make the close operation very slow since all - accessed entries are written back (there is no way to determine which accessed + Because of Python semantics, a shelf cannot know when a mutable + persistent-dictionary entry is modified. By default modified objects are + written only when assigned to the shelf (see :ref:`shelve-example`). If + the optional *writeback* parameter is set to *True*, all entries accessed + are cached in memory, and written back at close time; this can make it + handier to mutate mutable entries in the persistent dictionary, but, if + many entries are accessed, it can consume vast amounts of memory for the + cache, and it can make the close operation very slow since all accessed + entries are written back (there is no way to determine which accessed entries are mutable, nor which ones were actually mutated). Shelf objects support all methods supported by dictionaries. This eases the @@ -125,6 +127,8 @@ interpretation as for the :class:`Shelf` class. +.. _shelve-example: + Example ------- From python-checkins at python.org Tue May 12 03:38:25 2009 From: python-checkins at python.org (r.david.murray) Date: Tue, 12 May 2009 03:38:25 +0200 (CEST) Subject: [Python-checkins] r72573 - in python/branches/release26-maint: Doc/library/shelve.rst Message-ID: <20090512013825.ADAC4D4FC@mail.python.org> Author: r.david.murray Date: Tue May 12 03:38:25 2009 New Revision: 72573 Log: Merged revisions 72572 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72572 | r.david.murray | 2009-05-11 21:36:57 -0400 (Mon, 11 May 2009) | 3 lines Make it clear up front that shelve only records changes when objects are assigned back to it when writeback is False. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/library/shelve.rst Modified: python/branches/release26-maint/Doc/library/shelve.rst ============================================================================== --- python/branches/release26-maint/Doc/library/shelve.rst (original) +++ python/branches/release26-maint/Doc/library/shelve.rst Tue May 12 03:38:25 2009 @@ -29,13 +29,15 @@ .. versionchanged:: 2.3 The *protocol* parameter was added. - By default, mutations to persistent-dictionary mutable entries are not - automatically written back. If the optional *writeback* parameter is set to - *True*, all entries accessed are cached in memory, and written back at close - time; this can make it handier to mutate mutable entries in the persistent - dictionary, but, if many entries are accessed, it can consume vast amounts of - memory for the cache, and it can make the close operation very slow since all - accessed entries are written back (there is no way to determine which accessed + Because of Python semantics, a shelf cannot know when a mutable + persistent-dictionary entry is modified. By default modified objects are + written only when assigned to the shelf (see :ref:`shelve-example`). If + the optional *writeback* parameter is set to *True*, all entries accessed + are cached in memory, and written back at close time; this can make it + handier to mutate mutable entries in the persistent dictionary, but, if + many entries are accessed, it can consume vast amounts of memory for the + cache, and it can make the close operation very slow since all accessed + entries are written back (there is no way to determine which accessed entries are mutable, nor which ones were actually mutated). Shelve objects support all methods supported by dictionaries. This eases the @@ -126,6 +128,8 @@ interpretation as for the :class:`Shelf` class. +.. _shelve-example: + Example ------- From python-checkins at python.org Tue May 12 03:40:16 2009 From: python-checkins at python.org (r.david.murray) Date: Tue, 12 May 2009 03:40:16 +0200 (CEST) Subject: [Python-checkins] r72574 - in python/branches/py3k: Doc/library/shelve.rst Message-ID: <20090512014016.5A1FBD51D@mail.python.org> Author: r.david.murray Date: Tue May 12 03:40:16 2009 New Revision: 72574 Log: Merged revisions 72572 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72572 | r.david.murray | 2009-05-11 21:36:57 -0400 (Mon, 11 May 2009) | 3 lines Make it clear up front that shelve only records changes when objects are assigned back to it when writeback is False. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/shelve.rst Modified: python/branches/py3k/Doc/library/shelve.rst ============================================================================== --- python/branches/py3k/Doc/library/shelve.rst (original) +++ python/branches/py3k/Doc/library/shelve.rst Tue May 12 03:40:16 2009 @@ -25,13 +25,15 @@ By default, version 3 pickles are used to serialize values. The version of the pickle protocol can be specified with the *protocol* parameter. - By default, mutations to persistent-dictionary mutable entries are not - automatically written back. If the optional *writeback* parameter is set to - *True*, all entries accessed are cached in memory, and written back at close - time; this can make it handier to mutate mutable entries in the persistent - dictionary, but, if many entries are accessed, it can consume vast amounts of - memory for the cache, and it can make the close operation very slow since all - accessed entries are written back (there is no way to determine which accessed + Because of Python semantics, a shelf cannot know when a mutable + persistent-dictionary entry is modified. By default modified objects are + written only when assigned to the shelf (see :ref:`shelve-example`). If + the optional *writeback* parameter is set to *True*, all entries accessed + are cached in memory, and written back at close time; this can make it + handier to mutate mutable entries in the persistent dictionary, but, if + many entries are accessed, it can consume vast amounts of memory for the + cache, and it can make the close operation very slow since all accessed + entries are written back (there is no way to determine which accessed entries are mutable, nor which ones were actually mutated). Shelf objects support all methods supported by dictionaries. This eases the @@ -118,6 +120,8 @@ interpretation as for the :class:`Shelf` class. +.. _shelve-example: + Example ------- From python-checkins at python.org Tue May 12 03:42:03 2009 From: python-checkins at python.org (r.david.murray) Date: Tue, 12 May 2009 03:42:03 +0200 (CEST) Subject: [Python-checkins] r72575 - in python/branches/release30-maint: Doc/library/shelve.rst Message-ID: <20090512014203.464D1D51F@mail.python.org> Author: r.david.murray Date: Tue May 12 03:42:03 2009 New Revision: 72575 Log: Merged revisions 72574 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72574 | r.david.murray | 2009-05-11 21:40:16 -0400 (Mon, 11 May 2009) | 10 lines Merged revisions 72572 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72572 | r.david.murray | 2009-05-11 21:36:57 -0400 (Mon, 11 May 2009) | 3 lines Make it clear up front that shelve only records changes when objects are assigned back to it when writeback is False. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/library/shelve.rst Modified: python/branches/release30-maint/Doc/library/shelve.rst ============================================================================== --- python/branches/release30-maint/Doc/library/shelve.rst (original) +++ python/branches/release30-maint/Doc/library/shelve.rst Tue May 12 03:42:03 2009 @@ -26,13 +26,15 @@ By default, version 3 pickles are used to serialize values. The version of the pickle protocol can be specified with the *protocol* parameter. - By default, mutations to persistent-dictionary mutable entries are not - automatically written back. If the optional *writeback* parameter is set to - *True*, all entries accessed are cached in memory, and written back at close - time; this can make it handier to mutate mutable entries in the persistent - dictionary, but, if many entries are accessed, it can consume vast amounts of - memory for the cache, and it can make the close operation very slow since all - accessed entries are written back (there is no way to determine which accessed + Because of Python semantics, a shelf cannot know when a mutable + persistent-dictionary entry is modified. By default modified objects are + written only when assigned to the shelf (see :ref:`shelve-example`). If + the optional *writeback* parameter is set to *True*, all entries accessed + are cached in memory, and written back at close time; this can make it + handier to mutate mutable entries in the persistent dictionary, but, if + many entries are accessed, it can consume vast amounts of memory for the + cache, and it can make the close operation very slow since all accessed + entries are written back (there is no way to determine which accessed entries are mutable, nor which ones were actually mutated). Shelve objects support all methods supported by dictionaries. This eases the @@ -119,6 +121,8 @@ interpretation as for the :class:`Shelf` class. +.. _shelve-example: + Example ------- From buildbot at python.org Tue May 12 04:28:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 02:28:35 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090512022835.DFB55D41A@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/608 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.dickinson,r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/multiprocessing/process.py", line 232, in _bootstrap self.run() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/multiprocessing/process.py", line 88, in run self._target(*self._args, **self._kwargs) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_multiprocessing.py", line 1203, in _putter manager.connect() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/multiprocessing/managers.py", line 478, in connect dispatch(conn, None, 'dummy') File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/multiprocessing/managers.py", line 79, in dispatch kind, result = c.recv() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/multiprocessing/connection.py", line 397, in recv s = self._conn.recv_bytes() EOFError 1 test failed: test_multiprocessing Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/multiprocessing/util.py", line 235, in _run_finalizers finalizer() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/multiprocessing/util.py", line 174, in __call__ res = self._callback(*self._args, **self._kwargs) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/multiprocessing/pool.py", line 388, in _terminate_pool p.join() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/multiprocessing/process.py", line 117, in join assert self._parent_pid == os.getpid(), 'can only join a child process' AssertionError: can only join a child process Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/multiprocessing/managers.py", line 340, in shutdown p.join() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/multiprocessing/process.py", line 117, in join assert self._parent_pid == os.getpid(), 'can only join a child process' AssertionError: can only join a child process make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue May 12 04:37:43 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 02:37:43 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090512023743.C2FA0D252@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%202.6/builds/331 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue May 12 05:01:52 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 12 May 2009 05:01:52 +0200 (CEST) Subject: [Python-checkins] r72576 - python/branches/py3k/Doc/library/sys.rst Message-ID: <20090512030152.11B0FD3FB@mail.python.org> Author: benjamin.peterson Date: Tue May 12 05:01:51 2009 New Revision: 72576 Log: detach() is a nifty trick for making std* binary Modified: python/branches/py3k/Doc/library/sys.rst Modified: python/branches/py3k/Doc/library/sys.rst ============================================================================== --- python/branches/py3k/Doc/library/sys.rst (original) +++ python/branches/py3k/Doc/library/sys.rst Tue May 12 05:01:51 2009 @@ -781,11 +781,10 @@ :func:`os.popen`, :func:`os.system` or the :func:`exec\*` family of functions in the :mod:`os` module.) - .. note:: - - The standard streams are in text mode by default. To write or read binary - data to these, use the underlying binary buffer. For example, to write - bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``. + The standard streams are in text mode by default. To write or read binary + data to these, use the underlying binary buffer. For example, to write bytes + to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``. Using + :meth:`io.TextIOWrapper.detach` streams can be made binary by default. .. data:: __stdin__ From python-checkins at python.org Tue May 12 09:01:30 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 12 May 2009 09:01:30 +0200 (CEST) Subject: [Python-checkins] r72577 - python/trunk/Lib/distutils/command/install_lib.py Message-ID: <20090512070130.2B3E9D431@mail.python.org> Author: tarek.ziade Date: Tue May 12 09:01:29 2009 New Revision: 72577 Log: removing the assert statement so the code works when Python is run with -O Modified: python/trunk/Lib/distutils/command/install_lib.py Modified: python/trunk/Lib/distutils/command/install_lib.py ============================================================================== --- python/trunk/Lib/distutils/command/install_lib.py (original) +++ python/trunk/Lib/distutils/command/install_lib.py Tue May 12 09:01:29 2009 @@ -80,7 +80,8 @@ if not isinstance(self.optimize, int): try: self.optimize = int(self.optimize) - assert self.optimize in (0, 1, 2) + if self.optimize not in (0, 1, 2): + raise AssertionError except (ValueError, AssertionError): raise DistutilsOptionError, "optimize must be 0, 1, or 2" From python-checkins at python.org Tue May 12 09:04:51 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 12 May 2009 09:04:51 +0200 (CEST) Subject: [Python-checkins] r72578 - in python/branches/release26-maint: Lib/distutils/command/install_lib.py Message-ID: <20090512070451.987DED518@mail.python.org> Author: tarek.ziade Date: Tue May 12 09:04:51 2009 New Revision: 72578 Log: Merged revisions 72577 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72577 | tarek.ziade | 2009-05-12 09:01:29 +0200 (Tue, 12 May 2009) | 1 line removing the assert statement so the code works when Python is run with -O ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/command/install_lib.py Modified: python/branches/release26-maint/Lib/distutils/command/install_lib.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/command/install_lib.py (original) +++ python/branches/release26-maint/Lib/distutils/command/install_lib.py Tue May 12 09:04:51 2009 @@ -80,7 +80,8 @@ if type(self.optimize) is not IntType: try: self.optimize = int(self.optimize) - assert 0 <= self.optimize <= 2 + if self.optimize not in (0, 1, 2): + raise AssertionError except (ValueError, AssertionError): raise DistutilsOptionError, "optimize must be 0, 1, or 2" From python-checkins at python.org Tue May 12 09:06:42 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 12 May 2009 09:06:42 +0200 (CEST) Subject: [Python-checkins] r72579 - in python/branches/py3k: Lib/distutils/command/install_lib.py Message-ID: <20090512070642.4B5D9D53E@mail.python.org> Author: tarek.ziade Date: Tue May 12 09:06:42 2009 New Revision: 72579 Log: Merged revisions 72577 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72577 | tarek.ziade | 2009-05-12 09:01:29 +0200 (Tue, 12 May 2009) | 1 line removing the assert statement so the code works when Python is run with -O ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/command/install_lib.py Modified: python/branches/py3k/Lib/distutils/command/install_lib.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/install_lib.py (original) +++ python/branches/py3k/Lib/distutils/command/install_lib.py Tue May 12 09:06:42 2009 @@ -77,7 +77,8 @@ if not isinstance(self.optimize, int): try: self.optimize = int(self.optimize) - assert self.optimize in (0, 1, 2) + if self.optimize not in (0, 1, 2): + raise AssertionError except (ValueError, AssertionError): raise DistutilsOptionError("optimize must be 0, 1, or 2") From python-checkins at python.org Tue May 12 09:07:42 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 12 May 2009 09:07:42 +0200 (CEST) Subject: [Python-checkins] r72580 - python/branches/release30-maint Message-ID: <20090512070742.CEA61D4EB@mail.python.org> Author: tarek.ziade Date: Tue May 12 09:07:42 2009 New Revision: 72580 Log: Blocked revisions 72562 via svnmerge ................ r72562 | tarek.ziade | 2009-05-11 10:49:17 +0200 (Mon, 11 May 2009) | 9 lines Merged revisions 72560 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72560 | tarek.ziade | 2009-05-11 10:45:17 +0200 (Mon, 11 May 2009) | 1 line distutils.test_build_clib added a new line at the end of the file, to avoid a warning with some compilers ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Tue May 12 09:08:45 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 12 May 2009 09:08:45 +0200 (CEST) Subject: [Python-checkins] r72581 - in python/branches/release30-maint: Lib/distutils/command/install_lib.py Message-ID: <20090512070845.0EEFBD271@mail.python.org> Author: tarek.ziade Date: Tue May 12 09:08:44 2009 New Revision: 72581 Log: Merged revisions 72579 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72579 | tarek.ziade | 2009-05-12 09:06:42 +0200 (Tue, 12 May 2009) | 9 lines Merged revisions 72577 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72577 | tarek.ziade | 2009-05-12 09:01:29 +0200 (Tue, 12 May 2009) | 1 line removing the assert statement so the code works when Python is run with -O ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/command/install_lib.py Modified: python/branches/release30-maint/Lib/distutils/command/install_lib.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/command/install_lib.py (original) +++ python/branches/release30-maint/Lib/distutils/command/install_lib.py Tue May 12 09:08:44 2009 @@ -73,7 +73,8 @@ if not isinstance(self.optimize, int): try: self.optimize = int(self.optimize) - assert 0 <= self.optimize <= 2 + if self.optimize not in (0, 1, 2): + raise AssertionError except (ValueError, AssertionError): raise DistutilsOptionError("optimize must be 0, 1, or 2") From buildbot at python.org Tue May 12 09:42:33 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 07:42:33 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090512074233.B41D1D532@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1305 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: r.david.murray,tarek.ziade BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From g.brandl at gmx.net Tue May 12 09:24:17 2009 From: g.brandl at gmx.net (Georg Brandl) Date: Tue, 12 May 2009 09:24:17 +0200 Subject: [Python-checkins] r72576 - python/branches/py3k/Doc/library/sys.rst In-Reply-To: <20090512030152.11B0FD3FB@mail.python.org> References: <20090512030152.11B0FD3FB@mail.python.org> Message-ID: benjamin.peterson schrieb: > Author: benjamin.peterson > Date: Tue May 12 05:01:51 2009 > New Revision: 72576 > > Log: > detach() is a nifty trick for making std* binary > > Modified: > python/branches/py3k/Doc/library/sys.rst > > Modified: python/branches/py3k/Doc/library/sys.rst > ============================================================================== > --- python/branches/py3k/Doc/library/sys.rst (original) > +++ python/branches/py3k/Doc/library/sys.rst Tue May 12 05:01:51 2009 > @@ -781,11 +781,10 @@ > :func:`os.popen`, :func:`os.system` or the :func:`exec\*` family of functions in > the :mod:`os` module.) > > - .. note:: > - > - The standard streams are in text mode by default. To write or read binary > - data to these, use the underlying binary buffer. For example, to write > - bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``. > + The standard streams are in text mode by default. To write or read binary > + data to these, use the underlying binary buffer. For example, to write bytes > + to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``. Using > + :meth:`io.TextIOWrapper.detach` streams can be made binary by default. It would be even nicer if you could directly include the incantation to do this. Georg From nnorwitz at gmail.com Tue May 12 11:37:45 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 12 May 2009 05:37:45 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090512093745.GA15505@python.psfb.org> More important issues: ---------------------- test_hashlib leaked [-2, 2, -2] references, sum=-2 Less important issues: ---------------------- test_cmd_line leaked [50, -25, 0] references, sum=25 test_smtplib leaked [23, -111, 199] references, sum=111 test_socketserver leaked [0, 80, -80] references, sum=0 test_sys leaked [-21, 0, 42] references, sum=21 test_threading leaked [48, 48, 48] references, sum=144 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 From buildbot at python.org Tue May 12 11:41:53 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 09:41:53 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090512094154.0B549D5BB@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/679 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_posix test_smtplib ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Tue May 12 12:31:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 10:31:34 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090512103134.BB133D63A@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/357 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Tue May 12 12:46:23 2009 From: python-checkins at python.org (michael.foord) Date: Tue, 12 May 2009 12:46:23 +0200 (CEST) Subject: [Python-checkins] r72582 - python/trunk/Lib/unittest.py Message-ID: <20090512104623.C6630D479@mail.python.org> Author: michael.foord Date: Tue May 12 12:46:23 2009 New Revision: 72582 Log: Fix to restore command line behaviour for test modules using unittest.main(). Regression caused by issue 5995. Michael Modified: python/trunk/Lib/unittest.py Modified: python/trunk/Lib/unittest.py ============================================================================== --- python/trunk/Lib/unittest.py (original) +++ python/trunk/Lib/unittest.py Tue May 12 12:46:23 2009 @@ -1567,7 +1567,8 @@ return if len(args) > 0: self.testNames = args - self.module = None + if os.path.splitext(os.path.basename(__file__))[0] == 'unitest': + self.module = None else: self.testNames = (self.defaultTest,) self.createTests() From python-checkins at python.org Tue May 12 12:49:13 2009 From: python-checkins at python.org (michael.foord) Date: Tue, 12 May 2009 12:49:13 +0200 (CEST) Subject: [Python-checkins] r72583 - python/trunk/Lib/unittest.py Message-ID: <20090512104913.51E0FC3A9@mail.python.org> Author: michael.foord Date: Tue May 12 12:49:13 2009 New Revision: 72583 Log: Better fix for modules using unittest.main(). Fixes regression caused by commit for issue 5995. Michael Foord Modified: python/trunk/Lib/unittest.py Modified: python/trunk/Lib/unittest.py ============================================================================== --- python/trunk/Lib/unittest.py (original) +++ python/trunk/Lib/unittest.py Tue May 12 12:49:13 2009 @@ -1567,7 +1567,7 @@ return if len(args) > 0: self.testNames = args - if os.path.splitext(os.path.basename(__file__))[0] == 'unitest': + if sys.modules['unittest'] is sys.modules['__main__']: self.module = None else: self.testNames = (self.defaultTest,) From python-checkins at python.org Tue May 12 13:19:14 2009 From: python-checkins at python.org (michael.foord) Date: Tue, 12 May 2009 13:19:14 +0200 (CEST) Subject: [Python-checkins] r72584 - python/branches/py3k/Doc/howto/urllib2.rst Message-ID: <20090512111914.6CDB6D4ED@mail.python.org> Author: michael.foord Date: Tue May 12 13:19:14 2009 New Revision: 72584 Log: Examples correction in urllib2 howto. Michael Foord Modified: python/branches/py3k/Doc/howto/urllib2.rst Modified: python/branches/py3k/Doc/howto/urllib2.rst ============================================================================== --- python/branches/py3k/Doc/howto/urllib2.rst (original) +++ python/branches/py3k/Doc/howto/urllib2.rst Tue May 12 13:19:14 2009 @@ -204,7 +204,7 @@ >>> req = urllib.request.Request('http://www.pretend_server.org') >>> try: urllib.request.urlopen(req) - >>> except urllib.error.URLError, e: + >>> except urllib.error.URLError as e: >>> print(e.reason) >>> (4, 'getaddrinfo failed') @@ -313,7 +313,7 @@ >>> req = urllib.request.Request('http://www.python.org/fish.html') >>> try: >>> urllib.request.urlopen(req) - >>> except urllib.error.URLError, e: + >>> except urllib.error.URLError as e: >>> print(e.code) >>> print(e.read()) >>> @@ -342,10 +342,10 @@ req = Request(someurl) try: response = urlopen(req) - except HTTPError, e: + except HTTPError as e: print('The server couldn\'t fulfill the request.') print('Error code: ', e.code) - except URLError, e: + except URLError as e: print('We failed to reach a server.') print('Reason: ', e.reason) else: @@ -367,7 +367,7 @@ req = Request(someurl) try: response = urlopen(req) - except URLError, e: + except URLError as e: if hasattr(e, 'reason'): print('We failed to reach a server.') print('Reason: ', e.reason) From buildbot at python.org Tue May 12 13:21:16 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 11:21:16 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090512112116.9D350D3FE@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%20trunk/builds/2 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: michael.foord BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Tue May 12 19:07:15 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 12 May 2009 19:07:15 +0200 (CEST) Subject: [Python-checkins] r72585 - in python/trunk: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090512170715.0FB1BD804@mail.python.org> Author: tarek.ziade Date: Tue May 12 19:07:14 2009 New Revision: 72585 Log: fixed #5977: distutils build_ext.get_outputs was not using the inplace option Modified: python/trunk/Lib/distutils/command/build_ext.py python/trunk/Lib/distutils/tests/test_build_ext.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/command/build_ext.py ============================================================================== --- python/trunk/Lib/distutils/command/build_ext.py (original) +++ python/trunk/Lib/distutils/command/build_ext.py Tue May 12 19:07:14 2009 @@ -311,38 +311,38 @@ # Setup the CCompiler object that we'll use to do all the # compiling and linking - self.compiler = new_compiler(compiler=self.compiler, + self._compiler = new_compiler(compiler=self.compiler, verbose=self.verbose, dry_run=self.dry_run, force=self.force) - customize_compiler(self.compiler) + customize_compiler(self._compiler) # If we are cross-compiling, init the compiler now (if we are not # cross-compiling, init would not hurt, but people may rely on # late initialization of compiler even if they shouldn't...) if os.name == 'nt' and self.plat_name != get_platform(): - self.compiler.initialize(self.plat_name) + self._compiler.initialize(self.plat_name) # And make sure that any compile/link-related options (which might # come from the command-line or from the setup script) are set in # that CCompiler object -- that way, they automatically apply to # all compiling and linking done here. if self.include_dirs is not None: - self.compiler.set_include_dirs(self.include_dirs) + self._compiler.set_include_dirs(self.include_dirs) if self.define is not None: # 'define' option is a list of (name,value) tuples for (name, value) in self.define: - self.compiler.define_macro(name, value) + self._compiler.define_macro(name, value) if self.undef is not None: for macro in self.undef: - self.compiler.undefine_macro(macro) + self._compiler.undefine_macro(macro) if self.libraries is not None: - self.compiler.set_libraries(self.libraries) + self._compiler.set_libraries(self.libraries) if self.library_dirs is not None: - self.compiler.set_library_dirs(self.library_dirs) + self._compiler.set_library_dirs(self.library_dirs) if self.rpath is not None: - self.compiler.set_runtime_library_dirs(self.rpath) + self._compiler.set_runtime_library_dirs(self.rpath) if self.link_objects is not None: - self.compiler.set_link_objects(self.link_objects) + self._compiler.set_link_objects(self.link_objects) # Now actually compile and link everything. self.build_extensions() @@ -446,9 +446,7 @@ # "build" tree. outputs = [] for ext in self.extensions: - fullname = self.get_ext_fullname(ext.name) - outputs.append(os.path.join(self.build_lib, - self.get_ext_filename(fullname))) + outputs.append(self.get_ext_fullpath(ext.name)) return outputs def build_extensions(self): @@ -473,24 +471,9 @@ "a list of source filenames") % ext.name sources = list(sources) - fullname = self.get_ext_fullname(ext.name) - if self.inplace: - # ignore build-lib -- put the compiled extension into - # the source tree along with pure Python modules - - modpath = string.split(fullname, '.') - package = string.join(modpath[0:-1], '.') - base = modpath[-1] - - build_py = self.get_finalized_command('build_py') - package_dir = build_py.get_package_dir(package) - ext_filename = os.path.join(package_dir, - self.get_ext_filename(base)) - else: - ext_filename = os.path.join(self.build_lib, - self.get_ext_filename(fullname)) + ext_path = self.get_ext_fullpath(ext.name) depends = sources + ext.depends - if not (self.force or newer_group(depends, ext_filename, 'newer')): + if not (self.force or newer_group(depends, ext_path, 'newer')): log.debug("skipping '%s' extension (up-to-date)", ext.name) return else: @@ -521,13 +504,13 @@ for undef in ext.undef_macros: macros.append((undef,)) - objects = self.compiler.compile(sources, - output_dir=self.build_temp, - macros=macros, - include_dirs=ext.include_dirs, - debug=self.debug, - extra_postargs=extra_args, - depends=ext.depends) + objects = self._compiler.compile(sources, + output_dir=self.build_temp, + macros=macros, + include_dirs=ext.include_dirs, + debug=self.debug, + extra_postargs=extra_args, + depends=ext.depends) # XXX -- this is a Vile HACK! # @@ -548,10 +531,10 @@ extra_args = ext.extra_link_args or [] # Detect target language, if not provided - language = ext.language or self.compiler.detect_language(sources) + language = ext.language or self._compiler.detect_language(sources) - self.compiler.link_shared_object( - objects, ext_filename, + self._compiler.link_shared_object( + objects, ext_path, libraries=self.get_libraries(ext), library_dirs=ext.library_dirs, runtime_library_dirs=ext.runtime_library_dirs, @@ -653,8 +636,28 @@ # -- Name generators ----------------------------------------------- # (extension names, filenames, whatever) + def get_ext_fullpath(self, ext_name): + """Returns the path of the filename for a given extension. + + The file is located in `build_lib` or directly in the package + (inplace option). + """ + if self.inplace: + fullname = self.get_ext_fullname(ext_name) + modpath = fullname.split('.') + package = '.'.join(modpath[0:-1]) + base = modpath[-1] + build_py = self.get_finalized_command('build_py') + package_dir = os.path.abspath(build_py.get_package_dir(package)) + return os.path.join(package_dir, base) + else: + filename = self.get_ext_filename(ext_name) + return os.path.join(self.build_lib, filename) + + def get_ext_fullname(self, ext_name): + """Returns the fullname of a given extension name. - def get_ext_fullname (self, ext_name): + Adds the `package.` prefix""" if self.package is None: return ext_name else: @@ -701,7 +704,7 @@ # Append '_d' to the python import library on debug builds. if sys.platform == "win32": from distutils.msvccompiler import MSVCCompiler - if not isinstance(self.compiler, MSVCCompiler): + if not isinstance(self._compiler, MSVCCompiler): template = "python%d%d" if self.debug: template = template + '_d' Modified: python/trunk/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_build_ext.py (original) +++ python/trunk/Lib/distutils/tests/test_build_ext.py Tue May 12 19:07:14 2009 @@ -113,7 +113,7 @@ else: _config_vars['Py_ENABLE_SHARED'] = old_var - # make sur we get some lobrary dirs under solaris + # make sure we get some library dirs under solaris self.assert_(len(cmd.library_dirs) > 0) def test_user_site(self): @@ -282,13 +282,50 @@ cmd.ensure_finalized() self.assertEquals(cmd.get_source_files(), ['xxx']) + def test_compiler_option(self): + # cmd.compiler is an option and + # should not be overriden by a compiler instance + # when the command is run + dist = Distribution() + cmd = build_ext(dist) + cmd.compiler = 'unix' + cmd.ensure_finalized() + cmd.run() + self.assertEquals(cmd.compiler, 'unix') + def test_get_outputs(self): - modules = [Extension('foo', ['xxx'], optional=False)] - dist = Distribution({'name': 'xx', 'ext_modules': modules}) + tmp_dir = self.mkdtemp() + c_file = os.path.join(tmp_dir, 'foo.c') + self.write_file(c_file, '') + ext = Extension('foo', [c_file], optional=False) + dist = Distribution({'name': 'xx', + 'ext_modules': [ext]}) cmd = build_ext(dist) cmd.ensure_finalized() self.assertEquals(len(cmd.get_outputs()), 1) + if os.name == "nt": + cmd.debug = sys.executable.endswith("_d.exe") + + cmd.build_lib = os.path.join(self.tmp_dir, 'build') + cmd.build_temp = os.path.join(self.tmp_dir, 'tempt') + + # issue #5977 : distutils build_ext.get_outputs + # returns wrong result with --inplace + cmd.inplace = 1 + cmd.run() + so_file = cmd.get_outputs()[0] + self.assert_(os.path.exists(so_file)) + so_dir = os.path.dirname(so_file) + self.assertEquals(so_dir, os.getcwd()) + + cmd.inplace = 0 + cmd.run() + so_file = cmd.get_outputs()[0] + self.assert_(os.path.exists(so_file)) + so_dir = os.path.dirname(so_file) + self.assertEquals(so_dir, cmd.build_lib) + def test_suite(): src = _get_source_filename() if not os.path.exists(src): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue May 12 19:07:14 2009 @@ -291,6 +291,9 @@ Library ------- +- Issue #5977: distutils build_ext.get_outputs was not taking into account the + inplace option. Initial patch by kxroberto. + - Issue #5984: distutils.command.build_ext.check_extensions_list checks were broken for old-style extensions. From python-checkins at python.org Tue May 12 19:11:54 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 12 May 2009 19:11:54 +0200 (CEST) Subject: [Python-checkins] r72586 - in python/branches/release26-maint: Lib/distutils/command/build_ext.py Lib/distutils/tests/support.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090512171154.61FC6D754@mail.python.org> Author: tarek.ziade Date: Tue May 12 19:11:54 2009 New Revision: 72586 Log: Merged revisions 72585 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72585 | tarek.ziade | 2009-05-12 19:07:14 +0200 (Tue, 12 May 2009) | 1 line fixed #5977: distutils build_ext.get_outputs was not using the inplace option ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/command/build_ext.py python/branches/release26-maint/Lib/distutils/tests/support.py python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/distutils/command/build_ext.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/command/build_ext.py (original) +++ python/branches/release26-maint/Lib/distutils/command/build_ext.py Tue May 12 19:11:54 2009 @@ -303,38 +303,38 @@ # Setup the CCompiler object that we'll use to do all the # compiling and linking - self.compiler = new_compiler(compiler=self.compiler, + self._compiler = new_compiler(compiler=self.compiler, verbose=self.verbose, dry_run=self.dry_run, force=self.force) - customize_compiler(self.compiler) + customize_compiler(self._compiler) # If we are cross-compiling, init the compiler now (if we are not # cross-compiling, init would not hurt, but people may rely on # late initialization of compiler even if they shouldn't...) if os.name == 'nt' and self.plat_name != get_platform(): - self.compiler.initialize(self.plat_name) + self._compiler.initialize(self.plat_name) # And make sure that any compile/link-related options (which might # come from the command-line or from the setup script) are set in # that CCompiler object -- that way, they automatically apply to # all compiling and linking done here. if self.include_dirs is not None: - self.compiler.set_include_dirs(self.include_dirs) + self._compiler.set_include_dirs(self.include_dirs) if self.define is not None: # 'define' option is a list of (name,value) tuples for (name, value) in self.define: - self.compiler.define_macro(name, value) + self._compiler.define_macro(name, value) if self.undef is not None: for macro in self.undef: - self.compiler.undefine_macro(macro) + self._compiler.undefine_macro(macro) if self.libraries is not None: - self.compiler.set_libraries(self.libraries) + self._compiler.set_libraries(self.libraries) if self.library_dirs is not None: - self.compiler.set_library_dirs(self.library_dirs) + self._compiler.set_library_dirs(self.library_dirs) if self.rpath is not None: - self.compiler.set_runtime_library_dirs(self.rpath) + self._compiler.set_runtime_library_dirs(self.rpath) if self.link_objects is not None: - self.compiler.set_link_objects(self.link_objects) + self._compiler.set_link_objects(self.link_objects) # Now actually compile and link everything. self.build_extensions() @@ -438,9 +438,7 @@ # "build" tree. outputs = [] for ext in self.extensions: - fullname = self.get_ext_fullname(ext.name) - outputs.append(os.path.join(self.build_lib, - self.get_ext_filename(fullname))) + outputs.append(self.get_ext_fullpath(ext.name)) return outputs def build_extensions(self): @@ -459,24 +457,9 @@ "a list of source filenames") % ext.name sources = list(sources) - fullname = self.get_ext_fullname(ext.name) - if self.inplace: - # ignore build-lib -- put the compiled extension into - # the source tree along with pure Python modules - - modpath = string.split(fullname, '.') - package = string.join(modpath[0:-1], '.') - base = modpath[-1] - - build_py = self.get_finalized_command('build_py') - package_dir = build_py.get_package_dir(package) - ext_filename = os.path.join(package_dir, - self.get_ext_filename(base)) - else: - ext_filename = os.path.join(self.build_lib, - self.get_ext_filename(fullname)) + ext_path = self.get_ext_fullpath(ext.name) depends = sources + ext.depends - if not (self.force or newer_group(depends, ext_filename, 'newer')): + if not (self.force or newer_group(depends, ext_path, 'newer')): log.debug("skipping '%s' extension (up-to-date)", ext.name) return else: @@ -507,13 +490,13 @@ for undef in ext.undef_macros: macros.append((undef,)) - objects = self.compiler.compile(sources, - output_dir=self.build_temp, - macros=macros, - include_dirs=ext.include_dirs, - debug=self.debug, - extra_postargs=extra_args, - depends=ext.depends) + objects = self._compiler.compile(sources, + output_dir=self.build_temp, + macros=macros, + include_dirs=ext.include_dirs, + debug=self.debug, + extra_postargs=extra_args, + depends=ext.depends) # XXX -- this is a Vile HACK! # @@ -534,10 +517,10 @@ extra_args = ext.extra_link_args or [] # Detect target language, if not provided - language = ext.language or self.compiler.detect_language(sources) + language = ext.language or self._compiler.detect_language(sources) - self.compiler.link_shared_object( - objects, ext_filename, + self._compiler.link_shared_object( + objects, ext_path, libraries=self.get_libraries(ext), library_dirs=ext.library_dirs, runtime_library_dirs=ext.runtime_library_dirs, @@ -639,8 +622,28 @@ # -- Name generators ----------------------------------------------- # (extension names, filenames, whatever) + def get_ext_fullpath(self, ext_name): + """Returns the path of the filename for a given extension. + + The file is located in `build_lib` or directly in the package + (inplace option). + """ + if self.inplace: + fullname = self.get_ext_fullname(ext_name) + modpath = fullname.split('.') + package = '.'.join(modpath[0:-1]) + base = modpath[-1] + build_py = self.get_finalized_command('build_py') + package_dir = os.path.abspath(build_py.get_package_dir(package)) + return os.path.join(package_dir, base) + else: + filename = self.get_ext_filename(ext_name) + return os.path.join(self.build_lib, filename) + + def get_ext_fullname(self, ext_name): + """Returns the fullname of a given extension name. - def get_ext_fullname (self, ext_name): + Adds the `package.` prefix""" if self.package is None: return ext_name else: @@ -687,7 +690,7 @@ # Append '_d' to the python import library on debug builds. if sys.platform == "win32": from distutils.msvccompiler import MSVCCompiler - if not isinstance(self.compiler, MSVCCompiler): + if not isinstance(self._compiler, MSVCCompiler): template = "python%d%d" if self.debug: template = template + '_d' Modified: python/branches/release26-maint/Lib/distutils/tests/support.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/tests/support.py (original) +++ python/branches/release26-maint/Lib/distutils/tests/support.py Tue May 12 19:11:54 2009 @@ -42,6 +42,18 @@ self.tempdirs.append(d) return d + def write_file(self, path, content='xxx'): + """Writes a file in the given path. + + path can be a string or a sequence. + """ + if isinstance(path, (list, tuple)): + path = os.path.join(*path) + f = open(path, 'w') + try: + f.write(content) + finally: + f.close() class DummyCommand: """Class to store options for retrieval via set_undefined_options().""" Modified: python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py Tue May 12 19:11:54 2009 @@ -99,7 +99,7 @@ else: _config_vars['Py_ENABLE_SHARED'] = old_var - # make sur we get some lobrary dirs under solaris + # make sure we get some library dirs under solaris self.assert_(len(cmd.library_dirs) > 0) def test_finalize_options(self): @@ -219,13 +219,50 @@ cmd.ensure_finalized() self.assertEquals(cmd.get_source_files(), ['xxx']) + def test_compiler_option(self): + # cmd.compiler is an option and + # should not be overriden by a compiler instance + # when the command is run + dist = Distribution() + cmd = build_ext(dist) + cmd.compiler = 'unix' + cmd.ensure_finalized() + cmd.run() + self.assertEquals(cmd.compiler, 'unix') + def test_get_outputs(self): - modules = [Extension('foo', ['xxx'])] - dist = Distribution({'name': 'xx', 'ext_modules': modules}) + tmp_dir = self.mkdtemp() + c_file = os.path.join(tmp_dir, 'foo.c') + self.write_file(c_file, '') + ext = Extension('foo', [c_file]) + dist = Distribution({'name': 'xx', + 'ext_modules': [ext]}) cmd = build_ext(dist) cmd.ensure_finalized() self.assertEquals(len(cmd.get_outputs()), 1) + if os.name == "nt": + cmd.debug = sys.executable.endswith("_d.exe") + + cmd.build_lib = os.path.join(self.tmp_dir, 'build') + cmd.build_temp = os.path.join(self.tmp_dir, 'tempt') + + # issue #5977 : distutils build_ext.get_outputs + # returns wrong result with --inplace + cmd.inplace = 1 + cmd.run() + so_file = cmd.get_outputs()[0] + self.assert_(os.path.exists(so_file)) + so_dir = os.path.dirname(so_file) + self.assertEquals(so_dir, os.getcwd()) + + cmd.inplace = 0 + cmd.run() + so_file = cmd.get_outputs()[0] + self.assert_(os.path.exists(so_file)) + so_dir = os.path.dirname(so_file) + self.assertEquals(so_dir, cmd.build_lib) + def test_suite(): if not sysconfig.python_build: if test_support.verbose: Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Tue May 12 19:11:54 2009 @@ -192,6 +192,9 @@ Library ------- +- Issue #5977: distutils build_ext.get_outputs was not taking into account the + inplace option. Initial patch by kxroberto. + - Issue #5984: distutils.command.build_ext.check_extensions_list checks were broken for old-style extensions. From buildbot at python.org Tue May 12 19:13:12 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 17:13:12 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090512171312.E4DC3D776@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/508 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Tue May 12 19:13:32 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 17:13:32 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090512171332.9A59BD776@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1307 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Tue May 12 19:13:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 17:13:39 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090512171339.298C8D77D@mail.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/4992 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed compile sincerely, -The Buildbot From python-checkins at python.org Tue May 12 19:14:01 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 12 May 2009 19:14:01 +0200 (CEST) Subject: [Python-checkins] r72587 - in python/branches/py3k: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090512171401.B6A79D77D@mail.python.org> Author: tarek.ziade Date: Tue May 12 19:14:01 2009 New Revision: 72587 Log: Merged revisions 72585 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72585 | tarek.ziade | 2009-05-12 19:07:14 +0200 (Tue, 12 May 2009) | 1 line fixed #5977: distutils build_ext.get_outputs was not using the inplace option ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/command/build_ext.py python/branches/py3k/Lib/distutils/tests/test_build_ext.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/distutils/command/build_ext.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/build_ext.py (original) +++ python/branches/py3k/Lib/distutils/command/build_ext.py Tue May 12 19:14:01 2009 @@ -310,38 +310,38 @@ # Setup the CCompiler object that we'll use to do all the # compiling and linking - self.compiler = new_compiler(compiler=self.compiler, + self._compiler = new_compiler(compiler=self.compiler, verbose=self.verbose, dry_run=self.dry_run, force=self.force) - customize_compiler(self.compiler) + customize_compiler(self._compiler) # If we are cross-compiling, init the compiler now (if we are not # cross-compiling, init would not hurt, but people may rely on # late initialization of compiler even if they shouldn't...) if os.name == 'nt' and self.plat_name != get_platform(): - self.compiler.initialize(self.plat_name) + self._compiler.initialize(self.plat_name) # And make sure that any compile/link-related options (which might # come from the command-line or from the setup script) are set in # that CCompiler object -- that way, they automatically apply to # all compiling and linking done here. if self.include_dirs is not None: - self.compiler.set_include_dirs(self.include_dirs) + self._compiler.set_include_dirs(self.include_dirs) if self.define is not None: # 'define' option is a list of (name,value) tuples for (name, value) in self.define: - self.compiler.define_macro(name, value) + self._compiler.define_macro(name, value) if self.undef is not None: for macro in self.undef: - self.compiler.undefine_macro(macro) + self._compiler.undefine_macro(macro) if self.libraries is not None: - self.compiler.set_libraries(self.libraries) + self._compiler.set_libraries(self.libraries) if self.library_dirs is not None: - self.compiler.set_library_dirs(self.library_dirs) + self._compiler.set_library_dirs(self.library_dirs) if self.rpath is not None: - self.compiler.set_runtime_library_dirs(self.rpath) + self._compiler.set_runtime_library_dirs(self.rpath) if self.link_objects is not None: - self.compiler.set_link_objects(self.link_objects) + self._compiler.set_link_objects(self.link_objects) # Now actually compile and link everything. self.build_extensions() @@ -444,9 +444,7 @@ # "build" tree. outputs = [] for ext in self.extensions: - fullname = self.get_ext_fullname(ext.name) - outputs.append(os.path.join(self.build_lib, - self.get_ext_filename(fullname))) + outputs.append(self.get_ext_fullpath(ext.name)) return outputs def build_extensions(self): @@ -471,24 +469,9 @@ "a list of source filenames" % ext.name) sources = list(sources) - fullname = self.get_ext_fullname(ext.name) - if self.inplace: - # ignore build-lib -- put the compiled extension into - # the source tree along with pure Python modules - - modpath = fullname.split('.') - package = '.'.join(modpath[0:-1]) - base = modpath[-1] - - build_py = self.get_finalized_command('build_py') - package_dir = build_py.get_package_dir(package) - ext_filename = os.path.join(package_dir, - self.get_ext_filename(base)) - else: - ext_filename = os.path.join(self.build_lib, - self.get_ext_filename(fullname)) + ext_path = self.get_ext_fullpath(ext.name) depends = sources + ext.depends - if not (self.force or newer_group(depends, ext_filename, 'newer')): + if not (self.force or newer_group(depends, ext_path, 'newer')): log.debug("skipping '%s' extension (up-to-date)", ext.name) return else: @@ -519,13 +502,13 @@ for undef in ext.undef_macros: macros.append((undef,)) - objects = self.compiler.compile(sources, - output_dir=self.build_temp, - macros=macros, - include_dirs=ext.include_dirs, - debug=self.debug, - extra_postargs=extra_args, - depends=ext.depends) + objects = self._compiler.compile(sources, + output_dir=self.build_temp, + macros=macros, + include_dirs=ext.include_dirs, + debug=self.debug, + extra_postargs=extra_args, + depends=ext.depends) # XXX -- this is a Vile HACK! # @@ -546,10 +529,10 @@ extra_args = ext.extra_link_args or [] # Detect target language, if not provided - language = ext.language or self.compiler.detect_language(sources) + language = ext.language or self._compiler.detect_language(sources) - self.compiler.link_shared_object( - objects, ext_filename, + self._compiler.link_shared_object( + objects, ext_path, libraries=self.get_libraries(ext), library_dirs=ext.library_dirs, runtime_library_dirs=ext.runtime_library_dirs, @@ -640,8 +623,28 @@ # -- Name generators ----------------------------------------------- # (extension names, filenames, whatever) + def get_ext_fullpath(self, ext_name): + """Returns the path of the filename for a given extension. + + The file is located in `build_lib` or directly in the package + (inplace option). + """ + if self.inplace: + fullname = self.get_ext_fullname(ext_name) + modpath = fullname.split('.') + package = '.'.join(modpath[0:-1]) + base = modpath[-1] + build_py = self.get_finalized_command('build_py') + package_dir = os.path.abspath(build_py.get_package_dir(package)) + return os.path.join(package_dir, base) + else: + filename = self.get_ext_filename(ext_name) + return os.path.join(self.build_lib, filename) def get_ext_fullname(self, ext_name): + """Returns the fullname of a given extension name. + + Adds the `package.` prefix""" if self.package is None: return ext_name else: @@ -686,7 +689,7 @@ # Append '_d' to the python import library on debug builds. if sys.platform == "win32": from distutils.msvccompiler import MSVCCompiler - if not isinstance(self.compiler, MSVCCompiler): + if not isinstance(self._compiler, MSVCCompiler): template = "python%d%d" if self.debug: template = template + '_d' Modified: python/branches/py3k/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_build_ext.py Tue May 12 19:14:01 2009 @@ -113,7 +113,7 @@ else: _config_vars['Py_ENABLE_SHARED'] = old_var - # make sur we get some lobrary dirs under solaris + # make sure we get some library dirs under solaris self.assert_(len(cmd.library_dirs) > 0) def test_user_site(self): @@ -282,13 +282,50 @@ cmd.ensure_finalized() self.assertEquals(cmd.get_source_files(), ['xxx']) + def test_compiler_option(self): + # cmd.compiler is an option and + # should not be overriden by a compiler instance + # when the command is run + dist = Distribution() + cmd = build_ext(dist) + cmd.compiler = 'unix' + cmd.ensure_finalized() + cmd.run() + self.assertEquals(cmd.compiler, 'unix') + def test_get_outputs(self): - modules = [Extension('foo', ['xxx'], optional=False)] - dist = Distribution({'name': 'xx', 'ext_modules': modules}) + tmp_dir = self.mkdtemp() + c_file = os.path.join(tmp_dir, 'foo.c') + self.write_file(c_file, '') + ext = Extension('foo', [c_file], optional=False) + dist = Distribution({'name': 'xx', + 'ext_modules': [ext]}) cmd = build_ext(dist) cmd.ensure_finalized() self.assertEquals(len(cmd.get_outputs()), 1) + if os.name == "nt": + cmd.debug = sys.executable.endswith("_d.exe") + + cmd.build_lib = os.path.join(self.tmp_dir, 'build') + cmd.build_temp = os.path.join(self.tmp_dir, 'tempt') + + # issue #5977 : distutils build_ext.get_outputs + # returns wrong result with --inplace + cmd.inplace = 1 + cmd.run() + so_file = cmd.get_outputs()[0] + self.assert_(os.path.exists(so_file)) + so_dir = os.path.dirname(so_file) + self.assertEquals(so_dir, os.getcwd()) + + cmd.inplace = 0 + cmd.run() + so_file = cmd.get_outputs()[0] + self.assert_(os.path.exists(so_file)) + so_dir = os.path.dirname(so_file) + self.assertEquals(so_dir, cmd.build_lib) + def test_suite(): src = _get_source_filename() if not os.path.exists(src): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue May 12 19:14:01 2009 @@ -596,6 +596,9 @@ Library ------- +- Issue #5977: distutils build_ext.get_outputs was not taking into account the + inplace option. Initial patch by kxroberto. + - Issue #5984: distutils.command.build_ext.check_extensions_list checks were broken for old-style extensions. From buildbot at python.org Tue May 12 19:14:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 17:14:41 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc trunk Message-ID: <20090512171441.B9179D3C7@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%20trunk/builds/416 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed compile sincerely, -The Buildbot From python-checkins at python.org Tue May 12 19:17:12 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 12 May 2009 19:17:12 +0200 (CEST) Subject: [Python-checkins] r72588 - in python/branches/release30-maint: Lib/distutils/command/build_ext.py Lib/distutils/tests/support.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090512171712.2A614D783@mail.python.org> Author: tarek.ziade Date: Tue May 12 19:17:11 2009 New Revision: 72588 Log: Merged revisions 72587 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72587 | tarek.ziade | 2009-05-12 19:14:01 +0200 (Tue, 12 May 2009) | 9 lines Merged revisions 72585 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72585 | tarek.ziade | 2009-05-12 19:07:14 +0200 (Tue, 12 May 2009) | 1 line fixed #5977: distutils build_ext.get_outputs was not using the inplace option ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/command/build_ext.py python/branches/release30-maint/Lib/distutils/tests/support.py python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/distutils/command/build_ext.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/command/build_ext.py (original) +++ python/branches/release30-maint/Lib/distutils/command/build_ext.py Tue May 12 19:17:11 2009 @@ -300,38 +300,38 @@ # Setup the CCompiler object that we'll use to do all the # compiling and linking - self.compiler = new_compiler(compiler=self.compiler, + self._compiler = new_compiler(compiler=self.compiler, verbose=self.verbose, dry_run=self.dry_run, force=self.force) - customize_compiler(self.compiler) + customize_compiler(self._compiler) # If we are cross-compiling, init the compiler now (if we are not # cross-compiling, init would not hurt, but people may rely on # late initialization of compiler even if they shouldn't...) if os.name == 'nt' and self.plat_name != get_platform(): - self.compiler.initialize(self.plat_name) + self._compiler.initialize(self.plat_name) # And make sure that any compile/link-related options (which might # come from the command-line or from the setup script) are set in # that CCompiler object -- that way, they automatically apply to # all compiling and linking done here. if self.include_dirs is not None: - self.compiler.set_include_dirs(self.include_dirs) + self._compiler.set_include_dirs(self.include_dirs) if self.define is not None: # 'define' option is a list of (name,value) tuples for (name, value) in self.define: - self.compiler.define_macro(name, value) + self._compiler.define_macro(name, value) if self.undef is not None: for macro in self.undef: - self.compiler.undefine_macro(macro) + self._compiler.undefine_macro(macro) if self.libraries is not None: - self.compiler.set_libraries(self.libraries) + self._compiler.set_libraries(self.libraries) if self.library_dirs is not None: - self.compiler.set_library_dirs(self.library_dirs) + self._compiler.set_library_dirs(self.library_dirs) if self.rpath is not None: - self.compiler.set_runtime_library_dirs(self.rpath) + self._compiler.set_runtime_library_dirs(self.rpath) if self.link_objects is not None: - self.compiler.set_link_objects(self.link_objects) + self._compiler.set_link_objects(self.link_objects) # Now actually compile and link everything. self.build_extensions() @@ -434,9 +434,7 @@ # "build" tree. outputs = [] for ext in self.extensions: - fullname = self.get_ext_fullname(ext.name) - outputs.append(os.path.join(self.build_lib, - self.get_ext_filename(fullname))) + outputs.append(self.get_ext_fullpath(ext.name)) return outputs def build_extensions(self): @@ -455,24 +453,9 @@ "a list of source filenames" % ext.name) sources = list(sources) - fullname = self.get_ext_fullname(ext.name) - if self.inplace: - # ignore build-lib -- put the compiled extension into - # the source tree along with pure Python modules - - modpath = fullname.split('.') - package = '.'.join(modpath[0:-1]) - base = modpath[-1] - - build_py = self.get_finalized_command('build_py') - package_dir = build_py.get_package_dir(package) - ext_filename = os.path.join(package_dir, - self.get_ext_filename(base)) - else: - ext_filename = os.path.join(self.build_lib, - self.get_ext_filename(fullname)) + ext_path = self.get_ext_fullpath(ext.name) depends = sources + ext.depends - if not (self.force or newer_group(depends, ext_filename, 'newer')): + if not (self.force or newer_group(depends, ext_path, 'newer')): log.debug("skipping '%s' extension (up-to-date)", ext.name) return else: @@ -503,13 +486,13 @@ for undef in ext.undef_macros: macros.append((undef,)) - objects = self.compiler.compile(sources, - output_dir=self.build_temp, - macros=macros, - include_dirs=ext.include_dirs, - debug=self.debug, - extra_postargs=extra_args, - depends=ext.depends) + objects = self._compiler.compile(sources, + output_dir=self.build_temp, + macros=macros, + include_dirs=ext.include_dirs, + debug=self.debug, + extra_postargs=extra_args, + depends=ext.depends) # XXX -- this is a Vile HACK! # @@ -530,10 +513,10 @@ extra_args = ext.extra_link_args or [] # Detect target language, if not provided - language = ext.language or self.compiler.detect_language(sources) + language = ext.language or self._compiler.detect_language(sources) - self.compiler.link_shared_object( - objects, ext_filename, + self._compiler.link_shared_object( + objects, ext_path, libraries=self.get_libraries(ext), library_dirs=ext.library_dirs, runtime_library_dirs=ext.runtime_library_dirs, @@ -624,8 +607,28 @@ # -- Name generators ----------------------------------------------- # (extension names, filenames, whatever) + def get_ext_fullpath(self, ext_name): + """Returns the path of the filename for a given extension. + + The file is located in `build_lib` or directly in the package + (inplace option). + """ + if self.inplace: + fullname = self.get_ext_fullname(ext_name) + modpath = fullname.split('.') + package = '.'.join(modpath[0:-1]) + base = modpath[-1] + build_py = self.get_finalized_command('build_py') + package_dir = os.path.abspath(build_py.get_package_dir(package)) + return os.path.join(package_dir, base) + else: + filename = self.get_ext_filename(ext_name) + return os.path.join(self.build_lib, filename) def get_ext_fullname(self, ext_name): + """Returns the fullname of a given extension name. + + Adds the `package.` prefix""" if self.package is None: return ext_name else: @@ -670,7 +673,7 @@ # Append '_d' to the python import library on debug builds. if sys.platform == "win32": from distutils.msvccompiler import MSVCCompiler - if not isinstance(self.compiler, MSVCCompiler): + if not isinstance(self._compiler, MSVCCompiler): template = "python%d%d" if self.debug: template = template + '_d' Modified: python/branches/release30-maint/Lib/distutils/tests/support.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/tests/support.py (original) +++ python/branches/release30-maint/Lib/distutils/tests/support.py Tue May 12 19:17:11 2009 @@ -42,6 +42,18 @@ self.tempdirs.append(d) return d + def write_file(self, path, content='xxx'): + """Writes a file in the given path. + + path can be a string or a sequence. + """ + if isinstance(path, (list, tuple)): + path = os.path.join(*path) + f = open(path, 'w') + try: + f.write(content) + finally: + f.close() class DummyCommand: """Class to store options for retrieval via set_undefined_options().""" Modified: python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py Tue May 12 19:17:11 2009 @@ -100,7 +100,7 @@ else: _config_vars['Py_ENABLE_SHARED'] = old_var - # make sur we get some lobrary dirs under solaris + # make sure we get some library dirs under solaris self.assert_(len(cmd.library_dirs) > 0) def test_finalize_options(self): @@ -220,13 +220,50 @@ cmd.ensure_finalized() self.assertEquals(cmd.get_source_files(), ['xxx']) + def test_compiler_option(self): + # cmd.compiler is an option and + # should not be overriden by a compiler instance + # when the command is run + dist = Distribution() + cmd = build_ext(dist) + cmd.compiler = 'unix' + cmd.ensure_finalized() + cmd.run() + self.assertEquals(cmd.compiler, 'unix') + def test_get_outputs(self): - modules = [Extension('foo', ['xxx'])] - dist = Distribution({'name': 'xx', 'ext_modules': modules}) + tmp_dir = self.mkdtemp() + c_file = os.path.join(tmp_dir, 'foo.c') + self.write_file(c_file, '') + ext = Extension('foo', [c_file]) + dist = Distribution({'name': 'xx', + 'ext_modules': [ext]}) cmd = build_ext(dist) cmd.ensure_finalized() self.assertEquals(len(cmd.get_outputs()), 1) + if os.name == "nt": + cmd.debug = sys.executable.endswith("_d.exe") + + cmd.build_lib = os.path.join(self.tmp_dir, 'build') + cmd.build_temp = os.path.join(self.tmp_dir, 'tempt') + + # issue #5977 : distutils build_ext.get_outputs + # returns wrong result with --inplace + cmd.inplace = 1 + cmd.run() + so_file = cmd.get_outputs()[0] + self.assert_(os.path.exists(so_file)) + so_dir = os.path.dirname(so_file) + self.assertEquals(so_dir, os.getcwd()) + + cmd.inplace = 0 + cmd.run() + so_file = cmd.get_outputs()[0] + self.assert_(os.path.exists(so_file)) + so_dir = os.path.dirname(so_file) + self.assertEquals(so_dir, cmd.build_lib) + def test_suite(): if not sysconfig.python_build: if support.verbose: Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Tue May 12 19:17:11 2009 @@ -283,6 +283,9 @@ Library ------- +- Issue #5977: distutils build_ext.get_outputs was not taking into account the + inplace option. Initial patch by kxroberto. + - Issue #5984: distutils.command.build_ext.check_extensions_list checks were broken for old-style extensions. From buildbot at python.org Tue May 12 19:17:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 17:17:52 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090512171752.6161CD7CA@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%202.6/builds/333 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Tue May 12 19:18:03 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 17:18:03 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090512171803.9213FD877@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%202.6/builds/351 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Tue May 12 19:18:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 17:18:18 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 2.6 Message-ID: <20090512171818.D488FD7E6@mail.python.org> The Buildbot has detected a new failure of x86 gentoo 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%202.6/builds/318 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Tue May 12 19:18:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 17:18:27 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090512171827.42D99D860@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%202.6/builds/334 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Tue May 12 19:18:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 17:18:54 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 2.6 Message-ID: <20090512171854.A3AE5D87E@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%202.6/builds/3 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Tue May 12 19:20:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 17:20:00 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090512172000.9F993C2EA@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/796 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: michael.foord,tarek.ziade BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Tue May 12 19:20:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 17:20:13 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090512172013.BB12DC2D6@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/958 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: michael.foord,tarek.ziade BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Tue May 12 19:20:38 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 17:20:38 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090512172038.1D9C7D4DD@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/743 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: michael.foord,tarek.ziade BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Tue May 12 19:20:55 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 17:20:55 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090512172055.D3962D3F1@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/610 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: michael.foord,tarek.ziade BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Tue May 12 19:23:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 17:23:09 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.0 Message-ID: <20090512172309.8C141D64C@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.0/builds/321 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Tue May 12 19:23:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 17:23:17 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.0 Message-ID: <20090512172317.332DCD802@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.0/builds/415 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Tue May 12 19:23:44 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 17:23:44 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.0 Message-ID: <20090512172344.39F9CD86C@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.0/builds/367 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Tue May 12 19:23:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 12 May 2009 17:23:56 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090512172356.6DD30D86C@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.0/builds/3 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed compile sincerely, -The Buildbot From python-checkins at python.org Tue May 12 22:39:25 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 12 May 2009 22:39:25 +0200 (CEST) Subject: [Python-checkins] r72589 - python/branches/py3k/Python/symtable.c Message-ID: <20090512203925.A7D04D48B@mail.python.org> Author: benjamin.peterson Date: Tue May 12 22:39:25 2009 New Revision: 72589 Log: fix error handling of PyNumber_InPlaceOr #6000 Modified: python/branches/py3k/Python/symtable.c Modified: python/branches/py3k/Python/symtable.c ============================================================================== --- python/branches/py3k/Python/symtable.c (original) +++ python/branches/py3k/Python/symtable.c Tue May 12 22:39:25 2009 @@ -658,6 +658,7 @@ { PyObject *name, *v, *local = NULL, *scopes = NULL, *newbound = NULL; PyObject *newglobal = NULL, *newfree = NULL, *allfree = NULL; + PyObject *temp; int i, success = 0; Py_ssize_t pos = 0; @@ -696,14 +697,16 @@ */ if (ste->ste_type == ClassBlock) { /* Pass down known globals */ - if (!PyNumber_InPlaceOr(newglobal, global)) + temp = PyNumber_InPlaceOr(newglobal, global); + if (!temp) goto error; - Py_DECREF(newglobal); + Py_DECREF(temp); /* Pass down previously bound symbols */ if (bound) { - if (!PyNumber_InPlaceOr(newbound, bound)) + temp = PyNumber_InPlaceOr(newbound, bound); + if (!temp) goto error; - Py_DECREF(newbound); + Py_DECREF(temp); } } @@ -718,20 +721,23 @@ if (ste->ste_type != ClassBlock) { /* Add function locals to bound set */ if (ste->ste_type == FunctionBlock) { - if (!PyNumber_InPlaceOr(newbound, local)) + temp = PyNumber_InPlaceOr(newbound, local); + if (!temp) goto error; - Py_DECREF(newbound); + Py_DECREF(temp); } /* Pass down previously bound symbols */ if (bound) { - if (!PyNumber_InPlaceOr(newbound, bound)) + temp = PyNumber_InPlaceOr(newbound, bound); + if (!temp) goto error; - Py_DECREF(newbound); + Py_DECREF(temp); } /* Pass down known globals */ - if (!PyNumber_InPlaceOr(newglobal, global)) + temp = PyNumber_InPlaceOr(newglobal, global); + if (!temp) goto error; - Py_DECREF(newglobal); + Py_DECREF(temp); } else { /* Special-case __class__ */ @@ -764,9 +770,10 @@ ste->ste_child_free = 1; } - if (PyNumber_InPlaceOr(newfree, allfree) < 0) + temp = PyNumber_InPlaceOr(newfree, allfree); + if (!temp) goto error; - Py_DECREF(newfree); + Py_DECREF(temp); /* Check if any local variables must be converted to cell variables */ if (ste->ste_type == FunctionBlock && !analyze_cells(scopes, newfree, @@ -782,9 +789,10 @@ if (!check_unoptimized(ste)) goto error; - if (!PyNumber_InPlaceOr(free, newfree)) + temp = PyNumber_InPlaceOr(free, newfree); + if (!temp) goto error; - Py_DECREF(free); + Py_DECREF(temp); success = 1; error: Py_XDECREF(scopes); @@ -803,6 +811,7 @@ PyObject *global, PyObject* child_free) { PyObject *temp_bound = NULL, *temp_global = NULL, *temp_free = NULL; + PyObject *temp; /* Copy the bound and global dictionaries. @@ -823,9 +832,10 @@ if (!analyze_block(entry, temp_bound, temp_free, temp_global)) goto error; - if (PyNumber_InPlaceOr(child_free, temp_free) < 0) + temp = PyNumber_InPlaceOr(child_free, temp_free); + if (!temp) goto error; - Py_DECREF(child_free); + Py_DECREF(temp); Py_DECREF(temp_bound); Py_DECREF(temp_free); Py_DECREF(temp_global); From python-checkins at python.org Tue May 12 22:47:57 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 12 May 2009 22:47:57 +0200 (CEST) Subject: [Python-checkins] r72590 - python/branches/py3k/Doc/library/sys.rst Message-ID: <20090512204757.520C6D744@mail.python.org> Author: benjamin.peterson Date: Tue May 12 22:47:57 2009 New Revision: 72590 Log: add example function Modified: python/branches/py3k/Doc/library/sys.rst Modified: python/branches/py3k/Doc/library/sys.rst ============================================================================== --- python/branches/py3k/Doc/library/sys.rst (original) +++ python/branches/py3k/Doc/library/sys.rst Tue May 12 22:47:57 2009 @@ -784,7 +784,13 @@ The standard streams are in text mode by default. To write or read binary data to these, use the underlying binary buffer. For example, to write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``. Using - :meth:`io.TextIOWrapper.detach` streams can be made binary by default. + :meth:`io.TextIOWrapper.detach` streams can be made binary by default. For + example, this function sets all the standard streams to binary: :: + + def make_streams_binary(): + sys.stdin = sys.stdin.detach() + sys.stdout = sys.stout.detach() + sys.stderr = sys.stderr.detach() .. data:: __stdin__ From python-checkins at python.org Tue May 12 22:50:32 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 12 May 2009 22:50:32 +0200 (CEST) Subject: [Python-checkins] r72591 - in python/branches/release30-maint: Python/symtable.c Message-ID: <20090512205032.E79D7D60C@mail.python.org> Author: benjamin.peterson Date: Tue May 12 22:50:32 2009 New Revision: 72591 Log: Merged revisions 72589 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r72589 | benjamin.peterson | 2009-05-12 15:39:25 -0500 (Tue, 12 May 2009) | 1 line fix error handling of PyNumber_InPlaceOr #6000 ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Python/symtable.c Modified: python/branches/release30-maint/Python/symtable.c ============================================================================== --- python/branches/release30-maint/Python/symtable.c (original) +++ python/branches/release30-maint/Python/symtable.c Tue May 12 22:50:32 2009 @@ -657,6 +657,7 @@ { PyObject *name, *v, *local = NULL, *scopes = NULL, *newbound = NULL; PyObject *newglobal = NULL, *newfree = NULL, *allfree = NULL; + PyObject *temp; int i, success = 0; Py_ssize_t pos = 0; @@ -695,14 +696,16 @@ */ if (ste->ste_type == ClassBlock) { /* Pass down known globals */ - if (!PyNumber_InPlaceOr(newglobal, global)) + temp = PyNumber_InPlaceOr(newglobal, global); + if (!temp) goto error; - Py_DECREF(newglobal); + Py_DECREF(temp); /* Pass down previously bound symbols */ if (bound) { - if (!PyNumber_InPlaceOr(newbound, bound)) + temp = PyNumber_InPlaceOr(newbound, bound); + if (!temp) goto error; - Py_DECREF(newbound); + Py_DECREF(temp); } } @@ -717,20 +720,23 @@ if (ste->ste_type != ClassBlock) { /* Add function locals to bound set */ if (ste->ste_type == FunctionBlock) { - if (!PyNumber_InPlaceOr(newbound, local)) + temp = PyNumber_InPlaceOr(newbound, local); + if (!temp) goto error; - Py_DECREF(newbound); + Py_DECREF(temp); } /* Pass down previously bound symbols */ if (bound) { - if (!PyNumber_InPlaceOr(newbound, bound)) + temp = PyNumber_InPlaceOr(newbound, bound); + if (!temp) goto error; - Py_DECREF(newbound); + Py_DECREF(temp); } /* Pass down known globals */ - if (!PyNumber_InPlaceOr(newglobal, global)) + temp = PyNumber_InPlaceOr(newglobal, global); + if (!temp) goto error; - Py_DECREF(newglobal); + Py_DECREF(temp); } else { /* Special-case __class__ */ @@ -763,9 +769,10 @@ ste->ste_child_free = 1; } - if (PyNumber_InPlaceOr(newfree, allfree) < 0) + temp = PyNumber_InPlaceOr(newfree, allfree); + if (!temp) goto error; - Py_DECREF(newfree); + Py_DECREF(temp); /* Check if any local variables must be converted to cell variables */ if (ste->ste_type == FunctionBlock && !analyze_cells(scopes, newfree, @@ -781,9 +788,10 @@ if (!check_unoptimized(ste)) goto error; - if (!PyNumber_InPlaceOr(free, newfree)) + temp = PyNumber_InPlaceOr(free, newfree); + if (!temp) goto error; - Py_DECREF(free); + Py_DECREF(temp); success = 1; error: Py_XDECREF(scopes); @@ -802,6 +810,7 @@ PyObject *global, PyObject* child_free) { PyObject *temp_bound = NULL, *temp_global = NULL, *temp_free = NULL; + PyObject *temp; /* Copy the bound and global dictionaries. @@ -822,9 +831,10 @@ if (!analyze_block(entry, temp_bound, temp_free, temp_global)) goto error; - if (PyNumber_InPlaceOr(child_free, temp_free) < 0) + temp = PyNumber_InPlaceOr(child_free, temp_free); + if (!temp) goto error; - Py_DECREF(child_free); + Py_DECREF(temp); Py_DECREF(temp_bound); Py_DECREF(temp_free); Py_DECREF(temp_global); From python-checkins at python.org Tue May 12 22:58:26 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 12 May 2009 22:58:26 +0200 (CEST) Subject: [Python-checkins] r72592 - python/branches/py3k/Doc/library/sys.rst Message-ID: <20090512205826.4F0B1D842@mail.python.org> Author: benjamin.peterson Date: Tue May 12 22:58:26 2009 New Revision: 72592 Log: two edits Modified: python/branches/py3k/Doc/library/sys.rst Modified: python/branches/py3k/Doc/library/sys.rst ============================================================================== --- python/branches/py3k/Doc/library/sys.rst (original) +++ python/branches/py3k/Doc/library/sys.rst Tue May 12 22:58:26 2009 @@ -784,8 +784,8 @@ The standard streams are in text mode by default. To write or read binary data to these, use the underlying binary buffer. For example, to write bytes to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``. Using - :meth:`io.TextIOWrapper.detach` streams can be made binary by default. For - example, this function sets all the standard streams to binary: :: + :meth:`io.TextIOBase.detach` streams can be made binary by default. For + example, this function sets all the standard streams to binary:: def make_streams_binary(): sys.stdin = sys.stdin.detach() From python-checkins at python.org Tue May 12 23:06:05 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 12 May 2009 23:06:05 +0200 (CEST) Subject: [Python-checkins] r72593 - python/trunk/Lib/distutils/command/build_ext.py Message-ID: <20090512210605.9E927D969@mail.python.org> Author: benjamin.peterson Date: Tue May 12 23:06:05 2009 New Revision: 72593 Log: the compiler attribute is used in setup.py; can't rename Modified: python/trunk/Lib/distutils/command/build_ext.py Modified: python/trunk/Lib/distutils/command/build_ext.py ============================================================================== --- python/trunk/Lib/distutils/command/build_ext.py (original) +++ python/trunk/Lib/distutils/command/build_ext.py Tue May 12 23:06:05 2009 @@ -311,38 +311,38 @@ # Setup the CCompiler object that we'll use to do all the # compiling and linking - self._compiler = new_compiler(compiler=self.compiler, + self.compiler = new_compiler(compiler=None, verbose=self.verbose, dry_run=self.dry_run, force=self.force) - customize_compiler(self._compiler) + customize_compiler(self.compiler) # If we are cross-compiling, init the compiler now (if we are not # cross-compiling, init would not hurt, but people may rely on # late initialization of compiler even if they shouldn't...) if os.name == 'nt' and self.plat_name != get_platform(): - self._compiler.initialize(self.plat_name) + self.compiler.initialize(self.plat_name) # And make sure that any compile/link-related options (which might # come from the command-line or from the setup script) are set in # that CCompiler object -- that way, they automatically apply to # all compiling and linking done here. if self.include_dirs is not None: - self._compiler.set_include_dirs(self.include_dirs) + self.compiler.set_include_dirs(self.include_dirs) if self.define is not None: # 'define' option is a list of (name,value) tuples for (name, value) in self.define: - self._compiler.define_macro(name, value) + self.compiler.define_macro(name, value) if self.undef is not None: for macro in self.undef: - self._compiler.undefine_macro(macro) + self.compiler.undefine_macro(macro) if self.libraries is not None: - self._compiler.set_libraries(self.libraries) + self.compiler.set_libraries(self.libraries) if self.library_dirs is not None: - self._compiler.set_library_dirs(self.library_dirs) + self.compiler.set_library_dirs(self.library_dirs) if self.rpath is not None: - self._compiler.set_runtime_library_dirs(self.rpath) + self.compiler.set_runtime_library_dirs(self.rpath) if self.link_objects is not None: - self._compiler.set_link_objects(self.link_objects) + self.compiler.set_link_objects(self.link_objects) # Now actually compile and link everything. self.build_extensions() @@ -504,7 +504,7 @@ for undef in ext.undef_macros: macros.append((undef,)) - objects = self._compiler.compile(sources, + objects = self.compiler.compile(sources, output_dir=self.build_temp, macros=macros, include_dirs=ext.include_dirs, @@ -531,9 +531,9 @@ extra_args = ext.extra_link_args or [] # Detect target language, if not provided - language = ext.language or self._compiler.detect_language(sources) + language = ext.language or self.compiler.detect_language(sources) - self._compiler.link_shared_object( + self.compiler.link_shared_object( objects, ext_path, libraries=self.get_libraries(ext), library_dirs=ext.library_dirs, @@ -704,7 +704,7 @@ # Append '_d' to the python import library on debug builds. if sys.platform == "win32": from distutils.msvccompiler import MSVCCompiler - if not isinstance(self._compiler, MSVCCompiler): + if not isinstance(self.compiler, MSVCCompiler): template = "python%d%d" if self.debug: template = template + '_d' From python-checkins at python.org Tue May 12 23:20:42 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 12 May 2009 23:20:42 +0200 (CEST) Subject: [Python-checkins] r72594 - in python/branches/release26-maint: Lib/distutils/command/build_ext.py Message-ID: <20090512212042.13B5CD596@mail.python.org> Author: benjamin.peterson Date: Tue May 12 23:20:41 2009 New Revision: 72594 Log: Merged revisions 72593 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72593 | benjamin.peterson | 2009-05-12 16:06:05 -0500 (Tue, 12 May 2009) | 1 line the compiler attribute is used in setup.py; can't rename ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/command/build_ext.py Modified: python/branches/release26-maint/Lib/distutils/command/build_ext.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/command/build_ext.py (original) +++ python/branches/release26-maint/Lib/distutils/command/build_ext.py Tue May 12 23:20:41 2009 @@ -303,38 +303,38 @@ # Setup the CCompiler object that we'll use to do all the # compiling and linking - self._compiler = new_compiler(compiler=self.compiler, + self.compiler = new_compiler(compiler=None, verbose=self.verbose, dry_run=self.dry_run, force=self.force) - customize_compiler(self._compiler) + customize_compiler(self.compiler) # If we are cross-compiling, init the compiler now (if we are not # cross-compiling, init would not hurt, but people may rely on # late initialization of compiler even if they shouldn't...) if os.name == 'nt' and self.plat_name != get_platform(): - self._compiler.initialize(self.plat_name) + self.compiler.initialize(self.plat_name) # And make sure that any compile/link-related options (which might # come from the command-line or from the setup script) are set in # that CCompiler object -- that way, they automatically apply to # all compiling and linking done here. if self.include_dirs is not None: - self._compiler.set_include_dirs(self.include_dirs) + self.compiler.set_include_dirs(self.include_dirs) if self.define is not None: # 'define' option is a list of (name,value) tuples for (name, value) in self.define: - self._compiler.define_macro(name, value) + self.compiler.define_macro(name, value) if self.undef is not None: for macro in self.undef: - self._compiler.undefine_macro(macro) + self.compiler.undefine_macro(macro) if self.libraries is not None: - self._compiler.set_libraries(self.libraries) + self.compiler.set_libraries(self.libraries) if self.library_dirs is not None: - self._compiler.set_library_dirs(self.library_dirs) + self.compiler.set_library_dirs(self.library_dirs) if self.rpath is not None: - self._compiler.set_runtime_library_dirs(self.rpath) + self.compiler.set_runtime_library_dirs(self.rpath) if self.link_objects is not None: - self._compiler.set_link_objects(self.link_objects) + self.compiler.set_link_objects(self.link_objects) # Now actually compile and link everything. self.build_extensions() @@ -490,7 +490,7 @@ for undef in ext.undef_macros: macros.append((undef,)) - objects = self._compiler.compile(sources, + objects = self.compiler.compile(sources, output_dir=self.build_temp, macros=macros, include_dirs=ext.include_dirs, @@ -517,9 +517,9 @@ extra_args = ext.extra_link_args or [] # Detect target language, if not provided - language = ext.language or self._compiler.detect_language(sources) + language = ext.language or self.compiler.detect_language(sources) - self._compiler.link_shared_object( + self.compiler.link_shared_object( objects, ext_path, libraries=self.get_libraries(ext), library_dirs=ext.library_dirs, @@ -690,7 +690,7 @@ # Append '_d' to the python import library on debug builds. if sys.platform == "win32": from distutils.msvccompiler import MSVCCompiler - if not isinstance(self._compiler, MSVCCompiler): + if not isinstance(self.compiler, MSVCCompiler): template = "python%d%d" if self.debug: template = template + '_d' From python-checkins at python.org Tue May 12 23:21:26 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 12 May 2009 23:21:26 +0200 (CEST) Subject: [Python-checkins] r72595 - in python/branches/py3k: Lib/distutils/command/build_ext.py Message-ID: <20090512212126.7B328D682@mail.python.org> Author: benjamin.peterson Date: Tue May 12 23:21:26 2009 New Revision: 72595 Log: Merged revisions 72593 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72593 | benjamin.peterson | 2009-05-12 16:06:05 -0500 (Tue, 12 May 2009) | 1 line the compiler attribute is used in setup.py; can't rename ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/command/build_ext.py Modified: python/branches/py3k/Lib/distutils/command/build_ext.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/build_ext.py (original) +++ python/branches/py3k/Lib/distutils/command/build_ext.py Tue May 12 23:21:26 2009 @@ -310,38 +310,38 @@ # Setup the CCompiler object that we'll use to do all the # compiling and linking - self._compiler = new_compiler(compiler=self.compiler, + self.compiler = new_compiler(compiler=None, verbose=self.verbose, dry_run=self.dry_run, force=self.force) - customize_compiler(self._compiler) + customize_compiler(self.compiler) # If we are cross-compiling, init the compiler now (if we are not # cross-compiling, init would not hurt, but people may rely on # late initialization of compiler even if they shouldn't...) if os.name == 'nt' and self.plat_name != get_platform(): - self._compiler.initialize(self.plat_name) + self.compiler.initialize(self.plat_name) # And make sure that any compile/link-related options (which might # come from the command-line or from the setup script) are set in # that CCompiler object -- that way, they automatically apply to # all compiling and linking done here. if self.include_dirs is not None: - self._compiler.set_include_dirs(self.include_dirs) + self.compiler.set_include_dirs(self.include_dirs) if self.define is not None: # 'define' option is a list of (name,value) tuples for (name, value) in self.define: - self._compiler.define_macro(name, value) + self.compiler.define_macro(name, value) if self.undef is not None: for macro in self.undef: - self._compiler.undefine_macro(macro) + self.compiler.undefine_macro(macro) if self.libraries is not None: - self._compiler.set_libraries(self.libraries) + self.compiler.set_libraries(self.libraries) if self.library_dirs is not None: - self._compiler.set_library_dirs(self.library_dirs) + self.compiler.set_library_dirs(self.library_dirs) if self.rpath is not None: - self._compiler.set_runtime_library_dirs(self.rpath) + self.compiler.set_runtime_library_dirs(self.rpath) if self.link_objects is not None: - self._compiler.set_link_objects(self.link_objects) + self.compiler.set_link_objects(self.link_objects) # Now actually compile and link everything. self.build_extensions() @@ -502,7 +502,7 @@ for undef in ext.undef_macros: macros.append((undef,)) - objects = self._compiler.compile(sources, + objects = self.compiler.compile(sources, output_dir=self.build_temp, macros=macros, include_dirs=ext.include_dirs, @@ -529,9 +529,9 @@ extra_args = ext.extra_link_args or [] # Detect target language, if not provided - language = ext.language or self._compiler.detect_language(sources) + language = ext.language or self.compiler.detect_language(sources) - self._compiler.link_shared_object( + self.compiler.link_shared_object( objects, ext_path, libraries=self.get_libraries(ext), library_dirs=ext.library_dirs, @@ -689,7 +689,7 @@ # Append '_d' to the python import library on debug builds. if sys.platform == "win32": from distutils.msvccompiler import MSVCCompiler - if not isinstance(self._compiler, MSVCCompiler): + if not isinstance(self.compiler, MSVCCompiler): template = "python%d%d" if self.debug: template = template + '_d' From ziade.tarek at gmail.com Wed May 13 00:00:56 2009 From: ziade.tarek at gmail.com (=?ISO-8859-1?Q?Tarek_Ziad=E9?=) Date: Wed, 13 May 2009 00:00:56 +0200 Subject: [Python-checkins] r72594 - in python/branches/release26-maint: Lib/distutils/command/build_ext.py In-Reply-To: <20090512212042.13B5CD596@mail.python.org> References: <20090512212042.13B5CD596@mail.python.org> Message-ID: <94bdd2610905121500o44e248ecv1d0282b4fdd89027@mail.gmail.com> On Tue, May 12, 2009 at 11:20 PM, benjamin.peterson wrote: > ?the compiler attribute is used in setup.py; can't rename Can't we rename it there as well ? "compiler" is an option (str) in build_ext, and shouldn't be turned into a compiler instance. > - ? ? ? ?self._compiler = new_compiler(compiler=self.compiler, > + ? ? ? ?self.compiler = new_compiler(compiler=None, You are braking the option here with that change, e.g. you can't force a compiler type anymore as it is supposed to be. So I think we have to make a choice : either it's a string, either it's a compiler instance, but it can't be both Tarek -- Tarek Ziad? | http://ziade.org From python-checkins at python.org Wed May 13 00:01:26 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 13 May 2009 00:01:26 +0200 (CEST) Subject: [Python-checkins] r72596 - in python/branches/release30-maint: Lib/distutils/command/build_ext.py Message-ID: <20090512220126.BCA69D8EC@mail.python.org> Author: benjamin.peterson Date: Wed May 13 00:01:26 2009 New Revision: 72596 Log: Merged revisions 72595 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72595 | benjamin.peterson | 2009-05-12 16:21:26 -0500 (Tue, 12 May 2009) | 9 lines Merged revisions 72593 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72593 | benjamin.peterson | 2009-05-12 16:06:05 -0500 (Tue, 12 May 2009) | 1 line the compiler attribute is used in setup.py; can't rename ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/command/build_ext.py Modified: python/branches/release30-maint/Lib/distutils/command/build_ext.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/command/build_ext.py (original) +++ python/branches/release30-maint/Lib/distutils/command/build_ext.py Wed May 13 00:01:26 2009 @@ -300,38 +300,38 @@ # Setup the CCompiler object that we'll use to do all the # compiling and linking - self._compiler = new_compiler(compiler=self.compiler, + self.compiler = new_compiler(compiler=None, verbose=self.verbose, dry_run=self.dry_run, force=self.force) - customize_compiler(self._compiler) + customize_compiler(self.compiler) # If we are cross-compiling, init the compiler now (if we are not # cross-compiling, init would not hurt, but people may rely on # late initialization of compiler even if they shouldn't...) if os.name == 'nt' and self.plat_name != get_platform(): - self._compiler.initialize(self.plat_name) + self.compiler.initialize(self.plat_name) # And make sure that any compile/link-related options (which might # come from the command-line or from the setup script) are set in # that CCompiler object -- that way, they automatically apply to # all compiling and linking done here. if self.include_dirs is not None: - self._compiler.set_include_dirs(self.include_dirs) + self.compiler.set_include_dirs(self.include_dirs) if self.define is not None: # 'define' option is a list of (name,value) tuples for (name, value) in self.define: - self._compiler.define_macro(name, value) + self.compiler.define_macro(name, value) if self.undef is not None: for macro in self.undef: - self._compiler.undefine_macro(macro) + self.compiler.undefine_macro(macro) if self.libraries is not None: - self._compiler.set_libraries(self.libraries) + self.compiler.set_libraries(self.libraries) if self.library_dirs is not None: - self._compiler.set_library_dirs(self.library_dirs) + self.compiler.set_library_dirs(self.library_dirs) if self.rpath is not None: - self._compiler.set_runtime_library_dirs(self.rpath) + self.compiler.set_runtime_library_dirs(self.rpath) if self.link_objects is not None: - self._compiler.set_link_objects(self.link_objects) + self.compiler.set_link_objects(self.link_objects) # Now actually compile and link everything. self.build_extensions() @@ -486,7 +486,7 @@ for undef in ext.undef_macros: macros.append((undef,)) - objects = self._compiler.compile(sources, + objects = self.compiler.compile(sources, output_dir=self.build_temp, macros=macros, include_dirs=ext.include_dirs, @@ -513,9 +513,9 @@ extra_args = ext.extra_link_args or [] # Detect target language, if not provided - language = ext.language or self._compiler.detect_language(sources) + language = ext.language or self.compiler.detect_language(sources) - self._compiler.link_shared_object( + self.compiler.link_shared_object( objects, ext_path, libraries=self.get_libraries(ext), library_dirs=ext.library_dirs, @@ -673,7 +673,7 @@ # Append '_d' to the python import library on debug builds. if sys.platform == "win32": from distutils.msvccompiler import MSVCCompiler - if not isinstance(self._compiler, MSVCCompiler): + if not isinstance(self.compiler, MSVCCompiler): template = "python%d%d" if self.debug: template = template + '_d' From benjamin at python.org Wed May 13 00:02:28 2009 From: benjamin at python.org (Benjamin Peterson) Date: Tue, 12 May 2009 17:02:28 -0500 Subject: [Python-checkins] r72594 - in python/branches/release26-maint: Lib/distutils/command/build_ext.py In-Reply-To: <94bdd2610905121500o44e248ecv1d0282b4fdd89027@mail.gmail.com> References: <20090512212042.13B5CD596@mail.python.org> <94bdd2610905121500o44e248ecv1d0282b4fdd89027@mail.gmail.com> Message-ID: <1afaf6160905121502p4d1f1a9cje57105f742f0faf7@mail.gmail.com> 2009/5/12 Tarek Ziad? : > On Tue, May 12, 2009 at 11:20 PM, benjamin.peterson > wrote: >> ?the compiler attribute is used in setup.py; can't rename > > Can't we rename it there as well ? "compiler" is an option (str) in > build_ext, and shouldn't be turned into a compiler instance. Certainly. I was just trying to fix the build. Do what you think is necessary . > > >> - ? ? ? ?self._compiler = new_compiler(compiler=self.compiler, >> + ? ? ? ?self.compiler = new_compiler(compiler=None, > > You are braking the option here with that change, e.g. you can't force > a compiler type > anymore as it is supposed to be. > > So I think we have to make a choice : either it's a string, either > it's a compiler instance, > but it can't be both -- Regards, Benjamin From python-checkins at python.org Wed May 13 02:30:29 2009 From: python-checkins at python.org (r.david.murray) Date: Wed, 13 May 2009 02:30:29 +0200 (CEST) Subject: [Python-checkins] r72597 - in python/trunk: Misc/NEWS Python/marshal.c Message-ID: <20090513003029.68642D317@mail.python.org> Author: r.david.murray Date: Wed May 13 02:30:29 2009 New Revision: 72597 Log: Issue 5994: add docstrings to marshal. Modified: python/trunk/Misc/NEWS python/trunk/Python/marshal.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed May 13 02:30:29 2009 @@ -291,6 +291,8 @@ Library ------- +- Issue #5994: the marshal module now has docstrings. + - Issue #5977: distutils build_ext.get_outputs was not taking into account the inplace option. Initial patch by kxroberto. Modified: python/trunk/Python/marshal.c ============================================================================== --- python/trunk/Python/marshal.c (original) +++ python/trunk/Python/marshal.c Wed May 13 02:30:29 2009 @@ -1245,6 +1245,20 @@ return Py_None; } +PyDoc_STRVAR(dump_doc, +"dump(value, file[, version])\n\ +\n\ +Write the value on the open file. The value must be a supported type.\n\ +The file must be an open file object such as sys.stdout or returned by\n\ +open() or os.popen(). It must be opened in binary mode ('wb' or 'w+b').\n\ +\n\ +If the value has (or contains an object that has) an unsupported type, a\n\ +ValueError exception is raised ? but garbage data will also be written\n\ +to the file. The object will not be properly read back by load()\n\ +\n\ +New in version 2.4: The version argument indicates the data format that\n\ +dump should use."); + static PyObject * marshal_load(PyObject *self, PyObject *f) { @@ -1263,6 +1277,19 @@ return result; } +PyDoc_STRVAR(load_doc, +"load(file)\n\ +\n\ +Read one value from the open file and return it. If no valid value is\n\ +read (e.g. because the data has a different Python version?s\n\ +incompatible marshal format), raise EOFError, ValueError or TypeError.\n\ +The file must be an open file object opened in binary mode ('rb' or\n\ +'r+b').\n\ +\n\ +Note: If an object containing an unsupported type was marshalled with\n\ +dump(), load() will substitute None for the unmarshallable type."); + + static PyObject * marshal_dumps(PyObject *self, PyObject *args) { @@ -1273,6 +1300,17 @@ return PyMarshal_WriteObjectToString(x, version); } +PyDoc_STRVAR(dumps_doc, +"dumps(value[, version])\n\ +\n\ +Return the string that would be written to a file by dump(value, file).\n\ +The value must be a supported type. Raise a ValueError exception if\n\ +value has (or contains an object that has) an unsupported type.\n\ +\n\ +New in version 2.4: The version argument indicates the data format that\n\ +dumps should use (see below)."); + + static PyObject * marshal_loads(PyObject *self, PyObject *args) { @@ -1292,18 +1330,56 @@ return result; } +PyDoc_STRVAR(loads_doc, +"loads(string)\n\ +\n\ +Convert the string to a value. If no valid value is found, raise\n\ +EOFError, ValueError or TypeError. Extra characters in the string are\n\ +ignored."); + static PyMethodDef marshal_methods[] = { - {"dump", marshal_dump, METH_VARARGS}, - {"load", marshal_load, METH_O}, - {"dumps", marshal_dumps, METH_VARARGS}, - {"loads", marshal_loads, METH_VARARGS}, + {"dump", marshal_dump, METH_VARARGS, dump_doc}, + {"load", marshal_load, METH_O, load_doc}, + {"dumps", marshal_dumps, METH_VARARGS, dumps_doc}, + {"loads", marshal_loads, METH_VARARGS, loads_doc}, {NULL, NULL} /* sentinel */ }; +PyDoc_STRVAR(marshal_doc, +"This module contains functions that can read and write Python values in\n\ +a binary format. The format is specific to Python, but independent of\n\ +machine architecture issues.\n\ +\n\ +Not all Python object types are supported; in general, only objects\n\ +whose value is independent from a particular invocation of Python can be\n\ +written and read by this module. The following types are supported:\n\ +None, integers, long integers, floating point numbers, strings, Unicode\n\ +objects, tuples, lists, sets, dictionaries, and code objects, where it\n\ +should be understood that tuples, lists and dictionaries are only\n\ +supported as long as the values contained therein are themselves\n\ +supported; and recursive lists and dictionaries should not be written\n\ +(they will cause infinite loops).\n\ +\n\ +Variables:\n\ +\n\ +version -- indicates the format that the module uses. Version 0 is the\n\ + historical format, version 1 (added in Python 2.4) shares interned\n\ + strings and version 2 (added in Python 2.5) uses a binary format for\n\ + floating point numbers. (New in version 2.4)\n\ +\n\ +Functions:\n\ +\n\ +dump() -- write value to a file\n\ +load() -- read value from a file\n\ +dumps() -- write value to a string\n\ +loads() -- read value from a string"); + + PyMODINIT_FUNC PyMarshal_Init(void) { - PyObject *mod = Py_InitModule("marshal", marshal_methods); + PyObject *mod = Py_InitModule3("marshal", marshal_methods, + marshal_doc); if (mod == NULL) return; PyModule_AddIntConstant(mod, "version", Py_MARSHAL_VERSION); From python-checkins at python.org Wed May 13 03:08:35 2009 From: python-checkins at python.org (r.david.murray) Date: Wed, 13 May 2009 03:08:35 +0200 (CEST) Subject: [Python-checkins] r72598 - in python/branches/release26-maint: Misc/NEWS Python/marshal.c Message-ID: <20090513010835.CFF41D4D5@mail.python.org> Author: r.david.murray Date: Wed May 13 03:08:35 2009 New Revision: 72598 Log: Merged revisions 72597 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72597 | r.david.murray | 2009-05-12 20:30:29 -0400 (Tue, 12 May 2009) | 2 lines Issue 5994: add docstrings to marshal. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Python/marshal.c Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Wed May 13 03:08:35 2009 @@ -45,6 +45,8 @@ Library ------- +- Issue #5994: the marshal module now has docstrings. + - Issue #5971: StreamHandler.handleError now swallows IOErrors which occur when trying to print a traceback. Modified: python/branches/release26-maint/Python/marshal.c ============================================================================== --- python/branches/release26-maint/Python/marshal.c (original) +++ python/branches/release26-maint/Python/marshal.c Wed May 13 03:08:35 2009 @@ -1179,6 +1179,20 @@ return Py_None; } +PyDoc_STRVAR(dump_doc, +"dump(value, file[, version])\n\ +\n\ +Write the value on the open file. The value must be a supported type.\n\ +The file must be an open file object such as sys.stdout or returned by\n\ +open() or os.popen(). It must be opened in binary mode ('wb' or 'w+b').\n\ +\n\ +If the value has (or contains an object that has) an unsupported type, a\n\ +ValueError exception is raised ? but garbage data will also be written\n\ +to the file. The object will not be properly read back by load()\n\ +\n\ +New in version 2.4: The version argument indicates the data format that\n\ +dump should use."); + static PyObject * marshal_load(PyObject *self, PyObject *f) { @@ -1197,6 +1211,19 @@ return result; } +PyDoc_STRVAR(load_doc, +"load(file)\n\ +\n\ +Read one value from the open file and return it. If no valid value is\n\ +read (e.g. because the data has a different Python version?s\n\ +incompatible marshal format), raise EOFError, ValueError or TypeError.\n\ +The file must be an open file object opened in binary mode ('rb' or\n\ +'r+b').\n\ +\n\ +Note: If an object containing an unsupported type was marshalled with\n\ +dump(), load() will substitute None for the unmarshallable type."); + + static PyObject * marshal_dumps(PyObject *self, PyObject *args) { @@ -1207,6 +1234,17 @@ return PyMarshal_WriteObjectToString(x, version); } +PyDoc_STRVAR(dumps_doc, +"dumps(value[, version])\n\ +\n\ +Return the string that would be written to a file by dump(value, file).\n\ +The value must be a supported type. Raise a ValueError exception if\n\ +value has (or contains an object that has) an unsupported type.\n\ +\n\ +New in version 2.4: The version argument indicates the data format that\n\ +dumps should use (see below)."); + + static PyObject * marshal_loads(PyObject *self, PyObject *args) { @@ -1226,18 +1264,56 @@ return result; } +PyDoc_STRVAR(loads_doc, +"loads(string)\n\ +\n\ +Convert the string to a value. If no valid value is found, raise\n\ +EOFError, ValueError or TypeError. Extra characters in the string are\n\ +ignored."); + static PyMethodDef marshal_methods[] = { - {"dump", marshal_dump, METH_VARARGS}, - {"load", marshal_load, METH_O}, - {"dumps", marshal_dumps, METH_VARARGS}, - {"loads", marshal_loads, METH_VARARGS}, + {"dump", marshal_dump, METH_VARARGS, dump_doc}, + {"load", marshal_load, METH_O, load_doc}, + {"dumps", marshal_dumps, METH_VARARGS, dumps_doc}, + {"loads", marshal_loads, METH_VARARGS, loads_doc}, {NULL, NULL} /* sentinel */ }; +PyDoc_STRVAR(marshal_doc, +"This module contains functions that can read and write Python values in\n\ +a binary format. The format is specific to Python, but independent of\n\ +machine architecture issues.\n\ +\n\ +Not all Python object types are supported; in general, only objects\n\ +whose value is independent from a particular invocation of Python can be\n\ +written and read by this module. The following types are supported:\n\ +None, integers, long integers, floating point numbers, strings, Unicode\n\ +objects, tuples, lists, sets, dictionaries, and code objects, where it\n\ +should be understood that tuples, lists and dictionaries are only\n\ +supported as long as the values contained therein are themselves\n\ +supported; and recursive lists and dictionaries should not be written\n\ +(they will cause infinite loops).\n\ +\n\ +Variables:\n\ +\n\ +version -- indicates the format that the module uses. Version 0 is the\n\ + historical format, version 1 (added in Python 2.4) shares interned\n\ + strings and version 2 (added in Python 2.5) uses a binary format for\n\ + floating point numbers. (New in version 2.4)\n\ +\n\ +Functions:\n\ +\n\ +dump() -- write value to a file\n\ +load() -- read value from a file\n\ +dumps() -- write value to a string\n\ +loads() -- read value from a string"); + + PyMODINIT_FUNC PyMarshal_Init(void) { - PyObject *mod = Py_InitModule("marshal", marshal_methods); + PyObject *mod = Py_InitModule3("marshal", marshal_methods, + marshal_doc); if (mod == NULL) return; PyModule_AddIntConstant(mod, "version", Py_MARSHAL_VERSION); From buildbot at python.org Wed May 13 03:18:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 13 May 2009 01:18:34 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090513011834.D9FBFD46C@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1309 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed May 13 06:24:43 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 13 May 2009 04:24:43 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090513042443.574A5D2A8@mail.python.org> The Buildbot has detected a new failure of x86 XP-4 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%202.6/builds/265 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_bsddb3 test_distutils ====================================================================== ERROR: test01_badpointer (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 21, in test01_badpointer dbs = dbshelve.open(self.filename) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\dbshelve.py", line 106, in open d.open(filename, dbname, filetype, flags, mode) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\dbshelve.py", line 171, in open self.db.open(*args, **kwargs) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test03_repr_closed_db (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 37, in test03_repr_closed_db db = hashopen(self.filename) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test04_repr_db (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 43, in test04_repr_db db = hashopen(self.filename) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test05_double_free_make_key_dbt (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 65, in test05_double_free_make_key_dbt db.DB_CREATE | db.DB_THREAD) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test06_key_with_null_bytes (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 77, in test06_key_with_null_bytes db1.open(self.filename, None, db.DB_HASH, db.DB_CREATE) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test07_DB_set_flags_persists (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 101, in test07_DB_set_flags_persists db1.open(self.filename, db.DB_HASH, db.DB_CREATE) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test_get_outputs (distutils.tests.test_build_ext.BuildExtTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\distutils\tests\test_build_ext.py", line 253, in test_get_outputs cmd.run() File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\distutils\command\build_ext.py", line 340, in run self.build_extensions() File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\distutils\command\build_ext.py", line 449, in build_extensions self.build_extension(ext) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\distutils\command\build_ext.py", line 531, in build_extension target_lang=language) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\distutils\ccompiler.py", line 845, in link_shared_object extra_preargs, extra_postargs, build_temp, target_lang) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\distutils\msvc9compiler.py", line 637, in link raise LinkError(msg) LinkError: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe"' failed with exit status 1120 sincerely, -The Buildbot From python-checkins at python.org Wed May 13 14:27:21 2009 From: python-checkins at python.org (r.david.murray) Date: Wed, 13 May 2009 14:27:21 +0200 (CEST) Subject: [Python-checkins] r72599 - in python/branches/py3k: Misc/NEWS Python/marshal.c Message-ID: <20090513122721.AA350C3C0@albatross.python.org> Author: r.david.murray Date: Wed May 13 14:27:21 2009 New Revision: 72599 Log: Merged revisions 72597 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72597 | r.david.murray | 2009-05-12 20:30:29 -0400 (Tue, 12 May 2009) | 2 lines Issue 5994: add docstrings to marshal. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Python/marshal.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed May 13 14:27:21 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #5994: the marshal module now has docstrings. + - Issue #5981: Fix three minor inf/nan issues in float.fromhex: (1) inf and nan strings with trailing whitespace were incorrectly rejected; (2) parsing of strings representing infinities and nans Modified: python/branches/py3k/Python/marshal.c ============================================================================== --- python/branches/py3k/Python/marshal.c (original) +++ python/branches/py3k/Python/marshal.c Wed May 13 14:27:21 2009 @@ -1209,6 +1209,19 @@ return res; } +PyDoc_STRVAR(dump_doc, +"dump(value, file[, version])\n\ +\n\ +Write the value on the open file. The value must be a supported type.\n\ +The file must be an open file object such as sys.stdout or returned by\n\ +open() or os.popen(). It must be opened in binary mode ('wb' or 'w+b').\n\ +\n\ +If the value has (or contains an object that has) an unsupported type, a\n\ +ValueError exception is raised ? but garbage data will also be written\n\ +to the file. The object will not be properly read back by load()\n\ +\n\ +The version argument indicates the data format that dump should use."); + static PyObject * marshal_load(PyObject *self, PyObject *f) { @@ -1243,6 +1256,19 @@ return result; } +PyDoc_STRVAR(load_doc, +"load(file)\n\ +\n\ +Read one value from the open file and return it. If no valid value is\n\ +read (e.g. because the data has a different Python version?s\n\ +incompatible marshal format), raise EOFError, ValueError or TypeError.\n\ +The file must be an open file object opened in binary mode ('rb' or\n\ +'r+b').\n\ +\n\ +Note: If an object containing an unsupported type was marshalled with\n\ +dump(), load() will substitute None for the unmarshallable type."); + + static PyObject * marshal_dumps(PyObject *self, PyObject *args) { @@ -1253,6 +1279,16 @@ return PyMarshal_WriteObjectToString(x, version); } +PyDoc_STRVAR(dumps_doc, +"dumps(value[, version])\n\ +\n\ +Return the string that would be written to a file by dump(value, file).\n\ +The value must be a supported type. Raise a ValueError exception if\n\ +value has (or contains an object that has) an unsupported type.\n\ +\n\ +The version argument indicates the data format that dumps should use."); + + static PyObject * marshal_loads(PyObject *self, PyObject *args) { @@ -1276,18 +1312,56 @@ return result; } +PyDoc_STRVAR(loads_doc, +"loads(string)\n\ +\n\ +Convert the string to a value. If no valid value is found, raise\n\ +EOFError, ValueError or TypeError. Extra characters in the string are\n\ +ignored."); + static PyMethodDef marshal_methods[] = { - {"dump", marshal_dump, METH_VARARGS}, - {"load", marshal_load, METH_O}, - {"dumps", marshal_dumps, METH_VARARGS}, - {"loads", marshal_loads, METH_VARARGS}, + {"dump", marshal_dump, METH_VARARGS, dump_doc}, + {"load", marshal_load, METH_O, load_doc}, + {"dumps", marshal_dumps, METH_VARARGS, dumps_doc}, + {"loads", marshal_loads, METH_VARARGS, loads_doc}, {NULL, NULL} /* sentinel */ }; + +PyDoc_STRVAR(module_doc, +"This module contains functions that can read and write Python values in\n\ +a binary format. The format is specific to Python, but independent of\n\ +machine architecture issues.\n\ +\n\ +Not all Python object types are supported; in general, only objects\n\ +whose value is independent from a particular invocation of Python can be\n\ +written and read by this module. The following types are supported:\n\ +None, integers, floating point numbers, strings, bytes, bytearrays,\n\ +tuples, lists, sets, dictionaries, and code objects, where it\n\ +should be understood that tuples, lists and dictionaries are only\n\ +supported as long as the values contained therein are themselves\n\ +supported; and recursive lists and dictionaries should not be written\n\ +(they will cause infinite loops).\n\ +\n\ +Variables:\n\ +\n\ +version -- indicates the format that the module uses. Version 0 is the\n\ + historical format, version 1 shares interned strings and version 2\n\ + uses a binary format for floating point numbers.\n\ +\n\ +Functions:\n\ +\n\ +dump() -- write value to a file\n\ +load() -- read value from a file\n\ +dumps() -- write value to a string\n\ +loads() -- read value from a string"); + + + static struct PyModuleDef marshalmodule = { PyModuleDef_HEAD_INIT, "marshal", - NULL, + module_doc, 0, marshal_methods, NULL, @@ -1296,8 +1370,6 @@ NULL }; - - PyMODINIT_FUNC PyMarshal_Init(void) { From ncoghlan at gmail.com Wed May 13 14:39:05 2009 From: ncoghlan at gmail.com (Nick Coghlan) Date: Wed, 13 May 2009 22:39:05 +1000 Subject: [Python-checkins] r72590 - python/branches/py3k/Doc/library/sys.rst In-Reply-To: <20090512204757.520C6D744@mail.python.org> References: <20090512204757.520C6D744@mail.python.org> Message-ID: <4A0ABF69.5040508@gmail.com> benjamin.peterson wrote: > Author: benjamin.peterson > Date: Tue May 12 22:47:57 2009 > New Revision: 72590 > > Log: > add example function > > Modified: > python/branches/py3k/Doc/library/sys.rst > > Modified: python/branches/py3k/Doc/library/sys.rst > ============================================================================== > --- python/branches/py3k/Doc/library/sys.rst (original) > +++ python/branches/py3k/Doc/library/sys.rst Tue May 12 22:47:57 2009 > @@ -784,7 +784,13 @@ > The standard streams are in text mode by default. To write or read binary > data to these, use the underlying binary buffer. For example, to write bytes > to :data:`stdout`, use ``sys.stdout.buffer.write(b'abc')``. Using > - :meth:`io.TextIOWrapper.detach` streams can be made binary by default. > + :meth:`io.TextIOWrapper.detach` streams can be made binary by default. For > + example, this function sets all the standard streams to binary: :: > + > + def make_streams_binary(): > + sys.stdin = sys.stdin.detach() > + sys.stdout = sys.stout.detach() Typo (missing 'd'): ^^^^^ Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- From python-checkins at python.org Wed May 13 14:53:18 2009 From: python-checkins at python.org (r.david.murray) Date: Wed, 13 May 2009 14:53:18 +0200 (CEST) Subject: [Python-checkins] r72600 - in python/branches/release30-maint: Misc/NEWS Python/marshal.c Message-ID: <20090513125318.7D1FBC2D5@albatross.python.org> Author: r.david.murray Date: Wed May 13 14:53:18 2009 New Revision: 72600 Log: Merged revisions 72599 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72599 | r.david.murray | 2009-05-13 08:27:21 -0400 (Wed, 13 May 2009) | 9 lines Merged revisions 72597 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72597 | r.david.murray | 2009-05-12 20:30:29 -0400 (Tue, 12 May 2009) | 2 lines Issue 5994: add docstrings to marshal. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Python/marshal.c Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Wed May 13 14:53:18 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #5994: the marshal module now has docstrings. + - Issue #5981: Fix two minor inf/nan issues in float.fromhex: (1) inf and nan strings with trailing whitespace were incorrectly rejected and (2) the interpretation of fromhex('-nan') didn't match that of Modified: python/branches/release30-maint/Python/marshal.c ============================================================================== --- python/branches/release30-maint/Python/marshal.c (original) +++ python/branches/release30-maint/Python/marshal.c Wed May 13 14:53:18 2009 @@ -1120,6 +1120,19 @@ return res; } +PyDoc_STRVAR(dump_doc, +"dump(value, file[, version])\n\ +\n\ +Write the value on the open file. The value must be a supported type.\n\ +The file must be an open file object such as sys.stdout or returned by\n\ +open() or os.popen(). It must be opened in binary mode ('wb' or 'w+b').\n\ +\n\ +If the value has (or contains an object that has) an unsupported type, a\n\ +ValueError exception is raised ? but garbage data will also be written\n\ +to the file. The object will not be properly read back by load()\n\ +\n\ +The version argument indicates the data format that dump should use."); + static PyObject * marshal_load(PyObject *self, PyObject *f) { @@ -1154,6 +1167,19 @@ return result; } +PyDoc_STRVAR(load_doc, +"load(file)\n\ +\n\ +Read one value from the open file and return it. If no valid value is\n\ +read (e.g. because the data has a different Python version?s\n\ +incompatible marshal format), raise EOFError, ValueError or TypeError.\n\ +The file must be an open file object opened in binary mode ('rb' or\n\ +'r+b').\n\ +\n\ +Note: If an object containing an unsupported type was marshalled with\n\ +dump(), load() will substitute None for the unmarshallable type."); + + static PyObject * marshal_dumps(PyObject *self, PyObject *args) { @@ -1164,6 +1190,16 @@ return PyMarshal_WriteObjectToString(x, version); } +PyDoc_STRVAR(dumps_doc, +"dumps(value[, version])\n\ +\n\ +Return the string that would be written to a file by dump(value, file).\n\ +The value must be a supported type. Raise a ValueError exception if\n\ +value has (or contains an object that has) an unsupported type.\n\ +\n\ +The version argument indicates the data format that dumps should use."); + + static PyObject * marshal_loads(PyObject *self, PyObject *args) { @@ -1187,18 +1223,56 @@ return result; } +PyDoc_STRVAR(loads_doc, +"loads(string)\n\ +\n\ +Convert the string to a value. If no valid value is found, raise\n\ +EOFError, ValueError or TypeError. Extra characters in the string are\n\ +ignored."); + static PyMethodDef marshal_methods[] = { - {"dump", marshal_dump, METH_VARARGS}, - {"load", marshal_load, METH_O}, - {"dumps", marshal_dumps, METH_VARARGS}, - {"loads", marshal_loads, METH_VARARGS}, + {"dump", marshal_dump, METH_VARARGS, dump_doc}, + {"load", marshal_load, METH_O, load_doc}, + {"dumps", marshal_dumps, METH_VARARGS, dumps_doc}, + {"loads", marshal_loads, METH_VARARGS, loads_doc}, {NULL, NULL} /* sentinel */ }; + +PyDoc_STRVAR(module_doc, +"This module contains functions that can read and write Python values in\n\ +a binary format. The format is specific to Python, but independent of\n\ +machine architecture issues.\n\ +\n\ +Not all Python object types are supported; in general, only objects\n\ +whose value is independent from a particular invocation of Python can be\n\ +written and read by this module. The following types are supported:\n\ +None, integers, floating point numbers, strings, bytes, bytearrays,\n\ +tuples, lists, sets, dictionaries, and code objects, where it\n\ +should be understood that tuples, lists and dictionaries are only\n\ +supported as long as the values contained therein are themselves\n\ +supported; and recursive lists and dictionaries should not be written\n\ +(they will cause infinite loops).\n\ +\n\ +Variables:\n\ +\n\ +version -- indicates the format that the module uses. Version 0 is the\n\ + historical format, version 1 shares interned strings and version 2\n\ + uses a binary format for floating point numbers.\n\ +\n\ +Functions:\n\ +\n\ +dump() -- write value to a file\n\ +load() -- read value from a file\n\ +dumps() -- write value to a string\n\ +loads() -- read value from a string"); + + + static struct PyModuleDef marshalmodule = { PyModuleDef_HEAD_INIT, "marshal", - NULL, + module_doc, 0, marshal_methods, NULL, @@ -1207,8 +1281,6 @@ NULL }; - - PyMODINIT_FUNC PyMarshal_Init(void) { From python-checkins at python.org Wed May 13 15:07:15 2009 From: python-checkins at python.org (r.david.murray) Date: Wed, 13 May 2009 15:07:15 +0200 (CEST) Subject: [Python-checkins] r72601 - in python/trunk: Misc/NEWS Python/marshal.c Message-ID: <20090513130715.10F26D64A@albatross.python.org> Author: r.david.murray Date: Wed May 13 15:07:14 2009 New Revision: 72601 Log: Move news item to correct section, remove spurious 'see below' from docstring. Modified: python/trunk/Misc/NEWS python/trunk/Python/marshal.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed May 13 15:07:14 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #5994: the marshal module now has docstrings. + - Issue #5981: Fix three minor inf/nan issues in float.fromhex: (1) inf and nan strings with trailing whitespace were incorrectly rejected; (2) parsing of strings representing infinities and nans @@ -291,8 +293,6 @@ Library ------- -- Issue #5994: the marshal module now has docstrings. - - Issue #5977: distutils build_ext.get_outputs was not taking into account the inplace option. Initial patch by kxroberto. Modified: python/trunk/Python/marshal.c ============================================================================== --- python/trunk/Python/marshal.c (original) +++ python/trunk/Python/marshal.c Wed May 13 15:07:14 2009 @@ -1308,7 +1308,7 @@ value has (or contains an object that has) an unsupported type.\n\ \n\ New in version 2.4: The version argument indicates the data format that\n\ -dumps should use (see below)."); +dumps should use."); static PyObject * From python-checkins at python.org Wed May 13 15:13:18 2009 From: python-checkins at python.org (r.david.murray) Date: Wed, 13 May 2009 15:13:18 +0200 (CEST) Subject: [Python-checkins] r72602 - in python/branches/release26-maint: Misc/NEWS Python/marshal.c Message-ID: <20090513131318.54A15D688@albatross.python.org> Author: r.david.murray Date: Wed May 13 15:13:18 2009 New Revision: 72602 Log: Merged revisions 72601 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72601 | r.david.murray | 2009-05-13 09:07:14 -0400 (Wed, 13 May 2009) | 3 lines Move news item to correct section, remove spurious 'see below' from docstring. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Python/marshal.c Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Wed May 13 15:13:18 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #5994: the marshal module now has docstrings. + - Issue #5981: Fix two minor inf/nan issues in float.fromhex: (1) inf and nan strings with trailing whitespace were incorrectly rejected and (2) the interpretation of fromhex('-nan') didn't match that of @@ -45,8 +47,6 @@ Library ------- -- Issue #5994: the marshal module now has docstrings. - - Issue #5971: StreamHandler.handleError now swallows IOErrors which occur when trying to print a traceback. Modified: python/branches/release26-maint/Python/marshal.c ============================================================================== --- python/branches/release26-maint/Python/marshal.c (original) +++ python/branches/release26-maint/Python/marshal.c Wed May 13 15:13:18 2009 @@ -1242,7 +1242,7 @@ value has (or contains an object that has) an unsupported type.\n\ \n\ New in version 2.4: The version argument indicates the data format that\n\ -dumps should use (see below)."); +dumps should use."); static PyObject * From python-checkins at python.org Wed May 13 15:15:06 2009 From: python-checkins at python.org (r.david.murray) Date: Wed, 13 May 2009 15:15:06 +0200 (CEST) Subject: [Python-checkins] r72603 - python/branches/py3k Message-ID: <20090513131506.51129D67A@albatross.python.org> Author: r.david.murray Date: Wed May 13 15:15:06 2009 New Revision: 72603 Log: Recorded merge of revisions 72601 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72601 | r.david.murray | 2009-05-13 09:07:14 -0400 (Wed, 13 May 2009) | 3 lines Move news item to correct section, remove spurious 'see below' from docstring. ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Wed May 13 15:16:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 13 May 2009 13:16:18 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090513131618.8A6E0D699@albatross.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/683 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_coding test_posix ====================================================================== ERROR: test_file_parse (test.test_coding.CodingTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_coding.py", line 45, in test_file_parse __import__(TESTFN) ImportError: No module named @test ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Wed May 13 15:16:47 2009 From: python-checkins at python.org (r.david.murray) Date: Wed, 13 May 2009 15:16:47 +0200 (CEST) Subject: [Python-checkins] r72604 - python/branches/release30-maint Message-ID: <20090513131647.0B92ED699@albatross.python.org> Author: r.david.murray Date: Wed May 13 15:16:46 2009 New Revision: 72604 Log: Recorded merge of revisions 72603 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72603 | r.david.murray | 2009-05-13 09:15:06 -0400 (Wed, 13 May 2009) | 10 lines Recorded merge of revisions 72601 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72601 | r.david.murray | 2009-05-13 09:07:14 -0400 (Wed, 13 May 2009) | 3 lines Move news item to correct section, remove spurious 'see below' from docstring. ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Wed May 13 15:21:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 13 May 2009 13:21:07 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090513132107.C1236D6B4@albatross.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.0/builds/6 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed May 13 16:17:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 13 May 2009 14:17:11 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090513141711.31798D677@albatross.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/567 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 533, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' 1 test failed: test_import sincerely, -The Buildbot From buildbot at python.org Wed May 13 16:19:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 13 May 2009 14:19:37 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 2.6 Message-ID: <20090513141937.ED611D678@albatross.python.org> The Buildbot has detected a new failure of amd64 gentoo 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%202.6/builds/6 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Wed May 13 16:25:42 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 13 May 2009 14:25:42 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090513142542.53AC3D6AA@albatross.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/361 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_posix test_subprocess ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From buildbot at python.org Wed May 13 17:34:01 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 13 May 2009 15:34:01 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090513153401.9CB78C31E@albatross.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/800 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed May 13 18:04:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 13 May 2009 16:04:31 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.0 Message-ID: <20090513160431.4C645D6A0@albatross.python.org> The Buildbot has detected a new failure of x86 XP-4 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.0/builds/296 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\tests\test_build_ext.py", line 254, in test_get_outputs cmd.run() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\command\build_ext.py", line 337, in run self.build_extensions() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\command\build_ext.py", line 445, in build_extensions self.build_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\command\build_ext.py", line 527, in build_extension target_lang=language) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\ccompiler.py", line 792, in link_shared_object extra_preargs, extra_postargs, build_temp, target_lang) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\msvc9compiler.py", line 636, in link raise LinkError(msg) distutils.errors.LinkError: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe"' failed with exit status 1120 2 tests failed: test_distutils test_memoryio ====================================================================== ERROR: test_get_outputs (distutils.tests.test_build_ext.BuildExtTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\msvc9compiler.py", line 634, in link self.spawn([self.linker] + ld_args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\ccompiler.py", line 982, in spawn spawn(cmd, dry_run=self.dry_run) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\spawn.py", line 33, in spawn _spawn_nt(cmd, search_path, dry_run=dry_run) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\spawn.py", line 74, in _spawn_nt "command '%s' failed with exit status %d" % (cmd[0], rc)) distutils.errors.DistutilsExecError: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe"' failed with exit status 1120 Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\tests\test_build_ext.py", line 254, in test_get_outputs cmd.run() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\command\build_ext.py", line 337, in run self.build_extensions() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\command\build_ext.py", line 445, in build_extensions self.build_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\command\build_ext.py", line 527, in build_extension target_lang=language) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\ccompiler.py", line 792, in link_shared_object extra_preargs, extra_postargs, build_temp, target_lang) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\msvc9compiler.py", line 636, in link raise LinkError(msg) distutils.errors.LinkError: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe"' failed with exit status 1120 Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\tests\test_build_ext.py", line 254, in test_get_outputs cmd.run() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\command\build_ext.py", line 337, in run self.build_extensions() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\command\build_ext.py", line 445, in build_extensions self.build_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\command\build_ext.py", line 527, in build_extension target_lang=language) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\ccompiler.py", line 792, in link_shared_object extra_preargs, extra_postargs, build_temp, target_lang) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\msvc9compiler.py", line 636, in link raise LinkError(msg) distutils.errors.LinkError: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe"' failed with exit status 1120 ====================================================================== FAIL: test_newline_none (test.test_memoryio.PyStringIOTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_memoryio.py", line 381, in test_newline_none self.assertEqual(memio.readlines(), ["hello\n", "hi\n"]) AssertionError: ['hello\n', '\n', 'hi\n', '\n'] != ['hello\n', 'hi\n'] ====================================================================== FAIL: test_newline_none (test.test_memoryio.CStringIOTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_memoryio.py", line 381, in test_newline_none self.assertEqual(memio.readlines(), ["hello\n", "hi\n"]) AssertionError: ['hello\n', '\n', '\n', 'hi\n', '\n', '\n'] != ['hello\n', 'hi\n'] sincerely, -The Buildbot From python-checkins at python.org Wed May 13 19:14:12 2009 From: python-checkins at python.org (r.david.murray) Date: Wed, 13 May 2009 19:14:12 +0200 (CEST) Subject: [Python-checkins] r72605 - in python/trunk: Lib/inspect.py Lib/test/test_inspect.py Misc/ACKS Misc/NEWS Message-ID: <20090513171412.29E74D6AA@albatross.python.org> Author: r.david.murray Date: Wed May 13 19:14:11 2009 New Revision: 72605 Log: Issue #4050: inspect.findsource/getsource now raise an IOError if the 'source' file is a binary. Patch by Brodie Rao, test by Daniel Diniz. Modified: python/trunk/Lib/inspect.py python/trunk/Lib/test/test_inspect.py python/trunk/Misc/ACKS python/trunk/Misc/NEWS Modified: python/trunk/Lib/inspect.py ============================================================================== --- python/trunk/Lib/inspect.py (original) +++ python/trunk/Lib/inspect.py Wed May 13 19:14:11 2009 @@ -523,7 +523,9 @@ or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is raised if the source code cannot be retrieved.""" - file = getsourcefile(object) or getfile(object) + file = getsourcefile(object) + if not file: + raise IOError('source code not available') module = getmodule(object, file) if module: lines = linecache.getlines(file, module.__dict__) Modified: python/trunk/Lib/test/test_inspect.py ============================================================================== --- python/trunk/Lib/test/test_inspect.py (original) +++ python/trunk/Lib/test/test_inspect.py Wed May 13 19:14:11 2009 @@ -9,6 +9,9 @@ from test import inspect_fodder as mod from test import inspect_fodder2 as mod2 +# C module for test_findsource_binary +import time + # Functions tested in this suite: # ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode, # isbuiltin, isroutine, isgenerator, isgeneratorfunction, getmembers, @@ -329,6 +332,10 @@ def test_method_in_dynamic_class(self): self.assertSourceEqual(mod2.method_in_dynamic_class, 95, 97) + def test_findsource_binary(self): + self.assertRaises(IOError, inspect.getsource, time) + self.assertRaises(IOError, inspect.findsource, time) + # Helper for testing classify_class_attrs. def attrs_wo_objs(cls): return [t[:3] for t in inspect.classify_class_attrs(cls)] Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Wed May 13 19:14:11 2009 @@ -171,6 +171,7 @@ Toby Dickenson Mark Dickinson Jack Diederich +Daniel Diniz Yves Dionne Daniel Dittmar Jaromir Dolecek @@ -577,6 +578,7 @@ Brian Quinlan Anders Qvist Burton Radons +Brodie Rao Antti Rasinen Eric Raymond Edward K. Ream Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed May 13 19:14:11 2009 @@ -293,6 +293,9 @@ Library ------- +- Issue #4050: inspect.findsource/getsource now raise an IOError if the 'source' + file is a binary. Patch by Brodie Rao, tests by Daniel Diniz. + - Issue #5977: distutils build_ext.get_outputs was not taking into account the inplace option. Initial patch by kxroberto. From python-checkins at python.org Wed May 13 19:18:07 2009 From: python-checkins at python.org (r.david.murray) Date: Wed, 13 May 2009 19:18:07 +0200 (CEST) Subject: [Python-checkins] r72606 - python/branches/release26-maint Message-ID: <20090513171807.D95E4D35F@albatross.python.org> Author: r.david.murray Date: Wed May 13 19:18:07 2009 New Revision: 72606 Log: Previously these would return the binary data, so since this fix is a behavior change, blocking backport. Blocked revisions 72605 via svnmerge ........ r72605 | r.david.murray | 2009-05-13 13:14:11 -0400 (Wed, 13 May 2009) | 3 lines Issue #4050: inspect.findsource/getsource now raise an IOError if the 'source' file is a binary. Patch by Brodie Rao, test by Daniel Diniz. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Wed May 13 19:33:03 2009 From: python-checkins at python.org (r.david.murray) Date: Wed, 13 May 2009 19:33:03 +0200 (CEST) Subject: [Python-checkins] r72607 - in python/branches/py3k: Lib/inspect.py Lib/test/test_inspect.py Misc/ACKS Misc/NEWS Message-ID: <20090513173303.4779ED731@albatross.python.org> Author: r.david.murray Date: Wed May 13 19:33:03 2009 New Revision: 72607 Log: This fix makes, eg, 'pydoc time' work again. Merged revisions 72605 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72605 | r.david.murray | 2009-05-13 13:14:11 -0400 (Wed, 13 May 2009) | 3 lines Issue #4050: inspect.findsource/getsource now raise an IOError if the 'source' file is a binary. Patch by Brodie Rao, test by Daniel Diniz. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/inspect.py python/branches/py3k/Lib/test/test_inspect.py python/branches/py3k/Misc/ACKS python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/inspect.py ============================================================================== --- python/branches/py3k/Lib/inspect.py (original) +++ python/branches/py3k/Lib/inspect.py Wed May 13 19:33:03 2009 @@ -518,7 +518,9 @@ or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is raised if the source code cannot be retrieved.""" - file = getsourcefile(object) or getfile(object) + file = getsourcefile(object) + if not file: + raise IOError('source code not available') module = getmodule(object, file) if module: lines = linecache.getlines(file, module.__dict__) Modified: python/branches/py3k/Lib/test/test_inspect.py ============================================================================== --- python/branches/py3k/Lib/test/test_inspect.py (original) +++ python/branches/py3k/Lib/test/test_inspect.py Wed May 13 19:33:03 2009 @@ -11,6 +11,9 @@ from test import inspect_fodder as mod from test import inspect_fodder2 as mod2 +# C module for test_findsource_binary +import time + # Functions tested in this suite: # ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode, # isbuiltin, isroutine, isgenerator, isgeneratorfunction, getmembers, @@ -336,6 +339,10 @@ def test_method_in_dynamic_class(self): self.assertSourceEqual(mod2.method_in_dynamic_class, 95, 97) + def test_findsource_binary(self): + self.assertRaises(IOError, inspect.getsource, time) + self.assertRaises(IOError, inspect.findsource, time) + # Helper for testing classify_class_attrs. def attrs_wo_objs(cls): return [t[:3] for t in inspect.classify_class_attrs(cls)] Modified: python/branches/py3k/Misc/ACKS ============================================================================== --- python/branches/py3k/Misc/ACKS (original) +++ python/branches/py3k/Misc/ACKS Wed May 13 19:33:03 2009 @@ -171,6 +171,7 @@ Toby Dickenson Mark Dickinson Jack Diederich +Daniel Diniz Humberto Diogenes Yves Dionne Daniel Dittmar @@ -581,6 +582,7 @@ Brian Quinlan Anders Qvist Burton Radons +Brodie Rao Antti Rasinen Eric Raymond Edward K. Ream Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed May 13 19:33:03 2009 @@ -23,6 +23,10 @@ Library ------- +- Issue #4050: inspect.findsource/getsource now raise an IOError if the 'source' + file is a binary. Patch by Brodie Rao, tests by Daniel Diniz. This fix + corrects a pydoc regression. + - Issue 5955: aifc's close method did not close the file it wrapped, now it does. This also means getfp method now returns the real fp. From python-checkins at python.org Wed May 13 20:02:11 2009 From: python-checkins at python.org (r.david.murray) Date: Wed, 13 May 2009 20:02:11 +0200 (CEST) Subject: [Python-checkins] r72608 - python/branches/release30-maint Message-ID: <20090513180211.175A4D7A1@albatross.python.org> Author: r.david.murray Date: Wed May 13 20:02:09 2009 New Revision: 72608 Log: Not backporting since pydoc isn't broken in 3.0. Blocked revisions 72607 via svnmerge ................ r72607 | r.david.murray | 2009-05-13 13:33:03 -0400 (Wed, 13 May 2009) | 12 lines This fix makes, eg, 'pydoc time' work again. Merged revisions 72605 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72605 | r.david.murray | 2009-05-13 13:14:11 -0400 (Wed, 13 May 2009) | 3 lines Issue #4050: inspect.findsource/getsource now raise an IOError if the 'source' file is a binary. Patch by Brodie Rao, test by Daniel Diniz. ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Wed May 13 20:26:36 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 13 May 2009 18:26:36 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090513182636.C7AC8D639@albatross.python.org> The Buildbot has detected a new failure of i386 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%202.6/builds/355 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed May 13 21:37:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 13 May 2009 19:37:41 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090513193741.E1440D5AD@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%202.6/builds/338 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_shelve ====================================================================== ERROR: test_update (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 182, in test_update d = self._empty_mapping() File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 218, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/bsddb/__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test_write (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 107, in test_write d = self._full_mapping(self.reference) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 24, in _full_mapping x = self._empty_mapping() File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 218, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/bsddb/__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test_update (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 182, in test_update d = self._empty_mapping() File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 218, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/bsddb/__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test_write (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 107, in test_write d = self._full_mapping(self.reference) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 24, in _full_mapping x = self._empty_mapping() File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 218, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/bsddb/__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test_update (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 182, in test_update d = self._empty_mapping() File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 218, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/bsddb/__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test_write (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 107, in test_write d = self._full_mapping(self.reference) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 24, in _full_mapping x = self._empty_mapping() File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 218, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/bsddb/__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed May 13 23:15:03 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 13 May 2009 23:15:03 +0200 (CEST) Subject: [Python-checkins] r72609 - python/branches/py3k/Doc/library/sys.rst Message-ID: <20090513211503.EE27AD5FD@mail.python.org> Author: benjamin.peterson Date: Wed May 13 23:15:03 2009 New Revision: 72609 Log: typo Modified: python/branches/py3k/Doc/library/sys.rst Modified: python/branches/py3k/Doc/library/sys.rst ============================================================================== --- python/branches/py3k/Doc/library/sys.rst (original) +++ python/branches/py3k/Doc/library/sys.rst Wed May 13 23:15:03 2009 @@ -789,7 +789,7 @@ def make_streams_binary(): sys.stdin = sys.stdin.detach() - sys.stdout = sys.stout.detach() + sys.stdout = sys.stdout.detach() sys.stderr = sys.stderr.detach() From nnorwitz at gmail.com Wed May 13 23:28:24 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 13 May 2009 17:28:24 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (2) Message-ID: <20090513212824.GA9219@python.psfb.org> More important issues: ---------------------- test_hashlib leaked [0, 85, 0] references, sum=85 test_ssl leaked [0, -81, 403] references, sum=322 Less important issues: ---------------------- test_cmd_line leaked [0, 0, -25] references, sum=-25 test_smtplib leaked [88, -88, 111] references, sum=111 test_socketserver leaked [3, -80, 0] references, sum=-77 test_sys leaked [0, -21, 0] references, sum=-21 test_threading leaked [48, 48, 48] references, sum=144 test_urllib2_localnet leaked [3, 286, -280] references, sum=9 From python-checkins at python.org Wed May 13 23:30:06 2009 From: python-checkins at python.org (tarek.ziade) Date: Wed, 13 May 2009 23:30:06 +0200 (CEST) Subject: [Python-checkins] r72610 - python/trunk/Lib/distutils/tests/test_build_ext.py Message-ID: <20090513213006.36B1CD699@mail.python.org> Author: tarek.ziade Date: Wed May 13 23:30:06 2009 New Revision: 72610 Log: added an inifoo in the C file, to avoid a warning by the MSVC9 linker Modified: python/trunk/Lib/distutils/tests/test_build_ext.py Modified: python/trunk/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_build_ext.py (original) +++ python/trunk/Lib/distutils/tests/test_build_ext.py Wed May 13 23:30:06 2009 @@ -296,7 +296,7 @@ def test_get_outputs(self): tmp_dir = self.mkdtemp() c_file = os.path.join(tmp_dir, 'foo.c') - self.write_file(c_file, '') + self.write_file(c_file, 'void initfoo() {};\n') ext = Extension('foo', [c_file], optional=False) dist = Distribution({'name': 'xx', 'ext_modules': [ext]}) From buildbot at python.org Wed May 13 23:47:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 13 May 2009 21:47:23 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090513214723.D4A74D5CD@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/363 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 45, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/Include ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Thu May 14 00:08:54 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 00:08:54 +0200 (CEST) Subject: [Python-checkins] r72611 - in python/branches/release26-maint: Lib/distutils/tests/test_build_ext.py Message-ID: <20090513220854.4A7A7D72E@mail.python.org> Author: tarek.ziade Date: Thu May 14 00:08:54 2009 New Revision: 72611 Log: Merged revisions 72610 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72610 | tarek.ziade | 2009-05-13 23:30:06 +0200 (Wed, 13 May 2009) | 1 line added an inifoo in the C file, to avoid a warning by the MSVC9 linker ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py Modified: python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py Thu May 14 00:08:54 2009 @@ -233,7 +233,7 @@ def test_get_outputs(self): tmp_dir = self.mkdtemp() c_file = os.path.join(tmp_dir, 'foo.c') - self.write_file(c_file, '') + self.write_file(c_file, 'void initfoo() {};\n') ext = Extension('foo', [c_file]) dist = Distribution({'name': 'xx', 'ext_modules': [ext]}) From python-checkins at python.org Thu May 14 00:16:03 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 00:16:03 +0200 (CEST) Subject: [Python-checkins] r72612 - python/trunk/Lib/distutils/tests/test_build_ext.py Message-ID: <20090513221603.B9EBAD704@mail.python.org> Author: tarek.ziade Date: Thu May 14 00:16:03 2009 New Revision: 72612 Log: adding void to the c function Modified: python/trunk/Lib/distutils/tests/test_build_ext.py Modified: python/trunk/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_build_ext.py (original) +++ python/trunk/Lib/distutils/tests/test_build_ext.py Thu May 14 00:16:03 2009 @@ -296,7 +296,7 @@ def test_get_outputs(self): tmp_dir = self.mkdtemp() c_file = os.path.join(tmp_dir, 'foo.c') - self.write_file(c_file, 'void initfoo() {};\n') + self.write_file(c_file, 'void initfoo(void) {};\n') ext = Extension('foo', [c_file], optional=False) dist = Distribution({'name': 'xx', 'ext_modules': [ext]}) From python-checkins at python.org Thu May 14 00:18:01 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 00:18:01 +0200 (CEST) Subject: [Python-checkins] r72613 - in python/branches/release26-maint: Lib/distutils/tests/test_build_ext.py Message-ID: <20090513221801.BA8D2D58F@mail.python.org> Author: tarek.ziade Date: Thu May 14 00:18:01 2009 New Revision: 72613 Log: Merged revisions 72612 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72612 | tarek.ziade | 2009-05-14 00:16:03 +0200 (Thu, 14 May 2009) | 1 line adding void to the c function ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py Modified: python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py Thu May 14 00:18:01 2009 @@ -233,7 +233,7 @@ def test_get_outputs(self): tmp_dir = self.mkdtemp() c_file = os.path.join(tmp_dir, 'foo.c') - self.write_file(c_file, 'void initfoo() {};\n') + self.write_file(c_file, 'void initfoo(void) {};\n') ext = Extension('foo', [c_file]) dist = Distribution({'name': 'xx', 'ext_modules': [ext]}) From python-checkins at python.org Thu May 14 00:20:49 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 00:20:49 +0200 (CEST) Subject: [Python-checkins] r72614 - in python/branches/py3k: Lib/distutils/tests/test_build_ext.py Message-ID: <20090513222049.370ACD84C@mail.python.org> Author: tarek.ziade Date: Thu May 14 00:20:49 2009 New Revision: 72614 Log: Merged revisions 72610,72612 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72610 | tarek.ziade | 2009-05-13 23:30:06 +0200 (Wed, 13 May 2009) | 1 line added an inifoo in the C file, to avoid a warning by the MSVC9 linker ........ r72612 | tarek.ziade | 2009-05-14 00:16:03 +0200 (Thu, 14 May 2009) | 1 line adding void to the c function ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_build_ext.py Modified: python/branches/py3k/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_build_ext.py Thu May 14 00:20:49 2009 @@ -296,7 +296,7 @@ def test_get_outputs(self): tmp_dir = self.mkdtemp() c_file = os.path.join(tmp_dir, 'foo.c') - self.write_file(c_file, '') + self.write_file(c_file, 'void initfoo(void) {};\n') ext = Extension('foo', [c_file], optional=False) dist = Distribution({'name': 'xx', 'ext_modules': [ext]}) From python-checkins at python.org Thu May 14 00:22:55 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 00:22:55 +0200 (CEST) Subject: [Python-checkins] r72615 - in python/branches/release30-maint: Lib/distutils/tests/test_build_ext.py Message-ID: <20090513222255.59701D634@mail.python.org> Author: tarek.ziade Date: Thu May 14 00:22:55 2009 New Revision: 72615 Log: Merged revisions 72614 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72614 | tarek.ziade | 2009-05-14 00:20:49 +0200 (Thu, 14 May 2009) | 13 lines Merged revisions 72610,72612 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72610 | tarek.ziade | 2009-05-13 23:30:06 +0200 (Wed, 13 May 2009) | 1 line added an inifoo in the C file, to avoid a warning by the MSVC9 linker ........ r72612 | tarek.ziade | 2009-05-14 00:16:03 +0200 (Thu, 14 May 2009) | 1 line adding void to the c function ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py Modified: python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py Thu May 14 00:22:55 2009 @@ -234,7 +234,7 @@ def test_get_outputs(self): tmp_dir = self.mkdtemp() c_file = os.path.join(tmp_dir, 'foo.c') - self.write_file(c_file, '') + self.write_file(c_file, 'void initfoo(void) {};\n') ext = Extension('foo', [c_file]) dist = Distribution({'name': 'xx', 'ext_modules': [ext]}) From buildbot at python.org Thu May 14 01:27:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 13 May 2009 23:27:09 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 3.0 Message-ID: <20090513232709.8C1C3D701@mail.python.org> The Buildbot has detected a new failure of x86 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%203.0/builds/397 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Unknown signal 32 sincerely, -The Buildbot From python-checkins at python.org Thu May 14 02:33:10 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 14 May 2009 02:33:10 +0200 (CEST) Subject: [Python-checkins] r72616 - python/trunk/Doc/reference/simple_stmts.rst Message-ID: <20090514003310.C7421D457@mail.python.org> Author: benjamin.peterson Date: Thu May 14 02:33:10 2009 New Revision: 72616 Log: importlib.import_module is better these days Modified: python/trunk/Doc/reference/simple_stmts.rst Modified: python/trunk/Doc/reference/simple_stmts.rst ============================================================================== --- python/trunk/Doc/reference/simple_stmts.rst (original) +++ python/trunk/Doc/reference/simple_stmts.rst Thu May 14 02:33:10 2009 @@ -825,12 +825,8 @@ imprt mod`` from within ``pkg.subpkg1`` you will import ``pkg.subpkg2.mod``. The specification for relative imports is contained within :pep:`328`. - -.. index:: builtin: __import__ - -The built-in function :func:`__import__` is provided to support applications -that determine which modules need to be loaded dynamically; refer to -:ref:`built-in-funcs` for additional information. +:func:`importlib.import_module` is provided to support applications that +determine which modules need to be loaded dynamically. .. _future: From buildbot at python.org Thu May 14 04:49:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 14 May 2009 02:49:30 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090514024930.F231DD50C@mail.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/569 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 533, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' 2 tests failed: test_import test_inspect ====================================================================== ERROR: test_findsource_binary (test.test_inspect.TestBuggyCases) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_inspect.py", line 343, in test_findsource_binary self.assertRaises(IOError, inspect.getsource, time) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 582, in assertRaises callableObj(*args, **kwargs) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\inspect.py", line 693, in getsource lines, lnum = getsourcelines(object) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\inspect.py", line 682, in getsourcelines lines, lnum = findsource(object) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\inspect.py", line 521, in findsource file = getsourcefile(object) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\inspect.py", line 443, in getsourcefile filename = getfile(object) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\inspect.py", line 405, in getfile raise TypeError('arg is a built-in module') TypeError: arg is a built-in module sincerely, -The Buildbot From nnorwitz at gmail.com Thu May 14 11:29:04 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 14 May 2009 05:29:04 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090514092904.GA16776@python.psfb.org> More important issues: ---------------------- test_hashlib leaked [5, 5, -5] references, sum=5 Less important issues: ---------------------- test_cmd_line leaked [25, 0, 0] references, sum=25 test_smtplib leaked [91, 88, -179] references, sum=0 test_socketserver leaked [0, 84, -84] references, sum=0 test_sys leaked [0, 0, -21] references, sum=-21 test_threading leaked [48, 53, 43] references, sum=144 test_threadsignals leaked [0, 0, -8] references, sum=-8 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 From python-checkins at python.org Thu May 14 11:32:29 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 11:32:29 +0200 (CEST) Subject: [Python-checkins] r72617 - peps/trunk/pep-0376.txt Message-ID: <20090514093229.6F772D8D0@mail.python.org> Author: tarek.ziade Date: Thu May 14 11:32:29 2009 New Revision: 72617 Log: typos and a roadmap section Modified: peps/trunk/pep-0376.txt Modified: peps/trunk/pep-0376.txt ============================================================================== --- peps/trunk/pep-0376.txt (original) +++ peps/trunk/pep-0376.txt Thu May 14 11:32:29 2009 @@ -30,8 +30,7 @@ Rationale ========= -There are three problems right now in the way projects are installed in -Python: +There are two problems right now in the way projects are installed in Python: - There are too many ways to install a project in Python. - There is no API to get the metadata of installed packages. @@ -46,7 +45,7 @@ The `install_egg_info` subcommand is called during this process, in order to create an `.egg-info` file in the `site-packages` directory. -For example, if the `zlib` project is installed (which contains one package), +For example, if the `zlib` project (which contains one package), is installed two elements will be installed in `site-packages`:: - zlib @@ -131,7 +130,7 @@ - the `RECORD` file will hold the list of installed files. These correspond to the files listed by the `record` option of the `install` - command, and will always be generated. This will allow uninstall, as + command, and will always be generated. This will allow uninstallation, as explained later in this PEP. The `install` command will record by default installed files in the @@ -142,12 +141,11 @@ system. This makes this information cross-compatible and allows simple installation to be relocatable. -- if the installed file is located elswhere in the system, a +- if the installed file is located elsewhere in the system, a '/'-separated absolute path is used. This will require changing the way the `install` command writes the record -file, so the old `record` behavior will be deprecated. -XXX see how to handle old record (new option, or wait for 2 version?) +file, so the old `record` behavior will be deprecated. Back to our `zlib` example, we will have:: @@ -205,11 +203,12 @@ Distutils will provide a very basic `uninstall` command that will remove all files listed in the `RECORD` file of a project, as long as they are not -mentioned in another `RECORD` file. +mentioned in another `RECORD` file and as long as the package is installed +using the standard described earlier. -This command will be added in the `util` module and will take the name -of the project to uninstall. A call to uninstall will return a list -of uninstalled files. If the project is not found, a Distutils:: +This command will be added in ``distutils.util`` and will take the name +of the project to uninstall as its argument. A call to uninstall will return a +list of uninstalled files:: >>> from distutils.util import uninstall >>> uninstall('zlib') @@ -219,9 +218,9 @@ If the project is not found, a ``DistutilsUninstallError`` will be raised. To make it a reference API for third-party projects that wish to provide -an `uninstall feature`. The `uninstall` API can also be invoked with a +an `uninstall feature`. The ``uninstall`` function can also be invoked with a second callable argument, that will be invoked for each file to be removed. -If it returns `True`, the file will be removed. +If this callable returns `True`, the file will be removed. Examples:: @@ -235,6 +234,13 @@ ... return False >>> uninstall('zlib', _dry_run) +Backward compatibility and roadmap +================================== + +These changes will not introduce any compatibility problems with the previous +version of Distutils, and will also work with existing third-party tools. + +The plan is to integrate them for Python 2.7 and Python 3.2 Aknowledgments ============== From python-checkins at python.org Thu May 14 14:40:59 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 14:40:59 +0200 (CEST) Subject: [Python-checkins] r72618 - in python/trunk/Lib/distutils: command/sdist.py tests/test_sdist.py Message-ID: <20090514124059.DD38DDAB2@mail.python.org> Author: tarek.ziade Date: Thu May 14 14:40:59 2009 New Revision: 72618 Log: more test coverage for distutils sdist command Modified: python/trunk/Lib/distutils/command/sdist.py python/trunk/Lib/distutils/tests/test_sdist.py Modified: python/trunk/Lib/distutils/command/sdist.py ============================================================================== --- python/trunk/Lib/distutils/command/sdist.py (original) +++ python/trunk/Lib/distutils/command/sdist.py Thu May 14 14:40:59 2009 @@ -16,19 +16,18 @@ from distutils import log from distutils.util import convert_path -def show_formats (): +def show_formats(): """Print all possible values for the 'formats' option (used by the "--help-formats" command-line option). """ from distutils.fancy_getopt import FancyGetopt from distutils.archive_util import ARCHIVE_FORMATS - formats=[] + formats = [] for format in ARCHIVE_FORMATS.keys(): formats.append(("formats=" + format, None, ARCHIVE_FORMATS[format][2])) formats.sort() - pretty_printer = FancyGetopt(formats) - pretty_printer.print_help( + FancyGetopt(formats).print_help( "List of available source distribution formats:") class sdist (Command): Modified: python/trunk/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_sdist.py (original) +++ python/trunk/Lib/distutils/tests/test_sdist.py Thu May 14 14:40:59 2009 @@ -7,12 +7,16 @@ import sys import tempfile +from test.test_support import captured_stdout + from distutils.command.sdist import sdist +from distutils.command.sdist import show_formats from distutils.core import Distribution from distutils.tests.test_config import PyPIRCCommandTestCase from distutils.errors import DistutilsExecError from distutils.spawn import find_executable from distutils.tests import support +from distutils.archive_util import ARCHIVE_FORMATS SETUP_PY = """ from distutils.core import setup @@ -210,6 +214,16 @@ manifest = open(join(self.tmp_dir, 'MANIFEST')).read() self.assertEquals(manifest, MANIFEST % {'sep': os.sep}) + def test_show_formats(self): + with captured_stdout() as stdout: + show_formats() + + # the output should be a header line + one line per format + num_formats = len(ARCHIVE_FORMATS.keys()) + output = [line for line in stdout.getvalue().split('\n') + if line.strip().startswith('--formats=')] + self.assertEquals(len(output), num_formats) + def test_suite(): return unittest.makeSuite(sdistTestCase) From python-checkins at python.org Thu May 14 14:44:10 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 14:44:10 +0200 (CEST) Subject: [Python-checkins] r72619 - python/branches/release26-maint Message-ID: <20090514124410.C8E80D28B@mail.python.org> Author: tarek.ziade Date: Thu May 14 14:44:10 2009 New Revision: 72619 Log: Blocked revisions 72618 via svnmerge ........ r72618 | tarek.ziade | 2009-05-14 14:40:59 +0200 (Thu, 14 May 2009) | 1 line more test coverage for distutils sdist command ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Thu May 14 14:45:48 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 14:45:48 +0200 (CEST) Subject: [Python-checkins] r72620 - in python/branches/py3k: Lib/distutils/command/sdist.py Lib/distutils/tests/test_sdist.py Message-ID: <20090514124548.4FF13C3E7@mail.python.org> Author: tarek.ziade Date: Thu May 14 14:45:48 2009 New Revision: 72620 Log: Merged revisions 72618 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72618 | tarek.ziade | 2009-05-14 14:40:59 +0200 (Thu, 14 May 2009) | 1 line more test coverage for distutils sdist command ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/command/sdist.py python/branches/py3k/Lib/distutils/tests/test_sdist.py Modified: python/branches/py3k/Lib/distutils/command/sdist.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/sdist.py (original) +++ python/branches/py3k/Lib/distutils/command/sdist.py Thu May 14 14:45:48 2009 @@ -17,19 +17,18 @@ from distutils import log from distutils.util import convert_path -def show_formats (): +def show_formats(): """Print all possible values for the 'formats' option (used by the "--help-formats" command-line option). """ from distutils.fancy_getopt import FancyGetopt from distutils.archive_util import ARCHIVE_FORMATS - formats=[] + formats = [] for format in ARCHIVE_FORMATS.keys(): formats.append(("formats=" + format, None, ARCHIVE_FORMATS[format][2])) formats.sort() - pretty_printer = FancyGetopt(formats) - pretty_printer.print_help( + FancyGetopt(formats).print_help( "List of available source distribution formats:") class sdist (Command): Modified: python/branches/py3k/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_sdist.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_sdist.py Thu May 14 14:45:48 2009 @@ -7,12 +7,16 @@ import sys import tempfile +from test.support import captured_stdout + from distutils.command.sdist import sdist +from distutils.command.sdist import show_formats from distutils.core import Distribution from distutils.tests.test_config import PyPIRCCommandTestCase from distutils.errors import DistutilsExecError from distutils.spawn import find_executable from distutils.tests import support +from distutils.archive_util import ARCHIVE_FORMATS SETUP_PY = """ from distutils.core import setup @@ -210,6 +214,16 @@ manifest = open(join(self.tmp_dir, 'MANIFEST')).read() self.assertEquals(manifest, MANIFEST % {'sep': os.sep}) + def test_show_formats(self): + with captured_stdout() as stdout: + show_formats() + + # the output should be a header line + one line per format + num_formats = len(ARCHIVE_FORMATS.keys()) + output = [line for line in stdout.getvalue().split('\n') + if line.strip().startswith('--formats=')] + self.assertEquals(len(output), num_formats) + def test_suite(): return unittest.makeSuite(sdistTestCase) From python-checkins at python.org Thu May 14 14:46:38 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 14:46:38 +0200 (CEST) Subject: [Python-checkins] r72621 - python/branches/release30-maint Message-ID: <20090514124638.48FB8D270@mail.python.org> Author: tarek.ziade Date: Thu May 14 14:46:38 2009 New Revision: 72621 Log: Blocked revisions 72620 via svnmerge ................ r72620 | tarek.ziade | 2009-05-14 14:45:48 +0200 (Thu, 14 May 2009) | 9 lines Merged revisions 72618 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72618 | tarek.ziade | 2009-05-14 14:40:59 +0200 (Thu, 14 May 2009) | 1 line more test coverage for distutils sdist command ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Thu May 14 14:48:09 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 14:48:09 +0200 (CEST) Subject: [Python-checkins] r72622 - python/branches/py3k/Doc/library/importlib.rst Message-ID: <20090514124809.AC8F2D94D@mail.python.org> Author: tarek.ziade Date: Thu May 14 14:48:09 2009 New Revision: 72622 Log: typo Modified: python/branches/py3k/Doc/library/importlib.rst Modified: python/branches/py3k/Doc/library/importlib.rst ============================================================================== --- python/branches/py3k/Doc/library/importlib.rst (original) +++ python/branches/py3k/Doc/library/importlib.rst Thu May 14 14:48:09 2009 @@ -16,7 +16,7 @@ The purpose of the :mod:`importlib` package is two-fold. One is to provide an implementation of the :keyword:`import` statement (and thus, by extension, the :func:`__import__` function) in Python source code. This provides an -implementaiton of :keyword:`import` which is portable to any Python +implementation of :keyword:`import` which is portable to any Python interpreter. This also provides a reference implementation which is easier to comprehend than one in a programming language other than Python. From python-checkins at python.org Thu May 14 14:49:09 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 14:49:09 +0200 (CEST) Subject: [Python-checkins] r72623 - python/branches/release30-maint Message-ID: <20090514124909.E3336D8B0@mail.python.org> Author: tarek.ziade Date: Thu May 14 14:49:09 2009 New Revision: 72623 Log: Blocked revisions 72622 via svnmerge ........ r72622 | tarek.ziade | 2009-05-14 14:48:09 +0200 (Thu, 14 May 2009) | 1 line typo ........ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Thu May 14 15:57:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 14 May 2009 13:57:11 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090514135711.A67E8D94F@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/617 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu May 14 16:20:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 14 May 2009 14:20:15 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090514142015.DECD7D85E@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.0/builds/10 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu May 14 16:56:14 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 16:56:14 +0200 (CEST) Subject: [Python-checkins] r72624 - in python/trunk/Lib/distutils: command/sdist.py tests/test_sdist.py Message-ID: <20090514145614.5C43DD967@mail.python.org> Author: tarek.ziade Date: Thu May 14 16:56:14 2009 New Revision: 72624 Log: pep8-fied distutils.command.sdist + more tests Modified: python/trunk/Lib/distutils/command/sdist.py python/trunk/Lib/distutils/tests/test_sdist.py Modified: python/trunk/Lib/distutils/command/sdist.py ============================================================================== --- python/trunk/Lib/distutils/command/sdist.py (original) +++ python/trunk/Lib/distutils/command/sdist.py Thu May 14 16:56:14 2009 @@ -30,7 +30,7 @@ FancyGetopt(formats).print_help( "List of available source distribution formats:") -class sdist (Command): +class sdist(Command): description = "create a source distribution (tarball, zip file, etc.)" @@ -77,10 +77,10 @@ negative_opt = {'no-defaults': 'use-defaults', 'no-prune': 'prune' } - default_format = { 'posix': 'gztar', - 'nt': 'zip' } + default_format = {'posix': 'gztar', + 'nt': 'zip' } - def initialize_options (self): + def initialize_options(self): # 'template' and 'manifest' are, respectively, the names of # the manifest template and manifest file. self.template = None @@ -100,8 +100,7 @@ self.archive_files = None - - def finalize_options (self): + def finalize_options(self): if self.manifest is None: self.manifest = "MANIFEST" if self.template is None: @@ -124,9 +123,7 @@ if self.dist_dir is None: self.dist_dir = "dist" - - def run (self): - + def run(self): # 'filelist' contains the list of files that will make up the # manifest self.filelist = FileList() @@ -148,8 +145,7 @@ # or zipfile, or whatever. self.make_distribution() - - def check_metadata (self): + def check_metadata(self): """Ensure that all required elements of meta-data (name, version, URL, (author and author_email) or (maintainer and maintainer_email)) are supplied by the Distribution object; warn if @@ -179,17 +175,13 @@ "or (maintainer and maintainer_email) " + "must be supplied") - # check_metadata () - - - def get_file_list (self): + def get_file_list(self): """Figure out the list of files to include in the source distribution, and put it in 'self.filelist'. This might involve reading the manifest template (and writing the manifest), or just reading the manifest, or just using the default file set -- it all depends on the user's options and the state of the filesystem. """ - # If we have a manifest template, see if it's newer than the # manifest; if so, we'll regenerate the manifest. template_exists = os.path.isfile(self.template) @@ -249,10 +241,7 @@ else: self.read_manifest() - # get_file_list () - - - def add_defaults (self): + def add_defaults(self): """Add all the default files to self.filelist: - README or README.txt - setup.py @@ -334,10 +323,7 @@ build_scripts = self.get_finalized_command('build_scripts') self.filelist.extend(build_scripts.get_source_files()) - # add_defaults () - - - def read_template (self): + def read_template(self): """Read and parse manifest template file named by self.template. (usually "MANIFEST.in") The parsing and processing is done by @@ -364,10 +350,7 @@ template.current_line, msg)) - # read_template () - - - def prune_file_list (self): + def prune_file_list(self): """Prune off branches that might slip into the file list as created by 'read_template()', but really don't belong there: * the build tree (typically "build") @@ -393,7 +376,7 @@ vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps) self.filelist.exclude_pattern(vcs_ptrn, is_regex=1) - def write_manifest (self): + def write_manifest(self): """Write the file list in 'self.filelist' (presumably as filled in by 'add_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'. @@ -402,10 +385,7 @@ (self.manifest, self.filelist.files), "writing manifest file '%s'" % self.manifest) - # write_manifest () - - - def read_manifest (self): + def read_manifest(self): """Read the manifest file (named by 'self.manifest') and use it to fill in 'self.filelist', the list of files to include in the source distribution. @@ -421,10 +401,7 @@ self.filelist.append(line) manifest.close() - # read_manifest () - - - def make_release_tree (self, base_dir, files): + def make_release_tree(self, base_dir, files): """Create the directory tree that will become the source distribution archive. All directories implied by the filenames in 'files' are created under 'base_dir', and then we hard link or copy @@ -466,9 +443,7 @@ self.distribution.metadata.write_pkg_info(base_dir) - # make_release_tree () - - def make_distribution (self): + def make_distribution(self): """Create the source distribution(s). First, we create the release tree with 'make_release_tree()'; then, we create all required archive files (according to 'self.formats') from the release tree. @@ -497,10 +472,8 @@ if not self.keep_temp: dir_util.remove_tree(base_dir, dry_run=self.dry_run) - def get_archive_files (self): + def get_archive_files(self): """Return the list of archive files created when the command was run, or None if the command hasn't run yet. """ return self.archive_files - -# class sdist Modified: python/trunk/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_sdist.py (original) +++ python/trunk/Lib/distutils/tests/test_sdist.py Thu May 14 16:56:14 2009 @@ -13,7 +13,7 @@ from distutils.command.sdist import show_formats from distutils.core import Distribution from distutils.tests.test_config import PyPIRCCommandTestCase -from distutils.errors import DistutilsExecError +from distutils.errors import DistutilsExecError, DistutilsOptionError from distutils.spawn import find_executable from distutils.tests import support from distutils.archive_util import ARCHIVE_FORMATS @@ -224,6 +224,28 @@ if line.strip().startswith('--formats=')] self.assertEquals(len(output), num_formats) + def test_finalize_options(self): + + dist, cmd = self.get_cmd() + cmd.finalize_options() + + # default options set by finalize + self.assertEquals(cmd.manifest, 'MANIFEST') + self.assertEquals(cmd.template, 'MANIFEST.in') + self.assertEquals(cmd.dist_dir, 'dist') + + # formats has to be a string splitable on (' ', ',') or + # a stringlist + cmd.formats = 1 + self.assertRaises(DistutilsOptionError, cmd.finalize_options) + cmd.formats = ['zip'] + cmd.finalize_options() + + # formats has to be known + cmd.formats = 'supazipa' + self.assertRaises(DistutilsOptionError, cmd.finalize_options) + + def test_suite(): return unittest.makeSuite(sdistTestCase) From python-checkins at python.org Thu May 14 16:56:58 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 16:56:58 +0200 (CEST) Subject: [Python-checkins] r72625 - python/branches/release26-maint Message-ID: <20090514145658.6E10DD92C@mail.python.org> Author: tarek.ziade Date: Thu May 14 16:56:58 2009 New Revision: 72625 Log: Blocked revisions 72624 via svnmerge ........ r72624 | tarek.ziade | 2009-05-14 16:56:14 +0200 (Thu, 14 May 2009) | 1 line pep8-fied distutils.command.sdist + more tests ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Thu May 14 17:21:26 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 17:21:26 +0200 (CEST) Subject: [Python-checkins] r72626 - in python/branches/py3k: Lib/distutils/command/sdist.py Lib/distutils/tests/test_sdist.py Message-ID: <20090514152126.8CB1BD915@mail.python.org> Author: tarek.ziade Date: Thu May 14 17:21:26 2009 New Revision: 72626 Log: Merged revisions 72624 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72624 | tarek.ziade | 2009-05-14 16:56:14 +0200 (Thu, 14 May 2009) | 1 line pep8-fied distutils.command.sdist + more tests ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/command/sdist.py python/branches/py3k/Lib/distutils/tests/test_sdist.py Modified: python/branches/py3k/Lib/distutils/command/sdist.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/sdist.py (original) +++ python/branches/py3k/Lib/distutils/command/sdist.py Thu May 14 17:21:26 2009 @@ -31,7 +31,7 @@ FancyGetopt(formats).print_help( "List of available source distribution formats:") -class sdist (Command): +class sdist(Command): description = "create a source distribution (tarball, zip file, etc.)" @@ -78,8 +78,8 @@ negative_opt = {'no-defaults': 'use-defaults', 'no-prune': 'prune' } - default_format = { 'posix': 'gztar', - 'nt': 'zip' } + default_format = {'posix': 'gztar', + 'nt': 'zip' } def initialize_options(self): # 'template' and 'manifest' are, respectively, the names of @@ -101,7 +101,6 @@ self.archive_files = None - def finalize_options(self): if self.manifest is None: self.manifest = "MANIFEST" @@ -125,7 +124,6 @@ if self.dist_dir is None: self.dist_dir = "dist" - def run(self): # 'filelist' contains the list of files that will make up the # manifest @@ -244,7 +242,6 @@ else: self.read_manifest() - def add_defaults(self): """Add all the default files to self.filelist: - README or README.txt @@ -373,7 +370,7 @@ vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps) self.filelist.exclude_pattern(vcs_ptrn, is_regex=1) - def write_manifest (self): + def write_manifest(self): """Write the file list in 'self.filelist' (presumably as filled in by 'add_defaults()' and 'read_template()') to the manifest file named by 'self.manifest'. Modified: python/branches/py3k/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_sdist.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_sdist.py Thu May 14 17:21:26 2009 @@ -13,7 +13,7 @@ from distutils.command.sdist import show_formats from distutils.core import Distribution from distutils.tests.test_config import PyPIRCCommandTestCase -from distutils.errors import DistutilsExecError +from distutils.errors import DistutilsExecError, DistutilsOptionError from distutils.spawn import find_executable from distutils.tests import support from distutils.archive_util import ARCHIVE_FORMATS @@ -224,6 +224,28 @@ if line.strip().startswith('--formats=')] self.assertEquals(len(output), num_formats) + def test_finalize_options(self): + + dist, cmd = self.get_cmd() + cmd.finalize_options() + + # default options set by finalize + self.assertEquals(cmd.manifest, 'MANIFEST') + self.assertEquals(cmd.template, 'MANIFEST.in') + self.assertEquals(cmd.dist_dir, 'dist') + + # formats has to be a string splitable on (' ', ',') or + # a stringlist + cmd.formats = 1 + self.assertRaises(DistutilsOptionError, cmd.finalize_options) + cmd.formats = ['zip'] + cmd.finalize_options() + + # formats has to be known + cmd.formats = 'supazipa' + self.assertRaises(DistutilsOptionError, cmd.finalize_options) + + def test_suite(): return unittest.makeSuite(sdistTestCase) From python-checkins at python.org Thu May 14 17:22:48 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 17:22:48 +0200 (CEST) Subject: [Python-checkins] r72627 - python/branches/release30-maint Message-ID: <20090514152248.85037C39E@mail.python.org> Author: tarek.ziade Date: Thu May 14 17:22:48 2009 New Revision: 72627 Log: Blocked revisions 72626 via svnmerge ................ r72626 | tarek.ziade | 2009-05-14 17:21:26 +0200 (Thu, 14 May 2009) | 9 lines Merged revisions 72624 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72624 | tarek.ziade | 2009-05-14 16:56:14 +0200 (Thu, 14 May 2009) | 1 line pep8-fied distutils.command.sdist + more tests ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Thu May 14 17:31:02 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 14 May 2009 17:31:02 +0200 (CEST) Subject: [Python-checkins] r72628 - python/branches/py3k/Doc/library/ipaddr.rst Message-ID: <20090514153102.E2CDCD8DE@mail.python.org> Author: raymond.hettinger Date: Thu May 14 17:31:02 2009 New Revision: 72628 Log: Suggest how to use compare_networks() with a modern Python. Modified: python/branches/py3k/Doc/library/ipaddr.rst Modified: python/branches/py3k/Doc/library/ipaddr.rst ============================================================================== --- python/branches/py3k/Doc/library/ipaddr.rst (original) +++ python/branches/py3k/Doc/library/ipaddr.rst Thu May 14 17:31:02 2009 @@ -199,6 +199,16 @@ 1 if self.version > other.version eg: IPv6('::1/128') > IPv4('255.255.255.0/24') + .. note:: + + To sort networks with :func:`sorted`, :func:`min`, :func:`max` and + other tools with a *key* argument, use the :func:`operator.attrgetter` + function to extract the relevant fields:: + + >>> from operator import attrgetter + >>> s = [IPv6('::1/128'), IPv4('255.255.255.0/24')] + >>> sorted(s, key=attrgetter('version', 'network', 'netmask')) + [IPv4('255.255.255.0/24'), IPv6('::1/128')] .. method:: subnet(prefixlen_diff=1) From python-checkins at python.org Thu May 14 17:51:36 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 14 May 2009 17:51:36 +0200 (CEST) Subject: [Python-checkins] r72629 - python/branches/py3k/Lib/ipaddr.py Message-ID: <20090514155136.78599DA20@mail.python.org> Author: raymond.hettinger Date: Thu May 14 17:51:36 2009 New Revision: 72629 Log: Convert docstring examples to doctests and fix any errors that were found. Add a usage note to compare_networks() showing how to do the ordering with modern python. Modified: python/branches/py3k/Lib/ipaddr.py Modified: python/branches/py3k/Lib/ipaddr.py ============================================================================== --- python/branches/py3k/Lib/ipaddr.py (original) +++ python/branches/py3k/Lib/ipaddr.py Thu May 14 17:51:36 2009 @@ -135,16 +135,17 @@ Example: - ip1 = IPv4('1.1.0.0/24') - ip2 = IPv4('1.1.1.0/24') - ip3 = IPv4('1.1.2.0/24') - ip4 = IPv4('1.1.3.0/24') - ip5 = IPv4('1.1.4.0/24') - ip6 = IPv4('1.1.0.1/22') + >>> ip1 = IPv4('1.1.0.0/24') + >>> ip2 = IPv4('1.1.1.0/24') + >>> ip3 = IPv4('1.1.2.0/24') + >>> ip4 = IPv4('1.1.3.0/24') + >>> ip5 = IPv4('1.1.4.0/24') + >>> ip6 = IPv4('1.1.0.1/22') - _collapse_address_list_recursive([ip1, ip2, ip3, ip4, ip5, ip6]) -> - [IPv4('1.1.0.0/22'), IPv4('1.1.4.0/24')] + >>> _collapse_address_list_recursive([ip1, ip2, ip3, ip4, ip5, ip6]) + [IPv4('1.1.0.0/22'), IPv4('1.1.4.0/24'), IPv4('1.1.0.1/22')] + Notes: This shouldn't be called directly; it is called via collapse_address_list([]). @@ -180,8 +181,9 @@ """Collapse a list of IP objects. Example: - collapse_address_list([IPv4('1.1.0.0/24'), IPv4('1.1.1.0/24')]) -> - [IPv4('1.1.0.0/23')] + + >>> collapse_address_list([IPv4('1.1.0.0/24'), IPv4('1.1.1.0/24')]) + [IPv4('1.1.0.0/23')] Args: addresses: A list of IPv4 or IPv6 objects. @@ -270,21 +272,20 @@ For example: - addr1 = IP('10.1.1.0/24') - addr2 = IP('10.1.1.0/26') - addr1.address_exclude(addr2) = - [IP('10.1.1.64/26'), IP('10.1.1.128/25')] + >>> addr1 = IP('10.1.1.0/24') + >>> addr2 = IP('10.1.1.0/26') + >>> addr1.address_exclude(addr2) + [IPv4('10.1.1.64/26'), IPv4('10.1.1.128/25')] or IPv6: - addr1 = IP('::1/32') - addr2 = IP('::1/128') - addr1.address_exclude(addr2) = [IP('::0/128'), - IP('::2/127'), - IP('::4/126'), - IP('::8/125'), - ... - IP('0:0:8000::/33')] + >>> addr1 = IP('::1/32') + >>> addr2 = IP('::1/128') + >>> s = addr1.address_exclude(addr2) + >>> s[:4] + [IPv6('::/128'), IPv6('::2/127'), IPv6('::4/126'), IPv6('::8/125')] + >>> s[-1] + IPv6('0:0:8000::/33') Args: other: An IP object of the same type. @@ -373,6 +374,15 @@ 1 if self.version > other.version eg: IPv6('::1/128') > IPv4('255.255.255.0/24') + To sort networks with sorted(), min(), max() and other tools with a + *key* argument, use the operator.attrgetter() function to extract the + relevant fields: + + >>> from operator import attrgetter + >>> s = [IPv6('::1/128'), IPv4('255.255.255.0/24')] + >>> sorted(s, key=attrgetter('version', 'network', 'netmask')) + [IPv4('255.255.255.0/24'), IPv6('::1/128')] + """ if self.version < other.version: return -1 @@ -521,19 +531,23 @@ """This class represents and manipulates 32-bit IPv4 addresses. - Attributes: [examples for IPv4('1.2.3.4/27')] - .ip: 16909060 - .ip_ext: '1.2.3.4' - .ip_ext_full: '1.2.3.4' - .network: 16909056L - .network_ext: '1.2.3.0' - .hostmask: 31L (0x1F) - .hostmask_ext: '0.0.0.31' - .broadcast: 16909087L (0x102031F) - .broadcast_ext: '1.2.3.31' - .netmask: 4294967040L (0xFFFFFFE0) - .netmask_ext: '255.255.255.224' - .prefixlen: 27 + >>> addr = IPv4('1.2.3.4/27') + >>> for attr in ['ip', 'ip_ext', 'ip_ext_full', 'network', 'network_ext', + ... 'hostmask', 'hostmask_ext', 'broadcast', 'broadcast_ext', + ... 'netmask', 'netmask_ext', 'prefixlen']: + ... print(attr, '=', getattr(addr, attr)) + ip = 16909060 + ip_ext = 1.2.3.4 + ip_ext_full = 1.2.3.4 + network = 16909056 + network_ext = 1.2.3.0 + hostmask = 31 + hostmask_ext = 0.0.0.31 + broadcast = 16909087 + broadcast_ext = 1.2.3.31 + netmask = 4294967264 + netmask_ext = 255.255.255.224 + prefixlen = 27 """ @@ -558,9 +572,9 @@ net-masks. (255.0.0.0 == 0.255.255.255) Additionally, an integer can be passed, so - IPv4('192.168.1.1') == IPv4(3232235777). + IPv4('192.168.1.1') == IPv4(3232235777). or, more generally - IPv4(IPv4('192.168.1.1').ip) == IPv4('192.168.1.1') + IPv4(IPv4('192.168.1.1').ip) == IPv4('192.168.1.1') Raises: IPv4IpValidationError: If ipaddr isn't a valid IPv4 address. @@ -863,19 +877,23 @@ """This class respresents and manipulates 128-bit IPv6 addresses. - Attributes: [examples for IPv6('2001:658:22A:CAFE:200::1/64')] - .ip: 42540616829182469433547762482097946625L - .ip_ext: '2001:658:22a:cafe:200::1' - .ip_ext_full: '2001:0658:022a:cafe:0200:0000:0000:0001' - .network: 42540616829182469433403647294022090752L - .network_ext: '2001:658:22a:cafe::' - .hostmask: 18446744073709551615L - .hostmask_ext: '::ffff:ffff:ffff:ffff' - .broadcast: 42540616829182469451850391367731642367L - .broadcast_ext: '2001:658:22a:cafe:ffff:ffff:ffff:ffff' - .netmask: 340282366920938463444927863358058659840L - .netmask_ext: 64 - .prefixlen: 64 + >>> addr = IPv6('2001:658:22A:CAFE:200::1/64') + >>> for attr in ['ip', 'ip_ext', 'ip_ext_full', 'network', 'network_ext', + ... 'hostmask', 'hostmask_ext', 'broadcast', 'broadcast_ext', + ... 'netmask', 'netmask_ext', 'prefixlen']: + ... print(attr, '=', getattr(addr, attr)) + ip = 42540616829182469433547762482097946625 + ip_ext = 2001:658:22a:cafe:200::1 + ip_ext_full = 2001:0658:022a:cafe:0200:0000:0000:0001 + network = 42540616829182469433403647294022090752 + network_ext = 2001:658:22a:cafe:: + hostmask = 18446744073709551615 + hostmask_ext = ::ffff:ffff:ffff:ffff + broadcast = 42540616829182469451850391367731642367 + broadcast_ext = 2001:658:22a:cafe:ffff:ffff:ffff:ffff + netmask = 340282366920938463444927863358058659840 + netmask_ext = 64 + prefixlen = 64 """ @@ -896,10 +914,10 @@ a mask of /128. Additionally, an integer can be passed, so - IPv6('2001:4860::') == - IPv6(42541956101370907050197289607612071936L). + IPv6('2001:4860::') == + IPv6(42541956101370907050197289607612071936L). or, more generally - IPv6(IPv6('2001:4860::').ip) == IPv6('2001:4860::') + IPv6(IPv6('2001:4860::').ip) == IPv6('2001:4860::') Raises: IPv6IpValidationError: If ipaddr isn't a valid IPv6 address. @@ -1367,3 +1385,8 @@ _IPV6_RFC4291_LINK_LOCAL = IPv6('fe80::/10') _IPV6_RFC3513_SITE_LOCAL = IPv6('fec0::/10') # Deprecated by RFC3879. _IPV6_RFC4193_PRIVATE = IPv6('fc00::/7') + +if __name__ == '__main__': + + import doctest + print(doctest.testmod()) From python-checkins at python.org Thu May 14 18:12:58 2009 From: python-checkins at python.org (r.david.murray) Date: Thu, 14 May 2009 18:12:58 +0200 (CEST) Subject: [Python-checkins] r72630 - python/trunk/Lib/test/test_inspect.py Message-ID: <20090514161258.235EDD887@mail.python.org> Author: r.david.murray Date: Thu May 14 18:12:57 2009 New Revision: 72630 Log: Fix test failure on Windows, and add skip check if even unicodedata turns out not to be an external module on some other platform. Modified: python/trunk/Lib/test/test_inspect.py Modified: python/trunk/Lib/test/test_inspect.py ============================================================================== --- python/trunk/Lib/test/test_inspect.py (original) +++ python/trunk/Lib/test/test_inspect.py Thu May 14 18:12:57 2009 @@ -10,7 +10,7 @@ from test import inspect_fodder2 as mod2 # C module for test_findsource_binary -import time +import unicodedata # Functions tested in this suite: # ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode, @@ -332,9 +332,13 @@ def test_method_in_dynamic_class(self): self.assertSourceEqual(mod2.method_in_dynamic_class, 95, 97) + @unittest.skipIf( + not hasattr(unicodedata, '__file__') or + unicodedata.__file__[-4:] in (".pyc", ".pyo"), + "unicodedata is not an external binary module") def test_findsource_binary(self): - self.assertRaises(IOError, inspect.getsource, time) - self.assertRaises(IOError, inspect.findsource, time) + self.assertRaises(IOError, inspect.getsource, unicodedata) + self.assertRaises(IOError, inspect.findsource, unicodedata) # Helper for testing classify_class_attrs. def attrs_wo_objs(cls): From python-checkins at python.org Thu May 14 18:13:36 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 14 May 2009 18:13:36 +0200 (CEST) Subject: [Python-checkins] r72631 - python/branches/py3k/Lib/test/test_ipaddr.py Message-ID: <20090514161336.B40E4D5FC@mail.python.org> Author: raymond.hettinger Date: Thu May 14 18:13:36 2009 New Revision: 72631 Log: Exercise the doctests. Modified: python/branches/py3k/Lib/test/test_ipaddr.py Modified: python/branches/py3k/Lib/test/test_ipaddr.py ============================================================================== --- python/branches/py3k/Lib/test/test_ipaddr.py (original) +++ python/branches/py3k/Lib/test/test_ipaddr.py Thu May 14 18:13:36 2009 @@ -19,7 +19,7 @@ import unittest - +from test import support import ipaddr @@ -569,4 +569,5 @@ if __name__ == '__main__': - unittest.main() + support.run_unittest(IpaddrUnitTest) + support.run_doctest(ipaddr, True) From python-checkins at python.org Thu May 14 18:14:18 2009 From: python-checkins at python.org (r.david.murray) Date: Thu, 14 May 2009 18:14:18 +0200 (CEST) Subject: [Python-checkins] r72632 - python/branches/release26-maint Message-ID: <20090514161418.ABFBBD99E@mail.python.org> Author: r.david.murray Date: Thu May 14 18:14:18 2009 New Revision: 72632 Log: Blocked revisions 72630 via svnmerge ........ r72630 | r.david.murray | 2009-05-14 12:12:57 -0400 (Thu, 14 May 2009) | 3 lines Fix test failure on Windows, and add skip check if even unicodedata turns out not to be an external module on some other platform. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Thu May 14 18:17:50 2009 From: python-checkins at python.org (r.david.murray) Date: Thu, 14 May 2009 18:17:50 +0200 (CEST) Subject: [Python-checkins] r72633 - in python/branches/py3k: Lib/test/test_inspect.py Message-ID: <20090514161750.7C902D3E1@mail.python.org> Author: r.david.murray Date: Thu May 14 18:17:50 2009 New Revision: 72633 Log: Merged revisions 72630 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72630 | r.david.murray | 2009-05-14 12:12:57 -0400 (Thu, 14 May 2009) | 3 lines Fix test failure on Windows, and add skip check if even unicodedata turns out not to be an external module on some other platform. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_inspect.py Modified: python/branches/py3k/Lib/test/test_inspect.py ============================================================================== --- python/branches/py3k/Lib/test/test_inspect.py (original) +++ python/branches/py3k/Lib/test/test_inspect.py Thu May 14 18:17:50 2009 @@ -12,7 +12,7 @@ from test import inspect_fodder2 as mod2 # C module for test_findsource_binary -import time +import unicodedata # Functions tested in this suite: # ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode, @@ -339,9 +339,13 @@ def test_method_in_dynamic_class(self): self.assertSourceEqual(mod2.method_in_dynamic_class, 95, 97) + @unittest.skipIf( + not hasattr(unicodedata, '__file__') or + unicodedata.__file__[-4:] in (".pyc", ".pyo"), + "unicodedata is not an external binary module") def test_findsource_binary(self): - self.assertRaises(IOError, inspect.getsource, time) - self.assertRaises(IOError, inspect.findsource, time) + self.assertRaises(IOError, inspect.getsource, unicodedata) + self.assertRaises(IOError, inspect.findsource, unicodedata) # Helper for testing classify_class_attrs. def attrs_wo_objs(cls): From buildbot at python.org Thu May 14 18:38:43 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 14 May 2009 16:38:43 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090514163843.A8CC6D417@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/365 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_posix test_subprocess ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Thu May 14 18:44:42 2009 From: python-checkins at python.org (r.david.murray) Date: Thu, 14 May 2009 18:44:42 +0200 (CEST) Subject: [Python-checkins] r72634 - python/branches/release30-maint Message-ID: <20090514164442.4DCD3D480@mail.python.org> Author: r.david.murray Date: Thu May 14 18:44:16 2009 New Revision: 72634 Log: Blocked revisions 72633 via svnmerge ................ r72633 | r.david.murray | 2009-05-14 12:17:50 -0400 (Thu, 14 May 2009) | 10 lines Merged revisions 72630 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72630 | r.david.murray | 2009-05-14 12:12:57 -0400 (Thu, 14 May 2009) | 3 lines Fix test failure on Windows, and add skip check if even unicodedata turns out not to be an external module on some other platform. ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Thu May 14 20:55:56 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 14 May 2009 20:55:56 +0200 (CEST) Subject: [Python-checkins] r72635 - in python/branches/py3k: Lib/_pyio.py Lib/test/test_io.py Misc/NEWS Modules/_io/_iomodule.c Modules/_io/_iomodule.h Modules/_io/textio.c Message-ID: <20090514185556.11341D3CF@mail.python.org> Author: antoine.pitrou Date: Thu May 14 20:55:55 2009 New Revision: 72635 Log: Issue #5006: Better handling of unicode byte-order marks (BOM) in the io library. This means, for example, that opening an UTF-16 text file in append mode doesn't add a BOM at the end of the file if the file isn't empty. Modified: python/branches/py3k/Lib/_pyio.py python/branches/py3k/Lib/test/test_io.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_io/_iomodule.c python/branches/py3k/Modules/_io/_iomodule.h python/branches/py3k/Modules/_io/textio.c Modified: python/branches/py3k/Lib/_pyio.py ============================================================================== --- python/branches/py3k/Lib/_pyio.py (original) +++ python/branches/py3k/Lib/_pyio.py Thu May 14 20:55:55 2009 @@ -1436,6 +1436,15 @@ self._snapshot = None # info for reconstructing decoder state self._seekable = self._telling = self.buffer.seekable() + if self._seekable and self.writable(): + position = self.buffer.tell() + if position != 0: + try: + self._get_encoder().setstate(0) + except LookupError: + # Sometimes the encoder doesn't exist + pass + # self._snapshot is either None, or a tuple (dec_flags, next_input) # where dec_flags is the second (integer) item of the decoder state # and next_input is the chunk of input bytes that comes next after the @@ -1741,6 +1750,17 @@ raise IOError("can't restore logical file position") self._decoded_chars_used = chars_to_skip + # Finally, reset the encoder (merely useful for proper BOM handling) + try: + encoder = self._encoder or self._get_encoder() + except LookupError: + # Sometimes the encoder doesn't exist + pass + else: + if cookie != 0: + encoder.setstate(0) + else: + encoder.reset() return cookie def read(self, n=None): Modified: python/branches/py3k/Lib/test/test_io.py ============================================================================== --- python/branches/py3k/Lib/test/test_io.py (original) +++ python/branches/py3k/Lib/test/test_io.py Thu May 14 20:55:55 2009 @@ -1963,6 +1963,37 @@ self.assertEqual(buffer.seekable(), txt.seekable()) + def test_append_bom(self): + # The BOM is not written again when appending to a non-empty file + filename = support.TESTFN + for charset in ('utf-8-sig', 'utf-16', 'utf-32'): + with self.open(filename, 'w', encoding=charset) as f: + f.write('aaa') + pos = f.tell() + with self.open(filename, 'rb') as f: + self.assertEquals(f.read(), 'aaa'.encode(charset)) + + with self.open(filename, 'a', encoding=charset) as f: + f.write('xxx') + with self.open(filename, 'rb') as f: + self.assertEquals(f.read(), 'aaaxxx'.encode(charset)) + + def test_seek_bom(self): + # Same test, but when seeking manually + filename = support.TESTFN + for charset in ('utf-8-sig', 'utf-16', 'utf-32'): + with self.open(filename, 'w', encoding=charset) as f: + f.write('aaa') + pos = f.tell() + with self.open(filename, 'r+', encoding=charset) as f: + f.seek(pos) + f.write('zzz') + f.seek(0) + f.write('bbb') + with self.open(filename, 'rb') as f: + self.assertEquals(f.read(), 'bbbzzz'.encode(charset)) + + class CTextIOWrapperTest(TextIOWrapperTest): def test_initialization(self): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu May 14 20:55:55 2009 @@ -23,6 +23,11 @@ Library ------- +- Issue #5006: Better handling of unicode byte-order marks (BOM) in the io + library. This means, for example, that opening an UTF-16 text file in + append mode doesn't add a BOM at the end of the file if the file isn't + empty. + - Issue #4050: inspect.findsource/getsource now raise an IOError if the 'source' file is a binary. Patch by Brodie Rao, tests by Daniel Diniz. This fix corrects a pydoc regression. Modified: python/branches/py3k/Modules/_io/_iomodule.c ============================================================================== --- python/branches/py3k/Modules/_io/_iomodule.c (original) +++ python/branches/py3k/Modules/_io/_iomodule.c Thu May 14 20:55:55 2009 @@ -41,6 +41,7 @@ PyObject *_PyIO_str_reset; PyObject *_PyIO_str_seek; PyObject *_PyIO_str_seekable; +PyObject *_PyIO_str_setstate; PyObject *_PyIO_str_tell; PyObject *_PyIO_str_truncate; PyObject *_PyIO_str_writable; @@ -48,6 +49,7 @@ PyObject *_PyIO_empty_str; PyObject *_PyIO_empty_bytes; +PyObject *_PyIO_zero; PyDoc_STRVAR(module_doc, @@ -734,6 +736,8 @@ goto fail; if (!(_PyIO_str_seekable = PyUnicode_InternFromString("seekable"))) goto fail; + if (!(_PyIO_str_setstate = PyUnicode_InternFromString("setstate"))) + goto fail; if (!(_PyIO_str_tell = PyUnicode_InternFromString("tell"))) goto fail; if (!(_PyIO_str_truncate = PyUnicode_InternFromString("truncate"))) @@ -747,6 +751,8 @@ goto fail; if (!(_PyIO_empty_bytes = PyBytes_FromStringAndSize(NULL, 0))) goto fail; + if (!(_PyIO_zero = PyLong_FromLong(0L))) + goto fail; state->initialized = 1; Modified: python/branches/py3k/Modules/_io/_iomodule.h ============================================================================== --- python/branches/py3k/Modules/_io/_iomodule.h (original) +++ python/branches/py3k/Modules/_io/_iomodule.h Thu May 14 20:55:55 2009 @@ -141,6 +141,7 @@ extern PyObject *_PyIO_str_reset; extern PyObject *_PyIO_str_seek; extern PyObject *_PyIO_str_seekable; +extern PyObject *_PyIO_str_setstate; extern PyObject *_PyIO_str_tell; extern PyObject *_PyIO_str_truncate; extern PyObject *_PyIO_str_writable; @@ -148,3 +149,4 @@ extern PyObject *_PyIO_empty_str; extern PyObject *_PyIO_empty_bytes; +extern PyObject *_PyIO_zero; Modified: python/branches/py3k/Modules/_io/textio.c ============================================================================== --- python/branches/py3k/Modules/_io/textio.c (original) +++ python/branches/py3k/Modules/_io/textio.c Thu May 14 20:55:55 2009 @@ -647,6 +647,8 @@ char telling; /* Specialized encoding func (see below) */ encodefunc_t encodefunc; + /* Whether or not it's the start of the stream */ + char encoding_start_of_stream; /* Reads and writes are internally buffered in order to speed things up. However, any read will first flush the write buffer if itsn't empty. @@ -707,21 +709,50 @@ static PyObject * utf16_encode(PyTextIOWrapperObject *self, PyObject *text) { - PyObject *res; - res = PyUnicode_EncodeUTF16(PyUnicode_AS_UNICODE(text), - PyUnicode_GET_SIZE(text), - PyBytes_AS_STRING(self->errors), 0); - if (res == NULL) - return NULL; - /* Next writes will skip the BOM and use native byte ordering */ + if (!self->encoding_start_of_stream) { + /* Skip the BOM and use native byte ordering */ #if defined(WORDS_BIGENDIAN) - self->encodefunc = (encodefunc_t) utf16be_encode; + return utf16be_encode(self, text); #else - self->encodefunc = (encodefunc_t) utf16le_encode; + return utf16le_encode(self, text); #endif - return res; + } + return PyUnicode_EncodeUTF16(PyUnicode_AS_UNICODE(text), + PyUnicode_GET_SIZE(text), + PyBytes_AS_STRING(self->errors), 0); } +static PyObject * +utf32be_encode(PyTextIOWrapperObject *self, PyObject *text) +{ + return PyUnicode_EncodeUTF32(PyUnicode_AS_UNICODE(text), + PyUnicode_GET_SIZE(text), + PyBytes_AS_STRING(self->errors), 1); +} + +static PyObject * +utf32le_encode(PyTextIOWrapperObject *self, PyObject *text) +{ + return PyUnicode_EncodeUTF32(PyUnicode_AS_UNICODE(text), + PyUnicode_GET_SIZE(text), + PyBytes_AS_STRING(self->errors), -1); +} + +static PyObject * +utf32_encode(PyTextIOWrapperObject *self, PyObject *text) +{ + if (!self->encoding_start_of_stream) { + /* Skip the BOM and use native byte ordering */ +#if defined(WORDS_BIGENDIAN) + return utf32be_encode(self, text); +#else + return utf32le_encode(self, text); +#endif + } + return PyUnicode_EncodeUTF32(PyUnicode_AS_UNICODE(text), + PyUnicode_GET_SIZE(text), + PyBytes_AS_STRING(self->errors), 0); +} static PyObject * utf8_encode(PyTextIOWrapperObject *self, PyObject *text) @@ -749,10 +780,13 @@ static encodefuncentry encodefuncs[] = { {"ascii", (encodefunc_t) ascii_encode}, {"iso8859-1", (encodefunc_t) latin1_encode}, + {"utf-8", (encodefunc_t) utf8_encode}, {"utf-16-be", (encodefunc_t) utf16be_encode}, {"utf-16-le", (encodefunc_t) utf16le_encode}, {"utf-16", (encodefunc_t) utf16_encode}, - {"utf-8", (encodefunc_t) utf8_encode}, + {"utf-32-be", (encodefunc_t) utf32be_encode}, + {"utf-32-le", (encodefunc_t) utf32le_encode}, + {"utf-32", (encodefunc_t) utf32_encode}, {NULL, NULL} }; @@ -978,6 +1012,33 @@ self->seekable = self->telling = PyObject_IsTrue(res); Py_DECREF(res); + self->encoding_start_of_stream = 0; + if (self->seekable && self->encoder) { + PyObject *cookieObj; + int cmp; + + self->encoding_start_of_stream = 1; + + cookieObj = PyObject_CallMethodObjArgs(buffer, _PyIO_str_tell, NULL); + if (cookieObj == NULL) + goto error; + + cmp = PyObject_RichCompareBool(cookieObj, _PyIO_zero, Py_EQ); + Py_DECREF(cookieObj); + if (cmp < 0) { + goto error; + } + + if (cmp == 0) { + self->encoding_start_of_stream = 0; + res = PyObject_CallMethodObjArgs(self->encoder, _PyIO_str_setstate, + _PyIO_zero, NULL); + if (res == NULL) + goto error; + Py_DECREF(res); + } + } + self->ok = 1; return 0; @@ -1192,8 +1253,10 @@ needflush = 1; /* XXX What if we were just reading? */ - if (self->encodefunc != NULL) + if (self->encodefunc != NULL) { b = (*self->encodefunc)((PyObject *) self, text); + self->encoding_start_of_stream = 0; + } else b = PyObject_CallMethodObjArgs(self->encoder, _PyIO_str_encode, text, NULL); @@ -1847,24 +1910,38 @@ return 0; } +static int +_TextIOWrapper_encoder_setstate(PyTextIOWrapperObject *self, + CookieStruct *cookie) +{ + PyObject *res; + /* Same as _TextIOWrapper_decoder_setstate() above. */ + if (cookie->start_pos == 0 && cookie->dec_flags == 0) { + res = PyObject_CallMethodObjArgs(self->encoder, _PyIO_str_reset, NULL); + self->encoding_start_of_stream = 1; + } + else { + res = PyObject_CallMethodObjArgs(self->encoder, _PyIO_str_setstate, + _PyIO_zero, NULL); + self->encoding_start_of_stream = 0; + } + if (res == NULL) + return -1; + Py_DECREF(res); + return 0; +} + static PyObject * TextIOWrapper_seek(PyTextIOWrapperObject *self, PyObject *args) { PyObject *cookieObj, *posobj; CookieStruct cookie; int whence = 0; - static PyObject *zero = NULL; PyObject *res; int cmp; CHECK_INITIALIZED(self); - if (zero == NULL) { - zero = PyLong_FromLong(0L); - if (zero == NULL) - return NULL; - } - if (!PyArg_ParseTuple(args, "O|i:seek", &cookieObj, &whence)) return NULL; CHECK_CLOSED(self); @@ -1879,7 +1956,7 @@ if (whence == 1) { /* seek relative to current position */ - cmp = PyObject_RichCompareBool(cookieObj, zero, Py_EQ); + cmp = PyObject_RichCompareBool(cookieObj, _PyIO_zero, Py_EQ); if (cmp < 0) goto fail; @@ -1900,7 +1977,7 @@ else if (whence == 2) { /* seek relative to end of file */ - cmp = PyObject_RichCompareBool(cookieObj, zero, Py_EQ); + cmp = PyObject_RichCompareBool(cookieObj, _PyIO_zero, Py_EQ); if (cmp < 0) goto fail; @@ -1934,7 +2011,7 @@ goto fail; } - cmp = PyObject_RichCompareBool(cookieObj, zero, Py_LT); + cmp = PyObject_RichCompareBool(cookieObj, _PyIO_zero, Py_LT); if (cmp < 0) goto fail; @@ -2013,6 +2090,11 @@ goto fail; } + /* Finally, reset the encoder (merely useful for proper BOM handling) */ + if (self->encoder) { + if (_TextIOWrapper_encoder_setstate(self, &cookie) < 0) + goto fail; + } return cookieObj; fail: Py_XDECREF(cookieObj); From buildbot at python.org Thu May 14 21:20:33 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 14 May 2009 19:20:33 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090514192033.28E56D442@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/621 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu May 14 22:14:14 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 22:14:14 +0200 (CEST) Subject: [Python-checkins] r72636 - in python/trunk: Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090514201414.0FE21D263@mail.python.org> Author: tarek.ziade Date: Thu May 14 22:14:13 2009 New Revision: 72636 Log: #6022 fixed test_get_outputs so it doesn't leaves a test file in the cwd Modified: python/trunk/Lib/distutils/tests/test_build_ext.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_build_ext.py (original) +++ python/trunk/Lib/distutils/tests/test_build_ext.py Thu May 14 22:14:13 2009 @@ -312,12 +312,18 @@ # issue #5977 : distutils build_ext.get_outputs # returns wrong result with --inplace - cmd.inplace = 1 - cmd.run() - so_file = cmd.get_outputs()[0] + other_tmp_dir = os.path.realpath(self.mkdtemp()) + old_wd = os.getcwd() + os.chdir(other_tmp_dir) + try: + cmd.inplace = 1 + cmd.run() + so_file = cmd.get_outputs()[0] + finally: + os.chdir(old_wd) self.assert_(os.path.exists(so_file)) so_dir = os.path.dirname(so_file) - self.assertEquals(so_dir, os.getcwd()) + self.assertEquals(so_dir, other_tmp_dir) cmd.inplace = 0 cmd.run() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu May 14 22:14:13 2009 @@ -293,6 +293,9 @@ Library ------- +- Issue #6022: a test file was created in the current working directory by + test_get_outputs in Distutils. + - Issue #4050: inspect.findsource/getsource now raise an IOError if the 'source' file is a binary. Patch by Brodie Rao, tests by Daniel Diniz. From python-checkins at python.org Thu May 14 22:17:32 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 22:17:32 +0200 (CEST) Subject: [Python-checkins] r72637 - in python/branches/release26-maint: Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090514201732.BB13ED3FE@mail.python.org> Author: tarek.ziade Date: Thu May 14 22:17:32 2009 New Revision: 72637 Log: Merged revisions 72636 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72636 | tarek.ziade | 2009-05-14 22:14:13 +0200 (Thu, 14 May 2009) | 1 line #6022 fixed test_get_outputs so it doesn't leaves a test file in the cwd ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py Thu May 14 22:17:32 2009 @@ -249,12 +249,18 @@ # issue #5977 : distutils build_ext.get_outputs # returns wrong result with --inplace - cmd.inplace = 1 - cmd.run() - so_file = cmd.get_outputs()[0] + other_tmp_dir = os.path.realpath(self.mkdtemp()) + old_wd = os.getcwd() + os.chdir(other_tmp_dir) + try: + cmd.inplace = 1 + cmd.run() + so_file = cmd.get_outputs()[0] + finally: + os.chdir(old_wd) self.assert_(os.path.exists(so_file)) so_dir = os.path.dirname(so_file) - self.assertEquals(so_dir, os.getcwd()) + self.assertEquals(so_dir, other_tmp_dir) cmd.inplace = 0 cmd.run() Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Thu May 14 22:17:32 2009 @@ -194,6 +194,9 @@ Library ------- +- Issue #6022: a test file was created in the current working directory by + test_get_outputs in Distutils. + - Issue #5977: distutils build_ext.get_outputs was not taking into account the inplace option. Initial patch by kxroberto. From python-checkins at python.org Thu May 14 22:20:48 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 22:20:48 +0200 (CEST) Subject: [Python-checkins] r72638 - in python/branches/py3k: Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090514202048.0A8B4D4DA@mail.python.org> Author: tarek.ziade Date: Thu May 14 22:20:47 2009 New Revision: 72638 Log: Merged revisions 72636 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72636 | tarek.ziade | 2009-05-14 22:14:13 +0200 (Thu, 14 May 2009) | 1 line #6022 fixed test_get_outputs so it doesn't leaves a test file in the cwd ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_build_ext.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_build_ext.py Thu May 14 22:20:47 2009 @@ -312,12 +312,18 @@ # issue #5977 : distutils build_ext.get_outputs # returns wrong result with --inplace - cmd.inplace = 1 - cmd.run() - so_file = cmd.get_outputs()[0] + other_tmp_dir = os.path.realpath(self.mkdtemp()) + old_wd = os.getcwd() + os.chdir(other_tmp_dir) + try: + cmd.inplace = 1 + cmd.run() + so_file = cmd.get_outputs()[0] + finally: + os.chdir(old_wd) self.assert_(os.path.exists(so_file)) so_dir = os.path.dirname(so_file) - self.assertEquals(so_dir, os.getcwd()) + self.assertEquals(so_dir, other_tmp_dir) cmd.inplace = 0 cmd.run() Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu May 14 22:20:47 2009 @@ -607,6 +607,9 @@ Library ------- +- Issue #6022: a test file was created in the current working directory by + test_get_outputs in Distutils. + - Issue #5977: distutils build_ext.get_outputs was not taking into account the inplace option. Initial patch by kxroberto. From python-checkins at python.org Thu May 14 22:22:01 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 22:22:01 +0200 (CEST) Subject: [Python-checkins] r72639 - in python/branches/release30-maint: Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090514202201.18C69D442@mail.python.org> Author: tarek.ziade Date: Thu May 14 22:22:00 2009 New Revision: 72639 Log: Merged revisions 72638 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72638 | tarek.ziade | 2009-05-14 22:20:47 +0200 (Thu, 14 May 2009) | 9 lines Merged revisions 72636 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72636 | tarek.ziade | 2009-05-14 22:14:13 +0200 (Thu, 14 May 2009) | 1 line #6022 fixed test_get_outputs so it doesn't leaves a test file in the cwd ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py Thu May 14 22:22:00 2009 @@ -250,12 +250,18 @@ # issue #5977 : distutils build_ext.get_outputs # returns wrong result with --inplace - cmd.inplace = 1 - cmd.run() - so_file = cmd.get_outputs()[0] + other_tmp_dir = os.path.realpath(self.mkdtemp()) + old_wd = os.getcwd() + os.chdir(other_tmp_dir) + try: + cmd.inplace = 1 + cmd.run() + so_file = cmd.get_outputs()[0] + finally: + os.chdir(old_wd) self.assert_(os.path.exists(so_file)) so_dir = os.path.dirname(so_file) - self.assertEquals(so_dir, os.getcwd()) + self.assertEquals(so_dir, other_tmp_dir) cmd.inplace = 0 cmd.run() Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Thu May 14 22:22:00 2009 @@ -285,6 +285,9 @@ Library ------- +- Issue #6022: a test file was created in the current working directory by + test_get_outputs in Distutils. + - Issue #5977: distutils build_ext.get_outputs was not taking into account the inplace option. Initial patch by kxroberto. From python-checkins at python.org Thu May 14 23:22:21 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 14 May 2009 23:22:21 +0200 (CEST) Subject: [Python-checkins] r72640 - in python/trunk: Lib/nntplib.py Misc/ACKS Misc/NEWS Message-ID: <20090514212221.BC56CD378@mail.python.org> Author: antoine.pitrou Date: Thu May 14 23:22:08 2009 New Revision: 72640 Log: Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr. (Unfortunately, nntplib doesn't have a test suite) Modified: python/trunk/Lib/nntplib.py python/trunk/Misc/ACKS python/trunk/Misc/NEWS Modified: python/trunk/Lib/nntplib.py ============================================================================== --- python/trunk/Lib/nntplib.py (original) +++ python/trunk/Lib/nntplib.py Thu May 14 23:22:08 2009 @@ -109,8 +109,7 @@ """ self.host = host self.port = port - self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.sock.connect((self.host, self.port)) + self.sock = socket.create_connection((host, port)) self.file = self.sock.makefile('rb') self.debugging = 0 self.welcome = self.getresp() Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Thu May 14 23:22:08 2009 @@ -492,6 +492,7 @@ The Dragon De Monsyne Skip Montanaro Paul Moore +Derek Morr James A Morrison Sjoerd Mullender Sape Mullender Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu May 14 23:22:08 2009 @@ -293,6 +293,8 @@ Library ------- +- Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr. + - Issue #6022: a test file was created in the current working directory by test_get_outputs in Distutils. From python-checkins at python.org Thu May 14 23:27:09 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 14 May 2009 23:27:09 +0200 (CEST) Subject: [Python-checkins] r72641 - in python/branches/release26-maint: Lib/nntplib.py Misc/ACKS Misc/NEWS Message-ID: <20090514212709.359CFD378@mail.python.org> Author: antoine.pitrou Date: Thu May 14 23:27:08 2009 New Revision: 72641 Log: Merged revisions 72640 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72640 | antoine.pitrou | 2009-05-14 23:22:08 +0200 (jeu., 14 mai 2009) | 5 lines Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr. (Unfortunately, nntplib doesn't have a test suite) ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/nntplib.py python/branches/release26-maint/Misc/ACKS python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/nntplib.py ============================================================================== --- python/branches/release26-maint/Lib/nntplib.py (original) +++ python/branches/release26-maint/Lib/nntplib.py Thu May 14 23:27:08 2009 @@ -109,8 +109,7 @@ """ self.host = host self.port = port - self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.sock.connect((self.host, self.port)) + self.sock = socket.create_connection((host, port)) self.file = self.sock.makefile('rb') self.debugging = 0 self.welcome = self.getresp() Modified: python/branches/release26-maint/Misc/ACKS ============================================================================== --- python/branches/release26-maint/Misc/ACKS (original) +++ python/branches/release26-maint/Misc/ACKS Thu May 14 23:27:08 2009 @@ -476,6 +476,7 @@ The Dragon De Monsyne Skip Montanaro Paul Moore +Derek Morr James A Morrison Sjoerd Mullender Sape Mullender Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Thu May 14 23:27:08 2009 @@ -194,6 +194,8 @@ Library ------- +- Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr. + - Issue #6022: a test file was created in the current working directory by test_get_outputs in Distutils. From python-checkins at python.org Thu May 14 23:29:45 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 14 May 2009 23:29:45 +0200 (CEST) Subject: [Python-checkins] r72642 - python/branches/release26-maint/Misc/NEWS Message-ID: <20090514212945.E0F5ED398@mail.python.org> Author: antoine.pitrou Date: Thu May 14 23:29:45 2009 New Revision: 72642 Log: Move misplaced news item Modified: python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Thu May 14 23:29:45 2009 @@ -47,6 +47,8 @@ Library ------- +- Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr. + - Issue #5971: StreamHandler.handleError now swallows IOErrors which occur when trying to print a traceback. @@ -194,8 +196,6 @@ Library ------- -- Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr. - - Issue #6022: a test file was created in the current working directory by test_get_outputs in Distutils. From python-checkins at python.org Thu May 14 23:30:46 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 14 May 2009 23:30:46 +0200 (CEST) Subject: [Python-checkins] r72643 - in python/branches/py3k: Lib/nntplib.py Misc/ACKS Misc/NEWS Message-ID: <20090514213046.3CF40D3BA@mail.python.org> Author: antoine.pitrou Date: Thu May 14 23:30:46 2009 New Revision: 72643 Log: Merged revisions 72640 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72640 | antoine.pitrou | 2009-05-14 23:22:08 +0200 (jeu., 14 mai 2009) | 5 lines Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr. (Unfortunately, nntplib doesn't have a test suite) ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/nntplib.py python/branches/py3k/Misc/ACKS python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/nntplib.py ============================================================================== --- python/branches/py3k/Lib/nntplib.py (original) +++ python/branches/py3k/Lib/nntplib.py Thu May 14 23:30:46 2009 @@ -109,8 +109,7 @@ """ self.host = host self.port = port - self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.sock.connect((self.host, self.port)) + self.sock = socket.create_connection((host, port)) self.file = self.sock.makefile('rb') self.debugging = 0 self.welcome = self.getresp() Modified: python/branches/py3k/Misc/ACKS ============================================================================== --- python/branches/py3k/Misc/ACKS (original) +++ python/branches/py3k/Misc/ACKS Thu May 14 23:30:46 2009 @@ -496,6 +496,7 @@ The Dragon De Monsyne Skip Montanaro Paul Moore +Derek Morr James A Morrison Sjoerd Mullender Sape Mullender Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu May 14 23:30:46 2009 @@ -23,6 +23,8 @@ Library ------- +- Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr. + - Issue #5006: Better handling of unicode byte-order marks (BOM) in the io library. This means, for example, that opening an UTF-16 text file in append mode doesn't add a BOM at the end of the file if the file isn't From python-checkins at python.org Thu May 14 23:48:02 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 14 May 2009 23:48:02 +0200 (CEST) Subject: [Python-checkins] r72644 - python/branches/py3k/Doc/library/itertools.rst Message-ID: <20090514214802.76878D5B5@mail.python.org> Author: raymond.hettinger Date: Thu May 14 23:48:02 2009 New Revision: 72644 Log: Fix error in 2-to-3 translation of docs. Modified: python/branches/py3k/Doc/library/itertools.rst Modified: python/branches/py3k/Doc/library/itertools.rst ============================================================================== --- python/branches/py3k/Doc/library/itertools.rst (original) +++ python/branches/py3k/Doc/library/itertools.rst Thu May 14 23:48:02 2009 @@ -361,7 +361,7 @@ # islice('ABCDEFG', 2, None) --> C D E F G # islice('ABCDEFG', 0, None, 2) --> A C E G s = slice(*args) - it = range(s.start or 0, s.stop or sys.maxsize, s.step or 1) + it = iter(range(s.start or 0, s.stop or sys.maxsize, s.step or 1)) nexti = next(it) for i, element in enumerate(iterable): if i == nexti: From python-checkins at python.org Thu May 14 23:48:10 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 14 May 2009 23:48:10 +0200 (CEST) Subject: [Python-checkins] r72645 - in python/trunk: Misc/NEWS Modules/parsermodule.c Message-ID: <20090514214810.0712CD26D@mail.python.org> Author: antoine.pitrou Date: Thu May 14 23:48:09 2009 New Revision: 72645 Log: Issue #5918: Fix a crash in the parser module. Patch by Amaury. Modified: python/trunk/Misc/NEWS python/trunk/Modules/parsermodule.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu May 14 23:48:09 2009 @@ -293,6 +293,8 @@ Library ------- +- Issue #5918: Fix a crash in the parser module. + - Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr. - Issue #6022: a test file was created in the current working directory by Modified: python/trunk/Modules/parsermodule.c ============================================================================== --- python/trunk/Modules/parsermodule.c (original) +++ python/trunk/Modules/parsermodule.c Thu May 14 23:48:09 2009 @@ -2092,14 +2092,14 @@ return (res); } /* try/except statement: skip past except_clause sections */ - while (res && (TYPE(CHILD(tree, pos)) == except_clause)) { + while (res && pos < nch && (TYPE(CHILD(tree, pos)) == except_clause)) { res = (validate_except_clause(CHILD(tree, pos)) && validate_colon(CHILD(tree, pos + 1)) && validate_suite(CHILD(tree, pos + 2))); pos += 3; } /* skip else clause */ - if (res && (TYPE(CHILD(tree, pos)) == NAME) && + if (res && pos < nch && (TYPE(CHILD(tree, pos)) == NAME) && (strcmp(STR(CHILD(tree, pos)), "else") == 0)) { res = (validate_colon(CHILD(tree, pos + 1)) && validate_suite(CHILD(tree, pos + 2))); From python-checkins at python.org Thu May 14 23:52:15 2009 From: python-checkins at python.org (raymond.hettinger) Date: Thu, 14 May 2009 23:52:15 +0200 (CEST) Subject: [Python-checkins] r72646 - python/branches/release30-maint/Doc/library/itertools.rst Message-ID: <20090514215215.90D12D5AF@mail.python.org> Author: raymond.hettinger Date: Thu May 14 23:52:15 2009 New Revision: 72646 Log: Fix error in 2-to-3 translation of docs. Modified: python/branches/release30-maint/Doc/library/itertools.rst Modified: python/branches/release30-maint/Doc/library/itertools.rst ============================================================================== --- python/branches/release30-maint/Doc/library/itertools.rst (original) +++ python/branches/release30-maint/Doc/library/itertools.rst Thu May 14 23:52:15 2009 @@ -294,7 +294,7 @@ # islice('ABCDEFG', 2, None) --> C D E F G # islice('ABCDEFG', 0, None, 2) --> A C E G s = slice(*args) - it = range(s.start or 0, s.stop or sys.maxsize, s.step or 1) + it = iter(range(s.start or 0, s.stop or sys.maxsize, s.step or 1)) nexti = next(it) for i, element in enumerate(iterable): if i == nexti: From python-checkins at python.org Thu May 14 23:52:58 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 14 May 2009 23:52:58 +0200 (CEST) Subject: [Python-checkins] r72647 - peps/trunk/pep-0376.txt Message-ID: <20090514215258.62CF7D468@mail.python.org> Author: tarek.ziade Date: Thu May 14 23:52:58 2009 New Revision: 72647 Log: more details on get_egg_info Modified: peps/trunk/pep-0376.txt Modified: peps/trunk/pep-0376.txt ============================================================================== --- peps/trunk/pep-0376.txt (original) +++ peps/trunk/pep-0376.txt Thu May 14 23:52:58 2009 @@ -164,13 +164,16 @@ - get_egg_info(project_name) -> path or None - Scans all site-packages directories and looks for all `project_name.egg-info` - directories. Returns the directory path that contains a PKG-INFO that matches + Scans all elements in `sys.path` and looks for all directories ending with + `.egg-info`. Returns the directory path that contains a PKG-INFO that matches `project_name` for the `name` metadata. Notice that there should be at most one result. The first result founded will be returned. If the directory is not found, returns None. + XXX The implementation of `get_egg_info` will focus on minimizing the I/O + accesses. + - get_metadata(project_name) -> DistributionMetadata or None Uses `get_egg_info` to get the `PKG-INFO` file, and returns a From python-checkins at python.org Thu May 14 23:54:00 2009 From: python-checkins at python.org (antoine.pitrou) Date: Thu, 14 May 2009 23:54:00 +0200 (CEST) Subject: [Python-checkins] r72648 - in python/branches/py3k: Misc/NEWS Modules/parsermodule.c Message-ID: <20090514215400.CF953D366@mail.python.org> Author: antoine.pitrou Date: Thu May 14 23:54:00 2009 New Revision: 72648 Log: Merged revisions 72645 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72645 | antoine.pitrou | 2009-05-14 23:48:09 +0200 (jeu., 14 mai 2009) | 6 lines Issue #5918: Fix a crash in the parser module. Patch by Amaury. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/parsermodule.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu May 14 23:54:00 2009 @@ -23,6 +23,8 @@ Library ------- +- Issue #5918: Fix a crash in the parser module. + - Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr. - Issue #5006: Better handling of unicode byte-order marks (BOM) in the io Modified: python/branches/py3k/Modules/parsermodule.c ============================================================================== --- python/branches/py3k/Modules/parsermodule.c (original) +++ python/branches/py3k/Modules/parsermodule.c Thu May 14 23:54:00 2009 @@ -1943,14 +1943,14 @@ return (res); } /* try/except statement: skip past except_clause sections */ - while (res && (TYPE(CHILD(tree, pos)) == except_clause)) { + while (res && pos < nch && (TYPE(CHILD(tree, pos)) == except_clause)) { res = (validate_except_clause(CHILD(tree, pos)) && validate_colon(CHILD(tree, pos + 1)) && validate_suite(CHILD(tree, pos + 2))); pos += 3; } /* skip else clause */ - if (res && (TYPE(CHILD(tree, pos)) == NAME) && + if (res && pos < nch && (TYPE(CHILD(tree, pos)) == NAME) && (strcmp(STR(CHILD(tree, pos)), "else") == 0)) { res = (validate_colon(CHILD(tree, pos + 1)) && validate_suite(CHILD(tree, pos + 2))); From python-checkins at python.org Fri May 15 00:01:31 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 15 May 2009 00:01:31 +0200 (CEST) Subject: [Python-checkins] r72649 - in python/branches/py3k: Lib/test/test_io.py Modules/_io/textio.c Message-ID: <20090514220131.5ABA4D50E@mail.python.org> Author: benjamin.peterson Date: Fri May 15 00:01:31 2009 New Revision: 72649 Log: correctly handle invalid operations on streams (like writing on a non-writable one) Modified: python/branches/py3k/Lib/test/test_io.py python/branches/py3k/Modules/_io/textio.c Modified: python/branches/py3k/Lib/test/test_io.py ============================================================================== --- python/branches/py3k/Lib/test/test_io.py (original) +++ python/branches/py3k/Lib/test/test_io.py Fri May 15 00:01:31 2009 @@ -290,6 +290,19 @@ self.assertEqual(f.seek(-1, 2), self.LARGE) self.assertEqual(f.read(2), b"x") + def test_invalid_operations(self): + # Try writing on a file opened in read mode and vice-versa. + for mode in ("w", "wb"): + with open(support.TESTFN, mode) as fp: + self.assertRaises(IOError, fp.read) + self.assertRaises(IOError, fp.readline) + with open(support.TESTFN, "rb") as fp: + self.assertRaises(IOError, fp.write, b"blah") + self.assertRaises(IOError, fp.writelines, [b"blah\n"]) + with open(support.TESTFN, "r") as fp: + self.assertRaises(IOError, fp.write, "blah") + self.assertRaises(IOError, fp.writelines, ["blah\n"]) + def test_raw_file_io(self): with self.open(support.TESTFN, "wb", buffering=0) as f: self.assertEqual(f.readable(), False) Modified: python/branches/py3k/Modules/_io/textio.c ============================================================================== --- python/branches/py3k/Modules/_io/textio.c (original) +++ python/branches/py3k/Modules/_io/textio.c Fri May 15 00:01:31 2009 @@ -1228,6 +1228,11 @@ CHECK_CLOSED(self); + if (self->encoder == NULL) { + PyErr_SetString(PyExc_IOError, "not writable"); + return NULL; + } + Py_INCREF(text); textlen = PyUnicode_GetSize(text); @@ -1363,7 +1368,7 @@ */ if (self->decoder == NULL) { - PyErr_SetString(PyExc_ValueError, "no decoder"); + PyErr_SetString(PyExc_IOError, "not readable"); return -1; } From python-checkins at python.org Fri May 15 00:03:08 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 15 May 2009 00:03:08 +0200 (CEST) Subject: [Python-checkins] r72650 - peps/trunk/pep-0376.txt Message-ID: <20090514220308.E2E5DD400@mail.python.org> Author: tarek.ziade Date: Fri May 15 00:03:08 2009 New Revision: 72650 Log: seems too late for 3.2 Modified: peps/trunk/pep-0376.txt Modified: peps/trunk/pep-0376.txt ============================================================================== --- peps/trunk/pep-0376.txt (original) +++ peps/trunk/pep-0376.txt Fri May 15 00:03:08 2009 @@ -7,7 +7,7 @@ Type: Standards Track Content-Type: text/x-rst Created: 22-Feb-2009 -Python-Version: 2.7, 3.1 +Python-Version: 2.7, 3.2 Post-History: From python-checkins at python.org Fri May 15 00:07:21 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 15 May 2009 00:07:21 +0200 (CEST) Subject: [Python-checkins] r72651 - peps/trunk/pep-0376.txt Message-ID: <20090514220721.E7420D351@mail.python.org> Author: tarek.ziade Date: Fri May 15 00:07:21 2009 New Revision: 72651 Log: typo Modified: peps/trunk/pep-0376.txt Modified: peps/trunk/pep-0376.txt ============================================================================== --- peps/trunk/pep-0376.txt (original) +++ peps/trunk/pep-0376.txt Fri May 15 00:07:21 2009 @@ -33,7 +33,7 @@ There are two problems right now in the way projects are installed in Python: - There are too many ways to install a project in Python. -- There is no API to get the metadata of installed packages. +- There is no API to get the metadata of installed projects. How projects are installed -------------------------- From python-checkins at python.org Fri May 15 00:09:00 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 15 May 2009 00:09:00 +0200 (CEST) Subject: [Python-checkins] r72652 - peps/trunk/pep-0376.txt Message-ID: <20090514220900.176ADD5E8@mail.python.org> Author: tarek.ziade Date: Fri May 15 00:08:59 2009 New Revision: 72652 Log: typo Modified: peps/trunk/pep-0376.txt Modified: peps/trunk/pep-0376.txt ============================================================================== --- peps/trunk/pep-0376.txt (original) +++ peps/trunk/pep-0376.txt Fri May 15 00:08:59 2009 @@ -45,7 +45,7 @@ The `install_egg_info` subcommand is called during this process, in order to create an `.egg-info` file in the `site-packages` directory. -For example, if the `zlib` project (which contains one package), is installed +For example, if the `zlib` project (which contains one package) is installed, two elements will be installed in `site-packages`:: - zlib From nnorwitz at gmail.com Fri May 15 00:15:05 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 14 May 2009 18:15:05 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (2) Message-ID: <20090514221505.GA4158@python.psfb.org> More important issues: ---------------------- test_hashlib leaked [0, 0, -2] references, sum=-2 test_ssl leaked [-403, 403, 322] references, sum=322 Less important issues: ---------------------- test_cmd_line leaked [0, -25, 25] references, sum=0 test_docxmlrpc leaked [0, 33, -36] references, sum=-3 test_smtplib leaked [0, 88, -88] references, sum=0 test_sys leaked [-21, 0, 42] references, sum=21 test_threading leaked [48, 48, 48] references, sum=144 test_threadsignals leaked [0, 0, -8] references, sum=-8 test_urllib2_localnet leaked [3, 285, 4] references, sum=292 test_xmlrpc leaked [0, 0, -4] references, sum=-4 From python-checkins at python.org Fri May 15 00:19:46 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 15 May 2009 00:19:46 +0200 (CEST) Subject: [Python-checkins] r72653 - peps/trunk/pep-0376.txt Message-ID: <20090514221946.55617D65D@mail.python.org> Author: tarek.ziade Date: Fri May 15 00:19:41 2009 New Revision: 72653 Log: adding a note on backport Modified: peps/trunk/pep-0376.txt Modified: peps/trunk/pep-0376.txt ============================================================================== --- peps/trunk/pep-0376.txt (original) +++ peps/trunk/pep-0376.txt Fri May 15 00:19:41 2009 @@ -243,6 +243,9 @@ These changes will not introduce any compatibility problems with the previous version of Distutils, and will also work with existing third-party tools. +Although, a backport of the new Distutils for 2.5, 2.6, 3.0 and 3.1 will be +provided so people can benefit from the new features. + The plan is to integrate them for Python 2.7 and Python 3.2 Aknowledgments From buildbot at python.org Fri May 15 00:27:33 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 14 May 2009 22:27:33 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090514222733.171A3D371@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/689 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou,r.david.murray,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Fri May 15 00:37:49 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 15 May 2009 00:37:49 +0200 (CEST) Subject: [Python-checkins] r72654 - python/trunk/Lib/test/test_hashlib.py Message-ID: <20090514223749.3DC7AD25C@mail.python.org> Author: benjamin.peterson Date: Fri May 15 00:37:49 2009 New Revision: 72654 Log: prevent refleaks from threads Modified: python/trunk/Lib/test/test_hashlib.py Modified: python/trunk/Lib/test/test_hashlib.py ============================================================================== --- python/trunk/Lib/test/test_hashlib.py (original) +++ python/trunk/Lib/test/test_hashlib.py Fri May 15 00:37:49 2009 @@ -256,7 +256,11 @@ def test_main(): - test_support.run_unittest(HashLibTestCase) + key = test_support.threading_setup() + try: + test_support.run_unittest(HashLibTestCase) + finally: + test_support.threading_cleanup(*key) if __name__ == "__main__": From python-checkins at python.org Fri May 15 00:40:34 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 15 May 2009 00:40:34 +0200 (CEST) Subject: [Python-checkins] r72655 - in python/trunk/Lib/test: test_hashlib.py test_support.py Message-ID: <20090514224034.EE41AD57D@mail.python.org> Author: benjamin.peterson Date: Fri May 15 00:40:34 2009 New Revision: 72655 Log: a useful decorator for cleaning up threads Modified: python/trunk/Lib/test/test_hashlib.py python/trunk/Lib/test/test_support.py Modified: python/trunk/Lib/test/test_hashlib.py ============================================================================== --- python/trunk/Lib/test/test_hashlib.py (original) +++ python/trunk/Lib/test/test_hashlib.py Fri May 15 00:40:34 2009 @@ -254,14 +254,9 @@ self.assertEqual(expected_hash, hasher.hexdigest()) - + at test_support.reap_threads def test_main(): - key = test_support.threading_setup() - try: - test_support.run_unittest(HashLibTestCase) - finally: - test_support.threading_cleanup(*key) - + test_support.run_unittest(HashLibTestCase) if __name__ == "__main__": test_main() Modified: python/trunk/Lib/test/test_support.py ============================================================================== --- python/trunk/Lib/test/test_support.py (original) +++ python/trunk/Lib/test/test_support.py Fri May 15 00:40:34 2009 @@ -5,6 +5,7 @@ import contextlib import errno +import functools import socket import sys import os @@ -934,6 +935,16 @@ count += 1 time.sleep(0.1) +def reap_threads(func): + @functools.wraps(func) + def decorator(*args): + key = threading_setup() + try: + return func(*args) + finally: + threading_cleanup(*key) + return decorator + def reap_children(): """Use this function at the end of test_main() whenever sub-processes are started. This will help ensure that no extra children (zombies) From python-checkins at python.org Fri May 15 00:48:19 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 15 May 2009 00:48:19 +0200 (CEST) Subject: [Python-checkins] r72656 - python/branches/py3k/Doc/whatsnew/3.1.rst Message-ID: <20090514224819.71435D379@mail.python.org> Author: raymond.hettinger Date: Fri May 15 00:48:19 2009 New Revision: 72656 Log: Update whatsnew for NEWS entries through May 5th. Modified: python/branches/py3k/Doc/whatsnew/3.1.rst Modified: python/branches/py3k/Doc/whatsnew/3.1.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/3.1.rst (original) +++ python/branches/py3k/Doc/whatsnew/3.1.rst Fri May 15 00:48:19 2009 @@ -94,10 +94,13 @@ '1,234,567' >>> format(1234567.89, ',.2f') '1,234,567.89' + >>> format(12345.6 + 8901234.12j, ',f') + '12,345.600000+8,901,234.120000j' >>> format(Decimal('1234567.89'), ',f') '1,234,567.89' -The supported types are :class:`int`, :class:`float` and :class:`decimal.Decimal`. +The supported types are :class:`int`, :class:`float`, :class:`complex` +and :class:`decimal.Decimal`. Discussions are underway about how to specify alternative separators like dots, spaces, apostrophes, or underscores. Locale-aware applications @@ -397,11 +400,16 @@ (Contributed by Antoine Pitrou and Amaury Forgeot d'Arc, :issue:`4868`.) * The :mod:`json` module is getting a C extension to substantially improve - its performance. The code is expected to be added in-time for the beta - release. - - (Contributed by Bob Ippolito and converted to Py3.1 by Antoine Pitrou; - :issue:`4136`.) + its performance. In addition, the API was modified so that json works + only with :class:`str`, not with :class:`bytes`. That change makes the + module more closely conform to the `JSON specification `_ + which is defined in terms of Unicode. + (Contributed by Bob Ippolito and converted to Py3.1 by Antoine Pitrou + and Benjamin Peterson; :issue:`4136`.) + +* Unpickling now interns the attribute names of pickled objects. This saves + memory and allows pickles to be smaller. + (Contributed by Jake McGuire and Antoine Pitrou; :issue:`5084`.) Build and C API Changes ======================= From python-checkins at python.org Fri May 15 01:31:04 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 15 May 2009 01:31:04 +0200 (CEST) Subject: [Python-checkins] r72659 - python/branches/py3k/Doc/whatsnew/3.1.rst Message-ID: <20090514233104.7CEA4D401@mail.python.org> Author: benjamin.peterson Date: Fri May 15 01:31:04 2009 New Revision: 72659 Log: this statement is actually true Modified: python/branches/py3k/Doc/whatsnew/3.1.rst Modified: python/branches/py3k/Doc/whatsnew/3.1.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/3.1.rst (original) +++ python/branches/py3k/Doc/whatsnew/3.1.rst Fri May 15 01:31:04 2009 @@ -454,9 +454,7 @@ for passing typing safety information and a less complicated signature for calling a destructor. - The old type had a problematic API and is now deprecated. To ease - transitioning code, the new type was implemented as a subtype of - :ctype:`PyCObject` API. + The old type had a problematic API and is now deprecated. (Contributed by Larry Hastings; :issue:`5630`.) From python-checkins at python.org Fri May 15 01:32:33 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 15 May 2009 01:32:33 +0200 (CEST) Subject: [Python-checkins] r72659 - svn:log Message-ID: <20090514233233.41CA5DACD@mail.python.org> Author: benjamin.peterson Revision: 72659 Property Name: svn:log Action: modified Property diff: --- old property value +++ new property value @@ -1 +1 @@ -this statement is actually true \ No newline at end of file +this statement isn't actually true \ No newline at end of file From buildbot at python.org Fri May 15 01:48:33 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 14 May 2009 23:48:33 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090514234833.A427BD596@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/624 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou,benjamin.peterson,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri May 15 01:56:33 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 14 May 2009 23:56:33 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090514235633.9A847D4EC@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/519 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox ====================================================================== FAIL: test_len (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_mailbox.py", line 267, in test_len self.assert_(len(self._box) == i + 1) AssertionError: False is not True make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri May 15 02:07:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 15 May 2009 00:07:04 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090515000704.3524AD597@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%202.6/builds/342 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Fri May 15 03:20:22 2009 From: python-checkins at python.org (collin.winter) Date: Fri, 15 May 2009 03:20:22 +0200 (CEST) Subject: [Python-checkins] r72660 - in python/branches/py3k: Lib/test/regrtest.py Message-ID: <20090515012022.0D7DAD360@mail.python.org> Author: collin.winter Date: Fri May 15 03:20:21 2009 New Revision: 72660 Log: Merged revisions 72658 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72658 | collin.winter | 2009-05-14 16:26:30 -0700 (Thu, 14 May 2009) | 1 line Issue 6024: make regrtest.py promote refleaks to test failures. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/regrtest.py Modified: python/branches/py3k/Lib/test/regrtest.py ============================================================================== --- python/branches/py3k/Lib/test/regrtest.py (original) +++ python/branches/py3k/Lib/test/regrtest.py Fri May 15 03:20:21 2009 @@ -598,6 +598,7 @@ else: cfp = io.StringIO() # XXX Should use io.StringIO() + refleak = False # True if the test leaked references. try: save_stdout = sys.stdout try: @@ -619,7 +620,7 @@ if indirect_test is not None: indirect_test() if huntrleaks: - dash_R(the_module, test, indirect_test, huntrleaks) + refleak = dash_R(the_module, test, indirect_test, huntrleaks) test_time = time.time() - start_time test_times.append((test_time, test)) finally: @@ -649,6 +650,8 @@ sys.stdout.flush() return 0 else: + if refleak: + return 0 if not cfp: return 1 output = cfp.getvalue() @@ -698,6 +701,11 @@ "removed: %s" % (testname, kind, name, msg)), file=sys.stderr) def dash_R(the_module, test, indirect_test, huntrleaks): + """Run a test multiple times, looking for reference leaks. + + Returns: + False if the test didn't leak references; True if we detected refleaks. + """ # This code is hackish and inelegant, but it seems to do the job. import copyreg, _abcoll @@ -745,6 +753,8 @@ refrep = open(fname, "a") print(msg, file=refrep) refrep.close() + return True + return False def dash_R_cleanup(fs, ps, pic, abcs): import gc, copyreg From buildbot at python.org Fri May 15 06:21:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 15 May 2009 04:21:39 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090515042139.4EB27C401@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/691 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,collin.winter,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_coding test_import test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Fri May 15 09:21:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 15 May 2009 07:21:06 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090515072106.E255ED5CE@mail.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/573 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou,benjamin.peterson,raymond.hettinger,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 533, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' 1 test failed: test_import ====================================================================== ERROR: testImport (test.test_import.ImportTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 61, in test_with_extension mod = __import__(TESTFN) ImportError: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 533, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 533, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' sincerely, -The Buildbot From python-checkins at python.org Fri May 15 10:03:04 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 15 May 2009 10:03:04 +0200 (CEST) Subject: [Python-checkins] r72661 - python/trunk/Doc/library/ctypes.rst Message-ID: <20090515080304.25395D3F4@mail.python.org> Author: georg.brandl Date: Fri May 15 10:03:03 2009 New Revision: 72661 Log: Fix example output for doctest-like demos. Modified: python/trunk/Doc/library/ctypes.rst Modified: python/trunk/Doc/library/ctypes.rst ============================================================================== --- python/trunk/Doc/library/ctypes.rst (original) +++ python/trunk/Doc/library/ctypes.rst Fri May 15 10:03:03 2009 @@ -341,9 +341,9 @@ >>> printf("Hello, %s\n", "World!") Hello, World! 14 - >>> printf("Hello, %S", u"World!") + >>> printf("Hello, %S\n", u"World!") Hello, World! - 13 + 14 >>> printf("%d bottles of beer\n", 42) 42 bottles of beer 19 @@ -358,7 +358,7 @@ that they can be converted to the required C data type:: >>> printf("An int %d, a double %f\n", 1234, c_double(3.14)) - Integer 1234, double 3.1400001049 + An int 1234, a double 3.140000 31 >>> @@ -414,9 +414,9 @@ Traceback (most recent call last): File "", line 1, in ? ArgumentError: argument 2: exceptions.TypeError: wrong type - >>> printf("%s %d %f", "X", 2, 3) - X 2 3.00000012 - 12 + >>> printf("%s %d %f\n", "X", 2, 3) + X 2 3.000000 + 13 >>> If you have defined your own classes which you pass to function calls, you have From python-checkins at python.org Fri May 15 13:50:29 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 15 May 2009 13:50:29 +0200 (CEST) Subject: [Python-checkins] r72662 - in python/trunk: Lib/imaplib.py Misc/NEWS Message-ID: <20090515115029.678E8C400@mail.python.org> Author: antoine.pitrou Date: Fri May 15 13:50:29 2009 New Revision: 72662 Log: Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr. Modified: python/trunk/Lib/imaplib.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/imaplib.py ============================================================================== --- python/trunk/Lib/imaplib.py (original) +++ python/trunk/Lib/imaplib.py Fri May 15 13:50:29 2009 @@ -226,8 +226,7 @@ """ self.host = host self.port = port - self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.sock.connect((host, port)) + self.sock = socket.create_connection((host, port)) self.file = self.sock.makefile('rb') @@ -1145,8 +1144,7 @@ """ self.host = host self.port = port - self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.sock.connect((host, port)) + self.sock = socket.create_connection((host, port)) self.sslobj = ssl.wrap_socket(self.sock, self.keyfile, self.certfile) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri May 15 13:50:29 2009 @@ -293,6 +293,8 @@ Library ------- +- Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr. + - Issue #5918: Fix a crash in the parser module. - Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr. From python-checkins at python.org Fri May 15 14:03:59 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 15 May 2009 14:03:59 +0200 (CEST) Subject: [Python-checkins] r72663 - in python/branches/release26-maint: Lib/imaplib.py Misc/NEWS Message-ID: <20090515120359.6B103D5CE@mail.python.org> Author: antoine.pitrou Date: Fri May 15 14:03:56 2009 New Revision: 72663 Log: Merged revisions 72662 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72662 | antoine.pitrou | 2009-05-15 13:50:29 +0200 (ven., 15 mai 2009) | 3 lines Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/imaplib.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/imaplib.py ============================================================================== --- python/branches/release26-maint/Lib/imaplib.py (original) +++ python/branches/release26-maint/Lib/imaplib.py Fri May 15 14:03:56 2009 @@ -226,8 +226,7 @@ """ self.host = host self.port = port - self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.sock.connect((host, port)) + self.sock = socket.create_connection((host, port)) self.file = self.sock.makefile('rb') @@ -1145,8 +1144,7 @@ """ self.host = host self.port = port - self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - self.sock.connect((host, port)) + self.sock = socket.create_connection((host, port)) self.sslobj = ssl.wrap_socket(self.sock, self.keyfile, self.certfile) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Fri May 15 14:03:56 2009 @@ -47,6 +47,8 @@ Library ------- +- Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr. + - Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr. - Issue #5971: StreamHandler.handleError now swallows IOErrors which occur when From python-checkins at python.org Fri May 15 14:15:51 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 15 May 2009 14:15:51 +0200 (CEST) Subject: [Python-checkins] r72664 - in python/branches/py3k: Lib/imaplib.py Misc/NEWS Message-ID: <20090515121551.AC74FD5BC@mail.python.org> Author: antoine.pitrou Date: Fri May 15 14:15:51 2009 New Revision: 72664 Log: Merged revisions 72662 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72662 | antoine.pitrou | 2009-05-15 13:50:29 +0200 (ven., 15 mai 2009) | 3 lines Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/imaplib.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/imaplib.py ============================================================================== --- python/branches/py3k/Lib/imaplib.py (original) +++ python/branches/py3k/Lib/imaplib.py Fri May 15 14:15:51 2009 @@ -222,9 +222,7 @@ def _create_socket(self): - sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - sock.connect((self.host, self.port)) - return sock + return socket.create_connection((self.host, self.port)) def open(self, host = '', port = IMAP4_PORT): """Setup connection to remote server on "host:port" Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri May 15 14:15:51 2009 @@ -23,6 +23,8 @@ Library ------- +- Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr. + - Issue #5918: Fix a crash in the parser module. - Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr. From solipsis at pitrou.net Fri May 15 15:13:22 2009 From: solipsis at pitrou.net (Antoine Pitrou) Date: Fri, 15 May 2009 13:13:22 +0000 (UTC) Subject: [Python-checkins] =?utf-8?q?r72655_-_in_python/trunk/Lib/test=3A?= =?utf-8?q?=09test=5Fhashlib=2Epytest=5Fsupport=2Epy?= References: <20090514224034.EE41AD57D@mail.python.org> Message-ID: writes: > > Log: > a useful decorator for cleaning up threads Calling this decorator should probably be generalized for rekleak runs (-R), in order to make the total reference count more deterministic. cheers Antoine. From python-checkins at python.org Fri May 15 16:55:32 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 15 May 2009 16:55:32 +0200 (CEST) Subject: [Python-checkins] r72665 - python/branches/py3k/Lib/ipaddr.py Message-ID: <20090515145532.539E0D8D4@mail.python.org> Author: raymond.hettinger Date: Fri May 15 16:55:32 2009 New Revision: 72665 Log: Simplified the header after discussion with Gregory Smith. Modified: python/branches/py3k/Lib/ipaddr.py Modified: python/branches/py3k/Lib/ipaddr.py ============================================================================== --- python/branches/py3k/Lib/ipaddr.py (original) +++ python/branches/py3k/Lib/ipaddr.py Fri May 15 16:55:32 2009 @@ -1,18 +1,5 @@ # Copyright 2007 Google Inc. # Licensed to PSF under a Contributor Agreement. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. See the License for the specific language governing -# permissions and limitations under the License. -# # See also: http://code.google.com/p/ipaddr-py/ """An IPv4/IPv6 manipulation library in Python. From python-checkins at python.org Fri May 15 16:57:35 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 15 May 2009 16:57:35 +0200 (CEST) Subject: [Python-checkins] r72666 - python/branches/py3k/Doc/whatsnew/3.1.rst Message-ID: <20090515145735.D15E7D36D@mail.python.org> Author: raymond.hettinger Date: Fri May 15 16:57:35 2009 New Revision: 72666 Log: Update whatsnew for imaplib changes. Move importlib work to end of section. Modified: python/branches/py3k/Doc/whatsnew/3.1.rst Modified: python/branches/py3k/Doc/whatsnew/3.1.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/3.1.rst (original) +++ python/branches/py3k/Doc/whatsnew/3.1.rst Fri May 15 16:57:35 2009 @@ -349,23 +349,23 @@ (Contributed by Ross Light; :issue:`4285`.) -* A new module, :mod:`importlib` was added. It provides a complete, portable, - pure Python reference implementation of the :keyword:`import` statement and its - counterpart, the :func:`__import__` function. It represents a substantial - step forward in documenting and defining the actions that take place during - imports. - - (Contributed by Brett Cannon.) - * A new module, :mod:`ipaddr` has been added to the standard library. It provides classes to represent, verify and manipulate IPv4 and IPv6 host and network addresses. (Contributed by Google, :issue:`3959`.) -* The :mod:`nntplib` module now supports IPv6. +* The :mod:`nntplib` :mod:`imaplib` modules now support IPv6. - (Contributed by Derek Morr; :issue:`1664`.) + (Contributed by Derek Morr; :issue:`1655` and :issue:`1664`.) + +* A new module, :mod:`importlib` was added. It provides a complete, portable, + pure Python reference implementation of the :keyword:`import` statement and its + counterpart, the :func:`__import__` function. It represents a substantial + step forward in documenting and defining the actions that take place during + imports. + + (Contributed by Brett Cannon.) Optimizations ============= @@ -407,11 +407,13 @@ only with :class:`str`, not with :class:`bytes`. That change makes the module more closely conform to the `JSON specification `_ which is defined in terms of Unicode. + (Contributed by Bob Ippolito and converted to Py3.1 by Antoine Pitrou and Benjamin Peterson; :issue:`4136`.) * Unpickling now interns the attribute names of pickled objects. This saves memory and allows pickles to be smaller. + (Contributed by Jake McGuire and Antoine Pitrou; :issue:`5084`.) Build and C API Changes @@ -452,9 +454,8 @@ * Added :ctype:`PyCapsule` as a replacement for the :ctype:`PyCObject` API. The principal difference is that the new type has a well defined interface for passing typing safety information and a less complicated signature - for calling a destructor. - - The old type had a problematic API and is now deprecated. + for calling a destructor. The old type had a problematic API and is now + deprecated. (Contributed by Larry Hastings; :issue:`5630`.) From goodger at python.org Fri May 15 17:15:36 2009 From: goodger at python.org (David Goodger) Date: Fri, 15 May 2009 11:15:36 -0400 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: <20090511125003.BF2F31E4012@bag.python.org> References: <20090511125003.BF2F31E4012@bag.python.org> Message-ID: <4A0D8718.1090704@python.org> [dirkjan.ochtman - 2009-05-11 08:50] > Author: dirkjan.ochtman > Date: Mon May 11 14:50:03 2009 > New Revision: 72563 > > Log: > Remove DVCS comparison from PEP 374 and talk about hg migration instead. > > Modified: > peps/trunk/pep-0374.txt > > Modified: peps/trunk/pep-0374.txt > ============================================================================== > --- peps/trunk/pep-0374.txt (original) > +++ peps/trunk/pep-0374.txt Mon May 11 14:50:03 2009 > @@ -1,11 +1,9 @@ > PEP: 374 > -Title: Migrating from svn to a distributed VCS > +Title: Migrating from svn to Mercurial > Version: $Revision$ > Last-Modified: $Date$ > Author: Brett Cannon , > - Stephen J. Turnbull , > - Alexandre Vassalotti , > - Barry Warsaw > + Dirkjan Ochtman Dirkjan, I appreciate the desire to go forward with the transition, and I applaud your initiative, but this is not the way to do it. A new PEP is appropriate here. Please revert revision 72563 and create a new PEP. There are three warning bells ringing loudly here: 1. The PEP title was changed. 2. The authors were changed. This is, IMO, incredibly rude. 3. Huge swaths of the existing PEP were ripped out. Effectively a complete rewrite. This feels like revising history. This is the wrong way to proceed. The existing PEP 374 should be left as-is (i.e. as-was in revision 70848), with the addition of details of the choice. Then mark PEP 374 as Accepted, and leave it as a historical document. Moving the text documenting the decision-making process to a wiki page is not sufficient; it makes that text second-class and ignorable. The great value of PEP 374 going forward is as a historical document. We have no shortage of PEP numbers. There is no need to recycle this PEP number, and strong reasons not to. I have not been active in PEP editing lately, so I won't impose my opinion unilaterally. PEP editors, what do you think? -- David Goodger From python-checkins at python.org Fri May 15 17:21:33 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 15 May 2009 17:21:33 +0200 (CEST) Subject: [Python-checkins] r72667 - python/branches/py3k/Doc/whatsnew/3.1.rst Message-ID: <20090515152133.8393CD7F4@mail.python.org> Author: raymond.hettinger Date: Fri May 15 17:21:33 2009 New Revision: 72667 Log: Add examples for ipaddr. Modified: python/branches/py3k/Doc/whatsnew/3.1.rst Modified: python/branches/py3k/Doc/whatsnew/3.1.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/3.1.rst (original) +++ python/branches/py3k/Doc/whatsnew/3.1.rst Fri May 15 17:21:33 2009 @@ -353,9 +353,40 @@ It provides classes to represent, verify and manipulate IPv4 and IPv6 host and network addresses. + The :func:`ipaddr.IP` factory function creates an address object from + a string or integer representing the IP or the IP and prefix/netmask. + The objects provide a number of attributes for direct access to + components of the full address:: + + >>> addr = IP('2001:658:22A:CAFE:200::1/64') + >>> for attr in ['ip', 'ip_ext', 'ip_ext_full', 'network', 'network_ext', + ... 'hostmask', 'hostmask_ext', 'broadcast', 'broadcast_ext', + ... 'netmask', 'netmask_ext', 'prefixlen']: + ... print(attr, '=', getattr(addr, attr)) + ... + ip = 42540616829182469433547762482097946625 + ip_ext = 2001:658:22a:cafe:200::1 + ip_ext_full = 2001:0658:022a:cafe:0200:0000:0000:0001 + network = 42540616829182469433403647294022090752 + network_ext = 2001:658:22a:cafe:: + hostmask = 18446744073709551615 + hostmask_ext = ::ffff:ffff:ffff:ffff + broadcast = 42540616829182469451850391367731642367 + broadcast_ext = 2001:658:22a:cafe:ffff:ffff:ffff:ffff + netmask = 340282366920938463444927863358058659840 + netmask_ext = 64 + prefixlen = 64 + + Each address object supports a number of simple properties including: + ``is_private``, ``is_multicast``, ``is_loopback``, and ``is_link_local``. + + Additionally, the address objects provide a sort order for IP addresses, + support for address ranges (stored as lists of addresses), and subnet + computations. + (Contributed by Google, :issue:`3959`.) -* The :mod:`nntplib` :mod:`imaplib` modules now support IPv6. +* The :mod:`nntplib` and :mod:`imaplib` modules now support IPv6. (Contributed by Derek Morr; :issue:`1655` and :issue:`1664`.) From dirkjan at ochtman.nl Fri May 15 17:22:07 2009 From: dirkjan at ochtman.nl (Dirkjan Ochtman) Date: Fri, 15 May 2009 17:22:07 +0200 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: <4A0D8718.1090704@python.org> References: <20090511125003.BF2F31E4012@bag.python.org> <4A0D8718.1090704@python.org> Message-ID: On Fri, May 15, 2009 at 5:15 PM, David Goodger wrote: > Dirkjan, I appreciate the desire to go forward with the transition, and I > applaud your initiative, but this is not the way to do it. ?A new PEP is > appropriate here. ?Please revert revision 72563 and create a new PEP. > > There are three warning bells ringing loudly here: > > 1. The PEP title was changed. > > 2. The authors were changed. ?This is, IMO, incredibly rude. > > 3. Huge swaths of the existing PEP were ripped out. ?Effectively a complete > rewrite. ?This feels like revising history. David, Thanks for letting me know about your thinking on this. I'd like to state that Martin v. Lowis proposed this as a good way forward (updating the current PEP). I know that changing the authors seems a bit strong, but all of their work has been removed from the PEP and moved to a separate wiki page, which the current version of the PEP clearly points to. The PEP, along with the contents of the wiki page, still clearly show who the authors of that work were. So I don't feel I've misrepresented the work that was done, though I'd be happy to restore the authors and/or the PEP contents if that's deemed more appropriate. I just followed the path that Martin recommended (since I don't know enough about PEP processes to have a strong opinion on this). It also might be actually useful if the comparison page can be easily updated by a broader community, so that it will stay a valuable guide to all the projects looking to switch sometime soon. Cheers, Dirkjan From buildbot at python.org Fri May 15 17:41:44 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 15 May 2009 15:41:44 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090515154144.A408DD6F9@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/693 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From goodger at python.org Fri May 15 17:58:14 2009 From: goodger at python.org (David Goodger) Date: Fri, 15 May 2009 11:58:14 -0400 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: References: <20090511125003.BF2F31E4012@bag.python.org> <4A0D8718.1090704@python.org> Message-ID: <4335d2c40905150858k18de2626x287c1b20d6b5e100@mail.gmail.com> On Fri, May 15, 2009 at 11:22, Dirkjan Ochtman wrote: > Thanks for letting me know about your thinking on this. > > I'd like to state that Martin v. Lowis proposed this as a good way > forward (updating the current PEP). In this matter, I disagree with Martin. The original objective of PEP 374 *has* been achieved: a DVCS was chosen. PEP 374 should continue to document that process. The transition details should be *added* to the record, not replace it. BTW, I can't find anything prior to Martin's reply to this thread, but your message implies there was something before revision 72563. Do you have a reference? Have you seen the other replies to this thread? Others agree that this revision should be reverted. Question for you: what harm would there be in reverting revision 72563 and creating a new PEP? > I know that changing the authors > seems a bit strong, but all of their work has been removed from the > PEP and moved to a separate wiki page, which the current version of > the PEP clearly points to. The PEP, along with the contents of the > wiki page, still clearly show who the authors of that work were. So I > don't feel I've misrepresented the work that was done, I don't think you've intentionally misrepresented anything or anyone. Your intentions seem good. It's just the execution that needs fixing. > though I'd be > happy to restore the authors and/or the PEP contents if that's deemed > more appropriate. Good, thanks. I will leave that decision to the other PEP editors. > I just followed the path that Martin recommended > (since I don't know enough about PEP processes to have a strong > opinion on this). >From PEP 1, PEP Purpose and Guidelines (http://www.python.org/dev/peps/pep-0001/ -- which I recommend you read): """ We intend PEPs to be the primary mechanisms for proposing new features, for collecting community input on an issue, and for documenting the design decisions that have gone into Python. """ This is clearly a case of documenting a decision. For future reference, questions about PEP process is what the PEP editors are for. > It also might be actually useful if the comparison page can be easily > updated by a broader community, so that it will stay a valuable guide > to all the projects looking to switch sometime soon. Perhaps, but that's secondary to our purposes (and can happen in parallel). Having a reliable & accessible historical document is important here. The wiki page can be changed over time, and would no longer record the thinking and data behind Python's DVCS decision. One would have to delve into the page history, which is a pain -- and won't show up in web searches. -- David Goodger From barry at python.org Fri May 15 18:06:16 2009 From: barry at python.org (Barry Warsaw) Date: Fri, 15 May 2009 12:06:16 -0400 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: <4A0D8718.1090704@python.org> References: <20090511125003.BF2F31E4012@bag.python.org> <4A0D8718.1090704@python.org> Message-ID: <5186F670-1D97-4AD5-BF8C-497A59958518@python.org> On May 15, 2009, at 11:15 AM, David Goodger wrote: > I have not been active in PEP editing lately, so I won't impose my > opinion > unilaterally. PEP editors, what do you think? I completely agree. BTW, if you need more backup for PEP editing, I can help, though not for the next two weeks. -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 832 bytes Desc: This is a digitally signed message part URL: From barry at python.org Fri May 15 18:08:37 2009 From: barry at python.org (Barry Warsaw) Date: Fri, 15 May 2009 12:08:37 -0400 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: <4335d2c40905150858k18de2626x287c1b20d6b5e100@mail.gmail.com> References: <20090511125003.BF2F31E4012@bag.python.org> <4A0D8718.1090704@python.org> <4335d2c40905150858k18de2626x287c1b20d6b5e100@mail.gmail.com> Message-ID: <3DA57E84-628C-46D3-A2D8-F61015AD37D1@python.org> On May 15, 2009, at 11:58 AM, David Goodger wrote: > Question for you: what harm would there be in reverting revision 72563 > and creating a new PEP? There should be none. Dirkjan, please do revert this change and claim a new PEP number for the migration plan. -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 832 bytes Desc: This is a digitally signed message part URL: From dirkjan at ochtman.nl Fri May 15 18:14:32 2009 From: dirkjan at ochtman.nl (Dirkjan Ochtman) Date: Fri, 15 May 2009 18:14:32 +0200 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: <4335d2c40905150858k18de2626x287c1b20d6b5e100@mail.gmail.com> References: <20090511125003.BF2F31E4012@bag.python.org> <4A0D8718.1090704@python.org> <4335d2c40905150858k18de2626x287c1b20d6b5e100@mail.gmail.com> Message-ID: On Fri, May 15, 2009 at 5:58 PM, David Goodger wrote: > In this matter, I disagree with Martin. The original objective of PEP > 374 *has* been achieved: a DVCS was chosen. PEP 374 should continue to > document that process. The transition details should be *added* to the > record, not replace it. Well, I (guided by Martin's interpretation, I guess) interpreted the objective of this PEP according to its former title: "Migration from svn to a distributed VCS". That doesn't imply just chosing the DVCS, it also implies the migration details. In that interpretation, it seems okay to clarify the title according to the new information, namely that we now know to which DVCS Python is migrating. > BTW, I can't find anything prior to Martin's reply to this thread, but > your message implies there was something before revision 72563. Do you > have a reference? This was in the conversation on getting the migration started, see http://mail.python.org/pipermail/python-dev/2009-April/088222.html. > Have you seen the other replies to this thread? Others agree that this > revision should be reverted. I have seen only messages from people who have replied to me explicitly, so I saw the message from Alexandre Vassalotti and Martin's reply to that, then Alexandre's reply again. I didn't see until just now the messages from Georg Brandl and Benjamin Peterson. > Question for you: what harm would there be in reverting revision 72563 > and creating a new PEP? There is no harm in that. > From PEP 1, PEP Purpose and Guidelines > (http://www.python.org/dev/peps/pep-0001/ -- which I recommend you > read): > > """ > We intend PEPs to be the primary mechanisms for proposing new > features, for collecting community input on an issue, and for > documenting the design decisions that have gone into Python. > """ > > This is clearly a case of documenting a decision. > > For future reference, questions about PEP process is what the PEP > editors are for. To be clear, I did read PEP 1. And I was going to ask Barry about committing my PEP change, but I asked Martin for review first, and he mentioned I could commit it myself. I'll revert, and would like toe hereby claim a new PEP number -- can I just start a new one by editing the index and then committing a new file? Cheers, Dirkjan From python-checkins at python.org Fri May 15 18:16:12 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 15 May 2009 18:16:12 +0200 (CEST) Subject: [Python-checkins] r72668 - python/branches/py3k/Doc/whatsnew/3.1.rst Message-ID: <20090515161612.94E7CD91A@mail.python.org> Author: raymond.hettinger Date: Fri May 15 18:16:12 2009 New Revision: 72668 Log: More updates. Modified: python/branches/py3k/Doc/whatsnew/3.1.rst Modified: python/branches/py3k/Doc/whatsnew/3.1.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/3.1.rst (original) +++ python/branches/py3k/Doc/whatsnew/3.1.rst Fri May 15 18:16:12 2009 @@ -147,6 +147,15 @@ (Contributed by Eric Smith; :issue:`5237`.) +* The :func:`string.maketrans` function is deprecated and is replaced by new + static methods, :meth:`bytes.maketrans` and :meth:`bytearray.maketrans`. + This change solves the confusion around which types were supported by the + :mod:`string` module. Now, :class:`str`, :class:`bytes`, and + :class:`bytearray` each have their own **maketrans** and **translate** + methods with intermediate translation tables of the appropriate type. + + (Contributed by Georg Brandl; :issue:`5675`.) + * ``round(x, n)`` now returns an integer if *x* is an integer. Previously it returned a float:: @@ -248,8 +257,8 @@ [2, 3, 5, 7] >>> c = count(start=Fraction(1,2), step=Fraction(1,6)) - >>> next(c), next(c), next(c), next(c) - (Fraction(1, 2), Fraction(2, 3), Fraction(5, 6), Fraction(1, 1)) + >>> [next(c), next(c), next(c), next(c)] + [Fraction(1, 2), Fraction(2, 3), Fraction(5, 6), Fraction(1, 1)] (Contributed by Raymond Hettinger.) @@ -433,10 +442,10 @@ (Contributed by Antoine Pitrou and Amaury Forgeot d'Arc, :issue:`4868`.) -* The :mod:`json` module is getting a C extension to substantially improve +* The :mod:`json` module now has a C extension to substantially improve its performance. In addition, the API was modified so that json works only with :class:`str`, not with :class:`bytes`. That change makes the - module more closely conform to the `JSON specification `_ + module closely match the `JSON specification `_ which is defined in terms of Unicode. (Contributed by Bob Ippolito and converted to Py3.1 by Antoine Pitrou @@ -482,6 +491,11 @@ (Contributed by Mark Dickinson; :issue:`4910`.) +* Added a new :cfunc:`PyOS_string_to_double` function to replace the + deprecated functions :cfunc:`PyOS_ascii_strtod` and :cfunc:`PyOS_ascii_atof`. + + (Contributed by Mark Dickinson; :issue:`5914`.) + * Added :ctype:`PyCapsule` as a replacement for the :ctype:`PyCObject` API. The principal difference is that the new type has a well defined interface for passing typing safety information and a less complicated signature From goodger at python.org Fri May 15 18:26:44 2009 From: goodger at python.org (David Goodger) Date: Fri, 15 May 2009 12:26:44 -0400 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: References: <20090511125003.BF2F31E4012@bag.python.org> <4A0D8718.1090704@python.org> <4335d2c40905150858k18de2626x287c1b20d6b5e100@mail.gmail.com> Message-ID: <4335d2c40905150926n6b4f6c7ch87503cff749646d6@mail.gmail.com> On Fri, May 15, 2009 at 12:14, Dirkjan Ochtman wrote: > Well, I (guided by Martin's interpretation, I guess) interpreted the > objective of this PEP according to its former title: "Migration from > svn to a distributed VCS". That doesn't imply just chosing the DVCS, > it also implies the migration details. In that interpretation, it > seems okay to clarify the title according to the new information, > namely that we now know to which DVCS Python is migrating. I agree that the title of PEP 374 could be adjusted to better reflect its eventual contents. Perhaps "Selecting a Distributed VCS to replace SVN". Or we could just add a question mark: "Migration from SVN to a Distributed VCS?". The PEP really addresses that question. > I'll revert, and would like to hereby claim a new PEP number -- Thanks! > can I just start a new one by editing the index and then\ > committing a new file? I believe that you don't actually have to edit the index any more, it's generated automatically (PEP 1 may need to be revised to reflect this). Please just claim the next PEP number when you commit. Currently that's pep-0384.txt (of course, please do an "svn update" before committing to be sure). Check the PEP index a few minutes later to confirm. -- David Goodger From buildbot at python.org Fri May 15 18:54:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 15 May 2009 16:54:07 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090515165407.D409EC40F@mail.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/576 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 533, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' 1 test failed: test_import ====================================================================== ERROR: testImport (test.test_import.ImportTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 61, in test_with_extension mod = __import__(TESTFN) ImportError: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 533, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 533, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' sincerely, -The Buildbot From python-checkins at python.org Fri May 15 18:54:53 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 15 May 2009 18:54:53 +0200 (CEST) Subject: [Python-checkins] r72669 - in python/trunk: Lib/copy.py Lib/test/test_copy.py Lib/weakref.py Misc/NEWS Message-ID: <20090515165453.0E2D2C420@mail.python.org> Author: antoine.pitrou Date: Fri May 15 18:54:52 2009 New Revision: 72669 Log: Issue #2116: Weak references and weak dictionaries now support copy()ing and deepcopy()ing. Modified: python/trunk/Lib/copy.py python/trunk/Lib/test/test_copy.py python/trunk/Lib/weakref.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/copy.py ============================================================================== --- python/trunk/Lib/copy.py (original) +++ python/trunk/Lib/copy.py Fri May 15 18:54:52 2009 @@ -49,6 +49,7 @@ """ import types +import weakref from copy_reg import dispatch_table class Error(Exception): @@ -102,7 +103,7 @@ for t in (type(None), int, long, float, bool, str, tuple, frozenset, type, xrange, types.ClassType, types.BuiltinFunctionType, type(Ellipsis), - types.FunctionType): + types.FunctionType, weakref.ref): d[t] = _copy_immutable for name in ("ComplexType", "UnicodeType", "CodeType"): t = getattr(types, name, None) @@ -220,6 +221,7 @@ d[types.ClassType] = _deepcopy_atomic d[types.BuiltinFunctionType] = _deepcopy_atomic d[types.FunctionType] = _deepcopy_atomic +d[weakref.ref] = _deepcopy_atomic def _deepcopy_list(x, memo): y = [] Modified: python/trunk/Lib/test/test_copy.py ============================================================================== --- python/trunk/Lib/test/test_copy.py (original) +++ python/trunk/Lib/test/test_copy.py Fri May 15 18:54:52 2009 @@ -2,6 +2,8 @@ import copy import copy_reg +import weakref +import operator import unittest from test import test_support @@ -585,6 +587,92 @@ bar = lambda: None self.assertEqual(copy.deepcopy(bar), bar) + def _check_weakref(self, _copy): + class C(object): + pass + obj = C() + x = weakref.ref(obj) + y = _copy(x) + self.assertTrue(y is x) + del obj + y = _copy(x) + self.assertTrue(y is x) + + def test_copy_weakref(self): + self._check_weakref(copy.copy) + + def test_deepcopy_weakref(self): + self._check_weakref(copy.deepcopy) + + def _check_copy_weakdict(self, _dicttype): + class C(object): + pass + a, b, c, d = [C() for i in xrange(4)] + u = _dicttype() + u[a] = b + u[c] = d + v = copy.copy(u) + self.assertFalse(v is u) + self.assertEqual(v, u) + self.assertEqual(v[a], b) + self.assertEqual(v[c], d) + self.assertEqual(len(v), 2) + del c, d + self.assertEqual(len(v), 1) + x, y = C(), C() + # The underlying containers are decoupled + v[x] = y + self.assertFalse(x in u) + + def test_copy_weakkeydict(self): + self._check_copy_weakdict(weakref.WeakKeyDictionary) + + def test_copy_weakvaluedict(self): + self._check_copy_weakdict(weakref.WeakValueDictionary) + + def test_deepcopy_weakkeydict(self): + class C(object): + def __init__(self, i): + self.i = i + a, b, c, d = [C(i) for i in xrange(4)] + u = weakref.WeakKeyDictionary() + u[a] = b + u[c] = d + # Keys aren't copied, values are + v = copy.deepcopy(u) + self.assertNotEqual(v, u) + self.assertEqual(len(v), 2) + self.assertFalse(v[a] is b) + self.assertFalse(v[c] is d) + self.assertEqual(v[a].i, b.i) + self.assertEqual(v[c].i, d.i) + del c + self.assertEqual(len(v), 1) + + def test_deepcopy_weakvaluedict(self): + class C(object): + def __init__(self, i): + self.i = i + a, b, c, d = [C(i) for i in xrange(4)] + u = weakref.WeakValueDictionary() + u[a] = b + u[c] = d + # Keys are copied, values aren't + v = copy.deepcopy(u) + self.assertNotEqual(v, u) + self.assertEqual(len(v), 2) + (x, y), (z, t) = sorted(v.items(), key=lambda (k, v): k.i) + self.assertFalse(x is a) + self.assertEqual(x.i, a.i) + self.assertTrue(y is b) + self.assertFalse(z is c) + self.assertEqual(z.i, c.i) + self.assertTrue(t is d) + del x, y, z, t + del d + self.assertEqual(len(v), 1) + + def global_foo(x, y): return x+y def test_main(): Modified: python/trunk/Lib/weakref.py ============================================================================== --- python/trunk/Lib/weakref.py (original) +++ python/trunk/Lib/weakref.py Fri May 15 18:54:52 2009 @@ -85,6 +85,17 @@ new[key] = o return new + __copy__ = copy + + def __deepcopy__(self, memo): + from copy import deepcopy + new = self.__class__() + for key, wr in self.data.items(): + o = wr() + if o is not None: + new[deepcopy(key, memo)] = o + return new + def get(self, key, default=None): try: wr = self.data[key] @@ -256,6 +267,17 @@ new[o] = value return new + __copy__ = copy + + def __deepcopy__(self, memo): + from copy import deepcopy + new = self.__class__() + for key, value in self.data.items(): + o = key() + if o is not None: + new[o] = deepcopy(value, memo) + return new + def get(self, key, default=None): return self.data.get(ref(key),default) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri May 15 18:54:52 2009 @@ -293,6 +293,9 @@ Library ------- +- Issue #2116: Weak references and weak dictionaries now support copy()ing and + deepcopy()ing. + - Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr. - Issue #5918: Fix a crash in the parser module. From buildbot at python.org Fri May 15 19:00:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 15 May 2009 17:00:39 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090515170039.C6BFED96C@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1323 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Fri May 15 19:01:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 15 May 2009 17:01:06 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090515170107.0E6DBD934@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/522 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Fri May 15 19:01:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 15 May 2009 17:01:17 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090515170117.4AD09D937@mail.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/5007 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Fri May 15 19:01:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 15 May 2009 17:01:59 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090515170159.F2E1CD938@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%20trunk/builds/19 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Fri May 15 19:02:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 15 May 2009 17:02:18 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc trunk Message-ID: <20090515170218.9C431D9BD@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%20trunk/builds/429 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed compile sincerely, -The Buildbot From python-checkins at python.org Fri May 15 19:04:50 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 15 May 2009 19:04:50 +0200 (CEST) Subject: [Python-checkins] r72670 - in python/branches/py3k: Lib/copy.py Lib/test/test_copy.py Lib/weakref.py Misc/NEWS Message-ID: <20090515170450.E6968D579@mail.python.org> Author: antoine.pitrou Date: Fri May 15 19:04:50 2009 New Revision: 72670 Log: Merged revisions 72669 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72669 | antoine.pitrou | 2009-05-15 18:54:52 +0200 (ven., 15 mai 2009) | 3 lines Issue #2116: Weak references and weak dictionaries now support copy()ing and deepcopy()ing. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/copy.py python/branches/py3k/Lib/test/test_copy.py python/branches/py3k/Lib/weakref.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/copy.py ============================================================================== --- python/branches/py3k/Lib/copy.py (original) +++ python/branches/py3k/Lib/copy.py Fri May 15 19:04:50 2009 @@ -49,6 +49,7 @@ """ import types +import weakref from copyreg import dispatch_table class Error(Exception): @@ -102,7 +103,7 @@ for t in (type(None), int, float, bool, str, tuple, frozenset, type, range, types.BuiltinFunctionType, type(Ellipsis), - types.FunctionType): + types.FunctionType, weakref.ref): d[t] = _copy_immutable t = getattr(types, "CodeType", None) if t is not None: @@ -198,6 +199,7 @@ d[range] = _deepcopy_atomic d[types.BuiltinFunctionType] = _deepcopy_atomic d[types.FunctionType] = _deepcopy_atomic +d[weakref.ref] = _deepcopy_atomic def _deepcopy_list(x, memo): y = [] Modified: python/branches/py3k/Lib/test/test_copy.py ============================================================================== --- python/branches/py3k/Lib/test/test_copy.py (original) +++ python/branches/py3k/Lib/test/test_copy.py Fri May 15 19:04:50 2009 @@ -2,7 +2,9 @@ import copy import copyreg +import weakref from operator import le, lt, ge, gt, eq, ne + import unittest from test import support @@ -590,6 +592,92 @@ bar = lambda: None self.assertEqual(copy.deepcopy(bar), bar) + def _check_weakref(self, _copy): + class C(object): + pass + obj = C() + x = weakref.ref(obj) + y = _copy(x) + self.assertTrue(y is x) + del obj + y = _copy(x) + self.assertTrue(y is x) + + def test_copy_weakref(self): + self._check_weakref(copy.copy) + + def test_deepcopy_weakref(self): + self._check_weakref(copy.deepcopy) + + def _check_copy_weakdict(self, _dicttype): + class C(object): + pass + a, b, c, d = [C() for i in range(4)] + u = _dicttype() + u[a] = b + u[c] = d + v = copy.copy(u) + self.assertFalse(v is u) + self.assertEqual(v, u) + self.assertEqual(v[a], b) + self.assertEqual(v[c], d) + self.assertEqual(len(v), 2) + del c, d + self.assertEqual(len(v), 1) + x, y = C(), C() + # The underlying containers are decoupled + v[x] = y + self.assertFalse(x in u) + + def test_copy_weakkeydict(self): + self._check_copy_weakdict(weakref.WeakKeyDictionary) + + def test_copy_weakvaluedict(self): + self._check_copy_weakdict(weakref.WeakValueDictionary) + + def test_deepcopy_weakkeydict(self): + class C(object): + def __init__(self, i): + self.i = i + a, b, c, d = [C(i) for i in range(4)] + u = weakref.WeakKeyDictionary() + u[a] = b + u[c] = d + # Keys aren't copied, values are + v = copy.deepcopy(u) + self.assertNotEqual(v, u) + self.assertEqual(len(v), 2) + self.assertFalse(v[a] is b) + self.assertFalse(v[c] is d) + self.assertEqual(v[a].i, b.i) + self.assertEqual(v[c].i, d.i) + del c + self.assertEqual(len(v), 1) + + def test_deepcopy_weakvaluedict(self): + class C(object): + def __init__(self, i): + self.i = i + a, b, c, d = [C(i) for i in range(4)] + u = weakref.WeakValueDictionary() + u[a] = b + u[c] = d + # Keys are copied, values aren't + v = copy.deepcopy(u) + self.assertNotEqual(v, u) + self.assertEqual(len(v), 2) + (x, y), (z, t) = sorted(v.items(), key=lambda pair: pair[0].i) + self.assertFalse(x is a) + self.assertEqual(x.i, a.i) + self.assertTrue(y is b) + self.assertFalse(z is c) + self.assertEqual(z.i, c.i) + self.assertTrue(t is d) + del x, y, z, t + del d + self.assertEqual(len(v), 1) + + def global_foo(x, y): return x+y def test_main(): Modified: python/branches/py3k/Lib/weakref.py ============================================================================== --- python/branches/py3k/Lib/weakref.py (original) +++ python/branches/py3k/Lib/weakref.py Fri May 15 19:04:50 2009 @@ -85,6 +85,17 @@ new[key] = o return new + __copy__ = copy + + def __deepcopy__(self, memo): + from copy import deepcopy + new = self.__class__() + for key, wr in self.data.items(): + o = wr() + if o is not None: + new[deepcopy(key, memo)] = o + return new + def get(self, key, default=None): try: wr = self.data[key] @@ -251,6 +262,17 @@ new[o] = value return new + __copy__ = copy + + def __deepcopy__(self, memo): + from copy import deepcopy + new = self.__class__() + for key, value in self.data.items(): + o = key() + if o is not None: + new[o] = deepcopy(value, memo) + return new + def get(self, key, default=None): return self.data.get(ref(key),default) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri May 15 19:04:50 2009 @@ -23,6 +23,9 @@ Library ------- +- Issue #2116: Weak references and weak dictionaries now support copy()ing and + deepcopy()ing. + - Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr. - Issue #5918: Fix a crash in the parser module. From buildbot at python.org Fri May 15 19:10:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 15 May 2009 17:10:34 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090515171034.DB9F1D874@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/976 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou,raymond.hettinger BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Fri May 15 19:10:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 15 May 2009 17:10:59 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090515171059.1EB07D874@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/812 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou,raymond.hettinger BUILD FAILED: failed compile sincerely, -The Buildbot From buildbot at python.org Fri May 15 19:11:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 15 May 2009 17:11:19 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090515171119.E6CC6D8BE@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/628 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou,raymond.hettinger BUILD FAILED: failed compile sincerely, -The Buildbot From python-checkins at python.org Fri May 15 19:27:30 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 15 May 2009 19:27:30 +0200 (CEST) Subject: [Python-checkins] r72671 - in python/trunk/Lib/distutils: ccompiler.py dist.py Message-ID: <20090515172730.6CE19D9C9@mail.python.org> Author: antoine.pitrou Date: Fri May 15 19:27:30 2009 New Revision: 72671 Log: Fix bootstrapping by removing uses of the copy module in distutils Modified: python/trunk/Lib/distutils/ccompiler.py python/trunk/Lib/distutils/dist.py Modified: python/trunk/Lib/distutils/ccompiler.py ============================================================================== --- python/trunk/Lib/distutils/ccompiler.py (original) +++ python/trunk/Lib/distutils/ccompiler.py Fri May 15 19:27:30 2009 @@ -7,7 +7,6 @@ import sys, os, re from types import * -from copy import copy from distutils.errors import * from distutils.spawn import spawn from distutils.file_util import move_file @@ -253,7 +252,7 @@ any list of standard include directories that the compiler may search by default. """ - self.include_dirs = copy (dirs) + self.include_dirs = dirs[:] def add_library (self, libname): @@ -278,7 +277,7 @@ not affect any standard system libraries that the linker may include by default. """ - self.libraries = copy (libnames) + self.libraries = libnames[:] def add_library_dir (self, dir): @@ -294,7 +293,7 @@ strings). This does not affect any standard library search path that the linker may search by default. """ - self.library_dirs = copy (dirs) + self.library_dirs = dirs[:] def add_runtime_library_dir (self, dir): @@ -309,7 +308,7 @@ standard search path that the runtime linker may search by default. """ - self.runtime_library_dirs = copy (dirs) + self.runtime_library_dirs = dirs[:] def add_link_object (self, object): @@ -326,7 +325,7 @@ files that the linker may include by default (such as system libraries). """ - self.objects = copy (objects) + self.objects = objects[:] # -- Private utility methods -------------------------------------- Modified: python/trunk/Lib/distutils/dist.py ============================================================================== --- python/trunk/Lib/distutils/dist.py (original) +++ python/trunk/Lib/distutils/dist.py Fri May 15 19:27:30 2009 @@ -8,7 +8,6 @@ import sys, os, string, re from types import * -from copy import copy try: import warnings @@ -537,7 +536,7 @@ # merge it in with the global negative aliases. negative_opt = self.negative_opt if hasattr(cmd_class, 'negative_opt'): - negative_opt = copy(negative_opt) + negative_opt = negative_opt.copy() negative_opt.update(cmd_class.negative_opt) # Check for help_options in command class. They have a different From python-checkins at python.org Fri May 15 19:34:21 2009 From: python-checkins at python.org (antoine.pitrou) Date: Fri, 15 May 2009 19:34:21 +0200 (CEST) Subject: [Python-checkins] r72672 - in python/branches/py3k: Lib/distutils/ccompiler.py Lib/distutils/dist.py Message-ID: <20090515173421.455B1DA5C@mail.python.org> Author: antoine.pitrou Date: Fri May 15 19:34:21 2009 New Revision: 72672 Log: Merged revisions 72671 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72671 | antoine.pitrou | 2009-05-15 19:27:30 +0200 (ven., 15 mai 2009) | 3 lines Fix bootstrapping by removing uses of the copy module in distutils ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/ccompiler.py python/branches/py3k/Lib/distutils/dist.py Modified: python/branches/py3k/Lib/distutils/ccompiler.py ============================================================================== --- python/branches/py3k/Lib/distutils/ccompiler.py (original) +++ python/branches/py3k/Lib/distutils/ccompiler.py Fri May 15 19:34:21 2009 @@ -6,7 +6,6 @@ __revision__ = "$Id$" import sys, os, re -from copy import copy from distutils.errors import * from distutils.spawn import spawn from distutils.file_util import move_file @@ -233,7 +232,7 @@ any list of standard include directories that the compiler may search by default. """ - self.include_dirs = copy(dirs) + self.include_dirs = dirs[:] def add_library(self, libname): """Add 'libname' to the list of libraries that will be included in @@ -257,7 +256,7 @@ not affect any standard system libraries that the linker may include by default. """ - self.libraries = copy(libnames) + self.libraries = libnames[:] def add_library_dir(self, dir): """Add 'dir' to the list of directories that will be searched for @@ -272,7 +271,7 @@ strings). This does not affect any standard library search path that the linker may search by default. """ - self.library_dirs = copy(dirs) + self.library_dirs = dirs[:] def add_runtime_library_dir(self, dir): """Add 'dir' to the list of directories that will be searched for @@ -286,7 +285,7 @@ standard search path that the runtime linker may search by default. """ - self.runtime_library_dirs = copy(dirs) + self.runtime_library_dirs = dirs[:] def add_link_object(self, object): """Add 'object' to the list of object files (or analogues, such as @@ -302,7 +301,7 @@ files that the linker may include by default (such as system libraries). """ - self.objects = copy(objects) + self.objects = objects[:] # -- Private utility methods -------------------------------------- Modified: python/branches/py3k/Lib/distutils/dist.py ============================================================================== --- python/branches/py3k/Lib/distutils/dist.py (original) +++ python/branches/py3k/Lib/distutils/dist.py Fri May 15 19:34:21 2009 @@ -7,7 +7,6 @@ __revision__ = "$Id$" import sys, os, re -from copy import copy try: import warnings @@ -521,7 +520,7 @@ # merge it in with the global negative aliases. negative_opt = self.negative_opt if hasattr(cmd_class, 'negative_opt'): - negative_opt = copy(negative_opt) + negative_opt = negative_opt.copy() negative_opt.update(cmd_class.negative_opt) # Check for help_options in command class. They have a different From brett at python.org Fri May 15 19:54:42 2009 From: brett at python.org (Brett Cannon) Date: Fri, 15 May 2009 10:54:42 -0700 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: <4335d2c40905150926n6b4f6c7ch87503cff749646d6@mail.gmail.com> References: <20090511125003.BF2F31E4012@bag.python.org> <4A0D8718.1090704@python.org> <4335d2c40905150858k18de2626x287c1b20d6b5e100@mail.gmail.com> <4335d2c40905150926n6b4f6c7ch87503cff749646d6@mail.gmail.com> Message-ID: I want to say that Dirkjan and Martin talked to me about their plan and I said I was okay with it. But going with a new PEP number is obviously fine by me as well. On Fri, May 15, 2009 at 09:26, David Goodger wrote: > On Fri, May 15, 2009 at 12:14, Dirkjan Ochtman wrote: > > Well, I (guided by Martin's interpretation, I guess) interpreted the > > objective of this PEP according to its former title: "Migration from > > svn to a distributed VCS". That doesn't imply just chosing the DVCS, > > it also implies the migration details. In that interpretation, it > > seems okay to clarify the title according to the new information, > > namely that we now know to which DVCS Python is migrating. > > I agree that the title of PEP 374 could be adjusted to better reflect > its eventual contents. Perhaps "Selecting a Distributed VCS to replace > SVN". Or we could just add a question mark: "Migration from SVN to a > Distributed VCS?". The PEP really addresses that question. > I'll try to get to that. > > > I'll revert, and would like to hereby claim a new PEP number -- > > Thanks! > > > can I just start a new one by editing the index and then\ > > committing a new file? > > I believe that you don't actually have to edit the index any more, > it's generated automatically (PEP 1 may need to be revised to reflect > this). It is auto-generated. -Brett -------------- next part -------------- An HTML attachment was scrubbed... URL: From buildbot at python.org Fri May 15 20:20:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 15 May 2009 18:20:19 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090515182019.3B49FD9DD@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/754 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From nnorwitz at gmail.com Fri May 15 23:27:52 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 15 May 2009 17:27:52 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090515212752.GA12079@python.psfb.org> More important issues: ---------------------- test_ssl leaked [0, 0, -322] references, sum=-322 Less important issues: ---------------------- test_asynchat leaked [126, -126, 0] references, sum=0 test_cmd_line leaked [0, 0, 25] references, sum=25 test_smtplib leaked [-88, 83, -83] references, sum=-88 test_sys leaked [42, -21, -21] references, sum=0 test_threading leaked [48, 53, 43] references, sum=144 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 From martin at v.loewis.de Sat May 16 00:42:29 2009 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sat, 16 May 2009 00:42:29 +0200 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: <4A0D8718.1090704@python.org> References: <20090511125003.BF2F31E4012@bag.python.org> <4A0D8718.1090704@python.org> Message-ID: <4A0DEFD5.8080501@v.loewis.de> > Dirkjan, I appreciate the desire to go forward with the transition, and I > applaud your initiative, but this is not the way to do it. A new PEP is > appropriate here. Please revert revision 72563 and create a new PEP. I disagree that this should be done. > There are three warning bells ringing loudly here: > > 1. The PEP title was changed. The title, but not the spirit. The title is just more precise than it was before? > 2. The authors were changed. This is, IMO, incredibly rude. Why is it rude? The original author agreed to that change. There have been changes to the list of authors in other PEPs before, and nobody complained. > 3. Huge swaths of the existing PEP were ripped out. Effectively a complete > rewrite. This feels like revising history. It was only done to improve the PEP. > The great value of > PEP 374 going forward is as a historical document. To have that value, it doesn't have to be in the PEP. Indeed, I think it has more value where it is now. > I have not been active in PEP editing lately, so I won't impose my opinion > unilaterally. PEP editors, what do you think? I don't think there are any PEP editors left :-( Regards, Martin From barry at python.org Sat May 16 00:54:09 2009 From: barry at python.org (Barry Warsaw) Date: Fri, 15 May 2009 18:54:09 -0400 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: <4A0DEFD5.8080501@v.loewis.de> References: <20090511125003.BF2F31E4012@bag.python.org> <4A0D8718.1090704@python.org> <4A0DEFD5.8080501@v.loewis.de> Message-ID: <0C15E7C8-FDB9-408F-9C2B-81DF8806EEE5@python.org> On May 15, 2009, at 6:42 PM, Martin v. L?wis wrote: >> 2. The authors were changed. This is, IMO, incredibly rude. > > Why is it rude? The original author agreed to that change. > There have been changes to the list of authors in other PEPs before, > and nobody complained. I wasn't asked. I'm inconsolably offended. (joking in case that wasn't clear! :) >> 3. Huge swaths of the existing PEP were ripped out. Effectively a >> complete >> rewrite. This feels like revising history. > > It was only done to improve the PEP. > >> The great value of >> PEP 374 going forward is as a historical document. > > To have that value, it doesn't have to be in the PEP. Indeed, I > think it > has more value where it is now. I disagree. I think the contents of the PEP as it was makes an excellent historical record of our evaluation, now likely googlable everywhere. While /I/ might quibble with the outcome , I think it's useful to have that evaluation not stashed in caches, but right there in the document. >> I have not been active in PEP editing lately, so I won't impose my >> opinion >> unilaterally. PEP editors, what do you think? > > I don't think there are any PEP editors left :-( Maybe it's time to put out a call for volunteers? New blood is always welcome. -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 832 bytes Desc: This is a digitally signed message part URL: From martin at v.loewis.de Sat May 16 01:01:13 2009 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sat, 16 May 2009 01:01:13 +0200 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: <0C15E7C8-FDB9-408F-9C2B-81DF8806EEE5@python.org> References: <20090511125003.BF2F31E4012@bag.python.org> <4A0D8718.1090704@python.org> <4A0DEFD5.8080501@v.loewis.de> <0C15E7C8-FDB9-408F-9C2B-81DF8806EEE5@python.org> Message-ID: <4A0DF439.9070606@v.loewis.de> >> To have that value, it doesn't have to be in the PEP. Indeed, I think it >> has more value where it is now. > > I disagree. I think the contents of the PEP as it was makes an > excellent historical record of our evaluation, now likely googlable > everywhere. While /I/ might quibble with the outcome , I think > it's useful to have that evaluation not stashed in caches, but right > there in the document. So I assume that the Wiki page that has a copy of the PEP should be deleted, then? >> I don't think there are any PEP editors left :-( > > Maybe it's time to put out a call for volunteers? New blood is always > welcome. I'm skeptical. It would be a long-term job, for 10 years or so. Even you two (who had been contributing for a while already before taking it) eventually stopped doing it, probably because people would edit their PEPs themselves, anyway, and because really new PEP editors came along so rarely. It's not surprising that the only time when the role of a PEP editor gets mentioned is when people actually disagree with the content being edited, but are silent if it is merely the process that isn't being followed. Regards, Martin From python-checkins at python.org Sat May 16 01:05:29 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 16 May 2009 01:05:29 +0200 (CEST) Subject: [Python-checkins] r72673 - python/branches/py3k/Modules/_io/fileio.c Message-ID: <20090515230529.8A6DED4D9@mail.python.org> Author: raymond.hettinger Date: Sat May 16 01:05:29 2009 New Revision: 72673 Log: Silence a compiler warning. Modified: python/branches/py3k/Modules/_io/fileio.c Modified: python/branches/py3k/Modules/_io/fileio.c ============================================================================== --- python/branches/py3k/Modules/_io/fileio.c (original) +++ python/branches/py3k/Modules/_io/fileio.c Sat May 16 01:05:29 2009 @@ -547,7 +547,7 @@ return NULL; } - if (PyBytes_GET_SIZE(result) < newsize) { + if (PyBytes_GET_SIZE(result) < (Py_ssize_t)newsize) { if (_PyBytes_Resize(&result, newsize) < 0) { if (total == 0) { Py_DECREF(result); From goodger at python.org Sat May 16 01:11:27 2009 From: goodger at python.org (David Goodger) Date: Fri, 15 May 2009 19:11:27 -0400 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: <4A0DEFD5.8080501@v.loewis.de> References: <20090511125003.BF2F31E4012@bag.python.org> <4A0D8718.1090704@python.org> <4A0DEFD5.8080501@v.loewis.de> Message-ID: <4335d2c40905151611p3ab5fb3n1ba99c2ccac479ad@mail.gmail.com> On Fri, May 15, 2009 at 18:42, "Martin v. L?wis" wrote: >> Dirkjan, I appreciate the desire to go forward with the transition, and I >> applaud your initiative, but this is not the way to do it. ?A new PEP is >> appropriate here. ?Please revert revision 72563 and create a new PEP. > > I disagree that this should be done. We'll just have to agree to disagree :-) One role of the PEP editors is to act as archivists, preserving the historical record. That's one of the points of PEPs: to serve as long-term memory. The rationale for the choice of DVCS is important history, and should be preserved. >> There are three warning bells ringing loudly here: >> >> 1. The PEP title was changed. > > The title, but not the spirit. The title is just more precise than it > was before? A title change to increase precision is fine. But combine that with a rewrite of the content, and the PEP is effectively replaced. >> 2. The authors were changed. ?This is, IMO, incredibly rude. > > Why is it rude? The original author agreed to that change. What about the other three? I.e. the ones that were removed (Stephen J. Turnbull, Alexandre Vassalotti, and Barry Warsaw). Were they consulted? > There have been changes to the list of authors in other PEPs before, > and nobody complained. I'm not aware of authors being removed before. Can you cite a case? >> 3. Huge swaths of the existing PEP were ripped out. ?Effectively a complete >> rewrite. ?This feels like revising history. > > It was only done to improve the PEP. To improve a building, it can be renovated, or it can be torn down and a new one built in its place. Why tear down this one? We have plenty of room for more. Why not just add a new one? That's the right course of action here IMO. > I don't think there are any PEP editors left :-( Currently subscribed to the PEP Editors list (peps at python.org): Anthony Baxter Georg Brandl Brett Cannon David Goodger Guido van Rossum Barry Warsaw Guido monitors the list. Georg has been the most active lately. Barry and I speak up from time to time. I do try to monitor PEP checkins, and speak up when I notice something's amiss. There hasn't been much activity lately, as I believe people have gotten used to the DIY approach. The workload is not overwhelming the current PEP editors. It's a non-issue. -- David Goodger From barry at python.org Sat May 16 01:19:05 2009 From: barry at python.org (Barry Warsaw) Date: Fri, 15 May 2009 19:19:05 -0400 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: <4335d2c40905151611p3ab5fb3n1ba99c2ccac479ad@mail.gmail.com> References: <20090511125003.BF2F31E4012@bag.python.org> <4A0D8718.1090704@python.org> <4A0DEFD5.8080501@v.loewis.de> <4335d2c40905151611p3ab5fb3n1ba99c2ccac479ad@mail.gmail.com> Message-ID: On May 15, 2009, at 7:11 PM, David Goodger wrote: > Guido monitors the list. Georg has been the most active lately. Barry > and I speak up from time to time. I do try to monitor PEP checkins, > and speak up when I notice something's amiss. > > There hasn't been much activity lately, as I believe people have > gotten used to the DIY approach. The workload is not overwhelming the > current PEP editors. It's a non-issue. Excellent. I'm totally happy (obviously) to go into reactive mode with PEPs. Most of the time it will just cruise along happily. When it doesn't we can fix it because even pokey old subversion is up to the task of reverting. :) -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 832 bytes Desc: This is a digitally signed message part URL: From goodger at python.org Sat May 16 01:22:05 2009 From: goodger at python.org (David Goodger) Date: Fri, 15 May 2009 19:22:05 -0400 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: <4A0DF439.9070606@v.loewis.de> References: <20090511125003.BF2F31E4012@bag.python.org> <4A0D8718.1090704@python.org> <4A0DEFD5.8080501@v.loewis.de> <0C15E7C8-FDB9-408F-9C2B-81DF8806EEE5@python.org> <4A0DF439.9070606@v.loewis.de> Message-ID: <4335d2c40905151622v984c01fk4afc74d10721545e@mail.gmail.com> On Fri, May 15, 2009 at 19:01, "Martin v. L?wis" wrote: >>> To have that value, it doesn't have to be in the PEP. Indeed, I think it >>> has more value where it is now. >> >> I disagree. ?I think the contents of the PEP as it was makes an >> excellent historical record of our evaluation, now likely googlable >> everywhere. ?While /I/ might quibble with the outcome , I think >> it's useful to have that evaluation not stashed in caches, but right >> there in the document. > > So I assume that the Wiki page that has a copy of the PEP should be > deleted, then? Not necessarily. If it serves a useful purpose, let it stand and evolve as it will. The point is, PEP 374 ought to reflect the process that led to the current decision. If the wiki page evolves, it will be a different and *not applicable* to the 2009 Python DVCS decision. I say let the wiki stand, and time will tell. We ought to add cross-references to both PEP & wiki though. I don't understand why we're still debating this. Several people want PEP 374 to remain as it was. Dirkjan has agreed to add a new PEP. There's room for the wiki page too (no shortage of space; the internet is effectively infinite). Everybody should be happy. -- David Goodger From buildbot at python.org Sat May 16 01:29:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 15 May 2009 23:29:54 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090515232954.5F290D4DE@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/630 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat May 16 01:53:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 15 May 2009 23:53:14 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090515235314.60516D463@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/696 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From martin at v.loewis.de Sat May 16 02:04:31 2009 From: martin at v.loewis.de (=?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?=) Date: Sat, 16 May 2009 02:04:31 +0200 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: <4335d2c40905151611p3ab5fb3n1ba99c2ccac479ad@mail.gmail.com> References: <20090511125003.BF2F31E4012@bag.python.org> <4A0D8718.1090704@python.org> <4A0DEFD5.8080501@v.loewis.de> <4335d2c40905151611p3ab5fb3n1ba99c2ccac479ad@mail.gmail.com> Message-ID: <4A0E030F.3070205@v.loewis.de> >>> 2. The authors were changed. This is, IMO, incredibly rude. >> Why is it rude? The original author agreed to that change. > > What about the other three? I.e. the ones that were removed (Stephen > J. Turnbull, Alexandre Vassalotti, and Barry Warsaw). Were they > consulted? No, they were not consulted. >> There have been changes to the list of authors in other PEPs before, >> and nobody complained. > > I'm not aware of authors being removed before. Can you cite a case? For PEP 282, authorship was transferred from Trent Mick to Vinay Sajip. AMK removed himself from PEP 3100. >>> 3. Huge swaths of the existing PEP were ripped out. Effectively a complete >>> rewrite. This feels like revising history. >> It was only done to improve the PEP. > > To improve a building, it can be renovated, or it can be torn down and > a new one built in its place. Why tear down this one? Because it just isn't a proper PEP! It didn't specify anything. It was "just" a tutorial. Now, with Dirkjan's edits, it would specify something: namely a procedure to move to hg. Regards, Martin From martin at v.loewis.de Sat May 16 02:09:15 2009 From: martin at v.loewis.de (=?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?=) Date: Sat, 16 May 2009 02:09:15 +0200 Subject: [Python-checkins] r72563 - peps/trunk/pep-0374.txt In-Reply-To: <4335d2c40905151622v984c01fk4afc74d10721545e@mail.gmail.com> References: <20090511125003.BF2F31E4012@bag.python.org> <4A0D8718.1090704@python.org> <4A0DEFD5.8080501@v.loewis.de> <0C15E7C8-FDB9-408F-9C2B-81DF8806EEE5@python.org> <4A0DF439.9070606@v.loewis.de> <4335d2c40905151622v984c01fk4afc74d10721545e@mail.gmail.com> Message-ID: <4A0E042B.3090507@v.loewis.de> > The point is, PEP 374 ought to reflect the process that led to the > current decision. And indeed, after Dirkjan's edits, it does. Before, it didn't reflect any process. > I don't understand why we're still debating this. Several people want > PEP 374 to remain as it was. Dirkjan has agreed to add a new PEP. I still think that PEP 374 isn't finished (yet), so it can't possibly be Final. Regards, Martin From python-checkins at python.org Sat May 16 03:46:11 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 16 May 2009 03:46:11 +0200 (CEST) Subject: [Python-checkins] r72674 - python/branches/py3k/Modules/audioop.c Message-ID: <20090516014611.8530BD5B0@mail.python.org> Author: raymond.hettinger Date: Sat May 16 03:46:11 2009 New Revision: 72674 Log: Silence compiler warning. Modified: python/branches/py3k/Modules/audioop.c Modified: python/branches/py3k/Modules/audioop.c ============================================================================== --- python/branches/py3k/Modules/audioop.c (original) +++ python/branches/py3k/Modules/audioop.c Sat May 16 03:46:11 2009 @@ -1121,7 +1121,7 @@ outrate /= d; alloc_size = sizeof(int) * (unsigned)nchannels; - if (alloc_size < nchannels) { + if (alloc_size < (unsigned)nchannels) { PyErr_SetString(PyExc_MemoryError, "not enough memory for output buffer"); return 0; From buildbot at python.org Sat May 16 04:55:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 16 May 2009 02:55:07 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090516025507.E3ECFC3CC@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/815 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat May 16 07:57:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 16 May 2009 05:57:34 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090516055734.7A6C3C3A9@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/757 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From georg at python.org Sat May 16 08:20:14 2009 From: georg at python.org (Georg Brandl) Date: Sat, 16 May 2009 08:20:14 +0200 Subject: [Python-checkins] [PEPs] r72563 - peps/trunk/pep-0374.txt In-Reply-To: <4A0DEFD5.8080501@v.loewis.de> References: <20090511125003.BF2F31E4012@bag.python.org> <4A0D8718.1090704@python.org> <4A0DEFD5.8080501@v.loewis.de> Message-ID: <4A0E5B1E.5050903@python.org> Martin v. L?wis schrieb: >> I have not been active in PEP editing lately, so I won't impose my opinion >> unilaterally. PEP editors, what do you think? > > I don't think there are any PEP editors left :-( That's not entirely true :) I already agreed with David, but on python-checkins only. Georg From nnorwitz at gmail.com Sat May 16 11:36:16 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 16 May 2009 05:36:16 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090516093616.GA485@python.psfb.org> More important issues: ---------------------- test_ssl leaked [0, 322, 322] references, sum=644 Less important issues: ---------------------- test_file leaked [0, 0, 84] references, sum=84 test_smtplib leaked [-88, 179, -91] references, sum=0 test_sys leaked [-21, 0, 42] references, sum=21 test_threading leaked [48, 53, 43] references, sum=144 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 From nnorwitz at gmail.com Sat May 16 11:55:02 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 16 May 2009 05:55:02 -0400 Subject: [Python-checkins] Python Regression Test Failures doc (1) Message-ID: <20090516095502.GA5260@python.psfb.org> rm -rf build/* rm -rf tools/sphinx Checking out Sphinx... svn: REPORT request failed on '/projects/!svn/vcc/default' svn: Can't find a temporary directory: Internal error make: *** [checkout] Error 1 From python-checkins at python.org Sat May 16 13:13:22 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 16 May 2009 13:13:22 +0200 (CEST) Subject: [Python-checkins] r72675 - python/trunk/Doc/reference/datamodel.rst Message-ID: <20090516111322.34699D435@mail.python.org> Author: georg.brandl Date: Sat May 16 13:13:21 2009 New Revision: 72675 Log: #6034: clarify __reversed__ doc. Modified: python/trunk/Doc/reference/datamodel.rst Modified: python/trunk/Doc/reference/datamodel.rst ============================================================================== --- python/trunk/Doc/reference/datamodel.rst (original) +++ python/trunk/Doc/reference/datamodel.rst Sat May 16 13:13:21 2009 @@ -1869,11 +1869,11 @@ reverse iteration. It should return a new iterator object that iterates over all the objects in the container in reverse order. - If the :meth:`__reversed__` method is not provided, the - :func:`reversed` builtin will fall back to using the sequence protocol - (:meth:`__len__` and :meth:`__getitem__`). Objects should normally - only provide :meth:`__reversed__` if they do not support the sequence - protocol and an efficient implementation of reverse iteration is possible. + If the :meth:`__reversed__` method is not provided, the :func:`reversed` + builtin will fall back to using the sequence protocol (:meth:`__len__` and + :meth:`__getitem__`). Objects that support the sequence protocol should + only provide :meth:`__reversed__` if they can provide an implementation + that is more efficient than the one provided by :func:`reversed`. .. versionadded:: 2.6 From python-checkins at python.org Sat May 16 13:14:52 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 16 May 2009 13:14:52 +0200 (CEST) Subject: [Python-checkins] r72676 - python/trunk/Doc/library/xml.dom.minidom.rst Message-ID: <20090516111452.BC749D49B@mail.python.org> Author: georg.brandl Date: Sat May 16 13:14:46 2009 New Revision: 72676 Log: #6025: fix signature of parse(). Modified: python/trunk/Doc/library/xml.dom.minidom.rst Modified: python/trunk/Doc/library/xml.dom.minidom.rst ============================================================================== --- python/trunk/Doc/library/xml.dom.minidom.rst (original) +++ python/trunk/Doc/library/xml.dom.minidom.rst Sat May 16 13:14:46 2009 @@ -30,7 +30,7 @@ The :func:`parse` function can take either a filename or an open file object. -.. function:: parse(filename_or_file, parser) +.. function:: parse(filename_or_file[, parser[, bufsize]]) Return a :class:`Document` from the given input. *filename_or_file* may be either a file name, or a file-like object. *parser*, if given, must be a SAX2 From python-checkins at python.org Sat May 16 13:18:55 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 16 May 2009 13:18:55 +0200 (CEST) Subject: [Python-checkins] r72677 - python/trunk/Doc/library/optparse.rst Message-ID: <20090516111855.63E8AD4DC@mail.python.org> Author: georg.brandl Date: Sat May 16 13:18:55 2009 New Revision: 72677 Log: #6009: undocument default argument of Option as deprecated. Modified: python/trunk/Doc/library/optparse.rst Modified: python/trunk/Doc/library/optparse.rst ============================================================================== --- python/trunk/Doc/library/optparse.rst (original) +++ python/trunk/Doc/library/optparse.rst Sat May 16 13:18:55 2009 @@ -1077,10 +1077,10 @@ tells :mod:`optparse` where to write it: :attr:`dest` names an attribute of the ``options`` object that :mod:`optparse` builds as it parses the command line. -* ``default`` (deprecated) +* ``default`` The value to use for this option's destination if the option is not seen on the - command line. Deprecated; use ``parser.set_defaults()`` instead. + command line. See also ``parser.set_defaults()``. * ``nargs`` (default: 1) From python-checkins at python.org Sat May 16 13:21:29 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 16 May 2009 13:21:29 +0200 (CEST) Subject: [Python-checkins] r72678 - python/trunk/Doc/library/os.rst Message-ID: <20090516112129.F33D8C2C0@mail.python.org> Author: georg.brandl Date: Sat May 16 13:21:29 2009 New Revision: 72678 Log: #2856: document 2.x os.listdir() behavior for undecodable filenames. Modified: python/trunk/Doc/library/os.rst Modified: python/trunk/Doc/library/os.rst ============================================================================== --- python/trunk/Doc/library/os.rst (original) +++ python/trunk/Doc/library/os.rst Sat May 16 13:21:29 2009 @@ -930,7 +930,8 @@ .. versionchanged:: 2.3 On Windows NT/2k/XP and Unix, if *path* is a Unicode object, the result will be - a list of Unicode objects. + a list of Unicode objects. Undecodable filenames will still be returned as + string objects. .. function:: lstat(path) From python-checkins at python.org Sat May 16 13:24:41 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 16 May 2009 13:24:41 +0200 (CEST) Subject: [Python-checkins] r72679 - in python/trunk/Doc: about.rst bugs.rst Message-ID: <20090516112441.CBC50C3E1@mail.python.org> Author: georg.brandl Date: Sat May 16 13:24:41 2009 New Revision: 72679 Log: Fix about and bugs pages to match real workflow. Modified: python/trunk/Doc/about.rst python/trunk/Doc/bugs.rst Modified: python/trunk/Doc/about.rst ============================================================================== --- python/trunk/Doc/about.rst (original) +++ python/trunk/Doc/about.rst Sat May 16 13:24:41 2009 @@ -7,8 +7,8 @@ `_ sources by *Sphinx*, a document processor specifically written for the Python documentation. -In the online version of these documents, you can submit comments and suggest -changes directly on the documentation pages. +.. In the online version of these documents, you can submit comments and suggest + changes directly on the documentation pages. Development of the documentation and its toolchain takes place on the docs at python.org mailing list. We're always looking for volunteers wanting @@ -24,7 +24,8 @@ `_ project from which Sphinx got many good ideas. -See :ref:`reporting-bugs` for information how to report bugs in Python itself. +See :ref:`reporting-bugs` for information how to report bugs in this +documentation, or Python itself. .. including the ACKS file here so that it can be maintained separately .. include:: ACKS.txt Modified: python/trunk/Doc/bugs.rst ============================================================================== --- python/trunk/Doc/bugs.rst (original) +++ python/trunk/Doc/bugs.rst Sat May 16 13:24:41 2009 @@ -19,6 +19,9 @@ information is needed (in which case you are welcome to provide it if you can!). To do this, search the bug database using the search box on the top of the page. +In the case of documentation bugs, look at the most recent development docs at +http://docs.python.org/dev to see if the bug has been fixed. + If the problem you're reporting is not already in the bug tracker, go back to the Python Bug Tracker. If you don't already have a tracker account, select the "Register" link in the sidebar and undergo the registration procedure. From python-checkins at python.org Sat May 16 18:02:06 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 16 May 2009 18:02:06 +0200 (CEST) Subject: [Python-checkins] r72680 - peps/trunk/pep-0376.txt Message-ID: <20090516160206.4C3B9D59E@mail.python.org> Author: tarek.ziade Date: Sat May 16 18:02:06 2009 New Revision: 72680 Log: changes after feedback from python-dev Modified: peps/trunk/pep-0376.txt Modified: peps/trunk/pep-0376.txt ============================================================================== --- peps/trunk/pep-0376.txt (original) +++ peps/trunk/pep-0376.txt Sat May 16 18:02:06 2009 @@ -22,28 +22,41 @@ Definitions =========== -A **project** is a Python application composed of one or many Python packages. -It is distributed using a `setup.py` script with Distutils and/or Setuptools. - -Once installed, one or several **packages** are added in Python's site-packages. +A **project** is a Python application composed of one or several files, which can +be Python modules, extensions or data. It is distributed using a `setup.py` script +with Distutils and/or Setuptools. The `setup.py` script indicates where each +elements should be installed. + +Once installed, the elements are located in various places in the system, like: + +- in Python's site-packages (Python modules, Python modules organized into packages, + Extensions, etc.) +- in Python's `include` directory. +- in Python's `bin` or `Script` directory. +- etc. Rationale ========= There are two problems right now in the way projects are installed in Python: -- There are too many ways to install a project in Python. +- There are too many ways to do it. - There is no API to get the metadata of installed projects. How projects are installed -------------------------- -Right now, when a project is installed in Python, every package its contains -is installed in the `site-packages` directory with the Distutils `install` -command. +Right now, when a project is installed in Python, every elements its contains +is installed in various directories. + +The pure Python code for instance is installed in the `purelib` directory, +which is located in the Python installation in `lib\python2.6\site-packages` +for example under unix-like systems or Mac OS X, and in `Lib/site-packages` +under Windows. This is done with the Distutils `install` command, which calls +various subcommands. The `install_egg_info` subcommand is called during this process, in order to -create an `.egg-info` file in the `site-packages` directory. +create an `.egg-info` file in the `purelib` directory. For example, if the `zlib` project (which contains one package) is installed, two elements will be installed in `site-packages`:: @@ -51,8 +64,8 @@ - zlib - zlib-2.5.2-py2.4.egg-info -Where `zlib` is the package, and `zlib-2.5.2-py2.4.egg-info` is -a file containing the package metadata as described in PEP 314. +Where `zlib` is a Python package, and `zlib-2.5.2-py2.4.egg-info` is +a file containing the project metadata as described in PEP 314 [#pep314]_. This file corresponds to the file called `PKG-INFO`, built by the `sdist` command. @@ -63,11 +76,13 @@ - `easy_install` creates an `EGG-INFO` directory inside an `.egg` directory, and adds a `PKG-INFO` file inside this directory. The `.egg` directory - contains in that case the packages of the project. - -- `pip` creates an `.egg-info` directory inside the site-packages directory - and adds a `PKG-INFO` file inside it. Packages are installed in - site-packages directory in a regular way. + contains in that case all the elements of the project that are supposed to + be installed in `site-packages`, and is placed in the `site-packages` + directory. + +- `pip` creates an `.egg-info` directory inside the `site-packages` directory + and adds a `PKG-INFO` file inside it. Elements of the project are then + installed in various places like Distutils does. They both add other files in the `EGG-INFO` or `.egg-info` directory, and create or modify `.pth` files. @@ -76,16 +91,19 @@ --------------------- Distutils doesn't provide any `uninstall` command. If you want to uninstall -a project, you have to be a power user and remove the various package -directories from the right `site-packages` directory, then look over the right -`pth` files. And this method differs, depending on the tools you are using. - -The worst issue is that you depend on the way the packager created his package. -When you call `python setup.py install`, it will not be installed the same way -depending on the tool used by the packager (mainly Distutils or Setuptools). +a project, you have to be a power user and remove the various elements that +were installed. Then look over the `.pth` file to clean them if necessary. + +And the process differs, depending on the tools you have used to install the +project, and if the project's `setup.py` uses Distutils or Setuptools. -But there's common behavior: files are copied in your installation. -And there's a way to keep track of theses file, so to remove them. +Under some circumstances, you might not be able to know for sure that you +have removed everything, or that you didn't break another project by +removing a file that was shared among the two projects. + +But there's common behavior: when you install a project, files are copied +in your system. And there's a way to keep track of theses files, so to remove +them. What this PEP proposes ---------------------- @@ -101,51 +119,58 @@ ============================= The first change would be to make `.egg-info` a directory and let it -hold the `PKG-INFO` file built by the `write_pkg_file` method. +hold the `PKG-INFO` file built by the `write_pkg_file` method of +the `Distribution` class in Distutils. -This change will not impact Python itself, because this file is not -used anywhere yet in the standard library. So there's no need of -deprecation. +This change will not impact Python itself, because `egg-info` files are not +used anywhere yet in the standard library besides Distutils. Although it will impact the `setuptools` and `pip` projects, but given -the fact that they already work with a directory that contains a -`PKG-INFO` file, the change will be small. +the fact that they already work with a directory that contains a `PKG-INFO` +file, the change will have no deep consequences. -For example, if the `zlib` package is installed, two elements -will be installed in `site-packages`:: +For example, if the `zlib` package is installed, the elements that +will be installed in `site-packages` will become:: - zlib - zlib-2.5.2.egg-info/ PKG-INFO -The Python version will also be removed from the .egg-info directory -name. To be able to implement this change, the impacted code in Distutils -is the `install_egg_info` command, and the various third-party projects. +The Python version will also be removed from the `.egg-info` directory +name. Adding a RECORD in the .egg-info directory ========================================== A `RECORD` file will be added inside the `.egg-info` directory at installation -time. +time. The `RECORD` file will hold the list of installed files. These correspond +to the files listed by the `record` option of the `install` command, and will +always be generated. This will allow uninstallation, as explained later in this +PEP. This RECORD file is inspired from PEP 262 FILES [#pep262]_. + +The RECORD format +----------------- + +The `RECORD` file is composed of records, one line per installed file. +Each record is composed of three elements separated by a `;` character: + +- the file's full **path** -- the `RECORD` file will hold the list of installed files. These - correspond to the files listed by the `record` option of the `install` - command, and will always be generated. This will allow uninstallation, as - explained later in this PEP. - -The `install` command will record by default installed files in the -RECORD file, using these rules: - -- if the installed file is located in a directory in `site-packages`, - it will be a '/'-separated relative path, no matter what is the target - system. This makes this information cross-compatible and allows simple - installation to be relocatable. + - if the installed file is located in a directory in `site-packages`, + it will be a '/'-separated relative path, no matter what is the target + system. This makes this information cross-compatible and allows simple + installation to be relocatable. -- if the installed file is located elsewhere in the system, a - '/'-separated absolute path is used. + - if the installed file is located elsewhere in the system, a + '/'-separated absolute path is used. -This will require changing the way the `install` command writes the record -file, so the old `record` behavior will be deprecated. +- the **MD5** hash of the file, encoded in hex. Notice that `pyc` and `pyo` + generated files will not have a hash. + +- the file's size in bytes + +Example +------- Back to our `zlib` example, we will have:: @@ -154,6 +179,21 @@ PKG-INFO RECORD +And the RECORD file will contain:: + + zlib/include/zconf.h;b690274f621402dda63bf11ba5373bf2;9544 + zlib/include/zlib.h;9c4b84aff68aa55f2e9bf70481b94333;66188 + zlib/lib/libz.a;e6d43fb94292411909404b07d0692d46;91128 + zlib/share/man/man3/zlib.3;785dc03452f0508ff0678fba2457e0ba;4486 + zlib-2.5.2.egg-info/PKG-INFO;6fe57de576d749536082d8e205b77748;195 + zlib-2.5.2.egg-info/RECORD + +Notice that: + +- the `RECORD` file can't contain a hash of itself and is just mentioned here +- `zlib` and `zlib-2.5.2.egg-info` are located in `site-packages` so the file + paths are relative to it. + New functions in pkgutil ======================== @@ -178,16 +218,31 @@ Uses `get_egg_info` to get the `PKG-INFO` file, and returns a `DistributionMetadata` instance that contains the metadata. - This will require a small change in `DistributionMetadata` (see #4908). -- get_egg_info_file(project_name, filename) -> file object or None +- get_files(project_name) -> iterator of (path, hash, size, other_projects) + + Uses `get_egg_info` to get the `RECORD` file, and returns an iterator. + + Each returned element is a tuple `(path, hash, size, other_projects)` where + ``path`, ``hash``, ``size`` are the values found in the RECORD file. - Uses `get_egg_info` and gets any file inside the directory, - pointed by filename. + `other_projects` is a tuple containing the name of the projects that are + also referring to this file in their own RECORD file (same path). + + If `other_projects` is empty, it means that the file is only referred by the + current project. In other words, it can be removed if the project is removed. + +- get_egg_info_file(project_name, path) -> file object or None + + Uses `get_egg_info` and gets any element inside the directory, + pointed by its relative path. `get_egg_info_file` will perform + an `os.path.join` on `get_egg_info(project_name)` and `path` to build the + whole path. Let's use it with our `zlib` example:: - >>> from pkgutil import get_egg_info, get_metadata, get_egg_info_file + >>> from pkgutil import (get_egg_info, get_metadata, get_egg_info_file, + ... get_files) >>> get_egg_info('zlib') '/opt/local/lib/python2.6/site-packages/zlib-2.5.2.egg-info' >>> metadata = get_metadata('zlib') @@ -197,6 +252,16 @@ some ... files + >>> for path, hash, size, other_projects in get_files('zlib'): + ... print '%s %s %d %s' % (path, hash, size, ','.join(other_projects)) + ... + zlib/include/zconf.h b690274f621402dda63bf11ba5373bf2 9544 + zlib/include/zlib.h 9c4b84aff68aa55f2e9bf70481b94333 66188 + zlib/lib/libz.a e6d43fb94292411909404b07d0692d46 91128 + zlib/share/man/man3/zlib.3 785dc03452f0508ff0678fba2457e0ba 4486 + zlib-2.5.2.egg-info/PKG-INFO 6fe57de576d749536082d8e205b77748 195 + zlib-2.5.2.egg-info/RECORD None None + Adding an Uninstall function ============================ @@ -204,14 +269,13 @@ Distutils provides a very basic way to install a project, which is running the `install` command over the `setup.py` script of the distribution. -Distutils will provide a very basic `uninstall` command that will remove -all files listed in the `RECORD` file of a project, as long as they are not -mentioned in another `RECORD` file and as long as the package is installed -using the standard described earlier. - -This command will be added in ``distutils.util`` and will take the name -of the project to uninstall as its argument. A call to uninstall will return a -list of uninstalled files:: +Distutils will provide a very basic ``uninstall`` function, that will be added +in ``distutils.util`` and will take the name of the project to uninstall as +its argument. ``uninstall`` will use ``pkgutil.get_files`` and remove all +unique files, as long as their hash didn't change. Then it will remove +directories where it removed the last elements. + +``uninstall`` will return a list of uninstalled files:: >>> from distutils.util import uninstall >>> uninstall('zlib') @@ -220,23 +284,28 @@ If the project is not found, a ``DistutilsUninstallError`` will be raised. -To make it a reference API for third-party projects that wish to provide -an `uninstall feature`. The ``uninstall`` function can also be invoked with a -second callable argument, that will be invoked for each file to be removed. -If this callable returns `True`, the file will be removed. +To make it a reference API for third-party projects that wish to control +how `uninstall` works, a second callable argument can be used. It will be +called for each file that is removed. If the callable returns `True`, the +file will be removed. If it returns False, it will be left alone. Examples:: >>> def _remove_and_log(path): ... logging.info('Removing %s' % path) ... return True + ... >>> uninstall('zlib', _remove_and_log) >>> def _dry_run(path): ... logging.info('Removing %s (dry run)' % path) ... return False + ... >>> uninstall('zlib', _dry_run) +Of course, a third-party tool can use ``pkgutil.get_files`` for a maximum +control, to implement their own uninstall feature. + Backward compatibility and roadmap ================================== @@ -244,10 +313,20 @@ version of Distutils, and will also work with existing third-party tools. Although, a backport of the new Distutils for 2.5, 2.6, 3.0 and 3.1 will be -provided so people can benefit from the new features. +provided so people can benefit from these new features. The plan is to integrate them for Python 2.7 and Python 3.2 +References +========== + +.. [#pep262] + http://www.python.org/dev/peps/pep-0262 + +.. [#pep314] + http://www.python.org/dev/peps/pep-0314 + + Aknowledgments ============== From python-checkins at python.org Sat May 16 18:37:06 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 16 May 2009 18:37:06 +0200 (CEST) Subject: [Python-checkins] r72681 - in python/trunk: Lib/distutils/command/register.py Lib/distutils/command/sdist.py Lib/distutils/tests/support.py Lib/distutils/tests/test_register.py Lib/distutils/tests/test_sdist.py Misc/NEWS Message-ID: <20090516163706.99470D516@mail.python.org> Author: tarek.ziade Date: Sat May 16 18:37:06 2009 New Revision: 72681 Log: #6041: sdist and register now use the check command. No more duplicate code for metadata checking Modified: python/trunk/Lib/distutils/command/register.py python/trunk/Lib/distutils/command/sdist.py python/trunk/Lib/distutils/tests/support.py python/trunk/Lib/distutils/tests/test_register.py python/trunk/Lib/distutils/tests/test_sdist.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/command/register.py ============================================================================== --- python/trunk/Lib/distutils/command/register.py (original) +++ python/trunk/Lib/distutils/command/register.py Sat May 16 18:37:06 2009 @@ -9,6 +9,7 @@ import os, string, urllib2, getpass, urlparse import StringIO +from warnings import warn from distutils.core import PyPIRCCommand from distutils.errors import * @@ -20,18 +21,34 @@ user_options = PyPIRCCommand.user_options + [ ('list-classifiers', None, 'list the valid Trove classifiers'), + ('strict', None , + 'Will stop the registering if the meta-data are not fully compliant') ] boolean_options = PyPIRCCommand.boolean_options + [ - 'verify', 'list-classifiers'] + 'verify', 'list-classifiers', 'strict'] + + sub_commands = [('check', lambda self: True)] def initialize_options(self): PyPIRCCommand.initialize_options(self) self.list_classifiers = 0 + self.strict = 0 + + def finalize_options(self): + PyPIRCCommand.finalize_options(self) + # setting options for the `check` subcommand + check_options = {'strict': ('register', self.strict), + 'restructuredtext': ('register', 1)} + self.distribution.command_options['check'] = check_options def run(self): self.finalize_options() self._set_config() - self.check_metadata() + + # Run sub commands + for cmd_name in self.get_sub_commands(): + self.run_command(cmd_name) + if self.dry_run: self.verify_metadata() elif self.list_classifiers: @@ -40,34 +57,14 @@ self.send_metadata() def check_metadata(self): - """Ensure that all required elements of meta-data (name, version, - URL, (author and author_email) or (maintainer and - maintainer_email)) are supplied by the Distribution object; warn if - any are missing. - """ - metadata = self.distribution.metadata - - missing = [] - for attr in ('name', 'version', 'url'): - if not (hasattr(metadata, attr) and getattr(metadata, attr)): - missing.append(attr) - - if missing: - self.warn("missing required meta-data: " + - string.join(missing, ", ")) - - if metadata.author: - if not metadata.author_email: - self.warn("missing meta-data: if 'author' supplied, " + - "'author_email' must be supplied too") - elif metadata.maintainer: - if not metadata.maintainer_email: - self.warn("missing meta-data: if 'maintainer' supplied, " + - "'maintainer_email' must be supplied too") - else: - self.warn("missing meta-data: either (author and author_email) " + - "or (maintainer and maintainer_email) " + - "must be supplied") + """Deprecated API.""" + warn("distutils.command.register.check_metadata is deprecated, \ + use the check command instead", PendingDeprecationWarning) + check = self.distribution.get_command_obj('check') + check.ensure_finalized() + check.strict = self.strict + check.restructuredtext = 1 + check.run() def _set_config(self): ''' Reads the configuration file and set attributes. Modified: python/trunk/Lib/distutils/command/sdist.py ============================================================================== --- python/trunk/Lib/distutils/command/sdist.py (original) +++ python/trunk/Lib/distutils/command/sdist.py Sat May 16 18:37:06 2009 @@ -8,6 +8,8 @@ import sys from types import * from glob import glob +from warnings import warn + from distutils.core import Command from distutils import dir_util, dep_util, file_util, archive_util from distutils.text_file import TextFile @@ -34,6 +36,12 @@ description = "create a source distribution (tarball, zip file, etc.)" + def checking_metadata(self): + """Callable used for the check sub-command. + + Placed here so user_options can view it""" + return self.metadata_check + user_options = [ ('template=', 't', "name of manifest template file [default: MANIFEST.in]"), @@ -63,11 +71,14 @@ ('dist-dir=', 'd', "directory to put the source distribution archive(s) in " "[default: dist]"), + ('medata-check', None, + "Ensure that all required elements of meta-data " + "are supplied. Warn if any missing. [default]"), ] boolean_options = ['use-defaults', 'prune', 'manifest-only', 'force-manifest', - 'keep-temp'] + 'keep-temp', 'metadata-check'] help_options = [ ('help-formats', None, @@ -80,6 +91,8 @@ default_format = {'posix': 'gztar', 'nt': 'zip' } + sub_commands = [('check', checking_metadata)] + def initialize_options(self): # 'template' and 'manifest' are, respectively, the names of # the manifest template and manifest file. @@ -99,6 +112,7 @@ self.dist_dir = None self.archive_files = None + self.metadata_check = 1 def finalize_options(self): if self.manifest is None: @@ -128,9 +142,9 @@ # manifest self.filelist = FileList() - # Ensure that all required meta-data is given; warn if not (but - # don't die, it's not *that* serious!) - self.check_metadata() + # Run sub commands + for cmd_name in self.get_sub_commands(): + self.run_command(cmd_name) # Do whatever it takes to get the list of files to process # (process the manifest template, read an existing manifest, @@ -146,34 +160,12 @@ self.make_distribution() def check_metadata(self): - """Ensure that all required elements of meta-data (name, version, - URL, (author and author_email) or (maintainer and - maintainer_email)) are supplied by the Distribution object; warn if - any are missing. - """ - metadata = self.distribution.metadata - - missing = [] - for attr in ('name', 'version', 'url'): - if not (hasattr(metadata, attr) and getattr(metadata, attr)): - missing.append(attr) - - if missing: - self.warn("missing required meta-data: " + - string.join(missing, ", ")) - - if metadata.author: - if not metadata.author_email: - self.warn("missing meta-data: if 'author' supplied, " + - "'author_email' must be supplied too") - elif metadata.maintainer: - if not metadata.maintainer_email: - self.warn("missing meta-data: if 'maintainer' supplied, " + - "'maintainer_email' must be supplied too") - else: - self.warn("missing meta-data: either (author and author_email) " + - "or (maintainer and maintainer_email) " + - "must be supplied") + """Deprecated API.""" + warn("distutils.command.sdist.check_metadata is deprecated, \ + use the check command instead", PendingDeprecationWarning) + check = self.distribution.get_command_obj('check') + check.ensure_finalized() + check.run() def get_file_list(self): """Figure out the list of files to include in the source Modified: python/trunk/Lib/distutils/tests/support.py ============================================================================== --- python/trunk/Lib/distutils/tests/support.py (original) +++ python/trunk/Lib/distutils/tests/support.py Sat May 16 18:37:06 2009 @@ -12,11 +12,31 @@ def setUp(self): super(LoggingSilencer, self).setUp() self.threshold = log.set_threshold(log.FATAL) + # catching warnings + # when log will be replaced by logging + # we won't need such monkey-patch anymore + self._old_log = log.Log._log + log.Log._log = self._log + self.logs = [] def tearDown(self): log.set_threshold(self.threshold) + log.Log._log = self._old_log super(LoggingSilencer, self).tearDown() + def _log(self, level, msg, args): + self.logs.append((level, msg, args)) + + def get_logs(self, *levels): + def _format(msg, args): + if len(args) == 0: + return msg + return msg % args + return [_format(msg, args) for level, msg, args + in self.logs if level in levels] + + def clear_logs(self): + self.logs = [] class TempdirManager(object): """Mix-in class that handles temporary directories for test cases. Modified: python/trunk/Lib/distutils/tests/test_register.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_register.py (original) +++ python/trunk/Lib/distutils/tests/test_register.py Sat May 16 18:37:06 2009 @@ -4,10 +4,14 @@ import unittest import getpass import urllib2 +import warnings + +from test.test_support import check_warnings from distutils.command import register as register_module from distutils.command.register import register from distutils.core import Distribution +from distutils.errors import DistutilsSetupError from distutils.tests import support from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase @@ -59,7 +63,7 @@ def read(self): return 'xxx' -class registerTestCase(PyPIRCCommandTestCase): +class RegisterTestCase(PyPIRCCommandTestCase): def setUp(self): PyPIRCCommandTestCase.setUp(self) @@ -76,10 +80,11 @@ urllib2.build_opener = self.old_opener PyPIRCCommandTestCase.tearDown(self) - def _get_cmd(self): - metadata = {'url': 'xxx', 'author': 'xxx', - 'author_email': 'xxx', - 'name': 'xxx', 'version': 'xxx'} + def _get_cmd(self, metadata=None): + if metadata is None: + metadata = {'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx', + 'name': 'xxx', 'version': 'xxx'} pkg_info, dist = self.create_dist(**metadata) return register(dist) @@ -184,8 +189,70 @@ self.assertEquals(headers['Content-length'], '290') self.assert_('tarek' in req.data) + def test_strict(self): + # testing the script option + # when on, the register command stops if + # the metadata is incomplete or if + # long_description is not reSt compliant + + # empty metadata + cmd = self._get_cmd({}) + cmd.ensure_finalized() + cmd.strict = 1 + self.assertRaises(DistutilsSetupError, cmd.run) + + # we don't test the reSt feature if docutils + # is not installed + try: + import docutils + except ImportError: + return + + # metadata are OK but long_description is broken + metadata = {'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx', + 'name': 'xxx', 'version': 'xxx', + 'long_description': 'title\n==\n\ntext'} + + cmd = self._get_cmd(metadata) + cmd.ensure_finalized() + cmd.strict = 1 + self.assertRaises(DistutilsSetupError, cmd.run) + + # now something that works + metadata['long_description'] = 'title\n=====\n\ntext' + cmd = self._get_cmd(metadata) + cmd.ensure_finalized() + cmd.strict = 1 + inputs = RawInputs('1', 'tarek', 'y') + register_module.raw_input = inputs.__call__ + # let's run the command + try: + cmd.run() + finally: + del register_module.raw_input + + # strict is not by default + cmd = self._get_cmd() + cmd.ensure_finalized() + inputs = RawInputs('1', 'tarek', 'y') + register_module.raw_input = inputs.__call__ + # let's run the command + try: + cmd.run() + finally: + del register_module.raw_input + + def test_check_metadata_deprecated(self): + # makes sure make_metadata is deprecated + cmd = self._get_cmd() + with check_warnings() as w: + warnings.simplefilter("always") + cmd.check_metadata() + self.assertEquals(len(w.warnings), 1) + def test_suite(): - return unittest.makeSuite(registerTestCase) + return unittest.makeSuite(RegisterTestCase) if __name__ == "__main__": unittest.main(defaultTest="test_suite") Modified: python/trunk/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_sdist.py (original) +++ python/trunk/Lib/distutils/tests/test_sdist.py Sat May 16 18:37:06 2009 @@ -6,7 +6,9 @@ from os.path import join import sys import tempfile +import warnings +from test.test_support import check_warnings from test.test_support import captured_stdout from distutils.command.sdist import sdist @@ -16,6 +18,7 @@ from distutils.errors import DistutilsExecError, DistutilsOptionError from distutils.spawn import find_executable from distutils.tests import support +from distutils.log import WARN from distutils.archive_util import ARCHIVE_FORMATS SETUP_PY = """ @@ -38,12 +41,12 @@ somecode%(sep)sdoc.txt """ -class sdistTestCase(PyPIRCCommandTestCase): +class SDistTestCase(PyPIRCCommandTestCase): def setUp(self): # PyPIRCCommandTestCase creates a temp dir already # and put it in self.tmp_dir - super(sdistTestCase, self).setUp() + super(SDistTestCase, self).setUp() # setting up an environment self.old_path = os.getcwd() os.mkdir(join(self.tmp_dir, 'somecode')) @@ -57,7 +60,7 @@ def tearDown(self): # back to normal os.chdir(self.old_path) - super(sdistTestCase, self).tearDown() + super(SDistTestCase, self).tearDown() def get_cmd(self, metadata=None): """Returns a cmd""" @@ -214,6 +217,34 @@ manifest = open(join(self.tmp_dir, 'MANIFEST')).read() self.assertEquals(manifest, MANIFEST % {'sep': os.sep}) + def test_metadata_check_option(self): + # testing the `medata-check` option + dist, cmd = self.get_cmd(metadata={}) + + # this should raise some warnings ! + # with the `check` subcommand + cmd.ensure_finalized() + cmd.run() + warnings = self.get_logs(WARN) + self.assertEquals(len(warnings), 2) + + # trying with a complete set of metadata + self.clear_logs() + dist, cmd = self.get_cmd() + cmd.ensure_finalized() + cmd.metadata_check = 0 + cmd.run() + warnings = self.get_logs(WARN) + self.assertEquals(len(warnings), 0) + + def test_check_metadata_deprecated(self): + # makes sure make_metadata is deprecated + dist, cmd = self.get_cmd() + with check_warnings() as w: + warnings.simplefilter("always") + cmd.check_metadata() + self.assertEquals(len(w.warnings), 1) + def test_show_formats(self): with captured_stdout() as stdout: show_formats() @@ -247,7 +278,7 @@ def test_suite(): - return unittest.makeSuite(sdistTestCase) + return unittest.makeSuite(SDistTestCase) if __name__ == "__main__": unittest.main(defaultTest="test_suite") Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat May 16 18:37:06 2009 @@ -293,6 +293,9 @@ Library ------- +- Issue #6041: Now distutils `sdist` and `register` commands use `check` as a + subcommand. + - Issue #2116: Weak references and weak dictionaries now support copy()ing and deepcopy()ing. From python-checkins at python.org Sat May 16 18:41:02 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 16 May 2009 18:41:02 +0200 (CEST) Subject: [Python-checkins] r72682 - python/branches/release26-maint Message-ID: <20090516164102.6A3C9D323@mail.python.org> Author: tarek.ziade Date: Sat May 16 18:41:02 2009 New Revision: 72682 Log: Blocked revisions 72681 via svnmerge ........ r72681 | tarek.ziade | 2009-05-16 18:37:06 +0200 (Sat, 16 May 2009) | 1 line #6041: sdist and register now use the check command. No more duplicate code for metadata checking ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sat May 16 18:52:13 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 16 May 2009 18:52:13 +0200 (CEST) Subject: [Python-checkins] r72683 - in python/branches/py3k: Lib/distutils/command/register.py Lib/distutils/command/sdist.py Lib/distutils/tests/support.py Lib/distutils/tests/test_register.py Lib/distutils/tests/test_sdist.py Misc/NEWS Message-ID: <20090516165213.4182CD748@mail.python.org> Author: tarek.ziade Date: Sat May 16 18:52:13 2009 New Revision: 72683 Log: Merged revisions 72681 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72681 | tarek.ziade | 2009-05-16 18:37:06 +0200 (Sat, 16 May 2009) | 1 line #6041: sdist and register now use the check command. No more duplicate code for metadata checking ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/command/register.py python/branches/py3k/Lib/distutils/command/sdist.py python/branches/py3k/Lib/distutils/tests/support.py python/branches/py3k/Lib/distutils/tests/test_register.py python/branches/py3k/Lib/distutils/tests/test_sdist.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/distutils/command/register.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/register.py (original) +++ python/branches/py3k/Lib/distutils/command/register.py Sat May 16 18:52:13 2009 @@ -10,6 +10,7 @@ import os, string, getpass import io import urllib.parse, urllib.request +from warnings import warn from distutils.core import PyPIRCCommand from distutils.errors import * @@ -21,18 +22,34 @@ user_options = PyPIRCCommand.user_options + [ ('list-classifiers', None, 'list the valid Trove classifiers'), + ('strict', None , + 'Will stop the registering if the meta-data are not fully compliant') ] boolean_options = PyPIRCCommand.boolean_options + [ - 'verify', 'list-classifiers'] + 'verify', 'list-classifiers', 'strict'] + + sub_commands = [('check', lambda self: True)] def initialize_options(self): PyPIRCCommand.initialize_options(self) self.list_classifiers = 0 + self.strict = 0 + + def finalize_options(self): + PyPIRCCommand.finalize_options(self) + # setting options for the `check` subcommand + check_options = {'strict': ('register', self.strict), + 'restructuredtext': ('register', 1)} + self.distribution.command_options['check'] = check_options def run(self): self.finalize_options() self._set_config() - self.check_metadata() + + # Run sub commands + for cmd_name in self.get_sub_commands(): + self.run_command(cmd_name) + if self.dry_run: self.verify_metadata() elif self.list_classifiers: @@ -41,34 +58,14 @@ self.send_metadata() def check_metadata(self): - """Ensure that all required elements of meta-data (name, version, - URL, (author and author_email) or (maintainer and - maintainer_email)) are supplied by the Distribution object; warn if - any are missing. - """ - metadata = self.distribution.metadata - - missing = [] - for attr in ('name', 'version', 'url'): - if not (hasattr(metadata, attr) and getattr(metadata, attr)): - missing.append(attr) - - if missing: - self.warn("missing required meta-data: " + - ", ".join(missing)) - - if metadata.author: - if not metadata.author_email: - self.warn("missing meta-data: if 'author' supplied, " + - "'author_email' must be supplied too") - elif metadata.maintainer: - if not metadata.maintainer_email: - self.warn("missing meta-data: if 'maintainer' supplied, " + - "'maintainer_email' must be supplied too") - else: - self.warn("missing meta-data: either (author and author_email) " + - "or (maintainer and maintainer_email) " + - "must be supplied") + """Deprecated API.""" + warn("distutils.command.register.check_metadata is deprecated, \ + use the check command instead", PendingDeprecationWarning) + check = self.distribution.get_command_obj('check') + check.ensure_finalized() + check.strict = self.strict + check.restructuredtext = 1 + check.run() def _set_config(self): ''' Reads the configuration file and set attributes. Modified: python/branches/py3k/Lib/distutils/command/sdist.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/sdist.py (original) +++ python/branches/py3k/Lib/distutils/command/sdist.py Sat May 16 18:52:13 2009 @@ -9,6 +9,8 @@ import sys from types import * from glob import glob +from warnings import warn + from distutils.core import Command from distutils import dir_util, dep_util, file_util, archive_util from distutils.text_file import TextFile @@ -35,6 +37,12 @@ description = "create a source distribution (tarball, zip file, etc.)" + def checking_metadata(self): + """Callable used for the check sub-command. + + Placed here so user_options can view it""" + return self.metadata_check + user_options = [ ('template=', 't', "name of manifest template file [default: MANIFEST.in]"), @@ -64,11 +72,14 @@ ('dist-dir=', 'd', "directory to put the source distribution archive(s) in " "[default: dist]"), + ('medata-check', None, + "Ensure that all required elements of meta-data " + "are supplied. Warn if any missing. [default]"), ] boolean_options = ['use-defaults', 'prune', 'manifest-only', 'force-manifest', - 'keep-temp'] + 'keep-temp', 'metadata-check'] help_options = [ ('help-formats', None, @@ -81,6 +92,8 @@ default_format = {'posix': 'gztar', 'nt': 'zip' } + sub_commands = [('check', checking_metadata)] + def initialize_options(self): # 'template' and 'manifest' are, respectively, the names of # the manifest template and manifest file. @@ -100,6 +113,7 @@ self.dist_dir = None self.archive_files = None + self.metadata_check = 1 def finalize_options(self): if self.manifest is None: @@ -129,9 +143,9 @@ # manifest self.filelist = FileList() - # Ensure that all required meta-data is given; warn if not (but - # don't die, it's not *that* serious!) - self.check_metadata() + # Run sub commands + for cmd_name in self.get_sub_commands(): + self.run_command(cmd_name) # Do whatever it takes to get the list of files to process # (process the manifest template, read an existing manifest, @@ -147,34 +161,12 @@ self.make_distribution() def check_metadata(self): - """Ensure that all required elements of meta-data (name, version, - URL, (author and author_email) or (maintainer and - maintainer_email)) are supplied by the Distribution object; warn if - any are missing. - """ - metadata = self.distribution.metadata - - missing = [] - for attr in ('name', 'version', 'url'): - if not (hasattr(metadata, attr) and getattr(metadata, attr)): - missing.append(attr) - - if missing: - self.warn("missing required meta-data: " + - ", ".join(missing)) - - if metadata.author: - if not metadata.author_email: - self.warn("missing meta-data: if 'author' supplied, " + - "'author_email' must be supplied too") - elif metadata.maintainer: - if not metadata.maintainer_email: - self.warn("missing meta-data: if 'maintainer' supplied, " + - "'maintainer_email' must be supplied too") - else: - self.warn("missing meta-data: either (author and author_email) " + - "or (maintainer and maintainer_email) " + - "must be supplied") + """Deprecated API.""" + warn("distutils.command.sdist.check_metadata is deprecated, \ + use the check command instead", PendingDeprecationWarning) + check = self.distribution.get_command_obj('check') + check.ensure_finalized() + check.run() def get_file_list(self): """Figure out the list of files to include in the source Modified: python/branches/py3k/Lib/distutils/tests/support.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/support.py (original) +++ python/branches/py3k/Lib/distutils/tests/support.py Sat May 16 18:52:13 2009 @@ -12,11 +12,31 @@ def setUp(self): super().setUp() self.threshold = log.set_threshold(log.FATAL) + # catching warnings + # when log will be replaced by logging + # we won't need such monkey-patch anymore + self._old_log = log.Log._log + log.Log._log = self._log + self.logs = [] def tearDown(self): log.set_threshold(self.threshold) + log.Log._log = self._old_log super().tearDown() + def _log(self, level, msg, args): + self.logs.append((level, msg, args)) + + def get_logs(self, *levels): + def _format(msg, args): + if len(args) == 0: + return msg + return msg % args + return [_format(msg, args) for level, msg, args + in self.logs if level in levels] + + def clear_logs(self): + self.logs = [] class TempdirManager(object): """Mix-in class that handles temporary directories for test cases. Modified: python/branches/py3k/Lib/distutils/tests/test_register.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_register.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_register.py Sat May 16 18:52:13 2009 @@ -4,10 +4,14 @@ import unittest import getpass import urllib +import warnings + +from test.support import check_warnings from distutils.command import register as register_module from distutils.command.register import register from distutils.core import Distribution +from distutils.errors import DistutilsSetupError from distutils.tests import support from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase @@ -59,7 +63,7 @@ def read(self): return 'xxx' -class registerTestCase(PyPIRCCommandTestCase): +class RegisterTestCase(PyPIRCCommandTestCase): def setUp(self): PyPIRCCommandTestCase.setUp(self) @@ -76,10 +80,11 @@ urllib.request.build_opener = self.old_opener PyPIRCCommandTestCase.tearDown(self) - def _get_cmd(self): - metadata = {'url': 'xxx', 'author': 'xxx', - 'author_email': 'xxx', - 'name': 'xxx', 'version': 'xxx'} + def _get_cmd(self, metadata=None): + if metadata is None: + metadata = {'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx', + 'name': 'xxx', 'version': 'xxx'} pkg_info, dist = self.create_dist(**metadata) return register(dist) @@ -184,8 +189,70 @@ self.assertEquals(headers['Content-length'], '290') self.assert_((b'tarek') in req.data) + def test_strict(self): + # testing the script option + # when on, the register command stops if + # the metadata is incomplete or if + # long_description is not reSt compliant + + # empty metadata + cmd = self._get_cmd({}) + cmd.ensure_finalized() + cmd.strict = 1 + self.assertRaises(DistutilsSetupError, cmd.run) + + # we don't test the reSt feature if docutils + # is not installed + try: + import docutils + except ImportError: + return + + # metadata are OK but long_description is broken + metadata = {'url': 'xxx', 'author': 'xxx', + 'author_email': 'xxx', + 'name': 'xxx', 'version': 'xxx', + 'long_description': 'title\n==\n\ntext'} + + cmd = self._get_cmd(metadata) + cmd.ensure_finalized() + cmd.strict = 1 + self.assertRaises(DistutilsSetupError, cmd.run) + + # now something that works + metadata['long_description'] = 'title\n=====\n\ntext' + cmd = self._get_cmd(metadata) + cmd.ensure_finalized() + cmd.strict = 1 + inputs = RawInputs('1', 'tarek', 'y') + register_module.raw_input = inputs.__call__ + # let's run the command + try: + cmd.run() + finally: + del register_module.raw_input + + # strict is not by default + cmd = self._get_cmd() + cmd.ensure_finalized() + inputs = RawInputs('1', 'tarek', 'y') + register_module.raw_input = inputs.__call__ + # let's run the command + try: + cmd.run() + finally: + del register_module.raw_input + + def test_check_metadata_deprecated(self): + # makes sure make_metadata is deprecated + cmd = self._get_cmd() + with check_warnings() as w: + warnings.simplefilter("always") + cmd.check_metadata() + self.assertEquals(len(w.warnings), 1) + def test_suite(): - return unittest.makeSuite(registerTestCase) + return unittest.makeSuite(RegisterTestCase) if __name__ == "__main__": unittest.main(defaultTest="test_suite") Modified: python/branches/py3k/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_sdist.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_sdist.py Sat May 16 18:52:13 2009 @@ -6,7 +6,9 @@ from os.path import join import sys import tempfile +import warnings +from test.support import check_warnings from test.support import captured_stdout from distutils.command.sdist import sdist @@ -16,6 +18,7 @@ from distutils.errors import DistutilsExecError, DistutilsOptionError from distutils.spawn import find_executable from distutils.tests import support +from distutils.log import WARN from distutils.archive_util import ARCHIVE_FORMATS SETUP_PY = """ @@ -38,12 +41,12 @@ somecode%(sep)sdoc.txt """ -class sdistTestCase(PyPIRCCommandTestCase): +class SDistTestCase(PyPIRCCommandTestCase): def setUp(self): # PyPIRCCommandTestCase creates a temp dir already # and put it in self.tmp_dir - super(sdistTestCase, self).setUp() + super(SDistTestCase, self).setUp() # setting up an environment self.old_path = os.getcwd() os.mkdir(join(self.tmp_dir, 'somecode')) @@ -57,7 +60,7 @@ def tearDown(self): # back to normal os.chdir(self.old_path) - super(sdistTestCase, self).tearDown() + super(SDistTestCase, self).tearDown() def get_cmd(self, metadata=None): """Returns a cmd""" @@ -214,6 +217,34 @@ manifest = open(join(self.tmp_dir, 'MANIFEST')).read() self.assertEquals(manifest, MANIFEST % {'sep': os.sep}) + def test_metadata_check_option(self): + # testing the `medata-check` option + dist, cmd = self.get_cmd(metadata={}) + + # this should raise some warnings ! + # with the `check` subcommand + cmd.ensure_finalized() + cmd.run() + warnings = self.get_logs(WARN) + self.assertEquals(len(warnings), 2) + + # trying with a complete set of metadata + self.clear_logs() + dist, cmd = self.get_cmd() + cmd.ensure_finalized() + cmd.metadata_check = 0 + cmd.run() + warnings = self.get_logs(WARN) + self.assertEquals(len(warnings), 0) + + def test_check_metadata_deprecated(self): + # makes sure make_metadata is deprecated + dist, cmd = self.get_cmd() + with check_warnings() as w: + warnings.simplefilter("always") + cmd.check_metadata() + self.assertEquals(len(w.warnings), 1) + def test_show_formats(self): with captured_stdout() as stdout: show_formats() @@ -247,7 +278,7 @@ def test_suite(): - return unittest.makeSuite(sdistTestCase) + return unittest.makeSuite(SDistTestCase) if __name__ == "__main__": unittest.main(defaultTest="test_suite") Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 16 18:52:13 2009 @@ -616,6 +616,9 @@ Library ------- +- Issue #6041: Now distutils `sdist` and `register` commands use `check` as a + subcommand. + - Issue #6022: a test file was created in the current working directory by test_get_outputs in Distutils. From python-checkins at python.org Sat May 16 18:53:54 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 16 May 2009 18:53:54 +0200 (CEST) Subject: [Python-checkins] r72684 - python/branches/release30-maint Message-ID: <20090516165354.2CB5CD6E8@mail.python.org> Author: tarek.ziade Date: Sat May 16 18:53:54 2009 New Revision: 72684 Log: Blocked revisions 72683 via svnmerge ................ r72683 | tarek.ziade | 2009-05-16 18:52:13 +0200 (Sat, 16 May 2009) | 9 lines Merged revisions 72681 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72681 | tarek.ziade | 2009-05-16 18:37:06 +0200 (Sat, 16 May 2009) | 1 line #6041: sdist and register now use the check command. No more duplicate code for metadata checking ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sat May 16 19:13:55 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 16 May 2009 19:13:55 +0200 (CEST) Subject: [Python-checkins] r72685 - peps/trunk/pep-0376.txt Message-ID: <20090516171355.033E8D6B2@mail.python.org> Author: tarek.ziade Date: Sat May 16 19:13:54 2009 New Revision: 72685 Log: typo+more references Modified: peps/trunk/pep-0376.txt Modified: peps/trunk/pep-0376.txt ============================================================================== --- peps/trunk/pep-0376.txt (original) +++ peps/trunk/pep-0376.txt Sat May 16 19:13:54 2009 @@ -70,9 +70,9 @@ This file corresponds to the file called `PKG-INFO`, built by the `sdist` command. -The problem is that many people use `easy_install` (setuptools) or `pip` -to install their packages, and these third-party tools do not install -packages in the same way that Distutils does: +The problem is that many people use `easy_install` (setuptools [#setuptools]_) +or `pip` [#pip]_ to install their packages, and these third-party tools do not +install packages in the same way that Distutils does: - `easy_install` creates an `EGG-INFO` directory inside an `.egg` directory, and adds a `PKG-INFO` file inside this directory. The `.egg` directory @@ -224,7 +224,7 @@ Uses `get_egg_info` to get the `RECORD` file, and returns an iterator. Each returned element is a tuple `(path, hash, size, other_projects)` where - ``path`, ``hash``, ``size`` are the values found in the RECORD file. + ``path``, ``hash``, ``size`` are the values found in the RECORD file. `other_projects` is a tuple containing the name of the projects that are also referring to this file in their own RECORD file (same path). @@ -303,8 +303,8 @@ ... >>> uninstall('zlib', _dry_run) -Of course, a third-party tool can use ``pkgutil.get_files`` for a maximum -control, to implement their own uninstall feature. +Of course, a third-party tool can use ``pkgutil.get_files``, to implement +its own uninstall feature. Backward compatibility and roadmap ================================== @@ -326,6 +326,11 @@ .. [#pep314] http://www.python.org/dev/peps/pep-0314 +.. [#setuptools] + http://peak.telecommunity.com/DevCenter/setuptools + +.. [#pip] + http://pypi.python.org/pypi/pip Aknowledgments ============== From python-checkins at python.org Sat May 16 20:29:41 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 16 May 2009 20:29:41 +0200 (CEST) Subject: [Python-checkins] r72686 - python/trunk/Lib/distutils/dist.py Message-ID: <20090516182941.18488D508@mail.python.org> Author: tarek.ziade Date: Sat May 16 20:29:40 2009 New Revision: 72686 Log: pep8-fied distutils.dist module Modified: python/trunk/Lib/distutils/dist.py Modified: python/trunk/Lib/distutils/dist.py ============================================================================== --- python/trunk/Lib/distutils/dist.py (original) +++ python/trunk/Lib/distutils/dist.py Sat May 16 20:29:40 2009 @@ -267,23 +267,18 @@ self.finalize_options() - # __init__ () - - - def get_option_dict (self, command): + def get_option_dict(self, command): """Get the option dictionary for a given command. If that command's option dictionary hasn't been created yet, then create it and return the new dictionary; otherwise, return the existing option dictionary. """ - dict = self.command_options.get(command) if dict is None: dict = self.command_options[command] = {} return dict - - def dump_option_dicts (self, header=None, commands=None, indent=""): + def dump_option_dicts(self, header=None, commands=None, indent=""): from pprint import pformat if commands is None: # dump all command option dicts @@ -308,13 +303,9 @@ for line in string.split(out, "\n"): print indent + " " + line - # dump_option_dicts () - - - # -- Config file finding/parsing methods --------------------------- - def find_config_files (self): + def find_config_files(self): """Find as many configuration files as should be processed for this platform, and return a list of filenames in the order in which they should be parsed. The filenames returned are guaranteed to exist @@ -355,10 +346,7 @@ return files - # find_config_files () - - - def parse_config_files (self, filenames=None): + def parse_config_files(self, filenames=None): from ConfigParser import ConfigParser if filenames is None: @@ -400,12 +388,9 @@ except ValueError, msg: raise DistutilsOptionError, msg - # parse_config_files () - - # -- Command-line parsing methods ---------------------------------- - def parse_command_line (self): + def parse_command_line(self): """Parse the setup script's command line, taken from the 'script_args' instance attribute (which defaults to 'sys.argv[1:]' -- see 'setup()' in core.py). This list is first processed for @@ -478,9 +463,7 @@ # All is well: return true return 1 - # parse_command_line() - - def _get_toplevel_options (self): + def _get_toplevel_options(self): """Return the non-display options recognized at the top level. This includes options that are recognized *only* at the top @@ -491,7 +474,7 @@ "list of packages that provide distutils commands"), ] - def _parse_command_opts (self, parser, args): + def _parse_command_opts(self, parser, args): """Parse the command-line options for a single command. 'parser' must be a FancyGetopt instance; 'args' must be the list of arguments, starting with the current command (whose options @@ -587,14 +570,11 @@ return args - # _parse_command_opts () - - def finalize_options (self): + def finalize_options(self): """Set final values for all the options on the Distribution instance, analogous to the .finalize_options() method of Command objects. """ - keywords = self.metadata.keywords if keywords is not None: if type(keywords) is StringType: @@ -607,11 +587,8 @@ platformlist = string.split(platforms, ',') self.metadata.platforms = map(string.strip, platformlist) - def _show_help (self, - parser, - global_options=1, - display_options=1, - commands=[]): + def _show_help(self, parser, global_options=1, display_options=1, + commands=[]): """Show help for the setup script command-line in the form of several lists of command-line options. 'parser' should be a FancyGetopt instance; do not expect it to be returned in the @@ -661,10 +638,7 @@ print gen_usage(self.script_name) return - # _show_help () - - - def handle_display_options (self, option_order): + def handle_display_options(self, option_order): """If there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return @@ -704,13 +678,10 @@ return any_display_options - # handle_display_options() - - def print_command_list (self, commands, header, max_length): + def print_command_list(self, commands, header, max_length): """Print a subset of the list of all commands -- used by 'print_commands()'. """ - print header + ":" for cmd in commands: @@ -724,10 +695,7 @@ print " %-*s %s" % (max_length, cmd, description) - # print_command_list () - - - def print_commands (self): + def print_commands(self): """Print out a help message listing all available commands with a description of each. The list is divided into "standard commands" (listed in distutils.command.__all__) and "extra commands" @@ -735,7 +703,6 @@ descriptions come from the command class attribute 'description'. """ - import distutils.command std_commands = distutils.command.__all__ is_std = {} @@ -761,9 +728,7 @@ "Extra commands", max_length) - # print_commands () - - def get_command_list (self): + def get_command_list(self): """Get a list of (command, description) tuples. The list is divided into "standard commands" (listed in distutils.command.__all__) and "extra commands" (mentioned in @@ -798,7 +763,7 @@ # -- Command class/object methods ---------------------------------- - def get_command_packages (self): + def get_command_packages(self): """Return a list of packages from which commands are loaded.""" pkgs = self.command_packages if not isinstance(pkgs, type([])): @@ -811,7 +776,7 @@ self.command_packages = pkgs return pkgs - def get_command_class (self, command): + def get_command_class(self, command): """Return the class that implements the Distutils command named by 'command'. First we check the 'cmdclass' dictionary; if the command is mentioned there, we fetch the class object from the @@ -850,9 +815,7 @@ raise DistutilsModuleError("invalid command '%s'" % command) - # get_command_class () - - def get_command_obj (self, command, create=1): + def get_command_obj(self, command, create=1): """Return the command object for 'command'. Normally this object is cached on a previous call to 'get_command_obj()'; if no command object for 'command' is in the cache, then we either create and @@ -879,7 +842,7 @@ return cmd_obj - def _set_command_options (self, command_obj, option_dict=None): + def _set_command_options(self, command_obj, option_dict=None): """Set the options for 'command_obj' from 'option_dict'. Basically this means copying elements of a dictionary ('option_dict') to attributes of an instance ('command'). @@ -919,7 +882,7 @@ except ValueError, msg: raise DistutilsOptionError, msg - def reinitialize_command (self, command, reinit_subcommands=0): + def reinitialize_command(self, command, reinit_subcommands=0): """Reinitializes a command to the state it was in when first returned by 'get_command_obj()': ie., initialized but not yet finalized. This provides the opportunity to sneak option @@ -958,13 +921,12 @@ return command - # -- Methods that operate on the Distribution ---------------------- - def announce (self, msg, level=1): + def announce(self, msg, level=1): log.debug(msg) - def run_commands (self): + def run_commands(self): """Run each command that was seen on the setup script command line. Uses the list of commands found and cache of command objects created by 'get_command_obj()'. @@ -972,10 +934,9 @@ for cmd in self.commands: self.run_command(cmd) - # -- Methods that operate on its Commands -------------------------- - def run_command (self, command): + def run_command(self, command): """Do whatever it takes to run a command (including nothing at all, if the command has already been run). Specifically: if we have already created and run the command named by 'command', return @@ -996,28 +957,28 @@ # -- Distribution query methods ------------------------------------ - def has_pure_modules (self): + def has_pure_modules(self): return len(self.packages or self.py_modules or []) > 0 - def has_ext_modules (self): + def has_ext_modules(self): return self.ext_modules and len(self.ext_modules) > 0 - def has_c_libraries (self): + def has_c_libraries(self): return self.libraries and len(self.libraries) > 0 - def has_modules (self): + def has_modules(self): return self.has_pure_modules() or self.has_ext_modules() - def has_headers (self): + def has_headers(self): return self.headers and len(self.headers) > 0 - def has_scripts (self): + def has_scripts(self): return self.scripts and len(self.scripts) > 0 - def has_data_files (self): + def has_data_files(self): return self.data_files and len(self.data_files) > 0 - def is_pure (self): + def is_pure(self): return (self.has_pure_modules() and not self.has_ext_modules() and not self.has_c_libraries()) @@ -1029,9 +990,6 @@ # to self.metadata.get_XXX. The actual code is in the # DistributionMetadata class, below. -# class Distribution - - class DistributionMetadata: """Dummy class to hold the distribution meta-data: name, version, author, and so forth. @@ -1067,18 +1025,14 @@ self.requires = None self.obsoletes = None - def write_pkg_info (self, base_dir): + def write_pkg_info(self, base_dir): """Write the PKG-INFO file into the release tree. """ pkg_info = open( os.path.join(base_dir, 'PKG-INFO'), 'w') - self.write_pkg_file(pkg_info) - pkg_info.close() - # write_pkg_info () - - def write_pkg_file (self, file): + def write_pkg_file(self, file): """Write the PKG-INFO format data to a file object. """ version = '1.0' @@ -1112,7 +1066,6 @@ self._write_list(file, 'Obsoletes', self.get_obsoletes()) def _write_field(self, file, name, value): - if isinstance(value, unicode): value = value.encode(PKG_INFO_ENCODING) else: @@ -1120,19 +1073,18 @@ file.write('%s: %s\n' % (name, value)) def _write_list (self, file, name, values): - for value in values: self._write_field(file, name, value) # -- Metadata query methods ---------------------------------------- - def get_name (self): + def get_name(self): return self.name or "UNKNOWN" def get_version(self): return self.version or "0.0.0" - def get_fullname (self): + def get_fullname(self): return "%s-%s" % (self.get_name(), self.get_version()) def get_author(self): @@ -1148,14 +1100,10 @@ return self.maintainer_email or "UNKNOWN" def get_contact(self): - return (self.maintainer or - self.author or - "UNKNOWN") + return self.maintainer or self.author or "UNKNOWN" def get_contact_email(self): - return (self.maintainer_email or - self.author_email or - "UNKNOWN") + return self.maintainer_email or self.author_email or "UNKNOWN" def get_url(self): return self.url or "UNKNOWN" @@ -1183,7 +1131,6 @@ return self.download_url or "UNKNOWN" # PEP 314 - def get_requires(self): return self.requires or [] @@ -1212,10 +1159,7 @@ distutils.versionpredicate.VersionPredicate(v) self.obsoletes = value -# class DistributionMetadata - - -def fix_help_options (options): +def fix_help_options(options): """Convert a 4-tuple 'help_options' list as found in various command classes to the 3-tuple form required by FancyGetopt. """ From python-checkins at python.org Sat May 16 20:30:30 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 16 May 2009 20:30:30 +0200 (CEST) Subject: [Python-checkins] r72687 - python/branches/release26-maint Message-ID: <20090516183030.CB242D508@mail.python.org> Author: tarek.ziade Date: Sat May 16 20:30:30 2009 New Revision: 72687 Log: Blocked revisions 72686 via svnmerge ........ r72686 | tarek.ziade | 2009-05-16 20:29:40 +0200 (Sat, 16 May 2009) | 1 line pep8-fied distutils.dist module ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sat May 16 20:37:32 2009 From: python-checkins at python.org (tarek.ziade) Date: Sat, 16 May 2009 20:37:32 +0200 (CEST) Subject: [Python-checkins] r72688 - in python/branches/py3k: Lib/distutils/dist.py Message-ID: <20090516183732.6790BD712@mail.python.org> Author: tarek.ziade Date: Sat May 16 20:37:32 2009 New Revision: 72688 Log: Merged revisions 72686 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72686 | tarek.ziade | 2009-05-16 20:29:40 +0200 (Sat, 16 May 2009) | 1 line pep8-fied distutils.dist module ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/dist.py Modified: python/branches/py3k/Lib/distutils/dist.py ============================================================================== --- python/branches/py3k/Lib/distutils/dist.py (original) +++ python/branches/py3k/Lib/distutils/dist.py Sat May 16 20:37:32 2009 @@ -262,21 +262,18 @@ self.finalize_options() - - def get_option_dict (self, command): + def get_option_dict(self, command): """Get the option dictionary for a given command. If that command's option dictionary hasn't been created yet, then create it and return the new dictionary; otherwise, return the existing option dictionary. """ - dict = self.command_options.get(command) if dict is None: dict = self.command_options[command] = {} return dict - - def dump_option_dicts (self, header=None, commands=None, indent=""): + def dump_option_dicts(self, header=None, commands=None, indent=""): from pprint import pformat if commands is None: # dump all command option dicts @@ -300,11 +297,9 @@ for line in out.split("\n"): print(indent + " " + line) - - # -- Config file finding/parsing methods --------------------------- - def find_config_files (self): + def find_config_files(self): """Find as many configuration files as should be processed for this platform, and return a list of filenames in the order in which they should be parsed. The filenames returned are guaranteed to exist @@ -345,9 +340,7 @@ return files - - def parse_config_files (self, filenames=None): - + def parse_config_files(self, filenames=None): from configparser import ConfigParser if filenames is None: @@ -389,10 +382,9 @@ except ValueError as msg: raise DistutilsOptionError(msg) - # -- Command-line parsing methods ---------------------------------- - def parse_command_line (self): + def parse_command_line(self): """Parse the setup script's command line, taken from the 'script_args' instance attribute (which defaults to 'sys.argv[1:]' -- see 'setup()' in core.py). This list is first processed for @@ -465,7 +457,7 @@ # All is well: return true return True - def _get_toplevel_options (self): + def _get_toplevel_options(self): """Return the non-display options recognized at the top level. This includes options that are recognized *only* at the top @@ -476,7 +468,7 @@ "list of packages that provide distutils commands"), ] - def _parse_command_opts (self, parser, args): + def _parse_command_opts(self, parser, args): """Parse the command-line options for a single command. 'parser' must be a FancyGetopt instance; 'args' must be the list of arguments, starting with the current command (whose options @@ -571,12 +563,11 @@ return args - def finalize_options (self): + def finalize_options(self): """Set final values for all the options on the Distribution instance, analogous to the .finalize_options() method of Command objects. """ - keywords = self.metadata.keywords if keywords is not None: if isinstance(keywords, str): @@ -589,11 +580,8 @@ platformlist = platforms.split(',') self.metadata.platforms = [x.strip() for x in platformlist] - def _show_help (self, - parser, - global_options=1, - display_options=1, - commands=[]): + def _show_help(self, parser, global_options=1, display_options=1, + commands=[]): """Show help for the setup script command-line in the form of several lists of command-line options. 'parser' should be a FancyGetopt instance; do not expect it to be returned in the @@ -643,8 +631,7 @@ print(gen_usage(self.script_name)) return - - def handle_display_options (self, option_order): + def handle_display_options(self, option_order): """If there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return @@ -684,7 +671,7 @@ return any_display_options - def print_command_list (self, commands, header, max_length): + def print_command_list(self, commands, header, max_length): """Print a subset of the list of all commands -- used by 'print_commands()'. """ @@ -701,8 +688,7 @@ print(" %-*s %s" % (max_length, cmd, description)) - - def print_commands (self): + def print_commands(self): """Print out a help message listing all available commands with a description of each. The list is divided into "standard commands" (listed in distutils.command.__all__) and "extra commands" @@ -735,7 +721,7 @@ "Extra commands", max_length) - def get_command_list (self): + def get_command_list(self): """Get a list of (command, description) tuples. The list is divided into "standard commands" (listed in distutils.command.__all__) and "extra commands" (mentioned in @@ -769,7 +755,7 @@ # -- Command class/object methods ---------------------------------- - def get_command_packages (self): + def get_command_packages(self): """Return a list of packages from which commands are loaded.""" pkgs = self.command_packages if not isinstance(pkgs, type([])): @@ -782,7 +768,7 @@ self.command_packages = pkgs return pkgs - def get_command_class (self, command): + def get_command_class(self, command): """Return the class that implements the Distutils command named by 'command'. First we check the 'cmdclass' dictionary; if the command is mentioned there, we fetch the class object from the @@ -820,7 +806,7 @@ raise DistutilsModuleError("invalid command '%s'" % command) - def get_command_obj (self, command, create=1): + def get_command_obj(self, command, create=1): """Return the command object for 'command'. Normally this object is cached on a previous call to 'get_command_obj()'; if no command object for 'command' is in the cache, then we either create and @@ -847,7 +833,7 @@ return cmd_obj - def _set_command_options (self, command_obj, option_dict=None): + def _set_command_options(self, command_obj, option_dict=None): """Set the options for 'command_obj' from 'option_dict'. Basically this means copying elements of a dictionary ('option_dict') to attributes of an instance ('command'). @@ -888,7 +874,7 @@ except ValueError as msg: raise DistutilsOptionError(msg) - def reinitialize_command (self, command, reinit_subcommands=0): + def reinitialize_command(self, command, reinit_subcommands=0): """Reinitializes a command to the state it was in when first returned by 'get_command_obj()': ie., initialized but not yet finalized. This provides the opportunity to sneak option @@ -927,13 +913,12 @@ return command - # -- Methods that operate on the Distribution ---------------------- - def announce (self, msg, level=1): + def announce(self, msg, level=1): log.debug(msg) - def run_commands (self): + def run_commands(self): """Run each command that was seen on the setup script command line. Uses the list of commands found and cache of command objects created by 'get_command_obj()'. @@ -941,10 +926,9 @@ for cmd in self.commands: self.run_command(cmd) - # -- Methods that operate on its Commands -------------------------- - def run_command (self, command): + def run_command(self, command): """Do whatever it takes to run a command (including nothing at all, if the command has already been run). Specifically: if we have already created and run the command named by 'command', return @@ -965,28 +949,28 @@ # -- Distribution query methods ------------------------------------ - def has_pure_modules (self): + def has_pure_modules(self): return len(self.packages or self.py_modules or []) > 0 - def has_ext_modules (self): + def has_ext_modules(self): return self.ext_modules and len(self.ext_modules) > 0 - def has_c_libraries (self): + def has_c_libraries(self): return self.libraries and len(self.libraries) > 0 - def has_modules (self): + def has_modules(self): return self.has_pure_modules() or self.has_ext_modules() - def has_headers (self): + def has_headers(self): return self.headers and len(self.headers) > 0 - def has_scripts (self): + def has_scripts(self): return self.scripts and len(self.scripts) > 0 - def has_data_files (self): + def has_data_files(self): return self.data_files and len(self.data_files) > 0 - def is_pure (self): + def is_pure(self): return (self.has_pure_modules() and not self.has_ext_modules() and not self.has_c_libraries()) @@ -998,9 +982,6 @@ # to self.metadata.get_XXX. The actual code is in the # DistributionMetadata class, below. -# class Distribution - - class DistributionMetadata: """Dummy class to hold the distribution meta-data: name, version, author, and so forth. @@ -1036,16 +1017,14 @@ self.requires = None self.obsoletes = None - def write_pkg_info (self, base_dir): + def write_pkg_info(self, base_dir): """Write the PKG-INFO file into the release tree. """ pkg_info = open( os.path.join(base_dir, 'PKG-INFO'), 'w') - self.write_pkg_file(pkg_info) - pkg_info.close() - def write_pkg_file (self, file): + def write_pkg_file(self, file): """Write the PKG-INFO format data to a file object. """ version = '1.0' @@ -1078,19 +1057,19 @@ self._write_list(file, 'Provides', self.get_provides()) self._write_list(file, 'Obsoletes', self.get_obsoletes()) - def _write_list (self, file, name, values): + def _write_list(self, file, name, values): for value in values: file.write('%s: %s\n' % (name, value)) # -- Metadata query methods ---------------------------------------- - def get_name (self): + def get_name(self): return self.name or "UNKNOWN" def get_version(self): return self.version or "0.0.0" - def get_fullname (self): + def get_fullname(self): return "%s-%s" % (self.get_name(), self.get_version()) def get_author(self): @@ -1106,14 +1085,10 @@ return self.maintainer_email or "UNKNOWN" def get_contact(self): - return (self.maintainer or - self.author or - "UNKNOWN") + return self.maintainer or self.author or "UNKNOWN" def get_contact_email(self): - return (self.maintainer_email or - self.author_email or - "UNKNOWN") + return self.maintainer_email or self.author_email or "UNKNOWN" def get_url(self): return self.url or "UNKNOWN" @@ -1141,7 +1116,6 @@ return self.download_url or "UNKNOWN" # PEP 314 - def get_requires(self): return self.requires or [] @@ -1170,8 +1144,7 @@ distutils.versionpredicate.VersionPredicate(v) self.obsoletes = value - -def fix_help_options (options): +def fix_help_options(options): """Convert a 4-tuple 'help_options' list as found in various command classes to the 3-tuple form required by FancyGetopt. """ From python-checkins at python.org Sat May 16 20:44:34 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 16 May 2009 20:44:34 +0200 (CEST) Subject: [Python-checkins] r72689 - python/trunk/Lib/test/test_os.py Message-ID: <20090516184434.A30DFD73C@mail.python.org> Author: benjamin.peterson Date: Sat May 16 20:44:34 2009 New Revision: 72689 Log: use skipTest() Modified: python/trunk/Lib/test/test_os.py Modified: python/trunk/Lib/test/test_os.py ============================================================================== --- python/trunk/Lib/test/test_os.py (original) +++ python/trunk/Lib/test/test_os.py Sat May 16 20:44:34 2009 @@ -37,10 +37,7 @@ retries += 1 if retries > 10: # XXX test skipped - print >> sys.stderr, ( - "couldn't allocate two consecutive fds, " - "skipping test_closerange") - return + self.skipTest("couldn't allocate two consecutive fds") first, second = second, os.dup(second) finally: os.close(second) From buildbot at python.org Sat May 16 21:16:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 16 May 2009 19:16:52 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090516191653.05B8CD558@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/698 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Sat May 16 21:53:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 16 May 2009 19:53:22 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090516195322.CFC1DC34F@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%202.6/builds/345 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_shelve ====================================================================== ERROR: test_update (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 182, in test_update d = self._empty_mapping() File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 218, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/bsddb/__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test_write (test.test_shelve.TestAsciiFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 107, in test_write d = self._full_mapping(self.reference) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 24, in _full_mapping x = self._empty_mapping() File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 218, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/bsddb/__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test_update (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 182, in test_update d = self._empty_mapping() File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 218, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/bsddb/__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test_write (test.test_shelve.TestBinaryFileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 107, in test_write d = self._full_mapping(self.reference) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 24, in _full_mapping x = self._empty_mapping() File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 218, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/bsddb/__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test_update (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 182, in test_update d = self._empty_mapping() File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 218, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/bsddb/__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test_write (test.test_shelve.TestProto2FileShelve) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 107, in test_write d = self._full_mapping(self.reference) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/mapping_tests.py", line 24, in _full_mapping x = self._empty_mapping() File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/test_shelve.py", line 108, in _empty_mapping x= shelve.open(self.fn+str(self.counter), **self._args) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 234, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/shelve.py", line 218, in __init__ Shelf.__init__(self, anydbm.open(filename, flag), protocol, writeback) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/anydbm.py", line 83, in open return mod.open(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/dbhash.py", line 19, in open return bsddb.hashopen(file, flag, mode) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/bsddb/__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat May 16 22:12:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 16 May 2009 20:12:57 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090516201258.03598D438@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%20trunk/builds/23 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat May 16 22:26:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 16 May 2009 20:26:22 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090516202622.6B347D528@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/369 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_posix test_subprocess ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From nnorwitz at gmail.com Sat May 16 23:27:46 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 16 May 2009 17:27:46 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090516212746.GA2672@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 Less important issues: ---------------------- test_asynchat leaked [128, -128, 0] references, sum=0 test_smtplib leaked [35, -123, 88] references, sum=0 test_sys leaked [-21, 0, 0] references, sum=-21 test_threading leaked [48, 53, 43] references, sum=144 test_threadsignals leaked [0, -8, 8] references, sum=0 test_urllib2_localnet leaked [-280, 3, 3] references, sum=-274 From python-checkins at python.org Sat May 16 23:44:25 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 16 May 2009 23:44:25 +0200 (CEST) Subject: [Python-checkins] r72690 - in python/trunk: Lib/test/test_descr.py Objects/abstract.c Objects/typeobject.c Message-ID: <20090516214425.DDCA8D620@mail.python.org> Author: benjamin.peterson Date: Sat May 16 23:44:25 2009 New Revision: 72690 Log: properly lookup __instancecheck__ and __subclasscheck__ Modified: python/trunk/Lib/test/test_descr.py python/trunk/Objects/abstract.c python/trunk/Objects/typeobject.c Modified: python/trunk/Lib/test/test_descr.py ============================================================================== --- python/trunk/Lib/test/test_descr.py (original) +++ python/trunk/Lib/test/test_descr.py Sat May 16 23:44:25 2009 @@ -1683,16 +1683,25 @@ return 0 def stop(self): raise StopIteration + def return_true(self, thing=None): + return True + def do_isinstance(obj): + return isinstance(int, obj) + def do_issubclass(obj): + return issubclass(int, obj) # It would be nice to have every special method tested here, but I'm # only listing the ones I can remember outside of typeobject.c, since it # does it right. specials = [ - ("__unicode__", unicode, hello, {}), - ("__reversed__", reversed, empty_seq, {}), - ("__length_hint__", list, zero, + ("__unicode__", unicode, hello, set(), {}), + ("__reversed__", reversed, empty_seq, set(), {}), + ("__length_hint__", list, zero, set(), {"__iter__" : iden, "next" : stop}), - ("__sizeof__", sys.getsizeof, zero, {}), + ("__sizeof__", sys.getsizeof, zero, set(), {}), + ("__instancecheck__", do_isinstance, return_true, set(), {}), + ("__subclasscheck__", do_issubclass, return_true, + set(("__bases__",)), {}), # These two fail because the compiler generates LOAD_ATTR to look # them up. We'd have to add a new opcode to fix this, and it's # probably not worth it. @@ -1704,7 +1713,9 @@ def __getattr__(self, attr, test=self): test.fail("__getattr__ called with {0}".format(attr)) def __getattribute__(self, attr, test=self): - test.fail("__getattribute__ called with {0}".format(attr)) + if attr not in ok: + test.fail("__getattribute__ called with {0}".format(attr)) + return object.__getattribute__(attr) class SpecialDescr(object): def __init__(self, impl): self.impl = impl @@ -1713,7 +1724,7 @@ return self.impl.__get__(obj, owner) - for name, runner, meth_impl, env in specials: + for name, runner, meth_impl, ok, env in specials: class X(Checker): pass for attr, obj in env.iteritems(): Modified: python/trunk/Objects/abstract.c ============================================================================== --- python/trunk/Objects/abstract.c (original) +++ python/trunk/Objects/abstract.c Sat May 16 23:44:25 2009 @@ -2926,14 +2926,19 @@ Py_LeaveRecursiveCall(); return r; } - if (name == NULL) { - name = PyString_InternFromString("__instancecheck__"); - if (name == NULL) - return -1; + + if (PyInstance_Check(cls)) { + checker = PyObject_GetAttrString(cls, "__instancecheck__"); + if (checker == NULL) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) + PyErr_Clear(); + else + return -1; + } + } + else { + checker = _PyObject_LookupSpecial(cls, "__instancecheck__", &name); } - checker = PyObject_GetAttr(cls, name); - if (checker == NULL && PyErr_Occurred()) - PyErr_Clear(); if (checker != NULL) { PyObject *res; int ok = -1; @@ -3008,14 +3013,21 @@ Py_LeaveRecursiveCall(); return r; } - if (name == NULL) { - name = PyString_InternFromString("__subclasscheck__"); - if (name == NULL) + if (PyInstance_Check(cls)) { + PyErr_Fetch(&t, &v, &tb); + checker = PyObject_GetAttr(cls, name); + if (checker == NULL && + !PyErr_ExceptionMatches(PyExc_AttributeError)) { + Py_XDECREF(t); + Py_XDECREF(v); + Py_XDECREF(tb); return -1; + } + PyErr_Restore(t, v, tb); + } + else { + checker = _PyObject_LookupSpecial(cls, "__subclasscheck__", &name); } - PyErr_Fetch(&t, &v, &tb); - checker = PyObject_GetAttr(cls, name); - PyErr_Restore(t, v, tb); if (checker != NULL) { PyObject *res; int ok = -1; Modified: python/trunk/Objects/typeobject.c ============================================================================== --- python/trunk/Objects/typeobject.c (original) +++ python/trunk/Objects/typeobject.c Sat May 16 23:44:25 2009 @@ -586,14 +586,6 @@ static PyObject * -type_get_instancecheck(PyObject *type, void *context) -{ - static PyMethodDef ml = {"__instancecheck__", - type___instancecheck__, METH_O }; - return PyCFunction_New(&ml, type); -} - -static PyObject * type___subclasscheck__(PyObject *type, PyObject *inst) { switch (_PyObject_RealIsSubclass(inst, type)) { @@ -606,13 +598,6 @@ } } -static PyObject * -type_get_subclasscheck(PyObject *type, void *context) -{ - static PyMethodDef ml = {"__subclasscheck__", - type___subclasscheck__, METH_O }; - return PyCFunction_New(&ml, type); -} static PyGetSetDef type_getsets[] = { {"__name__", (getter)type_name, (setter)type_set_name, NULL}, @@ -622,8 +607,6 @@ (setter)type_set_abstractmethods, NULL}, {"__dict__", (getter)type_dict, NULL, NULL}, {"__doc__", (getter)type_get_doc, NULL, NULL}, - {"__instancecheck__", (getter)type_get_instancecheck, NULL, NULL}, - {"__subclasscheck__", (getter)type_get_subclasscheck, NULL, NULL}, {0} }; @@ -2674,6 +2657,10 @@ PyDoc_STR("mro() -> list\nreturn a type's method resolution order")}, {"__subclasses__", (PyCFunction)type_subclasses, METH_NOARGS, PyDoc_STR("__subclasses__() -> list of immediate subclasses")}, + {"__instancecheck__", type___instancecheck__, METH_O, + PyDoc_STR("__instancecheck__() -> check if an object is an instance")}, + {"__subclasscheck__", type___subclasscheck__, METH_O, + PyDoc_STR("__subclasschck__ -> check if an class is a subclass")}, {0} }; From python-checkins at python.org Sat May 16 23:55:25 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 16 May 2009 23:55:25 +0200 (CEST) Subject: [Python-checkins] r72691 - in python/branches/py3k: Lib/test/test_descr.py Objects/abstract.c Objects/typeobject.c Message-ID: <20090516215525.0AEFAD4F3@mail.python.org> Author: benjamin.peterson Date: Sat May 16 23:55:24 2009 New Revision: 72691 Log: Merged revisions 72690 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72690 | benjamin.peterson | 2009-05-16 16:44:25 -0500 (Sat, 16 May 2009) | 1 line properly lookup __instancecheck__ and __subclasscheck__ ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_descr.py python/branches/py3k/Objects/abstract.c python/branches/py3k/Objects/typeobject.c Modified: python/branches/py3k/Lib/test/test_descr.py ============================================================================== --- python/branches/py3k/Lib/test/test_descr.py (original) +++ python/branches/py3k/Lib/test/test_descr.py Sat May 16 23:55:24 2009 @@ -1556,16 +1556,25 @@ return 0 def stop(self): raise StopIteration + def return_true(self, thing=None): + return True + def do_isinstance(obj): + return isinstance(int, obj) + def do_issubclass(obj): + return issubclass(int, obj) # It would be nice to have every special method tested here, but I'm # only listing the ones I can remember outside of typeobject.c, since it # does it right. specials = [ - ("__bytes__", bytes, hello, {}), - ("__reversed__", reversed, empty_seq, {}), - ("__length_hint__", list, zero, + ("__bytes__", bytes, hello, set(), {}), + ("__reversed__", reversed, empty_seq, set(), {}), + ("__length_hint__", list, zero, set(), {"__iter__" : iden, "__next__" : stop}), - ("__sizeof__", sys.getsizeof, zero, {}), + ("__sizeof__", sys.getsizeof, zero, set(), {}), + ("__instancecheck__", do_isinstance, return_true, set(), {}), + ("__subclasscheck__", do_issubclass, return_true, + set(("__bases__",)), {}), # These two fail because the compiler generates LOAD_ATTR to look # them up. We'd have to add a new opcode to fix this, and it's # probably not worth it. @@ -1577,7 +1586,9 @@ def __getattr__(self, attr, test=self): test.fail("__getattr__ called with {0}".format(attr)) def __getattribute__(self, attr, test=self): - test.fail("__getattribute__ called with {0}".format(attr)) + if attr not in ok: + test.fail("__getattribute__ called with {0}".format(attr)) + return object.__getattribute__(attr) class SpecialDescr(object): def __init__(self, impl): self.impl = impl @@ -1586,7 +1597,7 @@ return self.impl.__get__(obj, owner) - for name, runner, meth_impl, env in specials: + for name, runner, meth_impl, ok, env in specials: class X(Checker): pass for attr, obj in env.items(): Modified: python/branches/py3k/Objects/abstract.c ============================================================================== --- python/branches/py3k/Objects/abstract.c (original) +++ python/branches/py3k/Objects/abstract.c Sat May 16 23:55:24 2009 @@ -2574,14 +2574,8 @@ Py_LeaveRecursiveCall(); return r; } - if (name == NULL) { - name = PyUnicode_InternFromString("__instancecheck__"); - if (name == NULL) - return -1; - } - checker = PyObject_GetAttr(cls, name); - if (checker == NULL && PyErr_Occurred()) - PyErr_Clear(); + + checker = _PyObject_LookupSpecial(cls, "__instancecheck__", &name); if (checker != NULL) { PyObject *res; int ok = -1; @@ -2644,14 +2638,8 @@ Py_LeaveRecursiveCall(); return r; } - if (name == NULL) { - name = PyUnicode_InternFromString("__subclasscheck__"); - if (name == NULL) - return -1; - } - PyErr_Fetch(&t, &v, &tb); - checker = PyObject_GetAttr(cls, name); - PyErr_Restore(t, v, tb); + + checker = _PyObject_LookupSpecial(cls, "__subclasscheck__", &name); if (checker != NULL) { PyObject *res; int ok = -1; Modified: python/branches/py3k/Objects/typeobject.c ============================================================================== --- python/branches/py3k/Objects/typeobject.c (original) +++ python/branches/py3k/Objects/typeobject.c Sat May 16 23:55:24 2009 @@ -599,14 +599,6 @@ static PyObject * -type_get_instancecheck(PyObject *type, void *context) -{ - static PyMethodDef ml = {"__instancecheck__", - type___instancecheck__, METH_O }; - return PyCFunction_New(&ml, type); -} - -static PyObject * type___subclasscheck__(PyObject *type, PyObject *inst) { switch (_PyObject_RealIsSubclass(inst, type)) { @@ -619,13 +611,6 @@ } } -static PyObject * -type_get_subclasscheck(PyObject *type, void *context) -{ - static PyMethodDef ml = {"__subclasscheck__", - type___subclasscheck__, METH_O }; - return PyCFunction_New(&ml, type); -} static PyGetSetDef type_getsets[] = { {"__name__", (getter)type_name, (setter)type_set_name, NULL}, @@ -635,8 +620,6 @@ (setter)type_set_abstractmethods, NULL}, {"__dict__", (getter)type_dict, NULL, NULL}, {"__doc__", (getter)type_get_doc, NULL, NULL}, - {"__instancecheck__", (getter)type_get_instancecheck, NULL, NULL}, - {"__subclasscheck__", (getter)type_get_subclasscheck, NULL, NULL}, {0} }; @@ -2518,6 +2501,10 @@ METH_VARARGS | METH_KEYWORDS | METH_CLASS, PyDoc_STR("__prepare__() -> dict\n" "used to create the namespace for the class statement")}, + {"__instancecheck__", type___instancecheck__, METH_O, + PyDoc_STR("__instancecheck__() -> check if an object is an instance")}, + {"__subclasscheck__", type___subclasscheck__, METH_O, + PyDoc_STR("__subclasschck__ -> check if an class is a subclass")}, {0} }; From buildbot at python.org Sun May 17 00:08:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 16 May 2009 22:08:22 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090516220822.615B4D473@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1328 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_typechecks ====================================================================== FAIL: testInfiniteRecursionCaughtProperly (test.test_typechecks.TypeChecksTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-ubuntu-i386/build/Lib/test/test_typechecks.py", line 81, in testInfiniteRecursionCaughtProperly self.assertRaises(RuntimeError, isinstance, e, Evil) AssertionError: RuntimeError not raised make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun May 17 00:16:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 16 May 2009 22:16:27 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090516221627.E133DD630@mail.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/5012 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_typechecks ====================================================================== FAIL: testInfiniteRecursionCaughtProperly (test.test_typechecks.TypeChecksTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/test/test_typechecks.py", line 81, in testInfiniteRecursionCaughtProperly self.assertRaises(RuntimeError, isinstance, e, Evil) AssertionError: RuntimeError not raised make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun May 17 00:30:49 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 17 May 2009 00:30:49 +0200 (CEST) Subject: [Python-checkins] r72692 - python/trunk/Objects/abstract.c Message-ID: <20090516223049.23691D6B2@mail.python.org> Author: benjamin.peterson Date: Sun May 17 00:30:48 2009 New Revision: 72692 Log: deal with old-style classes in issubclass and isinstance Modified: python/trunk/Objects/abstract.c Modified: python/trunk/Objects/abstract.c ============================================================================== --- python/trunk/Objects/abstract.c (original) +++ python/trunk/Objects/abstract.c Sun May 17 00:30:48 2009 @@ -2927,7 +2927,7 @@ return r; } - if (PyInstance_Check(cls)) { + if (PyClass_Check(cls) || PyInstance_Check(cls)) { checker = PyObject_GetAttrString(cls, "__instancecheck__"); if (checker == NULL) { if (PyErr_ExceptionMatches(PyExc_AttributeError)) @@ -3013,7 +3013,7 @@ Py_LeaveRecursiveCall(); return r; } - if (PyInstance_Check(cls)) { + if (PyClass_Check(cls) || PyInstance_Check(cls)) { PyErr_Fetch(&t, &v, &tb); checker = PyObject_GetAttr(cls, name); if (checker == NULL && From buildbot at python.org Sun May 17 00:38:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 16 May 2009 22:38:11 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090516223812.07375D567@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/527 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_typechecks ====================================================================== FAIL: testInfiniteRecursionCaughtProperly (test.test_typechecks.TypeChecksTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_typechecks.py", line 81, in testInfiniteRecursionCaughtProperly self.assertRaises(RuntimeError, isinstance, e, Evil) AssertionError: RuntimeError not raised make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun May 17 00:40:56 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 17 May 2009 00:40:56 +0200 (CEST) Subject: [Python-checkins] r72693 - in python/trunk: Lib/test/test_typechecks.py Objects/abstract.c Message-ID: <20090516224056.92C83D761@mail.python.org> Author: benjamin.peterson Date: Sun May 17 00:40:56 2009 New Revision: 72693 Log: completely ignore old-style stuff for type checking overloading Modified: python/trunk/Lib/test/test_typechecks.py python/trunk/Objects/abstract.c Modified: python/trunk/Lib/test/test_typechecks.py ============================================================================== --- python/trunk/Lib/test/test_typechecks.py (original) +++ python/trunk/Lib/test/test_typechecks.py Sun May 17 00:40:56 2009 @@ -29,10 +29,6 @@ pass -class Evil: - def __instancecheck__(self, inst): return False - - class TypeChecksTest(unittest.TestCase): def testIsSubclassInternal(self): @@ -75,11 +71,18 @@ self.assertEqual(isinstance(42, SubInt), False) self.assertEqual(isinstance(42, (SubInt,)), False) - def testInfiniteRecursionCaughtProperly(self): - e = Evil() - # This invokes isinstance() recursively, until the stack is exhausted. - self.assertRaises(RuntimeError, isinstance, e, Evil) - # XXX How to check the same situation for issubclass()? + def test_oldstyle(self): + # These should just be ignored. + class X: + def __instancecheck__(self, inst): + return True + def __subclasscheck__(self, cls): + return True + class Sub(X): pass + self.assertFalse(isinstance(3, X)) + self.assertTrue(isinstance(X(), X)) + self.assertFalse(issubclass(int, X)) + self.assertTrue(issubclass(Sub, X)) def test_main(): Modified: python/trunk/Objects/abstract.c ============================================================================== --- python/trunk/Objects/abstract.c (original) +++ python/trunk/Objects/abstract.c Sun May 17 00:40:56 2009 @@ -2902,7 +2902,6 @@ PyObject_IsInstance(PyObject *inst, PyObject *cls) { static PyObject *name = NULL; - PyObject *checker; /* Quick test for an exact match */ if (Py_TYPE(inst) == (PyTypeObject *)cls) @@ -2927,33 +2926,25 @@ return r; } - if (PyClass_Check(cls) || PyInstance_Check(cls)) { - checker = PyObject_GetAttrString(cls, "__instancecheck__"); - if (checker == NULL) { - if (PyErr_ExceptionMatches(PyExc_AttributeError)) - PyErr_Clear(); - else - return -1; - } - } - else { + if (!(PyClass_Check(cls) || PyInstance_Check(cls))) { + PyObject *checker; checker = _PyObject_LookupSpecial(cls, "__instancecheck__", &name); - } - if (checker != NULL) { - PyObject *res; - int ok = -1; - if (Py_EnterRecursiveCall(" in __instancecheck__")) { + if (checker != NULL) { + PyObject *res; + int ok = -1; + if (Py_EnterRecursiveCall(" in __instancecheck__")) { + Py_DECREF(checker); + return ok; + } + res = PyObject_CallFunctionObjArgs(checker, inst, NULL); + Py_LeaveRecursiveCall(); Py_DECREF(checker); + if (res != NULL) { + ok = PyObject_IsTrue(res); + Py_DECREF(res); + } return ok; } - res = PyObject_CallFunctionObjArgs(checker, inst, NULL); - Py_LeaveRecursiveCall(); - Py_DECREF(checker); - if (res != NULL) { - ok = PyObject_IsTrue(res); - Py_DECREF(res); - } - return ok; } return recursive_isinstance(inst, cls); } @@ -2992,8 +2983,6 @@ PyObject_IsSubclass(PyObject *derived, PyObject *cls) { static PyObject *name = NULL; - PyObject *t, *v, *tb; - PyObject *checker; if (PyTuple_Check(cls)) { Py_ssize_t i; @@ -3013,36 +3002,25 @@ Py_LeaveRecursiveCall(); return r; } - if (PyClass_Check(cls) || PyInstance_Check(cls)) { - PyErr_Fetch(&t, &v, &tb); - checker = PyObject_GetAttr(cls, name); - if (checker == NULL && - !PyErr_ExceptionMatches(PyExc_AttributeError)) { - Py_XDECREF(t); - Py_XDECREF(v); - Py_XDECREF(tb); - return -1; - } - PyErr_Restore(t, v, tb); - } - else { + if (!(PyClass_Check(cls) || PyInstance_Check(cls))) { + PyObject *checker; checker = _PyObject_LookupSpecial(cls, "__subclasscheck__", &name); - } - if (checker != NULL) { - PyObject *res; - int ok = -1; - if (Py_EnterRecursiveCall(" in __subclasscheck__")) { + if (checker != NULL) { + PyObject *res; + int ok = -1; + if (Py_EnterRecursiveCall(" in __subclasscheck__")) { + Py_DECREF(checker); + return ok; + } + res = PyObject_CallFunctionObjArgs(checker, derived, NULL); + Py_LeaveRecursiveCall(); Py_DECREF(checker); + if (res != NULL) { + ok = PyObject_IsTrue(res); + Py_DECREF(res); + } return ok; } - res = PyObject_CallFunctionObjArgs(checker, derived, NULL); - Py_LeaveRecursiveCall(); - Py_DECREF(checker); - if (res != NULL) { - ok = PyObject_IsTrue(res); - Py_DECREF(res); - } - return ok; } return recursive_issubclass(derived, cls); } From python-checkins at python.org Sun May 17 00:46:11 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 17 May 2009 00:46:11 +0200 (CEST) Subject: [Python-checkins] r72694 - python/trunk/Misc/NEWS Message-ID: <20090516224611.811CCD581@mail.python.org> Author: benjamin.peterson Date: Sun May 17 00:46:11 2009 New Revision: 72694 Log: update Modified: python/trunk/Misc/NEWS Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun May 17 00:46:11 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- __isinstancecheck__ and __subclasscheck__ are now completely ignored on + classic classes and instances. + - Issue #5994: the marshal module now has docstrings. - Issue #5981: Fix three minor inf/nan issues in float.fromhex: From python-checkins at python.org Sun May 17 00:50:58 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 17 May 2009 00:50:58 +0200 (CEST) Subject: [Python-checkins] r72695 - python/branches/py3k Message-ID: <20090516225058.7D34CD5EB@mail.python.org> Author: benjamin.peterson Date: Sun May 17 00:50:58 2009 New Revision: 72695 Log: Blocked revisions 72692-72694 via svnmerge ........ r72692 | benjamin.peterson | 2009-05-16 17:30:48 -0500 (Sat, 16 May 2009) | 1 line deal with old-style classes in issubclass and isinstance ........ r72693 | benjamin.peterson | 2009-05-16 17:40:56 -0500 (Sat, 16 May 2009) | 1 line completely ignore old-style stuff for type checking overloading ........ r72694 | benjamin.peterson | 2009-05-16 17:46:11 -0500 (Sat, 16 May 2009) | 1 line update ........ Modified: python/branches/py3k/ (props changed) From g.brandl at gmx.net Sun May 17 01:32:06 2009 From: g.brandl at gmx.net (Georg Brandl) Date: Sun, 17 May 2009 01:32:06 +0200 Subject: [Python-checkins] r72694 - python/trunk/Misc/NEWS In-Reply-To: <20090516224611.811CCD581@mail.python.org> References: <20090516224611.811CCD581@mail.python.org> Message-ID: benjamin.peterson schrieb: > Author: benjamin.peterson > Date: Sun May 17 00:46:11 2009 > New Revision: 72694 > > Log: > update > > Modified: > python/trunk/Misc/NEWS > > Modified: python/trunk/Misc/NEWS > ============================================================================== > --- python/trunk/Misc/NEWS (original) > +++ python/trunk/Misc/NEWS Sun May 17 00:46:11 2009 > @@ -12,6 +12,9 @@ > Core and Builtins > ----------------- > > +- __isinstancecheck__ and __subclasscheck__ are now completely ignored on > + classic classes and instances. Should be __instancecheck__ here. Georg -- Thus spake the Lord: Thou shalt indent with four spaces. No more, no less. Four shall be the number of spaces thou shalt indent, and the number of thy indenting shall be four. Eight shalt thou not indent, nor either indent thou two, excepting that thou then proceed to four. Tabs are right out. From python-checkins at python.org Sun May 17 01:34:19 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 17 May 2009 01:34:19 +0200 (CEST) Subject: [Python-checkins] r72696 - python/trunk/Misc/NEWS Message-ID: <20090516233419.DCC5FD54E@mail.python.org> Author: benjamin.peterson Date: Sun May 17 01:34:19 2009 New Revision: 72696 Log: typo Modified: python/trunk/Misc/NEWS Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun May 17 01:34:19 2009 @@ -12,8 +12,8 @@ Core and Builtins ----------------- -- __isinstancecheck__ and __subclasscheck__ are now completely ignored on - classic classes and instances. +- __instancecheck__ and __subclasscheck__ are now completely ignored on classic + classes and instances. - Issue #5994: the marshal module now has docstrings. From python-checkins at python.org Sun May 17 01:36:26 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 17 May 2009 01:36:26 +0200 (CEST) Subject: [Python-checkins] r72697 - python/branches/py3k Message-ID: <20090516233626.647B3D603@mail.python.org> Author: benjamin.peterson Date: Sun May 17 01:36:26 2009 New Revision: 72697 Log: Blocked revisions 72696 via svnmerge ........ r72696 | benjamin.peterson | 2009-05-16 18:34:19 -0500 (Sat, 16 May 2009) | 1 line typo ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Sun May 17 01:49:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 16 May 2009 23:49:47 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090516234947.79C4BD5E3@mail.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/5014 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/threading.py", line 524, in __bootstrap_inner self.run() File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/bsddb/test/test_thread.py", line 306, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/home/buildslave/python-trunk/trunk.norwitz-x86/build/Lib/bsddb/dbutils.py", line 68, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30996, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') sincerely, -The Buildbot From buildbot at python.org Sun May 17 02:41:10 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 00:41:10 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090517004110.C642CD57F@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/700 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_capi test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sun May 17 04:52:10 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sun, 17 May 2009 04:52:10 +0200 (CEST) Subject: [Python-checkins] r72698 - in python/trunk: Include/pyerrors.h Modules/_fileio.c Modules/posixmodule.c Objects/fileobject.c PC/pyconfig.h Python/errors.c Message-ID: <20090517025210.09B9CD5BA@mail.python.org> Author: hirokazu.yamamoto Date: Sun May 17 04:52:09 2009 New Revision: 72698 Log: Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more. Modified: python/trunk/Include/pyerrors.h python/trunk/Modules/_fileio.c python/trunk/Modules/posixmodule.c python/trunk/Objects/fileobject.c python/trunk/PC/pyconfig.h python/trunk/Python/errors.c Modified: python/trunk/Include/pyerrors.h ============================================================================== --- python/trunk/Include/pyerrors.h (original) +++ python/trunk/Include/pyerrors.h Sun May 17 04:52:09 2009 @@ -112,7 +112,7 @@ ? (PyObject*)((PyInstanceObject*)(x))->in_class \ : (PyObject*)((x)->ob_type))) - + /* Predefined exceptions */ PyAPI_DATA(PyObject *) PyExc_BaseException; @@ -186,10 +186,10 @@ PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject( PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, char *); -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename( PyObject *, Py_UNICODE *); -#endif /* Py_WIN_WIDE_FILENAMES */ +#endif /* MS_WINDOWS */ PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...) Py_GCC_ATTRIBUTE((format(printf, 2, 3))); @@ -199,19 +199,15 @@ int, const char *); PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename( int, const char *); -#ifdef Py_WIN_WIDE_FILENAMES PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename( int, const Py_UNICODE *); -#endif /* Py_WIN_WIDE_FILENAMES */ PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int); PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject( PyObject *,int, PyObject *); PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename( PyObject *,int, const char *); -#ifdef Py_WIN_WIDE_FILENAMES PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename( PyObject *,int, const Py_UNICODE *); -#endif /* Py_WIN_WIDE_FILENAMES */ PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int); #endif /* MS_WINDOWS */ Modified: python/trunk/Modules/_fileio.c ============================================================================== --- python/trunk/Modules/_fileio.c (original) +++ python/trunk/Modules/_fileio.c Sun May 17 04:52:09 2009 @@ -178,7 +178,7 @@ else { PyErr_Clear(); -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS if (GetVersion() < 0x80000000) { /* On NT, so wide API available */ PyObject *po; Modified: python/trunk/Modules/posixmodule.c ============================================================================== --- python/trunk/Modules/posixmodule.c (original) +++ python/trunk/Modules/posixmodule.c Sun May 17 04:52:09 2009 @@ -523,13 +523,13 @@ return PyErr_SetFromErrnoWithFilename(PyExc_OSError, name); } -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS static PyObject * posix_error_with_unicode_filename(Py_UNICODE* name) { return PyErr_SetFromErrnoWithUnicodeFilename(PyExc_OSError, name); } -#endif /* Py_WIN_WIDE_FILENAMES */ +#endif /* MS_WINDOWS */ static PyObject * @@ -556,7 +556,6 @@ return PyErr_SetFromWindowsErr(errno); } -#ifdef Py_WIN_WIDE_FILENAMES static PyObject * win32_error_unicode(char* function, Py_UNICODE* filename) { @@ -585,9 +584,7 @@ return (*param) != NULL; } -#endif /* Py_WIN_WIDE_FILENAMES */ - -#endif +#endif /* MS_WINDOWS */ #if defined(PYOS_OS2) /********************************************************************** @@ -686,7 +683,7 @@ return Py_None; } -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS static int unicode_file_names(void) { @@ -741,7 +738,7 @@ return Py_None; } -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS static PyObject* win32_1str(PyObject* args, char* func, char* format, BOOL (__stdcall *funcA)(LPCSTR), @@ -1497,7 +1494,6 @@ #undef ISSLASH } -#ifdef Py_WIN_WIDE_FILENAMES static BOOL IsUNCRootW(Py_UNICODE *path, int pathlen) { @@ -1520,7 +1516,6 @@ #undef ISSLASH } -#endif /* Py_WIN_WIDE_FILENAMES */ #endif /* MS_WINDOWS */ static PyObject * @@ -1540,7 +1535,7 @@ int res; PyObject *result; -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS /* If on wide-character-capable OS see if argument is Unicode and if so use wide API. */ if (unicode_file_names()) { @@ -1603,7 +1598,7 @@ char *path; int mode; -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS DWORD attr; if (unicode_file_names()) { PyUnicodeObject *po; @@ -1636,7 +1631,7 @@ return PyBool_FromLong(!(mode & 2) || !(attr & FILE_ATTRIBUTE_READONLY) || (attr & FILE_ATTRIBUTE_DIRECTORY)); -#else +#else /* MS_WINDOWS */ int res; if (!PyArg_ParseTuple(args, "eti:access", Py_FileSystemDefaultEncoding, &path, &mode)) @@ -1646,7 +1641,7 @@ Py_END_ALLOW_THREADS PyMem_Free(path); return PyBool_FromLong(res == 0); -#endif +#endif /* MS_WINDOWS */ } #ifndef F_OK @@ -1757,7 +1752,7 @@ char *path = NULL; int i; int res; -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS DWORD attr; if (unicode_file_names()) { PyUnicodeObject *po; @@ -1807,7 +1802,7 @@ PyMem_Free(path); Py_INCREF(Py_None); return Py_None; -#else /* Py_WIN_WIDE_FILENAMES */ +#else /* MS_WINDOWS */ if (!PyArg_ParseTuple(args, "eti:chmod", Py_FileSystemDefaultEncoding, &path, &i)) return NULL; @@ -2092,7 +2087,7 @@ char buf[1026]; char *res; -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS DWORD len; if (unicode_file_names()) { wchar_t wbuf[1026]; @@ -2121,7 +2116,7 @@ if (wbuf2 != wbuf) free(wbuf2); return resobj; } -#endif +#endif /* MS_WINDOWS */ Py_BEGIN_ALLOW_THREADS #if defined(PYOS_OS2) && defined(PYCC_GCC) @@ -2134,8 +2129,8 @@ return posix_error(); return PyUnicode_Decode(buf, strlen(buf), Py_FileSystemDefaultEncoding,"strict"); } -#endif -#endif +#endif /* Py_USING_UNICODE */ +#endif /* HAVE_GETCWD */ #ifdef HAVE_LINK @@ -2175,7 +2170,6 @@ char *bufptr = namebuf; Py_ssize_t len = sizeof(namebuf)-5; /* only claim to have space for MAX_PATH */ -#ifdef Py_WIN_WIDE_FILENAMES /* If on wide-character-capable OS see if argument is Unicode and if so use wide API. */ if (unicode_file_names()) { @@ -2258,7 +2252,6 @@ are also valid. */ PyErr_Clear(); } -#endif if (!PyArg_ParseTuple(args, "et#:listdir", Py_FileSystemDefaultEncoding, &bufptr, &len)) @@ -2482,7 +2475,7 @@ Py_ssize_t insize = sizeof(inbuf); char outbuf[MAX_PATH*2]; char *temp; -#ifdef Py_WIN_WIDE_FILENAMES + if (unicode_file_names()) { PyUnicodeObject *po; if (PyArg_ParseTuple(args, "U|:_getfullpathname", &po)) { @@ -2512,7 +2505,7 @@ are also valid. */ PyErr_Clear(); } -#endif + if (!PyArg_ParseTuple (args, "et#:_getfullpathname", Py_FileSystemDefaultEncoding, &inbufp, &insize)) @@ -2539,7 +2532,7 @@ char *path = NULL; int mode = 0777; -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS if (unicode_file_names()) { PyUnicodeObject *po; if (PyArg_ParseTuple(args, "U|i:mkdir", &po, &mode)) { @@ -2573,7 +2566,7 @@ PyMem_Free(path); Py_INCREF(Py_None); return Py_None; -#else +#else /* MS_WINDOWS */ if (!PyArg_ParseTuple(args, "et|i:mkdir", Py_FileSystemDefaultEncoding, &path, &mode)) @@ -2590,7 +2583,7 @@ PyMem_Free(path); Py_INCREF(Py_None); return Py_None; -#endif +#endif /* MS_WINDOWS */ } @@ -2833,7 +2826,7 @@ static PyObject * posix_utime(PyObject *self, PyObject *args) { -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS PyObject *arg; PyUnicodeObject *obwpath; wchar_t *wpath = NULL; @@ -2911,7 +2904,7 @@ done: CloseHandle(hFile); return result; -#else /* Py_WIN_WIDE_FILENAMES */ +#else /* MS_WINDOWS */ char *path = NULL; long atime, mtime, ausec, musec; @@ -2985,7 +2978,7 @@ #undef UTIME_ARG #undef ATIME #undef MTIME -#endif /* Py_WIN_WIDE_FILENAMES */ +#endif /* MS_WINDOWS */ } @@ -8273,7 +8266,7 @@ char *filepath; char *operation = NULL; HINSTANCE rc; -#ifdef Py_WIN_WIDE_FILENAMES + if (unicode_file_names()) { PyObject *unipath, *woperation = NULL; if (!PyArg_ParseTuple(args, "U|s:startfile", @@ -8308,7 +8301,6 @@ Py_INCREF(Py_None); return Py_None; } -#endif normal: if (!PyArg_ParseTuple(args, "et|s:startfile", @@ -8328,7 +8320,7 @@ Py_INCREF(Py_None); return Py_None; } -#endif +#endif /* MS_WINDOWS */ #ifdef HAVE_GETLOADAVG PyDoc_STRVAR(posix_getloadavg__doc__, Modified: python/trunk/Objects/fileobject.c ============================================================================== --- python/trunk/Objects/fileobject.c (original) +++ python/trunk/Objects/fileobject.c Sun May 17 04:52:09 2009 @@ -2254,7 +2254,7 @@ Py_DECREF(closeresult); } -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS if (GetVersion() < 0x80000000) { /* On NT, so wide API available */ PyObject *po; if (PyArg_ParseTupleAndKeywords(args, kwds, "U|si:file", Modified: python/trunk/PC/pyconfig.h ============================================================================== --- python/trunk/PC/pyconfig.h (original) +++ python/trunk/PC/pyconfig.h Sun May 17 04:52:09 2009 @@ -565,10 +565,6 @@ /* This is enough for unicodeobject.h to do the "right thing" on Windows. */ #define Py_UNICODE_SIZE 2 -/* Define to indicate that the Python Unicode representation can be passed - as-is to Win32 Wide API. */ -#define Py_WIN_WIDE_FILENAMES - /* Use Python's own small-block memory-allocator. */ #define WITH_PYMALLOC 1 Modified: python/trunk/Python/errors.c ============================================================================== --- python/trunk/Python/errors.c (original) +++ python/trunk/Python/errors.c Sun May 17 04:52:09 2009 @@ -379,7 +379,7 @@ return result; } -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS PyObject * PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, Py_UNICODE *filename) { @@ -390,7 +390,7 @@ Py_XDECREF(name); return result; } -#endif /* Py_WIN_WIDE_FILENAMES */ +#endif /* MS_WINDOWS */ PyObject * PyErr_SetFromErrno(PyObject *exc) @@ -460,7 +460,6 @@ return ret; } -#ifdef Py_WIN_WIDE_FILENAMES PyObject *PyErr_SetExcFromWindowsErrWithUnicodeFilename( PyObject *exc, int ierr, @@ -475,7 +474,6 @@ Py_XDECREF(name); return ret; } -#endif /* Py_WIN_WIDE_FILENAMES */ PyObject *PyErr_SetExcFromWindowsErr(PyObject *exc, int ierr) { @@ -499,7 +497,6 @@ return result; } -#ifdef Py_WIN_WIDE_FILENAMES PyObject *PyErr_SetFromWindowsErrWithUnicodeFilename( int ierr, const Py_UNICODE *filename) @@ -513,7 +510,6 @@ Py_XDECREF(name); return result; } -#endif /* Py_WIN_WIDE_FILENAMES */ #endif /* MS_WINDOWS */ void From python-checkins at python.org Sun May 17 04:58:36 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sun, 17 May 2009 04:58:36 +0200 (CEST) Subject: [Python-checkins] r72699 - python/trunk/Misc/NEWS Message-ID: <20090517025836.3D6BED4E8@mail.python.org> Author: hirokazu.yamamoto Date: Sun May 17 04:58:36 2009 New Revision: 72699 Log: Added NEWS for r72698. Modified: python/trunk/Misc/NEWS Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun May 17 04:58:36 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more. + - __instancecheck__ and __subclasscheck__ are now completely ignored on classic classes and instances. From python-checkins at python.org Sun May 17 05:08:44 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sun, 17 May 2009 05:08:44 +0200 (CEST) Subject: [Python-checkins] r72700 - python/branches/release26-maint Message-ID: <20090517030844.822DCD59C@mail.python.org> Author: hirokazu.yamamoto Date: Sun May 17 05:08:44 2009 New Revision: 72700 Log: Blocked revisions 72698-72699 via svnmerge ........ r72698 | hirokazu.yamamoto | 2009-05-17 11:52:09 +0900 | 1 line Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more. ........ r72699 | hirokazu.yamamoto | 2009-05-17 11:58:36 +0900 | 1 line Added NEWS for r72698. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun May 17 06:21:53 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sun, 17 May 2009 06:21:53 +0200 (CEST) Subject: [Python-checkins] r72701 - in python/branches/py3k: Include/pyerrors.h Misc/NEWS Modules/_io/fileio.c Modules/posixmodule.c PC/pyconfig.h Python/errors.c Message-ID: <20090517042153.C3412D5C4@mail.python.org> Author: hirokazu.yamamoto Date: Sun May 17 06:21:53 2009 New Revision: 72701 Log: Merged revisions 72698-72699 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72698 | hirokazu.yamamoto | 2009-05-17 11:52:09 +0900 | 1 line Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more. ........ r72699 | hirokazu.yamamoto | 2009-05-17 11:58:36 +0900 | 1 line Added NEWS for r72698. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Include/pyerrors.h python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_io/fileio.c python/branches/py3k/Modules/posixmodule.c python/branches/py3k/PC/pyconfig.h python/branches/py3k/Python/errors.c Modified: python/branches/py3k/Include/pyerrors.h ============================================================================== --- python/branches/py3k/Include/pyerrors.h (original) +++ python/branches/py3k/Include/pyerrors.h Sun May 17 06:21:53 2009 @@ -177,10 +177,10 @@ PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilenameObject( PyObject *, PyObject *); PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithFilename(PyObject *, const char *); -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS PyAPI_FUNC(PyObject *) PyErr_SetFromErrnoWithUnicodeFilename( PyObject *, const Py_UNICODE *); -#endif /* Py_WIN_WIDE_FILENAMES */ +#endif /* MS_WINDOWS */ PyAPI_FUNC(PyObject *) PyErr_Format(PyObject *, const char *, ...); @@ -189,19 +189,15 @@ int, const char *); PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithFilename( int, const char *); -#ifdef Py_WIN_WIDE_FILENAMES PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErrWithUnicodeFilename( int, const Py_UNICODE *); -#endif /* Py_WIN_WIDE_FILENAMES */ PyAPI_FUNC(PyObject *) PyErr_SetFromWindowsErr(int); PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilenameObject( PyObject *,int, PyObject *); PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithFilename( PyObject *,int, const char *); -#ifdef Py_WIN_WIDE_FILENAMES PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErrWithUnicodeFilename( PyObject *,int, const Py_UNICODE *); -#endif /* Py_WIN_WIDE_FILENAMES */ PyAPI_FUNC(PyObject *) PyErr_SetExcFromWindowsErr(PyObject *, int); #endif /* MS_WINDOWS */ Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun May 17 06:21:53 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more. + - Issue #5994: the marshal module now has docstrings. - Issue #5981: Fix three minor inf/nan issues in float.fromhex: Modified: python/branches/py3k/Modules/_io/fileio.c ============================================================================== --- python/branches/py3k/Modules/_io/fileio.c (original) +++ python/branches/py3k/Modules/_io/fileio.c Sun May 17 06:21:53 2009 @@ -223,7 +223,7 @@ PyErr_Clear(); } -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS if (GetVersion() < 0x80000000) { /* On NT, so wide API available */ if (PyUnicode_Check(nameobj)) Modified: python/branches/py3k/Modules/posixmodule.c ============================================================================== --- python/branches/py3k/Modules/posixmodule.c (original) +++ python/branches/py3k/Modules/posixmodule.c Sun May 17 06:21:53 2009 @@ -581,13 +581,13 @@ return PyErr_SetFromErrnoWithFilename(PyExc_OSError, name); } -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS static PyObject * posix_error_with_unicode_filename(Py_UNICODE* name) { return PyErr_SetFromErrnoWithUnicodeFilename(PyExc_OSError, name); } -#endif /* Py_WIN_WIDE_FILENAMES */ +#endif /* MS_WINDOWS */ static PyObject * @@ -615,7 +615,6 @@ return PyErr_SetFromWindowsErr(errno); } -#ifdef Py_WIN_WIDE_FILENAMES static PyObject * win32_error_unicode(char* function, Py_UNICODE* filename) { @@ -644,9 +643,7 @@ return (*param) != NULL; } -#endif /* Py_WIN_WIDE_FILENAMES */ - -#endif +#endif /* MS_WINDOWS */ #if defined(PYOS_OS2) /********************************************************************** @@ -745,7 +742,7 @@ return Py_None; } -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS static int unicode_file_names(void) { @@ -808,7 +805,7 @@ return Py_None; } -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS static PyObject* win32_1str(PyObject* args, char* func, char* format, BOOL (__stdcall *funcA)(LPCSTR), @@ -1564,7 +1561,6 @@ #undef ISSLASH } -#ifdef Py_WIN_WIDE_FILENAMES static BOOL IsUNCRootW(Py_UNICODE *path, int pathlen) { @@ -1587,7 +1583,6 @@ #undef ISSLASH } -#endif /* Py_WIN_WIDE_FILENAMES */ #endif /* MS_WINDOWS */ static PyObject * @@ -1607,7 +1602,7 @@ int res; PyObject *result; -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS /* If on wide-character-capable OS see if argument is Unicode and if so use wide API. */ if (unicode_file_names()) { @@ -1670,7 +1665,7 @@ char *path; int mode; -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS DWORD attr; if (unicode_file_names()) { PyUnicodeObject *po; @@ -1827,7 +1822,7 @@ char *path = NULL; int i; int res; -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS DWORD attr; if (unicode_file_names()) { PyUnicodeObject *po; @@ -1878,7 +1873,7 @@ release_bytes(opath); Py_INCREF(Py_None); return Py_None; -#else /* Py_WIN_WIDE_FILENAMES */ +#else /* MS_WINDOWS */ if (!PyArg_ParseTuple(args, "O&i:chmod", PyUnicode_FSConverter, &opath, &i)) return NULL; @@ -2128,7 +2123,7 @@ char buf[1026]; char *res; -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS if (!use_bytes && unicode_file_names()) { wchar_t wbuf[1026]; wchar_t *wbuf2 = wbuf; @@ -2233,7 +2228,6 @@ char *bufptr = namebuf; Py_ssize_t len = sizeof(namebuf)-5; /* only claim to have space for MAX_PATH */ -#ifdef Py_WIN_WIDE_FILENAMES /* If on wide-character-capable OS see if argument is Unicode and if so use wide API. */ if (unicode_file_names()) { @@ -2316,7 +2310,6 @@ are also valid. */ PyErr_Clear(); } -#endif if (!PyArg_ParseTuple(args, "O&:listdir", PyUnicode_FSConverter, &opath)) @@ -2553,7 +2546,7 @@ char *path; char outbuf[MAX_PATH*2]; char *temp; -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS if (unicode_file_names()) { PyUnicodeObject *po; if (PyArg_ParseTuple(args, "U|:_getfullpathname", &po)) { @@ -2615,7 +2608,7 @@ char *path; int mode = 0777; -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS if (unicode_file_names()) { PyUnicodeObject *po; if (PyArg_ParseTuple(args, "U|i:mkdir", &po, &mode)) { @@ -2921,7 +2914,7 @@ static PyObject * posix_utime(PyObject *self, PyObject *args) { -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS PyObject *arg; PyUnicodeObject *obwpath; wchar_t *wpath = NULL; @@ -3001,7 +2994,7 @@ done: CloseHandle(hFile); return result; -#else /* Py_WIN_WIDE_FILENAMES */ +#else /* MS_WINDOWS */ PyObject *opath; char *path; @@ -3077,7 +3070,7 @@ #undef UTIME_ARG #undef ATIME #undef MTIME -#endif /* Py_WIN_WIDE_FILENAMES */ +#endif /* MS_WINDOWS */ } @@ -6803,7 +6796,7 @@ char *filepath; char *operation = NULL; HINSTANCE rc; -#ifdef Py_WIN_WIDE_FILENAMES + if (unicode_file_names()) { PyObject *unipath, *woperation = NULL; if (!PyArg_ParseTuple(args, "U|s:startfile", @@ -6838,7 +6831,6 @@ Py_INCREF(Py_None); return Py_None; } -#endif normal: if (!PyArg_ParseTuple(args, "O&|s:startfile", Modified: python/branches/py3k/PC/pyconfig.h ============================================================================== --- python/branches/py3k/PC/pyconfig.h (original) +++ python/branches/py3k/PC/pyconfig.h Sun May 17 06:21:53 2009 @@ -558,10 +558,6 @@ /* This is enough for unicodeobject.h to do the "right thing" on Windows. */ #define Py_UNICODE_SIZE 2 -/* Define to indicate that the Python Unicode representation can be passed - as-is to Win32 Wide API. */ -#define Py_WIN_WIDE_FILENAMES - /* Use Python's own small-block memory-allocator. */ #define WITH_PYMALLOC 1 Modified: python/branches/py3k/Python/errors.c ============================================================================== --- python/branches/py3k/Python/errors.c (original) +++ python/branches/py3k/Python/errors.c Sun May 17 06:21:53 2009 @@ -461,7 +461,7 @@ return result; } -#ifdef Py_WIN_WIDE_FILENAMES +#ifdef MS_WINDOWS PyObject * PyErr_SetFromErrnoWithUnicodeFilename(PyObject *exc, const Py_UNICODE *filename) { @@ -472,7 +472,7 @@ Py_XDECREF(name); return result; } -#endif /* Py_WIN_WIDE_FILENAMES */ +#endif /* MS_WINDOWS */ PyObject * PyErr_SetFromErrno(PyObject *exc) @@ -549,7 +549,6 @@ return ret; } -#ifdef Py_WIN_WIDE_FILENAMES PyObject *PyErr_SetExcFromWindowsErrWithUnicodeFilename( PyObject *exc, int ierr, @@ -564,7 +563,6 @@ Py_XDECREF(name); return ret; } -#endif /* Py_WIN_WIDE_FILENAMES */ PyObject *PyErr_SetExcFromWindowsErr(PyObject *exc, int ierr) { @@ -588,7 +586,6 @@ return result; } -#ifdef Py_WIN_WIDE_FILENAMES PyObject *PyErr_SetFromWindowsErrWithUnicodeFilename( int ierr, const Py_UNICODE *filename) @@ -602,7 +599,6 @@ Py_XDECREF(name); return result; } -#endif /* Py_WIN_WIDE_FILENAMES */ #endif /* MS_WINDOWS */ void From buildbot at python.org Sun May 17 06:26:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 04:26:57 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090517042657.82379D5F7@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/821 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Sun May 17 06:27:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 04:27:30 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090517042730.BDD39C446@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/637 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Sun May 17 06:32:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 04:32:54 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090517043254.A9BDCD4CD@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/985 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed svn sincerely, -The Buildbot From buildbot at python.org Sun May 17 07:30:55 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 05:30:55 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090517053055.5A243D552@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/702 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sun May 17 08:00:20 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Sun, 17 May 2009 08:00:20 +0200 (CEST) Subject: [Python-checkins] r72702 - python/branches/release30-maint Message-ID: <20090517060020.C781DD630@mail.python.org> Author: hirokazu.yamamoto Date: Sun May 17 08:00:20 2009 New Revision: 72702 Log: Blocked revisions 72701 via svnmerge ................ r72701 | hirokazu.yamamoto | 2009-05-17 13:21:53 +0900 | 13 lines Merged revisions 72698-72699 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72698 | hirokazu.yamamoto | 2009-05-17 11:52:09 +0900 | 1 line Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more. ........ r72699 | hirokazu.yamamoto | 2009-05-17 11:58:36 +0900 | 1 line Added NEWS for r72698. ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun May 17 10:10:27 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 17 May 2009 10:10:27 +0200 (CEST) Subject: [Python-checkins] r72703 - python/trunk/Doc/tutorial/introduction.rst Message-ID: <20090517081027.5E78EC401@mail.python.org> Author: georg.brandl Date: Sun May 17 10:10:27 2009 New Revision: 72703 Log: part of #4144: fix exception message in console session. Modified: python/trunk/Doc/tutorial/introduction.rst Modified: python/trunk/Doc/tutorial/introduction.rst ============================================================================== --- python/trunk/Doc/tutorial/introduction.rst (original) +++ python/trunk/Doc/tutorial/introduction.rst Sun May 17 10:10:27 2009 @@ -285,11 +285,11 @@ >>> word[0] = 'x' Traceback (most recent call last): File "", line 1, in ? - TypeError: object doesn't support item assignment + TypeError: object does not support item assignment >>> word[:1] = 'Splat' Traceback (most recent call last): File "", line 1, in ? - TypeError: object doesn't support slice assignment + TypeError: object does not support slice assignment However, creating a new string with the combined content is easy and efficient:: From python-checkins at python.org Sun May 17 10:14:39 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 17 May 2009 10:14:39 +0200 (CEST) Subject: [Python-checkins] r72704 - python/branches/py3k/Doc/tutorial/errors.rst Message-ID: <20090517081439.4E4DCD26E@mail.python.org> Author: georg.brandl Date: Sun May 17 10:14:39 2009 New Revision: 72704 Log: #4144: fix output of console sessions. Modified: python/branches/py3k/Doc/tutorial/errors.rst Modified: python/branches/py3k/Doc/tutorial/errors.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/errors.rst (original) +++ python/branches/py3k/Doc/tutorial/errors.rst Sun May 17 10:14:39 2009 @@ -53,7 +53,7 @@ >>> '2' + 2 Traceback (most recent call last): File "", line 1, in ? - TypeError: coercing to Unicode: need string or buffer, int found + TypeError: Can't convert 'int' object to str implicitly The last line of the error message indicates what happened. Exceptions come in different types, and the type is printed as part of the message: the types in @@ -353,7 +353,7 @@ ... print("executing finally clause") ... >>> divide(2, 1) - result is 2 + result is 2.0 executing finally clause >>> divide(2, 0) division by zero! From python-checkins at python.org Sun May 17 10:18:02 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 17 May 2009 10:18:02 +0200 (CEST) Subject: [Python-checkins] r72705 - in python/branches/py3k: Doc/tutorial/introduction.rst Message-ID: <20090517081802.3CBDBD370@mail.python.org> Author: georg.brandl Date: Sun May 17 10:18:02 2009 New Revision: 72705 Log: Merged revisions 72703 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72703 | georg.brandl | 2009-05-17 10:10:27 +0200 (So, 17 Mai 2009) | 1 line part of #4144: fix exception message in console session. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/tutorial/introduction.rst Modified: python/branches/py3k/Doc/tutorial/introduction.rst ============================================================================== --- python/branches/py3k/Doc/tutorial/introduction.rst (original) +++ python/branches/py3k/Doc/tutorial/introduction.rst Sun May 17 10:18:02 2009 @@ -296,11 +296,11 @@ >>> word[0] = 'x' Traceback (most recent call last): File "", line 1, in ? - TypeError: 'str' object doesn't support item assignment + TypeError: 'str' object does not support item assignment >>> word[:1] = 'Splat' Traceback (most recent call last): File "", line 1, in ? - TypeError: 'str' object doesn't support slice assignment + TypeError: 'str' object does not support slice assignment However, creating a new string with the combined content is easy and efficient:: From python-checkins at python.org Sun May 17 10:20:45 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 17 May 2009 10:20:45 +0200 (CEST) Subject: [Python-checkins] r72706 - python/branches/py3k/Modules/zipimport.c Message-ID: <20090517082045.9715CD6A1@mail.python.org> Author: georg.brandl Date: Sun May 17 10:20:45 2009 New Revision: 72706 Log: Fix a warning. Modified: python/branches/py3k/Modules/zipimport.c Modified: python/branches/py3k/Modules/zipimport.c ============================================================================== --- python/branches/py3k/Modules/zipimport.c (original) +++ python/branches/py3k/Modules/zipimport.c Sun May 17 10:20:45 2009 @@ -1129,7 +1129,7 @@ if (Py_VerboseFlag > 1) PySys_WriteStderr("# trying %s%c%s\n", _PyUnicode_AsString(self->archive), - SEP, path); + (int)SEP, path); toc_entry = PyDict_GetItemString(self->files, path); if (toc_entry != NULL) { time_t mtime = 0; From python-checkins at python.org Sun May 17 10:22:45 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 17 May 2009 10:22:45 +0200 (CEST) Subject: [Python-checkins] r72707 - python/branches/py3k/Objects/abstract.c Message-ID: <20090517082245.2AE19D5EB@mail.python.org> Author: georg.brandl Date: Sun May 17 10:22:45 2009 New Revision: 72707 Log: Remove unused variables. Modified: python/branches/py3k/Objects/abstract.c Modified: python/branches/py3k/Objects/abstract.c ============================================================================== --- python/branches/py3k/Objects/abstract.c (original) +++ python/branches/py3k/Objects/abstract.c Sun May 17 10:22:45 2009 @@ -2617,9 +2617,8 @@ PyObject_IsSubclass(PyObject *derived, PyObject *cls) { static PyObject *name = NULL; - PyObject *t, *v, *tb; PyObject *checker; - + if (PyTuple_Check(cls)) { Py_ssize_t i; Py_ssize_t n; From python-checkins at python.org Sun May 17 10:24:29 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 17 May 2009 10:24:29 +0200 (CEST) Subject: [Python-checkins] r72708 - python/trunk/Doc/library/stdtypes.rst Message-ID: <20090517082429.AD404D691@mail.python.org> Author: georg.brandl Date: Sun May 17 10:24:29 2009 New Revision: 72708 Log: #6017: better document behavior of dictiterators when the dict is changed. Modified: python/trunk/Doc/library/stdtypes.rst Modified: python/trunk/Doc/library/stdtypes.rst ============================================================================== --- python/trunk/Doc/library/stdtypes.rst (original) +++ python/trunk/Doc/library/stdtypes.rst Sun May 17 10:24:29 2009 @@ -1986,7 +1986,7 @@ note for :meth:`dict.items`. Using :meth:`iteritems` while adding or deleting entries in the dictionary - will raise a :exc:`RuntimeError`. + may raise a :exc:`RuntimeError` or fail to iterate over all entries. .. versionadded:: 2.2 @@ -1996,7 +1996,7 @@ :meth:`dict.items`. Using :meth:`iterkeys` while adding or deleting entries in the dictionary - will raise a :exc:`RuntimeError`. + may raise a :exc:`RuntimeError` or fail to iterate over all entries. .. versionadded:: 2.2 @@ -2006,7 +2006,8 @@ :meth:`dict.items`. Using :meth:`itervalues` while adding or deleting entries in the - dictionary will raise a :exc:`RuntimeError`. + dictionary may raise a :exc:`RuntimeError` or fail to iterate over all + entries. .. versionadded:: 2.2 From python-checkins at python.org Sun May 17 10:31:29 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 17 May 2009 10:31:29 +0200 (CEST) Subject: [Python-checkins] r72709 - in python/branches/py3k: Doc/library/stdtypes.rst Message-ID: <20090517083129.38331D405@mail.python.org> Author: georg.brandl Date: Sun May 17 10:31:29 2009 New Revision: 72709 Log: Recorded merge of revisions 72708 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72708 | georg.brandl | 2009-05-17 10:24:29 +0200 (So, 17 Mai 2009) | 1 line #6017: better document behavior of dictiterators when the dict is changed. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/stdtypes.rst Modified: python/branches/py3k/Doc/library/stdtypes.rst ============================================================================== --- python/branches/py3k/Doc/library/stdtypes.rst (original) +++ python/branches/py3k/Doc/library/stdtypes.rst Sun May 17 10:31:29 2009 @@ -1959,8 +1959,8 @@ using :func:`zip`: ``pairs = zip(d.values(), d.keys())``. Another way to create the same list is ``pairs = [(v, k) for (k, v) in d.items()]``. - Iterating views while adding or deleting entries in the dictionary will raise - a :exc:`RuntimeError`. + Iterating views while adding or deleting entries in the dictionary may raise + a :exc:`RuntimeError` or fail to iterate over all entries. .. describe:: x in dictview From python-checkins at python.org Sun May 17 10:36:05 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 17 May 2009 10:36:05 +0200 (CEST) Subject: [Python-checkins] r72710 - python/trunk/Doc/library/anydbm.rst Message-ID: <20090517083605.1B39ED428@mail.python.org> Author: georg.brandl Date: Sun May 17 10:36:04 2009 New Revision: 72710 Log: #5942: Copy over flag table from dbm.rst which is clearer. Modified: python/trunk/Doc/library/anydbm.rst Modified: python/trunk/Doc/library/anydbm.rst ============================================================================== --- python/trunk/Doc/library/anydbm.rst (original) +++ python/trunk/Doc/library/anydbm.rst Sun May 17 10:36:04 2009 @@ -27,19 +27,33 @@ Open the database file *filename* and return a corresponding object. - If the database file already exists, the :mod:`whichdb` module is used to - determine its type and the appropriate module is used; if it does not exist, the - first module listed above that can be imported is used. - - The optional *flag* argument can be ``'r'`` to open an existing database for - reading only, ``'w'`` to open an existing database for reading and writing, - ``'c'`` to create the database if it doesn't exist, or ``'n'``, which will - always create a new empty database. If not specified, the default value is - ``'r'``. + If the database file already exists, the :mod:`whichdb` module is used to + determine its type and the appropriate module is used; if it does not exist, + the first module listed above that can be imported is used. + + The optional *flag* argument must be one of these values: + + +---------+-------------------------------------------+ + | Value | Meaning | + +=========+===========================================+ + | ``'r'`` | Open existing database for reading only | + | | (default) | + +---------+-------------------------------------------+ + | ``'w'`` | Open existing database for reading and | + | | writing | + +---------+-------------------------------------------+ + | ``'c'`` | Open database for reading and writing, | + | | creating it if it doesn't exist | + +---------+-------------------------------------------+ + | ``'n'`` | Always create a new, empty database, open | + | | for reading and writing | + +---------+-------------------------------------------+ + + If not specified, the default value is ``'r'``. The optional *mode* argument is the Unix mode of the file, used only when the - database has to be created. It defaults to octal ``0666`` (and will be modified - by the prevailing umask). + database has to be created. It defaults to octal ``0666`` (and will be + modified by the prevailing umask). .. exception:: error From python-checkins at python.org Sun May 17 10:42:58 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 17 May 2009 10:42:58 +0200 (CEST) Subject: [Python-checkins] r72711 - python/branches/py3k/Lib/dbm/__init__.py Message-ID: <20090517084258.E069EC3B7@mail.python.org> Author: georg.brandl Date: Sun May 17 10:42:58 2009 New Revision: 72711 Log: We dont have dbm.bsd support anymore. Modified: python/branches/py3k/Lib/dbm/__init__.py Modified: python/branches/py3k/Lib/dbm/__init__.py ============================================================================== --- python/branches/py3k/Lib/dbm/__init__.py (original) +++ python/branches/py3k/Lib/dbm/__init__.py Sun May 17 10:42:58 2009 @@ -179,9 +179,9 @@ except struct.error: return "" - # Check for BSD hash - if magic in (0x00061561, 0x61150600): - return "dbm.bsd" + ## Check for BSD hash + #if magic in (0x00061561, 0x61150600): + # return "dbm.bsd" # Unknown return "" From python-checkins at python.org Sun May 17 10:55:00 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 17 May 2009 10:55:00 +0200 (CEST) Subject: [Python-checkins] r72712 - python/trunk/Doc/library/webbrowser.rst Message-ID: <20090517085500.571B5D46A@mail.python.org> Author: georg.brandl Date: Sun May 17 10:55:00 2009 New Revision: 72712 Log: #5935: mention that BROWSER is looked for in PATH. Modified: python/trunk/Doc/library/webbrowser.rst Modified: python/trunk/Doc/library/webbrowser.rst ============================================================================== --- python/trunk/Doc/library/webbrowser.rst (original) +++ python/trunk/Doc/library/webbrowser.rst Sun May 17 10:55:00 2009 @@ -22,7 +22,7 @@ of browsers to try in order. When the value of a list part contains the string ``%s``, then it is interpreted as a literal browser command line to be used with the argument URL substituted for ``%s``; if the part does not contain -``%s``, it is simply interpreted as the name of the browser to launch. +``%s``, it is simply interpreted as the name of the browser to launch. [1]_ For non-Unix platforms, or when a remote browser is available on Unix, the controlling process will not wait for the user to finish with the browser, but @@ -201,3 +201,8 @@ .. versionadded:: 2.5 + +.. rubric:: Footnotes + +.. [1] Executables named here without a full path will be searched in the + directories given in the :envvar:`PATH` environment variable. From nnorwitz at gmail.com Sun May 17 11:46:09 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 17 May 2009 05:46:09 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090517094609.GA7329@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 Less important issues: ---------------------- test_asynchat leaked [139, -139, 0] references, sum=0 test_docxmlrpc leaked [0, 32, -36] references, sum=-4 test_smtplib leaked [-88, 90, -90] references, sum=-88 test_socketserver leaked [0, 80, -80] references, sum=0 test_ssl leaked [0, -403, 403] references, sum=0 test_sys leaked [42, -21, -21] references, sum=0 test_threadedtempfile leaked [-102, 0, 102] references, sum=0 test_threading leaked [47, 54, 43] references, sum=144 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 From python-checkins at python.org Sun May 17 12:07:48 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 12:07:48 +0200 (CEST) Subject: [Python-checkins] r72713 - python/trunk/Lib/distutils/tests/test_build_ext.py Message-ID: <20090517100748.A0244D428@mail.python.org> Author: tarek.ziade Date: Sun May 17 12:07:48 2009 New Revision: 72713 Log: not running this test with MSVC6 Modified: python/trunk/Lib/distutils/tests/test_build_ext.py Modified: python/trunk/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_build_ext.py (original) +++ python/trunk/Lib/distutils/tests/test_build_ext.py Sun May 17 12:07:48 2009 @@ -19,6 +19,12 @@ # Don't load the xx module more than once. ALREADY_TESTED = False +if sys.platform != 'win32': + UNDER_MSVC8 = False +else: + from distutils.msvccompiler import get_build_version + UNDER_MSVC8 = get_build_version() < 8.0 + def _get_source_filename(): srcdir = sysconfig.get_config_var('srcdir') return os.path.join(srcdir, 'Modules', 'xxmodule.c') @@ -293,6 +299,7 @@ cmd.run() self.assertEquals(cmd.compiler, 'unix') + @unittest.skipIf(UNDER_MSVC8, 'not running this test for MSVC < 8') def test_get_outputs(self): tmp_dir = self.mkdtemp() c_file = os.path.join(tmp_dir, 'foo.c') From python-checkins at python.org Sun May 17 12:10:51 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 12:10:51 +0200 (CEST) Subject: [Python-checkins] r72714 - in python/branches/release26-maint: Lib/distutils/tests/test_build_ext.py Message-ID: <20090517101051.AE274D434@mail.python.org> Author: tarek.ziade Date: Sun May 17 12:10:51 2009 New Revision: 72714 Log: Merged revisions 72713 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72713 | tarek.ziade | 2009-05-17 12:07:48 +0200 (Sun, 17 May 2009) | 1 line not running this test with MSVC6 ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py Modified: python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py Sun May 17 12:10:51 2009 @@ -17,6 +17,12 @@ # Don't load the xx module more than once. ALREADY_TESTED = False +if sys.platform != 'win32': + UNDER_MSVC8 = False +else: + from distutils.msvccompiler import get_build_version + UNDER_MSVC8 = get_build_version() < 8.0 + class BuildExtTestCase(support.TempdirManager, support.LoggingSilencer, unittest.TestCase): @@ -231,6 +237,8 @@ self.assertEquals(cmd.compiler, 'unix') def test_get_outputs(self): + if UNDER_MSVC8: + return # not running this test for MSVC < 8 tmp_dir = self.mkdtemp() c_file = os.path.join(tmp_dir, 'foo.c') self.write_file(c_file, 'void initfoo(void) {};\n') From python-checkins at python.org Sun May 17 12:12:02 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 12:12:02 +0200 (CEST) Subject: [Python-checkins] r72715 - in python/branches/py3k: Lib/distutils/tests/test_build_ext.py Message-ID: <20090517101202.CD5C1D45D@mail.python.org> Author: tarek.ziade Date: Sun May 17 12:12:02 2009 New Revision: 72715 Log: Merged revisions 72713 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72713 | tarek.ziade | 2009-05-17 12:07:48 +0200 (Sun, 17 May 2009) | 1 line not running this test with MSVC6 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_build_ext.py Modified: python/branches/py3k/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_build_ext.py Sun May 17 12:12:02 2009 @@ -20,6 +20,12 @@ # Don't load the xx module more than once. ALREADY_TESTED = False +if sys.platform != 'win32': + UNDER_MSVC8 = False +else: + from distutils.msvccompiler import get_build_version + UNDER_MSVC8 = get_build_version() < 8.0 + def _get_source_filename(): srcdir = sysconfig.get_config_var('srcdir') return os.path.join(srcdir, 'Modules', 'xxmodule.c') @@ -293,6 +299,7 @@ cmd.run() self.assertEquals(cmd.compiler, 'unix') + @unittest.skipIf(UNDER_MSVC8, 'not running this test for MSVC < 8') def test_get_outputs(self): tmp_dir = self.mkdtemp() c_file = os.path.join(tmp_dir, 'foo.c') From python-checkins at python.org Sun May 17 12:13:17 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 12:13:17 +0200 (CEST) Subject: [Python-checkins] r72716 - python/branches/release30-maint Message-ID: <20090517101317.B3B35C34E@mail.python.org> Author: tarek.ziade Date: Sun May 17 12:13:17 2009 New Revision: 72716 Log: Blocked revisions 72688 via svnmerge ................ r72688 | tarek.ziade | 2009-05-16 20:37:32 +0200 (Sat, 16 May 2009) | 9 lines Merged revisions 72686 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72686 | tarek.ziade | 2009-05-16 20:29:40 +0200 (Sat, 16 May 2009) | 1 line pep8-fied distutils.dist module ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun May 17 12:16:18 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 12:16:18 +0200 (CEST) Subject: [Python-checkins] r72717 - in python/branches/release30-maint: Lib/distutils/tests/test_build_ext.py Message-ID: <20090517101618.371C1D486@mail.python.org> Author: tarek.ziade Date: Sun May 17 12:16:18 2009 New Revision: 72717 Log: Merged revisions 72715 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72715 | tarek.ziade | 2009-05-17 12:12:02 +0200 (Sun, 17 May 2009) | 9 lines Merged revisions 72713 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72713 | tarek.ziade | 2009-05-17 12:07:48 +0200 (Sun, 17 May 2009) | 1 line not running this test with MSVC6 ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py Modified: python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py Sun May 17 12:16:18 2009 @@ -18,6 +18,12 @@ # Don't load the xx module more than once. ALREADY_TESTED = False +if sys.platform != 'win32': + UNDER_MSVC8 = False +else: + from distutils.msvccompiler import get_build_version + UNDER_MSVC8 = get_build_version() < 8.0 + class BuildExtTestCase(TempdirManager, LoggingSilencer, unittest.TestCase): @@ -232,6 +238,8 @@ self.assertEquals(cmd.compiler, 'unix') def test_get_outputs(self): + if UNDER_MSVC8: + return tmp_dir = self.mkdtemp() c_file = os.path.join(tmp_dir, 'foo.c') self.write_file(c_file, 'void initfoo(void) {};\n') From python-checkins at python.org Sun May 17 12:38:30 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 17 May 2009 12:38:30 +0200 (CEST) Subject: [Python-checkins] r72718 - python/trunk/Objects/complexobject.c Message-ID: <20090517103830.E60EBD3EB@mail.python.org> Author: mark.dickinson Date: Sun May 17 12:38:30 2009 New Revision: 72718 Log: Issue #6044: remove confusing wording from complex -> integer and complex -> float conversion error messages. Modified: python/trunk/Objects/complexobject.c Modified: python/trunk/Objects/complexobject.c ============================================================================== --- python/trunk/Objects/complexobject.c (original) +++ python/trunk/Objects/complexobject.c Sun May 17 12:38:30 2009 @@ -800,7 +800,7 @@ complex_int(PyObject *v) { PyErr_SetString(PyExc_TypeError, - "can't convert complex to int; use int(abs(z))"); + "can't convert complex to int"); return NULL; } @@ -808,7 +808,7 @@ complex_long(PyObject *v) { PyErr_SetString(PyExc_TypeError, - "can't convert complex to long; use long(abs(z))"); + "can't convert complex to long"); return NULL; } @@ -816,7 +816,7 @@ complex_float(PyObject *v) { PyErr_SetString(PyExc_TypeError, - "can't convert complex to float; use abs(z)"); + "can't convert complex to float"); return NULL; } From python-checkins at python.org Sun May 17 12:40:11 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 17 May 2009 12:40:11 +0200 (CEST) Subject: [Python-checkins] r72719 - in python/branches/py3k: Objects/complexobject.c Message-ID: <20090517104011.27261D37B@mail.python.org> Author: mark.dickinson Date: Sun May 17 12:40:10 2009 New Revision: 72719 Log: Merged revisions 72718 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72718 | mark.dickinson | 2009-05-17 11:38:30 +0100 (Sun, 17 May 2009) | 4 lines Issue #6044: remove confusing wording from complex -> integer and complex -> float conversion error messages. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Objects/complexobject.c Modified: python/branches/py3k/Objects/complexobject.c ============================================================================== --- python/branches/py3k/Objects/complexobject.c (original) +++ python/branches/py3k/Objects/complexobject.c Sun May 17 12:40:10 2009 @@ -648,7 +648,7 @@ complex_int(PyObject *v) { PyErr_SetString(PyExc_TypeError, - "can't convert complex to int; use int(abs(z))"); + "can't convert complex to int"); return NULL; } @@ -656,7 +656,7 @@ complex_float(PyObject *v) { PyErr_SetString(PyExc_TypeError, - "can't convert complex to float; use abs(z)"); + "can't convert complex to float"); return NULL; } From python-checkins at python.org Sun May 17 12:43:52 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 17 May 2009 12:43:52 +0200 (CEST) Subject: [Python-checkins] r72720 - in python/branches/release30-maint: Objects/complexobject.c Message-ID: <20090517104352.496C0D3F8@mail.python.org> Author: mark.dickinson Date: Sun May 17 12:43:52 2009 New Revision: 72720 Log: Merged revisions 72719 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72719 | mark.dickinson | 2009-05-17 11:40:10 +0100 (Sun, 17 May 2009) | 10 lines Merged revisions 72718 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72718 | mark.dickinson | 2009-05-17 11:38:30 +0100 (Sun, 17 May 2009) | 4 lines Issue #6044: remove confusing wording from complex -> integer and complex -> float conversion error messages. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Objects/complexobject.c Modified: python/branches/release30-maint/Objects/complexobject.c ============================================================================== --- python/branches/release30-maint/Objects/complexobject.c (original) +++ python/branches/release30-maint/Objects/complexobject.c Sun May 17 12:43:52 2009 @@ -656,7 +656,7 @@ complex_int(PyObject *v) { PyErr_SetString(PyExc_TypeError, - "can't convert complex to int; use int(abs(z))"); + "can't convert complex to int"); return NULL; } @@ -664,7 +664,7 @@ complex_float(PyObject *v) { PyErr_SetString(PyExc_TypeError, - "can't convert complex to float; use abs(z)"); + "can't convert complex to float"); return NULL; } From python-checkins at python.org Sun May 17 12:44:12 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 12:44:12 +0200 (CEST) Subject: [Python-checkins] r72721 - in python/trunk/Lib/distutils: dist.py tests/test_dist.py Message-ID: <20090517104412.ED0C8D3FA@mail.python.org> Author: tarek.ziade Date: Sun May 17 12:44:12 2009 New Revision: 72721 Log: removed sys.platform == 'mac' support in distutils.dist.parse_command_line and improved test coverage Modified: python/trunk/Lib/distutils/dist.py python/trunk/Lib/distutils/tests/test_dist.py Modified: python/trunk/Lib/distutils/dist.py ============================================================================== --- python/trunk/Lib/distutils/dist.py (original) +++ python/trunk/Lib/distutils/dist.py Sun May 17 12:44:12 2009 @@ -414,11 +414,6 @@ # that allows the user to interactively specify the "command line". # toplevel_options = self._get_toplevel_options() - if sys.platform == 'mac': - import EasyDialogs - cmdlist = self.get_command_list() - self.script_args = EasyDialogs.GetArgv( - toplevel_options + self.display_options, cmdlist) # We have to parse the command line a bit at a time -- global # options, then the first command, then its options, and so on -- @@ -438,7 +433,6 @@ # for display options we return immediately if self.handle_display_options(option_order): return - while args: args = self._parse_command_opts(parser, args) if args is None: # user asked for help (and got it) Modified: python/trunk/Lib/distutils/tests/test_dist.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_dist.py (original) +++ python/trunk/Lib/distutils/tests/test_dist.py Sun May 17 12:44:12 2009 @@ -1,19 +1,19 @@ # -*- coding: latin-1 -*- """Tests for distutils.dist.""" - -import distutils.cmd -import distutils.dist import os import StringIO import sys import unittest import warnings -from test.test_support import TESTFN +from distutils.dist import Distribution, fix_help_options +from distutils.cmd import Command + +from test.test_support import TESTFN, captured_stdout from distutils.tests import support -class test_dist(distutils.cmd.Command): +class test_dist(Command): """Sample distutils extension command.""" user_options = [ @@ -24,7 +24,7 @@ self.sample_option = None -class TestDistribution(distutils.dist.Distribution): +class TestDistribution(Distribution): """Distribution subclasses that avoids the default search for configuration files. @@ -104,7 +104,7 @@ # Check DistributionMetadata handling of Unicode fields tmp_dir = self.mkdtemp() my_file = os.path.join(tmp_dir, 'f') - klass = distutils.dist.Distribution + klass = Distribution dist = klass(attrs={'author': u'Mister Caf?', 'name': 'my.package', @@ -131,7 +131,7 @@ def test_empty_options(self): # an empty options dictionary should not stay in the # list of attributes - klass = distutils.dist.Distribution + klass = Distribution # catching warnings warns = [] @@ -157,7 +157,7 @@ def test_simple_metadata(self): attrs = {"name": "package", "version": "1.0"} - dist = distutils.dist.Distribution(attrs) + dist = Distribution(attrs) meta = self.format_metadata(dist) self.assert_("Metadata-Version: 1.0" in meta) self.assert_("provides:" not in meta.lower()) @@ -168,7 +168,7 @@ attrs = {"name": "package", "version": "1.0", "provides": ["package", "package.sub"]} - dist = distutils.dist.Distribution(attrs) + dist = Distribution(attrs) self.assertEqual(dist.metadata.get_provides(), ["package", "package.sub"]) self.assertEqual(dist.get_provides(), @@ -179,8 +179,7 @@ self.assert_("obsoletes:" not in meta.lower()) def test_provides_illegal(self): - self.assertRaises(ValueError, - distutils.dist.Distribution, + self.assertRaises(ValueError, Distribution, {"name": "package", "version": "1.0", "provides": ["my.pkg (splat)"]}) @@ -189,7 +188,7 @@ attrs = {"name": "package", "version": "1.0", "requires": ["other", "another (==1.0)"]} - dist = distutils.dist.Distribution(attrs) + dist = Distribution(attrs) self.assertEqual(dist.metadata.get_requires(), ["other", "another (==1.0)"]) self.assertEqual(dist.get_requires(), @@ -202,8 +201,7 @@ self.assert_("obsoletes:" not in meta.lower()) def test_requires_illegal(self): - self.assertRaises(ValueError, - distutils.dist.Distribution, + self.assertRaises(ValueError, Distribution, {"name": "package", "version": "1.0", "requires": ["my.pkg (splat)"]}) @@ -212,7 +210,7 @@ attrs = {"name": "package", "version": "1.0", "obsoletes": ["other", "another (<1.0)"]} - dist = distutils.dist.Distribution(attrs) + dist = Distribution(attrs) self.assertEqual(dist.metadata.get_obsoletes(), ["other", "another (<1.0)"]) self.assertEqual(dist.get_obsoletes(), @@ -225,8 +223,7 @@ self.assert_("Obsoletes: another (<1.0)" in meta) def test_obsoletes_illegal(self): - self.assertRaises(ValueError, - distutils.dist.Distribution, + self.assertRaises(ValueError, Distribution, {"name": "package", "version": "1.0", "obsoletes": ["my.pkg (splat)"]}) @@ -251,7 +248,7 @@ f.close() try: - dist = distutils.dist.Distribution() + dist = Distribution() # linux-style if sys.platform in ('linux', 'darwin'): @@ -269,6 +266,29 @@ finally: os.remove(user_filename) + def test_fix_help_options(self): + help_tuples = [('a', 'b', 'c', 'd'), (1, 2, 3, 4)] + fancy_options = fix_help_options(help_tuples) + self.assertEquals(fancy_options[0], ('a', 'b', 'c')) + self.assertEquals(fancy_options[1], (1, 2, 3)) + + def test_show_help(self): + # smoke test, just makes sure some help is displayed + dist = Distribution() + old_argv = sys.argv + sys.argv = [] + try: + dist.help = 1 + dist.script_name = 'setup.py' + with captured_stdout() as s: + dist.parse_command_line() + finally: + sys.argv = old_argv + + output = [line for line in s.getvalue().split('\n') + if line.strip() != ''] + self.assert_(len(output) > 0) + def test_suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(DistributionTestCase)) From python-checkins at python.org Sun May 17 12:44:48 2009 From: python-checkins at python.org (mark.dickinson) Date: Sun, 17 May 2009 12:44:48 +0200 (CEST) Subject: [Python-checkins] r72722 - in python/branches/release26-maint: Objects/complexobject.c Message-ID: <20090517104448.C3D84D3FA@mail.python.org> Author: mark.dickinson Date: Sun May 17 12:44:48 2009 New Revision: 72722 Log: Merged revisions 72718 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72718 | mark.dickinson | 2009-05-17 11:38:30 +0100 (Sun, 17 May 2009) | 4 lines Issue #6044: remove confusing wording from complex -> integer and complex -> float conversion error messages. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Objects/complexobject.c Modified: python/branches/release26-maint/Objects/complexobject.c ============================================================================== --- python/branches/release26-maint/Objects/complexobject.c (original) +++ python/branches/release26-maint/Objects/complexobject.c Sun May 17 12:44:48 2009 @@ -785,7 +785,7 @@ complex_int(PyObject *v) { PyErr_SetString(PyExc_TypeError, - "can't convert complex to int; use int(abs(z))"); + "can't convert complex to int"); return NULL; } @@ -793,7 +793,7 @@ complex_long(PyObject *v) { PyErr_SetString(PyExc_TypeError, - "can't convert complex to long; use long(abs(z))"); + "can't convert complex to long"); return NULL; } @@ -801,7 +801,7 @@ complex_float(PyObject *v) { PyErr_SetString(PyExc_TypeError, - "can't convert complex to float; use abs(z)"); + "can't convert complex to float"); return NULL; } From python-checkins at python.org Sun May 17 12:45:53 2009 From: python-checkins at python.org (ronald.oussoren) Date: Sun, 17 May 2009 12:45:53 +0200 (CEST) Subject: [Python-checkins] r72723 - python/branches/py3k/Mac/Makefile.in Message-ID: <20090517104553.54B87D42C@mail.python.org> Author: ronald.oussoren Date: Sun May 17 12:45:53 2009 New Revision: 72723 Log: Update framework installation makefiles to deal correctly with the rename of 'python' to 'python3' Modified: python/branches/py3k/Mac/Makefile.in Modified: python/branches/py3k/Mac/Makefile.in ============================================================================== --- python/branches/py3k/Mac/Makefile.in (original) +++ python/branches/py3k/Mac/Makefile.in Sun May 17 12:45:53 2009 @@ -56,8 +56,8 @@ install_pythonw: pythonw $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)" $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/python$(VERSION)" - ln -sf python$(VERSION) "$(DESTDIR)$(prefix)/bin/python" - ln -sf pythonw$(VERSION) "$(DESTDIR)$(prefix)/bin/pythonw" + ln -sf python$(VERSION) "$(DESTDIR)$(prefix)/bin/python3" + ln -sf pythonw$(VERSION) "$(DESTDIR)$(prefix)/bin/pythonw3" # Install 3 variants of python/pythonw: @@ -68,23 +68,23 @@ install_pythonw4way: pythonw-32 pythonw-64 pythonw $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-64 "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-64" $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-64 "$(DESTDIR)$(prefix)/bin/python$(VERSION)-64" - ln -sf python$(VERSION)-64 "$(DESTDIR)$(prefix)/bin/python-64" - ln -sf pythonw$(VERSION)-64 "$(DESTDIR)$(prefix)/bin/pythonw-64" + ln -sf python$(VERSION)-64 "$(DESTDIR)$(prefix)/bin/python3-64" + ln -sf pythonw$(VERSION)-64 "$(DESTDIR)$(prefix)/bin/pythonw3-64" $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-32 "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-32" $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-32 "$(DESTDIR)$(prefix)/bin/python$(VERSION)-32" - ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python-32" - ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw-32" + ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python3-32" + ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw3-32" $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-all" $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/python$(VERSION)-all" - ln -sf python$(VERSION)-all "$(DESTDIR)$(prefix)/bin/python-all" - ln -sf pythonw$(VERSION)-all "$(DESTDIR)$(prefix)/bin/pythonw-all" + ln -sf python$(VERSION)-all "$(DESTDIR)$(prefix)/bin/python3-all" + ln -sf pythonw$(VERSION)-all "$(DESTDIR)$(prefix)/bin/pythonw3-all" ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)" ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python$(VERSION)" - ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw" - ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python" + ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw3" + ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python3" # # Install unix tools in /usr/local/bin. These are just aliases for the @@ -94,9 +94,9 @@ if [ ! -d "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ]; then \ $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\ fi - for fn in python pythonw idle pydoc python-config smtpd.py \ + for fn in python3 pythonw3 idle3 pydoc3 python3-config \ python$(VERSION) pythonw$(VERSION) idle$(VERSION) \ - pydoc$(VERSION) python$(VERSION)-config smtpd$(VERSION).py ;\ + pydoc$(VERSION) python$(VERSION)-config ;\ do \ ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\ done @@ -114,7 +114,7 @@ $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\ fi for fn in python$(VERSION) pythonw$(VERSION) idle$(VERSION) \ - pydoc$(VERSION) python$(VERSION)-config smtpd$(VERSION).py ;\ + pydoc$(VERSION) python$(VERSION)-config ;\ do \ ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\ done @@ -129,19 +129,15 @@ install_versionedtools: for fn in idle pydoc ;\ do \ - if [ -h "$(DESTDIR)$(prefix)/bin/$${fn}" ]; then \ + if [ -h "$(DESTDIR)$(prefix)/bin/$${fn}3" ]; then \ continue ;\ fi ;\ - mv "$(DESTDIR)$(prefix)/bin/$${fn}" "$(DESTDIR)$(prefix)/bin/$${fn}$(VERSION)" ;\ - ln -sf "$${fn}$(VERSION)" "$(DESTDIR)$(prefix)/bin/$${fn}" ;\ + mv "$(DESTDIR)$(prefix)/bin/$${fn}3" "$(DESTDIR)$(prefix)/bin/$${fn}$(VERSION)" ;\ + ln -sf "$${fn}$(VERSION)" "$(DESTDIR)$(prefix)/bin/$${fn}3" ;\ done - if [ ! -h "$(DESTDIR)$(prefix)/bin/python-config" ]; then \ - mv "$(DESTDIR)$(prefix)/bin/python-config" "$(DESTDIR)$(prefix)/bin/python$(VERSION)-config" ;\ - ln -sf "python$(VERSION)-config" "$(DESTDIR)$(prefix)/bin/python-config" ; \ - fi - if [ ! -h "$(DESTDIR)$(prefix)/bin/smtpd.py" ]; then \ - mv "$(DESTDIR)$(prefix)/bin/smtpd.py" "$(DESTDIR)$(prefix)/bin/smtpd$(VERSION).py" ;\ - ln -sf "smtpd$(VERSION).py" "$(DESTDIR)$(prefix)/bin/smtpd.py" ;\ + if [ ! -h "$(DESTDIR)$(prefix)/bin/python3-config" ]; then \ + mv "$(DESTDIR)$(prefix)/bin/python3-config" "$(DESTDIR)$(prefix)/bin/python$(VERSION)-config" ;\ + ln -sf "python$(VERSION)-config" "$(DESTDIR)$(prefix)/bin/python3-config" ; \ fi From python-checkins at python.org Sun May 17 12:46:01 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 12:46:01 +0200 (CEST) Subject: [Python-checkins] r72724 - python/branches/release26-maint Message-ID: <20090517104601.68544D433@mail.python.org> Author: tarek.ziade Date: Sun May 17 12:46:01 2009 New Revision: 72724 Log: Blocked revisions 72721 via svnmerge ........ r72721 | tarek.ziade | 2009-05-17 12:44:12 +0200 (Sun, 17 May 2009) | 1 line removed sys.platform == 'mac' support in distutils.dist.parse_command_line and improved test coverage ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun May 17 12:50:25 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 12:50:25 +0200 (CEST) Subject: [Python-checkins] r72725 - in python/branches/py3k: Lib/distutils/dist.py Lib/distutils/tests/test_dist.py Message-ID: <20090517105025.0C7B6D460@mail.python.org> Author: tarek.ziade Date: Sun May 17 12:50:24 2009 New Revision: 72725 Log: Merged revisions 72721 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72721 | tarek.ziade | 2009-05-17 12:44:12 +0200 (Sun, 17 May 2009) | 1 line removed sys.platform == 'mac' support in distutils.dist.parse_command_line and improved test coverage ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/dist.py python/branches/py3k/Lib/distutils/tests/test_dist.py Modified: python/branches/py3k/Lib/distutils/dist.py ============================================================================== --- python/branches/py3k/Lib/distutils/dist.py (original) +++ python/branches/py3k/Lib/distutils/dist.py Sun May 17 12:50:24 2009 @@ -408,11 +408,6 @@ # that allows the user to interactively specify the "command line". # toplevel_options = self._get_toplevel_options() - if sys.platform == 'mac': - import EasyDialogs - cmdlist = self.get_command_list() - self.script_args = EasyDialogs.GetArgv( - toplevel_options + self.display_options, cmdlist) # We have to parse the command line a bit at a time -- global # options, then the first command, then its options, and so on -- @@ -432,7 +427,6 @@ # for display options we return immediately if self.handle_display_options(option_order): return - while args: args = self._parse_command_opts(parser, args) if args is None: # user asked for help (and got it) Modified: python/branches/py3k/Lib/distutils/tests/test_dist.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_dist.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_dist.py Sun May 17 12:50:24 2009 @@ -1,18 +1,18 @@ """Tests for distutils.dist.""" - -import distutils.cmd -import distutils.dist import os import io import sys import unittest import warnings -from test.support import TESTFN +from distutils.dist import Distribution, fix_help_options +from distutils.cmd import Command + +from test.support import TESTFN, captured_stdout from distutils.tests import support -class test_dist(distutils.cmd.Command): +class test_dist(Command): """Sample distutils extension command.""" user_options = [ @@ -23,7 +23,7 @@ self.sample_option = None -class TestDistribution(distutils.dist.Distribution): +class TestDistribution(Distribution): """Distribution subclasses that avoids the default search for configuration files. @@ -99,11 +99,10 @@ finally: os.unlink(TESTFN) - def test_empty_options(self): # an empty options dictionary should not stay in the # list of attributes - klass = distutils.dist.Distribution + klass = Distribution # catching warnings warns = [] @@ -129,7 +128,7 @@ def test_simple_metadata(self): attrs = {"name": "package", "version": "1.0"} - dist = distutils.dist.Distribution(attrs) + dist = Distribution(attrs) meta = self.format_metadata(dist) self.assert_("Metadata-Version: 1.0" in meta) self.assert_("provides:" not in meta.lower()) @@ -140,7 +139,7 @@ attrs = {"name": "package", "version": "1.0", "provides": ["package", "package.sub"]} - dist = distutils.dist.Distribution(attrs) + dist = Distribution(attrs) self.assertEqual(dist.metadata.get_provides(), ["package", "package.sub"]) self.assertEqual(dist.get_provides(), @@ -151,8 +150,7 @@ self.assert_("obsoletes:" not in meta.lower()) def test_provides_illegal(self): - self.assertRaises(ValueError, - distutils.dist.Distribution, + self.assertRaises(ValueError, Distribution, {"name": "package", "version": "1.0", "provides": ["my.pkg (splat)"]}) @@ -161,7 +159,7 @@ attrs = {"name": "package", "version": "1.0", "requires": ["other", "another (==1.0)"]} - dist = distutils.dist.Distribution(attrs) + dist = Distribution(attrs) self.assertEqual(dist.metadata.get_requires(), ["other", "another (==1.0)"]) self.assertEqual(dist.get_requires(), @@ -174,8 +172,7 @@ self.assert_("obsoletes:" not in meta.lower()) def test_requires_illegal(self): - self.assertRaises(ValueError, - distutils.dist.Distribution, + self.assertRaises(ValueError, Distribution, {"name": "package", "version": "1.0", "requires": ["my.pkg (splat)"]}) @@ -184,7 +181,7 @@ attrs = {"name": "package", "version": "1.0", "obsoletes": ["other", "another (<1.0)"]} - dist = distutils.dist.Distribution(attrs) + dist = Distribution(attrs) self.assertEqual(dist.metadata.get_obsoletes(), ["other", "another (<1.0)"]) self.assertEqual(dist.get_obsoletes(), @@ -197,8 +194,7 @@ self.assert_("Obsoletes: another (<1.0)" in meta) def test_obsoletes_illegal(self): - self.assertRaises(ValueError, - distutils.dist.Distribution, + self.assertRaises(ValueError, Distribution, {"name": "package", "version": "1.0", "obsoletes": ["my.pkg (splat)"]}) @@ -223,7 +219,7 @@ f.close() try: - dist = distutils.dist.Distribution() + dist = Distribution() # linux-style if sys.platform in ('linux', 'darwin'): @@ -241,6 +237,29 @@ finally: os.remove(user_filename) + def test_fix_help_options(self): + help_tuples = [('a', 'b', 'c', 'd'), (1, 2, 3, 4)] + fancy_options = fix_help_options(help_tuples) + self.assertEquals(fancy_options[0], ('a', 'b', 'c')) + self.assertEquals(fancy_options[1], (1, 2, 3)) + + def test_show_help(self): + # smoke test, just makes sure some help is displayed + dist = Distribution() + old_argv = sys.argv + sys.argv = [] + try: + dist.help = 1 + dist.script_name = 'setup.py' + with captured_stdout() as s: + dist.parse_command_line() + finally: + sys.argv = old_argv + + output = [line for line in s.getvalue().split('\n') + if line.strip() != ''] + self.assert_(len(output) > 0) + def test_suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(DistributionTestCase)) From python-checkins at python.org Sun May 17 12:52:03 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 12:52:03 +0200 (CEST) Subject: [Python-checkins] r72726 - python/branches/release30-maint Message-ID: <20090517105203.3BA16D397@mail.python.org> Author: tarek.ziade Date: Sun May 17 12:52:03 2009 New Revision: 72726 Log: Blocked revisions 72725 via svnmerge ................ r72725 | tarek.ziade | 2009-05-17 12:50:24 +0200 (Sun, 17 May 2009) | 9 lines Merged revisions 72721 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72721 | tarek.ziade | 2009-05-17 12:44:12 +0200 (Sun, 17 May 2009) | 1 line removed sys.platform == 'mac' support in distutils.dist.parse_command_line and improved test coverage ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun May 17 13:11:57 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 13:11:57 +0200 (CEST) Subject: [Python-checkins] r72727 - in python/trunk/Lib/distutils: dir_util.py tests/test_dir_util.py Message-ID: <20090517111157.8640FD42C@mail.python.org> Author: tarek.ziade Date: Sun May 17 13:11:57 2009 New Revision: 72727 Log: removed sys.platform == 'mac' usage in distutils.dir_util Modified: python/trunk/Lib/distutils/dir_util.py python/trunk/Lib/distutils/tests/test_dir_util.py Modified: python/trunk/Lib/distutils/dir_util.py ============================================================================== --- python/trunk/Lib/distutils/dir_util.py (original) +++ python/trunk/Lib/distutils/dir_util.py Sun May 17 13:11:57 2009 @@ -212,14 +212,11 @@ exc, "error removing %s: " % directory)) -def ensure_relative (path): +def ensure_relative(path): """Take the full path 'path', and make it a relative path so it can be the second argument to os.path.join(). """ drive, path = os.path.splitdrive(path) - if sys.platform == 'mac': - return os.sep + path - else: - if path[0:1] == os.sep: - path = drive + path[1:] - return path + if path[0:1] == os.sep: + path = drive + path[1:] + return path Modified: python/trunk/Lib/distutils/tests/test_dir_util.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_dir_util.py (original) +++ python/trunk/Lib/distutils/tests/test_dir_util.py Sun May 17 13:11:57 2009 @@ -3,10 +3,8 @@ import os import shutil -from distutils.dir_util import mkpath -from distutils.dir_util import remove_tree -from distutils.dir_util import create_tree -from distutils.dir_util import copy_tree +from distutils.dir_util import (mkpath, remove_tree, create_tree, copy_tree, + ensure_relative) from distutils import log from distutils.tests import support @@ -85,6 +83,14 @@ remove_tree(self.root_target, verbose=0) remove_tree(self.target2, verbose=0) + def test_ensure_relative(self): + if os.sep == '/': + self.assertEquals(ensure_relative('/home/foo'), 'home/foo') + self.assertEquals(ensure_relative('some/path'), 'some/path') + else: # \\ + self.assertEquals(ensure_relative('c:\\home\\foo'), 'home\\foo') + self.assertEquals(ensure_relative('home\\foo'), 'home\\foo') + def test_suite(): return unittest.makeSuite(DirUtilTestCase) From python-checkins at python.org Sun May 17 13:12:54 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 13:12:54 +0200 (CEST) Subject: [Python-checkins] r72728 - python/branches/release26-maint Message-ID: <20090517111254.B274DD462@mail.python.org> Author: tarek.ziade Date: Sun May 17 13:12:54 2009 New Revision: 72728 Log: Blocked revisions 72727 via svnmerge ........ r72727 | tarek.ziade | 2009-05-17 13:11:57 +0200 (Sun, 17 May 2009) | 1 line removed sys.platform == 'mac' usage in distutils.dir_util ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun May 17 13:14:15 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 13:14:15 +0200 (CEST) Subject: [Python-checkins] r72729 - in python/branches/py3k: Lib/distutils/dir_util.py Lib/distutils/tests/test_dir_util.py Message-ID: <20090517111415.A8854D486@mail.python.org> Author: tarek.ziade Date: Sun May 17 13:14:15 2009 New Revision: 72729 Log: Merged revisions 72727 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72727 | tarek.ziade | 2009-05-17 13:11:57 +0200 (Sun, 17 May 2009) | 1 line removed sys.platform == 'mac' usage in distutils.dir_util ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/dir_util.py python/branches/py3k/Lib/distutils/tests/test_dir_util.py Modified: python/branches/py3k/Lib/distutils/dir_util.py ============================================================================== --- python/branches/py3k/Lib/distutils/dir_util.py (original) +++ python/branches/py3k/Lib/distutils/dir_util.py Sun May 17 13:14:15 2009 @@ -208,14 +208,11 @@ exc, "error removing %s: " % directory)) -def ensure_relative (path): +def ensure_relative(path): """Take the full path 'path', and make it a relative path so it can be the second argument to os.path.join(). """ drive, path = os.path.splitdrive(path) - if sys.platform == 'mac': - return os.sep + path - else: - if path[0:1] == os.sep: - path = drive + path[1:] - return path + if path[0:1] == os.sep: + path = drive + path[1:] + return path Modified: python/branches/py3k/Lib/distutils/tests/test_dir_util.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_dir_util.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_dir_util.py Sun May 17 13:14:15 2009 @@ -3,10 +3,8 @@ import os import shutil -from distutils.dir_util import mkpath -from distutils.dir_util import remove_tree -from distutils.dir_util import create_tree -from distutils.dir_util import copy_tree +from distutils.dir_util import (mkpath, remove_tree, create_tree, copy_tree, + ensure_relative) from distutils import log from distutils.tests import support @@ -85,6 +83,14 @@ remove_tree(self.root_target, verbose=0) remove_tree(self.target2, verbose=0) + def test_ensure_relative(self): + if os.sep == '/': + self.assertEquals(ensure_relative('/home/foo'), 'home/foo') + self.assertEquals(ensure_relative('some/path'), 'some/path') + else: # \\ + self.assertEquals(ensure_relative('c:\\home\\foo'), 'home\\foo') + self.assertEquals(ensure_relative('home\\foo'), 'home\\foo') + def test_suite(): return unittest.makeSuite(DirUtilTestCase) From python-checkins at python.org Sun May 17 13:22:37 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 13:22:37 +0200 (CEST) Subject: [Python-checkins] r72730 - python/trunk/Lib/distutils/dir_util.py Message-ID: <20090517112237.06190D435@mail.python.org> Author: tarek.ziade Date: Sun May 17 13:22:36 2009 New Revision: 72730 Log: pep8-fied distutils.dir_util Modified: python/trunk/Lib/distutils/dir_util.py Modified: python/trunk/Lib/distutils/dir_util.py ============================================================================== --- python/trunk/Lib/distutils/dir_util.py (original) +++ python/trunk/Lib/distutils/dir_util.py Sun May 17 13:22:36 2009 @@ -5,7 +5,6 @@ __revision__ = "$Id$" import os, sys -from types import * from distutils.errors import DistutilsFileError, DistutilsInternalError from distutils import log @@ -16,20 +15,21 @@ # I don't use os.makedirs because a) it's new to Python 1.5.2, and # b) it blows up if the directory already exists (I want to silently # succeed in that case). -def mkpath (name, mode=0777, verbose=1, dry_run=0): - """Create a directory and any missing ancestor directories. If the - directory already exists (or if 'name' is the empty string, which - means the current directory, which of course exists), then do - nothing. Raise DistutilsFileError if unable to create some - directory along the way (eg. some sub-path exists, but is a file - rather than a directory). If 'verbose' is true, print a one-line - summary of each mkdir to stdout. Return the list of directories - actually created.""" +def mkpath(name, mode=0777, verbose=1, dry_run=0): + """Create a directory and any missing ancestor directories. + + If the directory already exists (or if 'name' is the empty string, which + means the current directory, which of course exists), then do nothing. + Raise DistutilsFileError if unable to create some directory along the way + (eg. some sub-path exists, but is a file rather than a directory). + If 'verbose' is true, print a one-line summary of each mkdir to stdout. + Return the list of directories actually created. + """ global _path_created # Detect a common bug -- name is None - if not isinstance(name, StringTypes): + if not isinstance(name, basestring): raise DistutilsInternalError, \ "mkpath: 'name' must be a string (got %r)" % (name,) @@ -77,19 +77,16 @@ _path_created[abs_head] = 1 return created_dirs -# mkpath () - - -def create_tree (base_dir, files, mode=0777, verbose=1, dry_run=0): - - """Create all the empty directories under 'base_dir' needed to - put 'files' there. 'base_dir' is just the a name of a directory - which doesn't necessarily exist yet; 'files' is a list of filenames - to be interpreted relative to 'base_dir'. 'base_dir' + the - directory portion of every file in 'files' will be created if it - doesn't already exist. 'mode', 'verbose' and 'dry_run' flags are as - for 'mkpath()'.""" - +def create_tree(base_dir, files, mode=0777, verbose=1, dry_run=0): + """Create all the empty directories under 'base_dir' needed to put 'files' + there. + + 'base_dir' is just the a name of a directory which doesn't necessarily + exist yet; 'files' is a list of filenames to be interpreted relative to + 'base_dir'. 'base_dir' + the directory portion of every file in 'files' + will be created if it doesn't already exist. 'mode', 'verbose' and + 'dry_run' flags are as for 'mkpath()'. + """ # First get the list of directories to create need_dir = {} for file in files: @@ -101,35 +98,27 @@ for dir in need_dirs: mkpath(dir, mode, verbose=verbose, dry_run=dry_run) -# create_tree () - - -def copy_tree (src, dst, - preserve_mode=1, - preserve_times=1, - preserve_symlinks=0, - update=0, - verbose=1, - dry_run=0): - - """Copy an entire directory tree 'src' to a new location 'dst'. Both - 'src' and 'dst' must be directory names. If 'src' is not a - directory, raise DistutilsFileError. If 'dst' does not exist, it is - created with 'mkpath()'. The end result of the copy is that every - file in 'src' is copied to 'dst', and directories under 'src' are - recursively copied to 'dst'. Return the list of files that were - copied or might have been copied, using their output name. The - return value is unaffected by 'update' or 'dry_run': it is simply - the list of all files under 'src', with the names changed to be - under 'dst'. - - 'preserve_mode' and 'preserve_times' are the same as for - 'copy_file'; note that they only apply to regular files, not to - directories. If 'preserve_symlinks' is true, symlinks will be - copied as symlinks (on platforms that support them!); otherwise - (the default), the destination of the symlink will be copied. - 'update' and 'verbose' are the same as for 'copy_file'.""" - +def copy_tree(src, dst, preserve_mode=1, preserve_times=1, + preserve_symlinks=0, update=0, verbose=1, dry_run=0): + """Copy an entire directory tree 'src' to a new location 'dst'. + + Both 'src' and 'dst' must be directory names. If 'src' is not a + directory, raise DistutilsFileError. If 'dst' does not exist, it is + created with 'mkpath()'. The end result of the copy is that every + file in 'src' is copied to 'dst', and directories under 'src' are + recursively copied to 'dst'. Return the list of files that were + copied or might have been copied, using their output name. The + return value is unaffected by 'update' or 'dry_run': it is simply + the list of all files under 'src', with the names changed to be + under 'dst'. + + 'preserve_mode' and 'preserve_times' are the same as for + 'copy_file'; note that they only apply to regular files, not to + directories. If 'preserve_symlinks' is true, symlinks will be + copied as symlinks (on platforms that support them!); otherwise + (the default), the destination of the symlink will be copied. + 'update' and 'verbose' are the same as for 'copy_file'. + """ from distutils.file_util import copy_file if not dry_run and not os.path.isdir(src): @@ -174,10 +163,8 @@ return outputs -# copy_tree () - -# Helper for remove_tree() def _build_cmdtuple(path, cmdtuples): + """Helper for remove_tree().""" for f in os.listdir(path): real_f = os.path.join(path,f) if os.path.isdir(real_f) and not os.path.islink(real_f): @@ -186,10 +173,11 @@ cmdtuples.append((os.remove, real_f)) cmdtuples.append((os.rmdir, path)) +def remove_tree(directory, verbose=1, dry_run=0): + """Recursively remove an entire directory tree. -def remove_tree (directory, verbose=1, dry_run=0): - """Recursively remove an entire directory tree. Any errors are ignored - (apart from being reported to stdout if 'verbose' is true). + Any errors are ignored (apart from being reported to stdout if 'verbose' + is true). """ from distutils.util import grok_environment_error global _path_created @@ -211,10 +199,10 @@ log.warn(grok_environment_error( exc, "error removing %s: " % directory)) - def ensure_relative(path): - """Take the full path 'path', and make it a relative path so - it can be the second argument to os.path.join(). + """Take the full path 'path', and make it a relative path. + + This is useful to make 'path' the second argument to os.path.join(). """ drive, path = os.path.splitdrive(path) if path[0:1] == os.sep: From buildbot at python.org Sun May 17 13:22:42 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 11:22:42 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090517112242.61AA1D4A7@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/640 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun May 17 13:23:23 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 13:23:23 +0200 (CEST) Subject: [Python-checkins] r72731 - python/branches/release26-maint Message-ID: <20090517112323.A4BC8D435@mail.python.org> Author: tarek.ziade Date: Sun May 17 13:23:23 2009 New Revision: 72731 Log: Blocked revisions 72730 via svnmerge ........ r72730 | tarek.ziade | 2009-05-17 13:22:36 +0200 (Sun, 17 May 2009) | 1 line pep8-fied distutils.dir_util ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun May 17 13:25:58 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 13:25:58 +0200 (CEST) Subject: [Python-checkins] r72732 - in python/branches/py3k: Lib/distutils/dir_util.py Message-ID: <20090517112558.25295D4EA@mail.python.org> Author: tarek.ziade Date: Sun May 17 13:25:57 2009 New Revision: 72732 Log: Merged revisions 72730 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72730 | tarek.ziade | 2009-05-17 13:22:36 +0200 (Sun, 17 May 2009) | 1 line pep8-fied distutils.dir_util ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/dir_util.py Modified: python/branches/py3k/Lib/distutils/dir_util.py ============================================================================== --- python/branches/py3k/Lib/distutils/dir_util.py (original) +++ python/branches/py3k/Lib/distutils/dir_util.py Sun May 17 13:25:57 2009 @@ -15,15 +15,16 @@ # I don't use os.makedirs because a) it's new to Python 1.5.2, and # b) it blows up if the directory already exists (I want to silently # succeed in that case). -def mkpath (name, mode=0o777, verbose=1, dry_run=0): - """Create a directory and any missing ancestor directories. If the - directory already exists (or if 'name' is the empty string, which - means the current directory, which of course exists), then do - nothing. Raise DistutilsFileError if unable to create some - directory along the way (eg. some sub-path exists, but is a file - rather than a directory). If 'verbose' is true, print a one-line - summary of each mkdir to stdout. Return the list of directories - actually created.""" +def mkpath(name, mode=0o777, verbose=1, dry_run=0): + """Create a directory and any missing ancestor directories. + + If the directory already exists (or if 'name' is the empty string, which + means the current directory, which of course exists), then do nothing. + Raise DistutilsFileError if unable to create some directory along the way + (eg. some sub-path exists, but is a file rather than a directory). + If 'verbose' is true, print a one-line summary of each mkdir to stdout. + Return the list of directories actually created. + """ global _path_created @@ -76,19 +77,16 @@ _path_created[abs_head] = 1 return created_dirs -# mkpath () - - -def create_tree (base_dir, files, mode=0o777, verbose=1, dry_run=0): - - """Create all the empty directories under 'base_dir' needed to - put 'files' there. 'base_dir' is just the a name of a directory - which doesn't necessarily exist yet; 'files' is a list of filenames - to be interpreted relative to 'base_dir'. 'base_dir' + the - directory portion of every file in 'files' will be created if it - doesn't already exist. 'mode', 'verbose' and 'dry_run' flags are as - for 'mkpath()'.""" - +def create_tree(base_dir, files, mode=0o777, verbose=1, dry_run=0): + """Create all the empty directories under 'base_dir' needed to put 'files' + there. + + 'base_dir' is just the a name of a directory which doesn't necessarily + exist yet; 'files' is a list of filenames to be interpreted relative to + 'base_dir'. 'base_dir' + the directory portion of every file in 'files' + will be created if it doesn't already exist. 'mode', 'verbose' and + 'dry_run' flags are as for 'mkpath()'. + """ # First get the list of directories to create need_dir = set() for file in files: @@ -98,35 +96,27 @@ for dir in sorted(need_dir): mkpath(dir, mode, verbose=verbose, dry_run=dry_run) -# create_tree () - - -def copy_tree (src, dst, - preserve_mode=1, - preserve_times=1, - preserve_symlinks=0, - update=0, - verbose=1, - dry_run=0): - - """Copy an entire directory tree 'src' to a new location 'dst'. Both - 'src' and 'dst' must be directory names. If 'src' is not a - directory, raise DistutilsFileError. If 'dst' does not exist, it is - created with 'mkpath()'. The end result of the copy is that every - file in 'src' is copied to 'dst', and directories under 'src' are - recursively copied to 'dst'. Return the list of files that were - copied or might have been copied, using their output name. The - return value is unaffected by 'update' or 'dry_run': it is simply - the list of all files under 'src', with the names changed to be - under 'dst'. - - 'preserve_mode' and 'preserve_times' are the same as for - 'copy_file'; note that they only apply to regular files, not to - directories. If 'preserve_symlinks' is true, symlinks will be - copied as symlinks (on platforms that support them!); otherwise - (the default), the destination of the symlink will be copied. - 'update' and 'verbose' are the same as for 'copy_file'.""" - +def copy_tree(src, dst, preserve_mode=1, preserve_times=1, + preserve_symlinks=0, update=0, verbose=1, dry_run=0): + """Copy an entire directory tree 'src' to a new location 'dst'. + + Both 'src' and 'dst' must be directory names. If 'src' is not a + directory, raise DistutilsFileError. If 'dst' does not exist, it is + created with 'mkpath()'. The end result of the copy is that every + file in 'src' is copied to 'dst', and directories under 'src' are + recursively copied to 'dst'. Return the list of files that were + copied or might have been copied, using their output name. The + return value is unaffected by 'update' or 'dry_run': it is simply + the list of all files under 'src', with the names changed to be + under 'dst'. + + 'preserve_mode' and 'preserve_times' are the same as for + 'copy_file'; note that they only apply to regular files, not to + directories. If 'preserve_symlinks' is true, symlinks will be + copied as symlinks (on platforms that support them!); otherwise + (the default), the destination of the symlink will be copied. + 'update' and 'verbose' are the same as for 'copy_file'. + """ from distutils.file_util import copy_file if not dry_run and not os.path.isdir(src): @@ -172,8 +162,8 @@ return outputs -# Helper for remove_tree() def _build_cmdtuple(path, cmdtuples): + """Helper for remove_tree().""" for f in os.listdir(path): real_f = os.path.join(path,f) if os.path.isdir(real_f) and not os.path.islink(real_f): @@ -182,10 +172,11 @@ cmdtuples.append((os.remove, real_f)) cmdtuples.append((os.rmdir, path)) +def remove_tree(directory, verbose=1, dry_run=0): + """Recursively remove an entire directory tree. -def remove_tree (directory, verbose=1, dry_run=0): - """Recursively remove an entire directory tree. Any errors are ignored - (apart from being reported to stdout if 'verbose' is true). + Any errors are ignored (apart from being reported to stdout if 'verbose' + is true). """ from distutils.util import grok_environment_error global _path_created @@ -207,10 +198,10 @@ log.warn(grok_environment_error( exc, "error removing %s: " % directory)) - def ensure_relative(path): - """Take the full path 'path', and make it a relative path so - it can be the second argument to os.path.join(). + """Take the full path 'path', and make it a relative path. + + This is useful to make 'path' the second argument to os.path.join(). """ drive, path = os.path.splitdrive(path) if path[0:1] == os.sep: From python-checkins at python.org Sun May 17 13:26:45 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 13:26:45 +0200 (CEST) Subject: [Python-checkins] r72733 - python/branches/release30-maint Message-ID: <20090517112645.53C23D4EA@mail.python.org> Author: tarek.ziade Date: Sun May 17 13:26:45 2009 New Revision: 72733 Log: Blocked revisions 72729 via svnmerge ................ r72729 | tarek.ziade | 2009-05-17 13:14:15 +0200 (Sun, 17 May 2009) | 9 lines Merged revisions 72727 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72727 | tarek.ziade | 2009-05-17 13:11:57 +0200 (Sun, 17 May 2009) | 1 line removed sys.platform == 'mac' usage in distutils.dir_util ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun May 17 13:27:25 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 13:27:25 +0200 (CEST) Subject: [Python-checkins] r72734 - python/branches/release30-maint Message-ID: <20090517112725.8F6CEC446@mail.python.org> Author: tarek.ziade Date: Sun May 17 13:27:25 2009 New Revision: 72734 Log: Blocked revisions 72732 via svnmerge ................ r72732 | tarek.ziade | 2009-05-17 13:25:57 +0200 (Sun, 17 May 2009) | 9 lines Merged revisions 72730 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72730 | tarek.ziade | 2009-05-17 13:22:36 +0200 (Sun, 17 May 2009) | 1 line pep8-fied distutils.dir_util ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun May 17 13:28:33 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 17 May 2009 13:28:33 +0200 (CEST) Subject: [Python-checkins] r72735 - in python/branches/py3k/Doc/library: email.charset.rst email.generator.rst email.header.rst email.iterators.rst email.message.rst email.mime.rst email.parser.rst email.rst email.util.rst Message-ID: <20090517112833.9DEA8D4F3@mail.python.org> Author: georg.brandl Date: Sun May 17 13:28:33 2009 New Revision: 72735 Log: Use new optional argument style in email docs. Modified: python/branches/py3k/Doc/library/email.charset.rst python/branches/py3k/Doc/library/email.generator.rst python/branches/py3k/Doc/library/email.header.rst python/branches/py3k/Doc/library/email.iterators.rst python/branches/py3k/Doc/library/email.message.rst python/branches/py3k/Doc/library/email.mime.rst python/branches/py3k/Doc/library/email.parser.rst python/branches/py3k/Doc/library/email.rst python/branches/py3k/Doc/library/email.util.rst Modified: python/branches/py3k/Doc/library/email.charset.rst ============================================================================== --- python/branches/py3k/Doc/library/email.charset.rst (original) +++ python/branches/py3k/Doc/library/email.charset.rst Sun May 17 13:28:33 2009 @@ -14,7 +14,7 @@ Import this class from the :mod:`email.charset` module. -.. class:: Charset([input_charset]) +.. class:: Charset(input_charset=DEFAULT_CHARSET) Map character sets to their email properties. @@ -40,7 +40,6 @@ :class:`Charset` instances have the following data attributes: - .. attribute:: input_charset The initial character set specified. Common aliases are converted to @@ -66,10 +65,10 @@ .. attribute:: output_charset - Some character sets must be converted before they can be used in email headers - or bodies. If the *input_charset* is one of them, this attribute will - contain the name of the character set output will be converted to. Otherwise, it will - be ``None``. + Some character sets must be converted before they can be used in email + headers or bodies. If the *input_charset* is one of them, this attribute + will contain the name of the character set output will be converted to. + Otherwise, it will be ``None``. .. attribute:: input_codec @@ -85,8 +84,8 @@ *output_charset*. If no conversion codec is necessary, this attribute will have the same value as the *input_codec*. - :class:`Charset` instances also have the following methods: + :class:`Charset` instances also have the following methods: .. method:: get_body_encoding() @@ -102,13 +101,9 @@ returns the string ``base64`` if *body_encoding* is ``BASE64``, and returns the string ``7bit`` otherwise. + .. XXX to_splittable and from_splittable are not there anymore! - .. method:: convert(s) - - Convert the string *s* from the *input_codec* to the *output_codec*. - - - .. method:: to_splittable(s) + .. method to_splittable(s) Convert a possibly multibyte string to a safely splittable format. *s* is the string to split. @@ -123,7 +118,7 @@ the Unicode replacement character ``'U+FFFD'``. - .. method:: from_splittable(ustr[, to_output]) + .. method from_splittable(ustr[, to_output]) Convert a splittable string back into an encoded string. *ustr* is a Unicode string to "unsplit". @@ -153,29 +148,17 @@ quoted-printable or base64 encoding. - .. method:: header_encode(s[, convert]) + .. method:: header_encode(string) - Header-encode the string *s*. - - If *convert* is ``True``, the string will be converted from the input - charset to the output charset automatically. This is not useful for - multibyte character sets, which have line length issues (multibyte - characters must be split on a character, not a byte boundary); use the - higher-level :class:`~email.header.Header` class to deal with these issues - (see :mod:`email.header`). *convert* defaults to ``False``. + Header-encode the string *string*. The type of encoding (base64 or quoted-printable) will be based on the *header_encoding* attribute. - .. method:: body_encode(s[, convert]) - - Body-encode the string *s*. + .. method:: body_encode(string) - If *convert* is ``True`` (the default), the string will be converted from - the input charset to output charset automatically. Unlike - :meth:`header_encode`, there are no issues with byte boundaries and - multibyte charsets in email bodies, so this is usually pretty safe. + Body-encode the string *string*. The type of encoding (base64 or quoted-printable) will be based on the *body_encoding* attribute. @@ -205,7 +188,7 @@ new entries to the global character set, alias, and codec registries: -.. function:: add_charset(charset[, header_enc[, body_enc[, output_charset]]]) +.. function:: add_charset(charset, header_enc=None, body_enc=None, output_charset=None) Add character properties to the global registry. Modified: python/branches/py3k/Doc/library/email.generator.rst ============================================================================== --- python/branches/py3k/Doc/library/email.generator.rst (original) +++ python/branches/py3k/Doc/library/email.generator.rst Sun May 17 13:28:33 2009 @@ -23,7 +23,7 @@ :mod:`email.generator` module: -.. class:: Generator(outfp[, mangle_from_[, maxheaderlen]]) +.. class:: Generator(outfp, mangle_from_=True, maxheaderlen=78) The constructor for the :class:`Generator` class takes a file-like object called *outfp* for an argument. *outfp* must support the :meth:`write` method and be @@ -47,7 +47,7 @@ The other public :class:`Generator` methods are: - .. method:: flatten(msg[, unixfrom]) + .. method:: flatten(msg, unixfrom=False) Print the textual representation of the message object structure rooted at *msg* to the output file specified when the :class:`Generator` instance @@ -84,7 +84,7 @@ representing the part. -.. class:: DecodedGenerator(outfp[, mangle_from_[, maxheaderlen[, fmt]]]) +.. class:: DecodedGenerator(outfp[, mangle_from_=True, maxheaderlen=78, fmt=None) This class, derived from :class:`Generator` walks through all the subparts of a message. If the subpart is of main type :mimetype:`text`, then it prints the Modified: python/branches/py3k/Doc/library/email.header.rst ============================================================================== --- python/branches/py3k/Doc/library/email.header.rst (original) +++ python/branches/py3k/Doc/library/email.header.rst Sun May 17 13:28:33 2009 @@ -46,7 +46,7 @@ Here is the :class:`Header` class description: -.. class:: Header([s[, charset[, maxlinelen[, header_name[, continuation_ws[, errors]]]]]]) +.. class:: Header(s=None, charset=None, maxlinelen=None, header_name=None, continuation_ws=' ', errors='strict') Create a MIME-compliant header that can contain strings in different character sets. @@ -70,14 +70,15 @@ for *header_name* is ``None``, meaning it is not taken into account for the first line of a long, split header. - Optional *continuation_ws* must be :rfc:`2822`\ -compliant folding whitespace, - and is usually either a space or a hard tab character. This character will be - prepended to continuation lines. *continuation_ws* defaults to a single space character (" "). + Optional *continuation_ws* must be :rfc:`2822`\ -compliant folding + whitespace, and is usually either a space or a hard tab character. This + character will be prepended to continuation lines. *continuation_ws* + defaults to a single space character. Optional *errors* is passed straight through to the :meth:`append` method. - .. method:: append(s[, charset[, errors]]) + .. method:: append(s, charset=None, errors='strict') Append the string *s* to the MIME header. @@ -103,7 +104,7 @@ :func:`ustr.encode` call, and defaults to "strict". - .. method:: encode([splitchars]) + .. method:: encode(splitchars=';, \\t', maxlinelen=None) Encode a message header into an RFC-compliant format, possibly wrapping long lines and encapsulating non-ASCII parts in base64 or quoted-printable @@ -111,10 +112,13 @@ split long ASCII lines on, in rough support of :rfc:`2822`'s *highest level syntactic breaks*. This doesn't affect :rfc:`2047` encoded lines. + *maxlinelen*, if given, overrides the instance's value for the maximum + line length. + + The :class:`Header` class also provides a number of methods to support standard operators and built-in functions. - .. method:: __str__() A synonym for :meth:`Header.encode`. Useful for ``str(aHeader)``. @@ -156,7 +160,7 @@ [('p\xf6stal', 'iso-8859-1')] -.. function:: make_header(decoded_seq[, maxlinelen[, header_name[, continuation_ws]]]) +.. function:: make_header(decoded_seq, maxlinelen=None, header_name=None, continuation_ws=' ') Create a :class:`Header` instance from a sequence of pairs as returned by :func:`decode_header`. @@ -165,7 +169,7 @@ pairs of the format ``(decoded_string, charset)`` where *charset* is the name of the character set. - This function takes one of those sequence of pairs and returns a :class:`Header` - instance. Optional *maxlinelen*, *header_name*, and *continuation_ws* are as in - the :class:`Header` constructor. + This function takes one of those sequence of pairs and returns a + :class:`Header` instance. Optional *maxlinelen*, *header_name*, and + *continuation_ws* are as in the :class:`Header` constructor. Modified: python/branches/py3k/Doc/library/email.iterators.rst ============================================================================== --- python/branches/py3k/Doc/library/email.iterators.rst (original) +++ python/branches/py3k/Doc/library/email.iterators.rst Sun May 17 13:28:33 2009 @@ -10,7 +10,7 @@ useful higher level iterations over message object trees. -.. function:: body_line_iterator(msg[, decode]) +.. function:: body_line_iterator(msg, decode=False) This iterates over all the payloads in all the subparts of *msg*, returning the string payloads line-by-line. It skips over all the subpart headers, and it @@ -21,7 +21,7 @@ Optional *decode* is passed through to :meth:`Message.get_payload`. -.. function:: typed_subpart_iterator(msg[, maintype[, subtype]]) +.. function:: typed_subpart_iterator(msg, maintype='text', subtype=None) This iterates over all the subparts of *msg*, returning only those subparts that match the MIME type specified by *maintype* and *subtype*. @@ -37,7 +37,7 @@ *not* be considered part of the supported public interface for the package. -.. function:: _structure(msg[, fp[, level]]) +.. function:: _structure(msg, fp=None, level=0, include_default=False) Prints an indented representation of the content types of the message object structure. For example:: @@ -62,4 +62,4 @@ Optional *fp* is a file-like object to print the output to. It must be suitable for Python's :func:`print` function. *level* is used internally. - + *include_default*, if true, prints the default type as well. Modified: python/branches/py3k/Doc/library/email.message.rst ============================================================================== --- python/branches/py3k/Doc/library/email.message.rst (original) +++ python/branches/py3k/Doc/library/email.message.rst Sun May 17 13:28:33 2009 @@ -36,7 +36,7 @@ The constructor takes no arguments. - .. method:: as_string([unixfrom]) + .. method:: as_string(unixfrom=False, maxheaderlen=0) Return the entire message flattened as a string. When optional *unixfrom* is ``True``, the envelope header is included in the returned string. @@ -88,7 +88,7 @@ :meth:`set_payload` instead. - .. method:: get_payload([i[, decode]]) + .. method:: get_payload(i=None, decode=False) Return the current payload, which will be a list of :class:`Message` objects when :meth:`is_multipart` is ``True``, or a @@ -113,7 +113,7 @@ *decode* is ``False``. - .. method:: set_payload(payload[, charset]) + .. method:: set_payload(payload, charset=None) Set the entire message object's payload to *payload*. It is the client's responsibility to ensure the payload invariants. Optional *charset* sets @@ -201,7 +201,8 @@ .. method:: __delitem__(name) Delete all occurrences of the field with name *name* from the message's - headers. No exception is raised if the named field isn't present in the headers. + headers. No exception is raised if the named field isn't present in the + headers. .. method:: Message.__contains__(name) @@ -226,7 +227,7 @@ values. - .. method:: get(name[, failobj]) + .. method:: get(name, failobj=None) Return the value of the named header field. This is identical to :meth:`__getitem__` except that optional *failobj* is returned if the @@ -235,7 +236,7 @@ Here are some additional useful methods: - .. method:: get_all(name[, failobj]) + .. method:: get_all(name, failobj=None) Return a list of all the values for the field named *name*. If there are no such named headers in the message, *failobj* is returned (defaults to @@ -315,7 +316,7 @@ :mailheader:`Content-Type` header. - .. method:: get_params([failobj[, header[, unquote]]]) + .. method:: get_params(failobj=None, header='content-type', unquote=True) Return the message's :mailheader:`Content-Type` parameters, as a list. The elements of the returned list are 2-tuples of key/value pairs, as @@ -330,7 +331,7 @@ search instead of :mailheader:`Content-Type`. - .. method:: get_param(param[, failobj[, header[, unquote]]]) + .. method:: get_param(param, failobj=None, header='content-type', unquote=True) Return the value of the :mailheader:`Content-Type` header's parameter *param* as a string. If the message has no :mailheader:`Content-Type` @@ -363,7 +364,7 @@ to ``False``. - .. method:: set_param(param, value[, header[, requote[, charset[, language]]]]) + .. method:: set_param(param, value, header='Content-Type', requote=True, charset=None, language='') Set a parameter in the :mailheader:`Content-Type` header. If the parameter already exists in the header, its value will be replaced with @@ -381,7 +382,7 @@ should be strings. - .. method:: del_param(param[, header[, requote]]) + .. method:: del_param(param, header='content-type', requote=True) Remove the given parameter completely from the :mailheader:`Content-Type` header. The header will be re-written in place without the parameter or @@ -390,7 +391,7 @@ alternative to :mailheader:`Content-Type`. - .. method:: set_type(type[, header][, requote]) + .. method:: set_type(type, header='Content-Type', requote=True) Set the main type and subtype for the :mailheader:`Content-Type` header. *type* must be a string in the form :mimetype:`maintype/subtype`, @@ -406,7 +407,7 @@ header is also added. - .. method:: get_filename([failobj]) + .. method:: get_filename(failobj=None) Return the value of the ``filename`` parameter of the :mailheader:`Content-Disposition` header of the message. If the header @@ -416,7 +417,7 @@ unquoted as per :func:`email.utils.unquote`. - .. method:: get_boundary([failobj]) + .. method:: get_boundary(failobj=None) Return the value of the ``boundary`` parameter of the :mailheader:`Content-Type` header of the message, or *failobj* if either @@ -439,7 +440,7 @@ have been present in the original :mailheader:`Content-Type` header. - .. method:: get_content_charset([failobj]) + .. method:: get_content_charset(failobj=None) Return the ``charset`` parameter of the :mailheader:`Content-Type` header, coerced to lower case. If there is no :mailheader:`Content-Type` header, or if @@ -449,7 +450,7 @@ :class:`~email.charset.Charset` instance for the default encoding of the message body. - .. method:: get_charsets([failobj]) + .. method:: get_charsets(failobj=None) Return a list containing the character set names in the message. If the message is a :mimetype:`multipart`, then the list will contain one element Modified: python/branches/py3k/Doc/library/email.mime.rst ============================================================================== --- python/branches/py3k/Doc/library/email.mime.rst (original) +++ python/branches/py3k/Doc/library/email.mime.rst Sun May 17 13:28:33 2009 @@ -57,7 +57,7 @@ .. currentmodule:: email.mime.multipart -.. class:: MIMEMultipart([_subtype[, boundary[, _subparts[, _params]]]]) +.. class:: MIMEMultipart(_subtype='mixed', boundary=None, _subparts=None, **_params) Module: :mod:`email.mime.multipart` @@ -82,7 +82,7 @@ .. currentmodule:: email.mime.application -.. class:: MIMEApplication(_data[, _subtype[, _encoder[, **_params]]]) +.. class:: MIMEApplication(_data, _subtype='octet-stream', _encoder=email.encoders.encode_base64, **_params) Module: :mod:`email.mime.application` @@ -105,7 +105,7 @@ .. currentmodule:: email.mime.audio -.. class:: MIMEAudio(_audiodata[, _subtype[, _encoder[, **_params]]]) +.. class:: MIMEAudio(_audiodata, _subtype=None, _encoder=email.encoders.encode_base64, **_params) Module: :mod:`email.mime.audio` @@ -131,7 +131,7 @@ .. currentmodule:: email.mime.image -.. class:: MIMEImage(_imagedata[, _subtype[, _encoder[, **_params]]]) +.. class:: MIMEImage(_imagedata, _subtype=None, _encoder=email.encoders.encode_base64, **_params) Module: :mod:`email.mime.image` @@ -158,7 +158,7 @@ .. currentmodule:: email.mime.message -.. class:: MIMEMessage(_msg[, _subtype]) +.. class:: MIMEMessage(_msg, _subtype='rfc822') Module: :mod:`email.mime.message` @@ -174,7 +174,7 @@ .. currentmodule:: email.mime.text -.. class:: MIMEText(_text[, _subtype[, _charset]]) +.. class:: MIMEText(_text, _subtype='plain', _charset='us-ascii') Module: :mod:`email.mime.text` Modified: python/branches/py3k/Doc/library/email.parser.rst ============================================================================== --- python/branches/py3k/Doc/library/email.parser.rst (original) +++ python/branches/py3k/Doc/library/email.parser.rst Sun May 17 13:28:33 2009 @@ -58,13 +58,12 @@ Here is the API for the :class:`FeedParser`: -.. class:: FeedParser([_factory]) +.. class:: FeedParser(_factory=email.message.Message) Create a :class:`FeedParser` instance. Optional *_factory* is a no-argument callable that will be called whenever a new message object is needed. It defaults to the :class:`email.message.Message` class. - .. method:: feed(data) Feed the :class:`FeedParser` some more data. *data* should be a string @@ -74,7 +73,6 @@ carriage return, newline, or carriage return and newline (they can even be mixed). - .. method:: close() Closing a :class:`FeedParser` completes the parsing of all previously fed @@ -96,7 +94,7 @@ class. -.. class:: Parser([_class]) +.. class:: Parser(_class=email.message.Message, strict=None) The constructor for the :class:`Parser` class takes an optional argument *_class*. This must be a callable factory (such as a function or a class), and @@ -115,7 +113,7 @@ The other public :class:`Parser` methods are: - .. method:: parse(fp[, headersonly]) + .. method:: parse(fp, headersonly=False) Read all the data from the file-like object *fp*, parse the resulting text, and return the root message object. *fp* must support both the @@ -129,7 +127,7 @@ Optional *headersonly* is as with the :meth:`parse` method. - .. method:: parsestr(text[, headersonly]) + .. method:: parsestr(text, headersonly=False) Similar to the :meth:`parse` method, except it takes a string object instead of a file-like object. Calling this method on a string is exactly @@ -147,14 +145,14 @@ .. currentmodule:: email -.. function:: message_from_string(s[, _class[, strict]]) +.. function:: message_from_string(s[, _class][, strict]) Return a message object structure from a string. This is exactly equivalent to ``Parser().parsestr(s)``. Optional *_class* and *strict* are interpreted as with the :class:`Parser` class constructor. -.. function:: message_from_file(fp[, _class[, strict]]) +.. function:: message_from_file(fp[, _class][, strict]) Return a message object structure tree from an open file object. This is exactly equivalent to ``Parser().parse(fp)``. Optional *_class* and *strict* Modified: python/branches/py3k/Doc/library/email.rst ============================================================================== --- python/branches/py3k/Doc/library/email.rst (original) +++ python/branches/py3k/Doc/library/email.rst Sun May 17 13:28:33 2009 @@ -2,8 +2,8 @@ =================================================== .. module:: email - :synopsis: Package supporting the parsing, manipulating, and generating email messages, - including MIME documents. + :synopsis: Package supporting the parsing, manipulating, and generating + email messages, including MIME documents. .. moduleauthor:: Barry A. Warsaw .. sectionauthor:: Barry A. Warsaw .. Copyright (C) 2001-2007 Python Software Foundation Modified: python/branches/py3k/Doc/library/email.util.rst ============================================================================== --- python/branches/py3k/Doc/library/email.util.rst (original) +++ python/branches/py3k/Doc/library/email.util.rst Sun May 17 13:28:33 2009 @@ -84,7 +84,7 @@ about for common use. -.. function:: formatdate([timeval[, localtime][, usegmt]]) +.. function:: formatdate(timeval=None, localtime=False, usegmt=False) Returns a date string as per :rfc:`2822`, e.g.:: @@ -105,11 +105,11 @@ ``False``. -.. function:: make_msgid([idstring]) +.. function:: make_msgid(idstring=None) Returns a string suitable for an :rfc:`2822`\ -compliant - :mailheader:`Message-ID` header. Optional *idstring* if given, is a string used - to strengthen the uniqueness of the message id. + :mailheader:`Message-ID` header. Optional *idstring* if given, is a string + used to strengthen the uniqueness of the message id. .. function:: decode_rfc2231(s) @@ -117,7 +117,7 @@ Decode the string *s* according to :rfc:`2231`. -.. function:: encode_rfc2231(s[, charset[, language]]) +.. function:: encode_rfc2231(s, charset=None, language=None) Encode the string *s* according to :rfc:`2231`. Optional *charset* and *language*, if given is the character set name and language name to use. If @@ -125,7 +125,7 @@ is not, the string is encoded using the empty string for *language*. -.. function:: collapse_rfc2231_value(value[, errors[, fallback_charset]]) +.. function:: collapse_rfc2231_value(value, errors='replace', fallback_charset='us-ascii') When a header parameter is encoded in :rfc:`2231` format, :meth:`Message.get_param` may return a 3-tuple containing the character set, From buildbot at python.org Sun May 17 13:44:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 11:44:39 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090517114439.7C25ED503@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/704 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Sun May 17 13:57:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 11:57:14 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090517115714.61725C461@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%202.6/builds/349 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun May 17 14:04:57 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 14:04:57 +0200 (CEST) Subject: [Python-checkins] r72736 - in python/trunk/Lib/distutils: archive_util.py tests/test_archive_util.py Message-ID: <20090517120457.7CA1DD62C@mail.python.org> Author: tarek.ziade Date: Sun May 17 14:04:57 2009 New Revision: 72736 Log: pep8-fied distutils.archive_util + added minimum test coverage Added: python/trunk/Lib/distutils/tests/test_archive_util.py (contents, props changed) Modified: python/trunk/Lib/distutils/archive_util.py Modified: python/trunk/Lib/distutils/archive_util.py ============================================================================== --- python/trunk/Lib/distutils/archive_util.py (original) +++ python/trunk/Lib/distutils/archive_util.py Sun May 17 14:04:57 2009 @@ -11,15 +11,16 @@ from distutils.dir_util import mkpath from distutils import log -def make_tarball (base_name, base_dir, compress="gzip", - verbose=0, dry_run=0): +def make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0): """Create a (possibly compressed) tar file from all the files under - 'base_dir'. 'compress' must be "gzip" (the default), "compress", - "bzip2", or None. Both "tar" and the compression utility named by - 'compress' must be on the default program search path, so this is - probably Unix-specific. The output tar file will be named 'base_dir' + - ".tar", possibly plus the appropriate compression extension (".gz", - ".bz2" or ".Z"). Return the output filename. + 'base_dir'. + + 'compress' must be "gzip" (the default), "compress", "bzip2", or None. + Both "tar" and the compression utility named by 'compress' must be on + the default program search path, so this is probably Unix-specific. + The output tar file will be named 'base_dir' + ".tar", possibly plus + the appropriate compression extension (".gz", ".bz2" or ".Z"). + Returns the output filename. """ # XXX GNU tar 1.13 has a nifty option to add a prefix directory. # It's pretty new, though, so we certainly can't require it -- @@ -27,9 +28,9 @@ # "create a tree of hardlinks" step! (Would also be nice to # detect GNU tar to use its 'z' option and save a step.) - compress_ext = { 'gzip': ".gz", - 'bzip2': '.bz2', - 'compress': ".Z" } + compress_ext = {'gzip': ".gz", + 'bzip2': '.bz2', + 'compress': ".Z" } # flags for compression program, each element of list will be an argument compress_flags = {'gzip': ["-f9"], @@ -52,15 +53,14 @@ else: return archive_name -# make_tarball () - +def make_zipfile(base_name, base_dir, verbose=0, dry_run=0): + """Create a zip file from all the files under 'base_dir'. -def make_zipfile (base_name, base_dir, verbose=0, dry_run=0): - """Create a zip file from all the files under 'base_dir'. The output - zip file will be named 'base_dir' + ".zip". Uses either the "zipfile" - Python module (if available) or the InfoZIP "zip" utility (if installed - and found on the default search path). If neither tool is available, - raises DistutilsExecError. Returns the name of the output zip file. + The output zip file will be named 'base_dir' + ".zip". Uses either the + "zipfile" Python module (if available) or the InfoZIP "zip" utility + (if installed and found on the default search path). If neither tool is + available, raises DistutilsExecError. Returns the name of the output zip + file. """ try: import zipfile @@ -94,22 +94,19 @@ zip_filename, base_dir) if not dry_run: - z = zipfile.ZipFile(zip_filename, "w", - compression=zipfile.ZIP_DEFLATED) + zip = zipfile.ZipFile(zip_filename, "w", + compression=zipfile.ZIP_DEFLATED) for dirpath, dirnames, filenames in os.walk(base_dir): for name in filenames: path = os.path.normpath(os.path.join(dirpath, name)) if os.path.isfile(path): - z.write(path, path) + zip.write(path, path) log.info("adding '%s'" % path) - z.close() + zip.close() return zip_filename -# make_zipfile () - - ARCHIVE_FORMATS = { 'gztar': (make_tarball, [('compress', 'gzip')], "gzip'ed tar-file"), 'bztar': (make_tarball, [('compress', 'bzip2')], "bzip2'ed tar-file"), @@ -118,19 +115,24 @@ 'zip': (make_zipfile, [],"ZIP file") } -def check_archive_formats (formats): +def check_archive_formats(formats): + """Returns the first format from the 'format' list that is unknown. + + If all formats are known, returns None + """ for format in formats: if format not in ARCHIVE_FORMATS: return format - else: - return None + return None + +def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0, + dry_run=0): + """Create an archive file (eg. zip or tar). + + 'base_name' is the name of the file to create, minus any format-specific + extension; 'format' is the archive format: one of "zip", "tar", "ztar", + or "gztar". -def make_archive (base_name, format, - root_dir=None, base_dir=None, - verbose=0, dry_run=0): - """Create an archive file (eg. zip or tar). 'base_name' is the name - of the file to create, minus any format-specific extension; 'format' - is the archive format: one of "zip", "tar", "ztar", or "gztar". 'root_dir' is a directory that will be the root directory of the archive; ie. we typically chdir into 'root_dir' before creating the archive. 'base_dir' is the directory where we start archiving from; @@ -148,7 +150,7 @@ if base_dir is None: base_dir = os.curdir - kwargs = { 'dry_run': dry_run } + kwargs = {'dry_run': dry_run} try: format_info = ARCHIVE_FORMATS[format] @@ -156,7 +158,7 @@ raise ValueError, "unknown archive format '%s'" % format func = format_info[0] - for (arg,val) in format_info[1]: + for arg, val in format_info[1]: kwargs[arg] = val filename = apply(func, (base_name, base_dir), kwargs) @@ -165,5 +167,3 @@ os.chdir(save_cwd) return filename - -# make_archive () Added: python/trunk/Lib/distutils/tests/test_archive_util.py ============================================================================== --- (empty file) +++ python/trunk/Lib/distutils/tests/test_archive_util.py Sun May 17 14:04:57 2009 @@ -0,0 +1,70 @@ +"""Tests for distutils.archive_util.""" +__revision__ = "$Id:$" + +import unittest +import os + +from distutils.archive_util import (check_archive_formats, make_tarball, + make_zipfile, make_archive) +from distutils.spawn import find_executable +from distutils.tests import support + +try: + import zipfile + ZIP_SUPPORT = True +except ImportError: + ZIP_SUPPORT = find_executable('zip') + +class ArchiveUtilTestCase(support.TempdirManager, + unittest.TestCase): + + @unittest.skipUnless(find_executable('tar'), 'Need the tar command to run') + def test_make_tarball(self): + # creating something to tar + tmpdir = self.mkdtemp() + self.write_file([tmpdir, 'file1'], 'xxx') + self.write_file([tmpdir, 'file2'], 'xxx') + + tmpdir2 = self.mkdtemp() + base_name = os.path.join(tmpdir2, 'archive') + make_tarball(base_name, tmpdir) + + # check if the compressed tarball was created + tarball = base_name + '.tar.gz' + self.assert_(os.path.exists(tarball)) + + # trying an uncompressed one + base_name = os.path.join(tmpdir2, 'archive') + make_tarball(base_name, tmpdir, compress=None) + tarball = base_name + '.tar' + self.assert_(os.path.exists(tarball)) + + @unittest.skipUnless(ZIP_SUPPORT, 'Need zip support to run') + def test_make_tarball(self): + # creating something to tar + tmpdir = self.mkdtemp() + self.write_file([tmpdir, 'file1'], 'xxx') + self.write_file([tmpdir, 'file2'], 'xxx') + + tmpdir2 = self.mkdtemp() + base_name = os.path.join(tmpdir2, 'archive') + make_zipfile(base_name, tmpdir) + + # check if the compressed tarball was created + tarball = base_name + '.zip' + + def test_check_archive_formats(self): + self.assertEquals(check_archive_formats(['gztar', 'xxx', 'zip']), + 'xxx') + self.assertEquals(check_archive_formats(['gztar', 'zip']), None) + + def test_make_archive(self): + tmpdir = self.mkdtemp() + base_name = os.path.join(tmpdir, 'archive') + self.assertRaises(ValueError, make_archive, base_name, 'xxx') + +def test_suite(): + return unittest.makeSuite(ArchiveUtilTestCase) + +if __name__ == "__main__": + unittest.main(defaultTest="test_suite") From python-checkins at python.org Sun May 17 14:06:38 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 14:06:38 +0200 (CEST) Subject: [Python-checkins] r72737 - python/branches/release26-maint Message-ID: <20090517120638.6E5DDD26E@mail.python.org> Author: tarek.ziade Date: Sun May 17 14:06:38 2009 New Revision: 72737 Log: Blocked revisions 72736 via svnmerge ........ r72736 | tarek.ziade | 2009-05-17 14:04:57 +0200 (Sun, 17 May 2009) | 1 line pep8-fied distutils.archive_util + added minimum test coverage ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun May 17 14:12:03 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 14:12:03 +0200 (CEST) Subject: [Python-checkins] r72738 - in python/branches/py3k: Lib/distutils/archive_util.py Lib/distutils/tests/test_archive_util.py Message-ID: <20090517121203.27123D394@mail.python.org> Author: tarek.ziade Date: Sun May 17 14:12:02 2009 New Revision: 72738 Log: Merged revisions 72736 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72736 | tarek.ziade | 2009-05-17 14:04:57 +0200 (Sun, 17 May 2009) | 1 line pep8-fied distutils.archive_util + added minimum test coverage ........ Added: python/branches/py3k/Lib/distutils/tests/test_archive_util.py - copied unchanged from r72736, /python/trunk/Lib/distutils/tests/test_archive_util.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/archive_util.py Modified: python/branches/py3k/Lib/distutils/archive_util.py ============================================================================== --- python/branches/py3k/Lib/distutils/archive_util.py (original) +++ python/branches/py3k/Lib/distutils/archive_util.py Sun May 17 14:12:02 2009 @@ -11,15 +11,16 @@ from distutils.dir_util import mkpath from distutils import log -def make_tarball (base_name, base_dir, compress="gzip", - verbose=0, dry_run=0): +def make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0): """Create a (possibly compressed) tar file from all the files under - 'base_dir'. 'compress' must be "gzip" (the default), "compress", - "bzip2", or None. Both "tar" and the compression utility named by - 'compress' must be on the default program search path, so this is - probably Unix-specific. The output tar file will be named 'base_dir' + - ".tar", possibly plus the appropriate compression extension (".gz", - ".bz2" or ".Z"). Return the output filename. + 'base_dir'. + + 'compress' must be "gzip" (the default), "compress", "bzip2", or None. + Both "tar" and the compression utility named by 'compress' must be on + the default program search path, so this is probably Unix-specific. + The output tar file will be named 'base_dir' + ".tar", possibly plus + the appropriate compression extension (".gz", ".bz2" or ".Z"). + Returns the output filename. """ # XXX GNU tar 1.13 has a nifty option to add a prefix directory. # It's pretty new, though, so we certainly can't require it -- @@ -27,9 +28,9 @@ # "create a tree of hardlinks" step! (Would also be nice to # detect GNU tar to use its 'z' option and save a step.) - compress_ext = { 'gzip': ".gz", - 'bzip2': '.bz2', - 'compress': ".Z" } + compress_ext = {'gzip': ".gz", + 'bzip2': '.bz2', + 'compress': ".Z" } # flags for compression program, each element of list will be an argument compress_flags = {'gzip': ["-f9"], @@ -52,15 +53,14 @@ else: return archive_name -# make_tarball () - +def make_zipfile(base_name, base_dir, verbose=0, dry_run=0): + """Create a zip file from all the files under 'base_dir'. -def make_zipfile (base_name, base_dir, verbose=0, dry_run=0): - """Create a zip file from all the files under 'base_dir'. The output - zip file will be named 'base_dir' + ".zip". Uses either the "zipfile" - Python module (if available) or the InfoZIP "zip" utility (if installed - and found on the default search path). If neither tool is available, - raises DistutilsExecError. Returns the name of the output zip file. + The output zip file will be named 'base_dir' + ".zip". Uses either the + "zipfile" Python module (if available) or the InfoZIP "zip" utility + (if installed and found on the default search path). If neither tool is + available, raises DistutilsExecError. Returns the name of the output zip + file. """ try: import zipfile @@ -93,22 +93,19 @@ zip_filename, base_dir) if not dry_run: - z = zipfile.ZipFile(zip_filename, "w", - compression=zipfile.ZIP_DEFLATED) + zip = zipfile.ZipFile(zip_filename, "w", + compression=zipfile.ZIP_DEFLATED) for dirpath, dirnames, filenames in os.walk(base_dir): for name in filenames: path = os.path.normpath(os.path.join(dirpath, name)) if os.path.isfile(path): - z.write(path, path) + zip.write(path, path) log.info("adding '%s'" % path) - z.close() + zip.close() return zip_filename -# make_zipfile () - - ARCHIVE_FORMATS = { 'gztar': (make_tarball, [('compress', 'gzip')], "gzip'ed tar-file"), 'bztar': (make_tarball, [('compress', 'bzip2')], "bzip2'ed tar-file"), @@ -117,19 +114,24 @@ 'zip': (make_zipfile, [],"ZIP file") } -def check_archive_formats (formats): +def check_archive_formats(formats): + """Returns the first format from the 'format' list that is unknown. + + If all formats are known, returns None + """ for format in formats: if format not in ARCHIVE_FORMATS: return format - else: - return None + return None + +def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0, + dry_run=0): + """Create an archive file (eg. zip or tar). + + 'base_name' is the name of the file to create, minus any format-specific + extension; 'format' is the archive format: one of "zip", "tar", "ztar", + or "gztar". -def make_archive (base_name, format, - root_dir=None, base_dir=None, - verbose=0, dry_run=0): - """Create an archive file (eg. zip or tar). 'base_name' is the name - of the file to create, minus any format-specific extension; 'format' - is the archive format: one of "zip", "tar", "ztar", or "gztar". 'root_dir' is a directory that will be the root directory of the archive; ie. we typically chdir into 'root_dir' before creating the archive. 'base_dir' is the directory where we start archiving from; @@ -147,7 +149,7 @@ if base_dir is None: base_dir = os.curdir - kwargs = { 'dry_run': dry_run } + kwargs = {'dry_run': dry_run} try: format_info = ARCHIVE_FORMATS[format] @@ -155,7 +157,7 @@ raise ValueError("unknown archive format '%s'" % format) func = format_info[0] - for (arg,val) in format_info[1]: + for arg, val in format_info[1]: kwargs[arg] = val filename = func(base_name, base_dir, **kwargs) @@ -164,5 +166,3 @@ os.chdir(save_cwd) return filename - -# make_archive () From python-checkins at python.org Sun May 17 14:12:48 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 14:12:48 +0200 (CEST) Subject: [Python-checkins] r72739 - python/branches/release30-maint Message-ID: <20090517121248.B96FCD3DF@mail.python.org> Author: tarek.ziade Date: Sun May 17 14:12:48 2009 New Revision: 72739 Log: Blocked revisions 72738 via svnmerge ................ r72738 | tarek.ziade | 2009-05-17 14:12:02 +0200 (Sun, 17 May 2009) | 9 lines Merged revisions 72736 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72736 | tarek.ziade | 2009-05-17 14:04:57 +0200 (Sun, 17 May 2009) | 1 line pep8-fied distutils.archive_util + added minimum test coverage ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Sun May 17 14:19:44 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 17 May 2009 14:19:44 +0200 (CEST) Subject: [Python-checkins] r72740 - python/branches/py3k/Lib/filecmp.py Message-ID: <20090517121944.7D731D461@mail.python.org> Author: georg.brandl Date: Sun May 17 14:19:44 2009 New Revision: 72740 Log: Use PEP 8 and true booleans. Modified: python/branches/py3k/Lib/filecmp.py Modified: python/branches/py3k/Lib/filecmp.py ============================================================================== --- python/branches/py3k/Lib/filecmp.py (original) +++ python/branches/py3k/Lib/filecmp.py Sun May 17 14:19:44 2009 @@ -4,7 +4,7 @@ dircmp Functions: - cmp(f1, f2, shallow=1) -> int + cmp(f1, f2, shallow=True) -> int cmpfiles(a, b, common) -> ([], [], []) """ @@ -14,12 +14,12 @@ import contextlib from itertools import filterfalse -__all__ = ["cmp","dircmp","cmpfiles"] +__all__ = ["cmp", "dircmp", "cmpfiles"] _cache = {} -BUFSIZE=8*1024 +BUFSIZE = 8*1024 -def cmp(f1, f2, shallow=1): +def cmp(f1, f2, shallow=True): """Compare two files. Arguments: @@ -77,7 +77,7 @@ class dircmp: """A class that manages the comparison of 2 directories. - dircmp(a,b,ignore=None,hide=None) + dircmp(a, b, ignore=None, hide=None) A and B are directories. IGNORE is a list of names to ignore, defaults to ['RCS', 'CVS', 'tags']. @@ -238,7 +238,7 @@ self.methodmap[attr](self) return getattr(self, attr) -def cmpfiles(a, b, common, shallow=1): +def cmpfiles(a, b, common, shallow=True): """Compare common files in two directories. a, b -- directory names From python-checkins at python.org Sun May 17 14:22:57 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 17 May 2009 14:22:57 +0200 (CEST) Subject: [Python-checkins] r72741 - python/branches/py3k/Lib/fileinput.py Message-ID: <20090517122257.8E246D427@mail.python.org> Author: georg.brandl Date: Sun May 17 14:22:57 2009 New Revision: 72741 Log: Use PEP 8 and true booleans. Modified: python/branches/py3k/Lib/fileinput.py Modified: python/branches/py3k/Lib/fileinput.py ============================================================================== --- python/branches/py3k/Lib/fileinput.py (original) +++ python/branches/py3k/Lib/fileinput.py Sun May 17 14:22:57 2009 @@ -81,16 +81,17 @@ import sys, os -__all__ = ["input","close","nextfile","filename","lineno","filelineno", - "isfirstline","isstdin","FileInput"] +__all__ = ["input", "close", "nextfile", "filename", "lineno", "filelineno", + "isfirstline", "isstdin", "FileInput"] _state = None DEFAULT_BUFSIZE = 8*1024 -def input(files=None, inplace=0, backup="", bufsize=0, +def input(files=None, inplace=False, backup="", bufsize=0, mode="r", openhook=None): - """input([files[, inplace[, backup[, mode[, openhook]]]]]) + """input(files=None, inplace=False, backup="", bufsize=0, \ +mode="r", openhook=None) Create an instance of the FileInput class. The instance will be used as global state for the functions of this module, and is also returned @@ -194,7 +195,7 @@ sequential order; random access and readline() cannot be mixed. """ - def __init__(self, files=None, inplace=0, backup="", bufsize=0, + def __init__(self, files=None, inplace=False, backup="", bufsize=0, mode="r", openhook=None): if isinstance(files, str): files = (files,) @@ -398,11 +399,11 @@ def _test(): import getopt - inplace = 0 - backup = 0 + inplace = False + backup = False opts, args = getopt.getopt(sys.argv[1:], "ib:") for o, a in opts: - if o == '-i': inplace = 1 + if o == '-i': inplace = True if o == '-b': backup = a for line in input(args, inplace=inplace, backup=backup): if line[-1:] == '\n': line = line[:-1] From python-checkins at python.org Sun May 17 14:29:12 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 17 May 2009 14:29:12 +0200 (CEST) Subject: [Python-checkins] r72742 - in python/branches/py3k/Doc/library: abc.rst allos.rst archiving.rst array.rst asynchat.rst asyncore.rst atexit.rst audioop.rst base64.rst binascii.rst code.rst codeop.rst collections.rst compileall.rst contextlib.rst copy.rst copyreg.rst crypt.rst crypto.rst csv.rst ctypes.rst curses.ascii.rst curses.panel.rst curses.rst custominterp.rst datatypes.rst decimal.rst development.rst dis.rst distutils.rst errno.rst fcntl.rst filecmp.rst fileformats.rst fileinput.rst filesys.rst fnmatch.rst formatter.rst fpectl.rst Message-ID: <20090517122912.AF2A8D4B6@mail.python.org> Author: georg.brandl Date: Sun May 17 14:29:12 2009 New Revision: 72742 Log: Remove surplus empty lines and convert more files to new optional arg style. Modified: python/branches/py3k/Doc/library/abc.rst python/branches/py3k/Doc/library/allos.rst python/branches/py3k/Doc/library/archiving.rst python/branches/py3k/Doc/library/array.rst python/branches/py3k/Doc/library/asynchat.rst python/branches/py3k/Doc/library/asyncore.rst python/branches/py3k/Doc/library/atexit.rst python/branches/py3k/Doc/library/audioop.rst python/branches/py3k/Doc/library/base64.rst python/branches/py3k/Doc/library/binascii.rst python/branches/py3k/Doc/library/code.rst python/branches/py3k/Doc/library/codeop.rst python/branches/py3k/Doc/library/collections.rst python/branches/py3k/Doc/library/compileall.rst python/branches/py3k/Doc/library/contextlib.rst python/branches/py3k/Doc/library/copy.rst python/branches/py3k/Doc/library/copyreg.rst python/branches/py3k/Doc/library/crypt.rst python/branches/py3k/Doc/library/crypto.rst python/branches/py3k/Doc/library/csv.rst python/branches/py3k/Doc/library/ctypes.rst python/branches/py3k/Doc/library/curses.ascii.rst python/branches/py3k/Doc/library/curses.panel.rst python/branches/py3k/Doc/library/curses.rst python/branches/py3k/Doc/library/custominterp.rst python/branches/py3k/Doc/library/datatypes.rst python/branches/py3k/Doc/library/decimal.rst python/branches/py3k/Doc/library/development.rst python/branches/py3k/Doc/library/dis.rst python/branches/py3k/Doc/library/distutils.rst python/branches/py3k/Doc/library/errno.rst python/branches/py3k/Doc/library/fcntl.rst python/branches/py3k/Doc/library/filecmp.rst python/branches/py3k/Doc/library/fileformats.rst python/branches/py3k/Doc/library/fileinput.rst python/branches/py3k/Doc/library/filesys.rst python/branches/py3k/Doc/library/fnmatch.rst python/branches/py3k/Doc/library/formatter.rst python/branches/py3k/Doc/library/fpectl.rst Modified: python/branches/py3k/Doc/library/abc.rst ============================================================================== --- python/branches/py3k/Doc/library/abc.rst (original) +++ python/branches/py3k/Doc/library/abc.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`abc` --- Abstract Base Classes ==================================== Modified: python/branches/py3k/Doc/library/allos.rst ============================================================================== --- python/branches/py3k/Doc/library/allos.rst (original) +++ python/branches/py3k/Doc/library/allos.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - .. _allos: ********************************* Modified: python/branches/py3k/Doc/library/archiving.rst ============================================================================== --- python/branches/py3k/Doc/library/archiving.rst (original) +++ python/branches/py3k/Doc/library/archiving.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - .. _archiving: ****************************** Modified: python/branches/py3k/Doc/library/array.rst ============================================================================== --- python/branches/py3k/Doc/library/array.rst (original) +++ python/branches/py3k/Doc/library/array.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`array` --- Efficient arrays of numeric values =================================================== Modified: python/branches/py3k/Doc/library/asynchat.rst ============================================================================== --- python/branches/py3k/Doc/library/asynchat.rst (original) +++ python/branches/py3k/Doc/library/asynchat.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`asynchat` --- Asynchronous socket command/response handler ================================================================ Modified: python/branches/py3k/Doc/library/asyncore.rst ============================================================================== --- python/branches/py3k/Doc/library/asyncore.rst (original) +++ python/branches/py3k/Doc/library/asyncore.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`asyncore` --- Asynchronous socket handler =============================================== Modified: python/branches/py3k/Doc/library/atexit.rst ============================================================================== --- python/branches/py3k/Doc/library/atexit.rst (original) +++ python/branches/py3k/Doc/library/atexit.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`atexit` --- Exit handlers =============================== Modified: python/branches/py3k/Doc/library/audioop.rst ============================================================================== --- python/branches/py3k/Doc/library/audioop.rst (original) +++ python/branches/py3k/Doc/library/audioop.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`audioop` --- Manipulate raw audio data ============================================ Modified: python/branches/py3k/Doc/library/base64.rst ============================================================================== --- python/branches/py3k/Doc/library/base64.rst (original) +++ python/branches/py3k/Doc/library/base64.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`base64` --- RFC 3548: Base16, Base32, Base64 Data Encodings ================================================================= Modified: python/branches/py3k/Doc/library/binascii.rst ============================================================================== --- python/branches/py3k/Doc/library/binascii.rst (original) +++ python/branches/py3k/Doc/library/binascii.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`binascii` --- Convert between binary and ASCII ==================================================== Modified: python/branches/py3k/Doc/library/code.rst ============================================================================== --- python/branches/py3k/Doc/library/code.rst (original) +++ python/branches/py3k/Doc/library/code.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`code` --- Interpreter base classes ======================================== @@ -6,7 +5,6 @@ :synopsis: Facilities to implement read-eval-print loops. - The ``code`` module provides facilities to implement read-eval-print loops in Python. Two classes and convenience functions are included which can be used to build applications which provide an interactive interpreter prompt. Modified: python/branches/py3k/Doc/library/codeop.rst ============================================================================== --- python/branches/py3k/Doc/library/codeop.rst (original) +++ python/branches/py3k/Doc/library/codeop.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`codeop` --- Compile Python code ===================================== Modified: python/branches/py3k/Doc/library/collections.rst ============================================================================== --- python/branches/py3k/Doc/library/collections.rst (original) +++ python/branches/py3k/Doc/library/collections.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`collections` --- Container datatypes ========================================== Modified: python/branches/py3k/Doc/library/compileall.rst ============================================================================== --- python/branches/py3k/Doc/library/compileall.rst (original) +++ python/branches/py3k/Doc/library/compileall.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`compileall` --- Byte-compile Python libraries =================================================== Modified: python/branches/py3k/Doc/library/contextlib.rst ============================================================================== --- python/branches/py3k/Doc/library/contextlib.rst (original) +++ python/branches/py3k/Doc/library/contextlib.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`contextlib` --- Utilities for :keyword:`with`\ -statement contexts. ========================================================================= Modified: python/branches/py3k/Doc/library/copy.rst ============================================================================== --- python/branches/py3k/Doc/library/copy.rst (original) +++ python/branches/py3k/Doc/library/copy.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`copy` --- Shallow and deep copy operations ================================================ Modified: python/branches/py3k/Doc/library/copyreg.rst ============================================================================== --- python/branches/py3k/Doc/library/copyreg.rst (original) +++ python/branches/py3k/Doc/library/copyreg.rst Sun May 17 14:29:12 2009 @@ -1,6 +1,5 @@ - :mod:`copyreg` --- Register :mod:`pickle` support functions -============================================================ +=========================================================== .. module:: copyreg :synopsis: Register pickle support functions. Modified: python/branches/py3k/Doc/library/crypt.rst ============================================================================== --- python/branches/py3k/Doc/library/crypt.rst (original) +++ python/branches/py3k/Doc/library/crypt.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`crypt` --- Function to check Unix passwords ================================================= Modified: python/branches/py3k/Doc/library/crypto.rst ============================================================================== --- python/branches/py3k/Doc/library/crypto.rst (original) +++ python/branches/py3k/Doc/library/crypto.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - .. _crypto: ********************** Modified: python/branches/py3k/Doc/library/csv.rst ============================================================================== --- python/branches/py3k/Doc/library/csv.rst (original) +++ python/branches/py3k/Doc/library/csv.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`csv` --- CSV File Reading and Writing =========================================== Modified: python/branches/py3k/Doc/library/ctypes.rst ============================================================================== --- python/branches/py3k/Doc/library/ctypes.rst (original) +++ python/branches/py3k/Doc/library/ctypes.rst Sun May 17 14:29:12 2009 @@ -1,6 +1,5 @@ - -:mod:`ctypes` --- A foreign function library for Python. -======================================================== +:mod:`ctypes` --- A foreign function library for Python +======================================================= .. module:: ctypes :synopsis: A foreign function library for Python. Modified: python/branches/py3k/Doc/library/curses.ascii.rst ============================================================================== --- python/branches/py3k/Doc/library/curses.ascii.rst (original) +++ python/branches/py3k/Doc/library/curses.ascii.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`curses.ascii` --- Utilities for ASCII characters ====================================================== Modified: python/branches/py3k/Doc/library/curses.panel.rst ============================================================================== --- python/branches/py3k/Doc/library/curses.panel.rst (original) +++ python/branches/py3k/Doc/library/curses.panel.rst Sun May 17 14:29:12 2009 @@ -1,6 +1,5 @@ - -:mod:`curses.panel` --- A panel stack extension for curses. -=========================================================== +:mod:`curses.panel` --- A panel stack extension for curses +========================================================== .. module:: curses.panel :synopsis: A panel stack extension that adds depth to curses windows. Modified: python/branches/py3k/Doc/library/curses.rst ============================================================================== --- python/branches/py3k/Doc/library/curses.rst (original) +++ python/branches/py3k/Doc/library/curses.rst Sun May 17 14:29:12 2009 @@ -1,9 +1,9 @@ - :mod:`curses` --- Terminal handling for character-cell displays =============================================================== .. module:: curses - :synopsis: An interface to the curses library, providing portable terminal handling. + :synopsis: An interface to the curses library, providing portable + terminal handling. .. sectionauthor:: Moshe Zadka .. sectionauthor:: Eric Raymond Modified: python/branches/py3k/Doc/library/custominterp.rst ============================================================================== --- python/branches/py3k/Doc/library/custominterp.rst (original) +++ python/branches/py3k/Doc/library/custominterp.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - .. _custominterp: ************************** Modified: python/branches/py3k/Doc/library/datatypes.rst ============================================================================== --- python/branches/py3k/Doc/library/datatypes.rst (original) +++ python/branches/py3k/Doc/library/datatypes.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - .. _datatypes: ********** Modified: python/branches/py3k/Doc/library/decimal.rst ============================================================================== --- python/branches/py3k/Doc/library/decimal.rst (original) +++ python/branches/py3k/Doc/library/decimal.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`decimal` --- Decimal fixed point and floating point arithmetic ==================================================================== Modified: python/branches/py3k/Doc/library/development.rst ============================================================================== --- python/branches/py3k/Doc/library/development.rst (original) +++ python/branches/py3k/Doc/library/development.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - .. _development: ***************** Modified: python/branches/py3k/Doc/library/dis.rst ============================================================================== --- python/branches/py3k/Doc/library/dis.rst (original) +++ python/branches/py3k/Doc/library/dis.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`dis` --- Disassembler for Python bytecode =============================================== @@ -6,11 +5,11 @@ :synopsis: Disassembler for Python bytecode. -The :mod:`dis` module supports the analysis of Python :term:`bytecode` by disassembling -it. Since there is no Python assembler, this module defines the Python assembly -language. The Python bytecode which this module takes as an input is defined -in the file :file:`Include/opcode.h` and used by the compiler and the -interpreter. +The :mod:`dis` module supports the analysis of Python :term:`bytecode` by +disassembling it. Since there is no Python assembler, this module defines the +Python assembly language. The Python bytecode which this module takes as an +input is defined in the file :file:`Include/opcode.h` and used by the compiler +and the interpreter. Example: Given the function :func:`myfunc`:: Modified: python/branches/py3k/Doc/library/distutils.rst ============================================================================== --- python/branches/py3k/Doc/library/distutils.rst (original) +++ python/branches/py3k/Doc/library/distutils.rst Sun May 17 14:29:12 2009 @@ -1,10 +1,9 @@ - :mod:`distutils` --- Building and installing Python modules =========================================================== .. module:: distutils - :synopsis: Support for building and installing Python modules into an existing Python - installation. + :synopsis: Support for building and installing Python modules into an + existing Python installation. .. sectionauthor:: Fred L. Drake, Jr. @@ -19,12 +18,12 @@ .. seealso:: :ref:`distutils-index` - The manual for developers and packagers of Python modules. This describes how - to prepare :mod:`distutils`\ -based packages so that they may be easily - installed into an existing Python installation. + The manual for developers and packagers of Python modules. This describes + how to prepare :mod:`distutils`\ -based packages so that they may be + easily installed into an existing Python installation. :ref:`install-index` - An "administrators" manual which includes information on installing modules into - an existing Python installation. You do not need to be a Python programmer to - read this manual. + An "administrators" manual which includes information on installing + modules into an existing Python installation. You do not need to be a + Python programmer to read this manual. Modified: python/branches/py3k/Doc/library/errno.rst ============================================================================== --- python/branches/py3k/Doc/library/errno.rst (original) +++ python/branches/py3k/Doc/library/errno.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`errno` --- Standard errno system symbols ============================================== Modified: python/branches/py3k/Doc/library/fcntl.rst ============================================================================== --- python/branches/py3k/Doc/library/fcntl.rst (original) +++ python/branches/py3k/Doc/library/fcntl.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`fcntl` --- The :func:`fcntl` and :func:`ioctl` system calls ================================================================= @@ -65,13 +64,13 @@ so long as the buffer you pass is as least as long as what the operating system wants to put there, things should work. - If *mutate_flag* is true (the default), then the buffer is (in effect) passed to the - underlying :func:`ioctl` system call, the latter's return code is passed back to - the calling Python, and the buffer's new contents reflect the action of the - :func:`ioctl`. This is a slight simplification, because if the supplied buffer - is less than 1024 bytes long it is first copied into a static buffer 1024 bytes - long which is then passed to :func:`ioctl` and copied back into the supplied - buffer. + If *mutate_flag* is true (the default), then the buffer is (in effect) passed + to the underlying :func:`ioctl` system call, the latter's return code is + passed back to the calling Python, and the buffer's new contents reflect the + action of the :func:`ioctl`. This is a slight simplification, because if the + supplied buffer is less than 1024 bytes long it is first copied into a static + buffer 1024 bytes long which is then passed to :func:`ioctl` and copied back + into the supplied buffer. An example:: Modified: python/branches/py3k/Doc/library/filecmp.rst ============================================================================== --- python/branches/py3k/Doc/library/filecmp.rst (original) +++ python/branches/py3k/Doc/library/filecmp.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`filecmp` --- File and Directory Comparisons ================================================= @@ -14,7 +13,7 @@ The :mod:`filecmp` module defines the following functions: -.. function:: cmp(f1, f2[, shallow]) +.. function:: cmp(f1, f2, shallow=True) Compare the files named *f1* and *f2*, returning ``True`` if they seem equal, ``False`` otherwise. @@ -29,7 +28,7 @@ portability and efficiency. -.. function:: cmpfiles(dir1, dir2, common[, shallow]) +.. function:: cmpfiles(dir1, dir2, common, shallow=True) Compare the files in the two directories *dir1* and *dir2* whose names are given by *common*. @@ -66,7 +65,7 @@ :class:`dircmp` instances are built using this constructor: -.. class:: dircmp(a, b[, ignore[, hide]]) +.. class:: dircmp(a, b, ignore=None, hide=None) Construct a new directory comparison object, to compare the directories *a* and *b*. *ignore* is a list of names to ignore, and defaults to ``['RCS', 'CVS', @@ -159,5 +158,6 @@ .. attribute:: subdirs - A dictionary mapping names in :attr:`common_dirs` to :class:`dircmp` objects. + A dictionary mapping names in :attr:`common_dirs` to :class:`dircmp` + objects. Modified: python/branches/py3k/Doc/library/fileformats.rst ============================================================================== --- python/branches/py3k/Doc/library/fileformats.rst (original) +++ python/branches/py3k/Doc/library/fileformats.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - .. _fileformats: ************ Modified: python/branches/py3k/Doc/library/fileinput.rst ============================================================================== --- python/branches/py3k/Doc/library/fileinput.rst (original) +++ python/branches/py3k/Doc/library/fileinput.rst Sun May 17 14:29:12 2009 @@ -47,7 +47,7 @@ The following function is the primary interface of this module: -.. function:: input([files[, inplace[, backup[, mode[, openhook]]]]]) +.. function:: input(files=None, inplace=False, backup='', bufsize=0, mode='r', openhook=None) Create an instance of the :class:`FileInput` class. The instance will be used as global state for the functions of this module, and is also returned to use @@ -115,7 +115,7 @@ available for subclassing as well: -.. class:: FileInput([files[, inplace[, backup[, mode[, openhook]]]]]) +.. class:: FileInput(files=None, inplace=False, backup='', bufsize=0, mode='r', openhook=None) Class :class:`FileInput` is the implementation; its methods :meth:`filename`, :meth:`fileno`, :meth:`lineno`, :meth:`filelineno`, :meth:`isfirstline`, Modified: python/branches/py3k/Doc/library/filesys.rst ============================================================================== --- python/branches/py3k/Doc/library/filesys.rst (original) +++ python/branches/py3k/Doc/library/filesys.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - .. _filesys: ************************* Modified: python/branches/py3k/Doc/library/fnmatch.rst ============================================================================== --- python/branches/py3k/Doc/library/fnmatch.rst (original) +++ python/branches/py3k/Doc/library/fnmatch.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`fnmatch` --- Unix filename pattern matching ================================================= Modified: python/branches/py3k/Doc/library/formatter.rst ============================================================================== --- python/branches/py3k/Doc/library/formatter.rst (original) +++ python/branches/py3k/Doc/library/formatter.rst Sun May 17 14:29:12 2009 @@ -165,7 +165,7 @@ :const:`AS_IS` values, is passed to the writer's :meth:`new_styles` method. -.. method:: formatter.pop_style([n=1]) +.. method:: formatter.pop_style(n=1) Pop the last *n* style specifications passed to :meth:`push_style`. A tuple representing the revised stack, including :const:`AS_IS` values, is passed to @@ -177,7 +177,7 @@ Set the spacing style for the writer. -.. method:: formatter.assert_line_data([flag=1]) +.. method:: formatter.assert_line_data(flag=1) Inform the formatter that data has been added to the current paragraph out-of-band. This should be used when the writer has been manipulated @@ -194,7 +194,7 @@ applications may use one of these classes without modification or subclassing. -.. class:: NullFormatter([writer]) +.. class:: NullFormatter(writer=None) A formatter which does nothing. If *writer* is omitted, a :class:`NullWriter` instance is created. No methods of the writer are called by @@ -337,7 +337,7 @@ output. -.. class:: DumbWriter([file[, maxcol=72]]) +.. class:: DumbWriter(file=None, maxcol=72) Simple writer class which writes output on the file object passed in as *file* or, if *file* is omitted, on standard output. The output is simply word-wrapped Modified: python/branches/py3k/Doc/library/fpectl.rst ============================================================================== --- python/branches/py3k/Doc/library/fpectl.rst (original) +++ python/branches/py3k/Doc/library/fpectl.rst Sun May 17 14:29:12 2009 @@ -1,4 +1,3 @@ - :mod:`fpectl` --- Floating point exception control ================================================== From buildbot at python.org Sun May 17 14:34:29 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 12:34:29 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090517123429.1FF49D527@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/824 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun May 17 14:50:58 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 17 May 2009 14:50:58 +0200 (CEST) Subject: [Python-checkins] r72743 - python/branches/py3k/Lib/gettext.py Message-ID: <20090517125058.C1C85D527@mail.python.org> Author: georg.brandl Date: Sun May 17 14:50:58 2009 New Revision: 72743 Log: Use true booleans. Modified: python/branches/py3k/Lib/gettext.py Modified: python/branches/py3k/Lib/gettext.py ============================================================================== --- python/branches/py3k/Lib/gettext.py (original) +++ python/branches/py3k/Lib/gettext.py Sun May 17 14:50:58 2009 @@ -366,7 +366,7 @@ # Locate a .mo file using the gettext strategy -def find(domain, localedir=None, languages=None, all=0): +def find(domain, localedir=None, languages=None, all=False): # Get some reasonable defaults for arguments that were not supplied if localedir is None: localedir = _default_localedir @@ -410,7 +410,7 @@ class_=None, fallback=False, codeset=None): if class_ is None: class_ = GNUTranslations - mofiles = find(domain, localedir, languages, all=1) + mofiles = find(domain, localedir, languages, all=True) if not mofiles: if fallback: return NullTranslations() From python-checkins at python.org Sun May 17 15:00:36 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 17 May 2009 15:00:36 +0200 (CEST) Subject: [Python-checkins] r72744 - in python/branches/py3k/Doc/library: fractions.rst frameworks.rst ftplib.rst functions.rst functools.rst gc.rst getopt.rst getpass.rst gettext.rst glob.rst grp.rst gzip.rst hashlib.rst heapq.rst hmac.rst http.client.rst http.cookies.rst http.server.rst i18n.rst Message-ID: <20090517130036.C1032D575@mail.python.org> Author: georg.brandl Date: Sun May 17 15:00:36 2009 New Revision: 72744 Log: More conversion to new-style optional args. Modified: python/branches/py3k/Doc/library/fractions.rst python/branches/py3k/Doc/library/frameworks.rst python/branches/py3k/Doc/library/ftplib.rst python/branches/py3k/Doc/library/functions.rst python/branches/py3k/Doc/library/functools.rst python/branches/py3k/Doc/library/gc.rst python/branches/py3k/Doc/library/getopt.rst python/branches/py3k/Doc/library/getpass.rst python/branches/py3k/Doc/library/gettext.rst python/branches/py3k/Doc/library/glob.rst python/branches/py3k/Doc/library/grp.rst python/branches/py3k/Doc/library/gzip.rst python/branches/py3k/Doc/library/hashlib.rst python/branches/py3k/Doc/library/heapq.rst python/branches/py3k/Doc/library/hmac.rst python/branches/py3k/Doc/library/http.client.rst python/branches/py3k/Doc/library/http.cookies.rst python/branches/py3k/Doc/library/http.server.rst python/branches/py3k/Doc/library/i18n.rst Modified: python/branches/py3k/Doc/library/fractions.rst ============================================================================== --- python/branches/py3k/Doc/library/fractions.rst (original) +++ python/branches/py3k/Doc/library/fractions.rst Sun May 17 15:00:36 2009 @@ -1,4 +1,3 @@ - :mod:`fractions` --- Rational numbers ===================================== Modified: python/branches/py3k/Doc/library/frameworks.rst ============================================================================== --- python/branches/py3k/Doc/library/frameworks.rst (original) +++ python/branches/py3k/Doc/library/frameworks.rst Sun May 17 15:00:36 2009 @@ -1,4 +1,3 @@ - .. _frameworks: ****************** Modified: python/branches/py3k/Doc/library/ftplib.rst ============================================================================== --- python/branches/py3k/Doc/library/ftplib.rst (original) +++ python/branches/py3k/Doc/library/ftplib.rst Sun May 17 15:00:36 2009 @@ -36,7 +36,7 @@ The module defines the following items: -.. class:: FTP([host[, user[, passwd[, acct[, timeout]]]]]) +.. class:: FTP(host='', user='', passwd='', acct=''[, timeout]) Return a new instance of the :class:`FTP` class. When *host* is given, the method call ``connect(host)`` is made. When *user* is given, additionally @@ -46,7 +46,6 @@ connection attempt (if is not specified, the global default timeout setting will be used). - .. attribute:: all_errors The set of all exceptions (as a tuple) that methods of :class:`FTP` @@ -56,33 +55,33 @@ :exc:`IOError`. - .. exception:: error_reply +.. exception:: error_reply - Exception raised when an unexpected reply is received from the server. + Exception raised when an unexpected reply is received from the server. - .. exception:: error_temp +.. exception:: error_temp - Exception raised when an error code in the range 400--499 is received. + Exception raised when an error code in the range 400--499 is received. - .. exception:: error_perm +.. exception:: error_perm - Exception raised when an error code in the range 500--599 is received. + Exception raised when an error code in the range 500--599 is received. - .. exception:: error_proto +.. exception:: error_proto - Exception raised when a reply is received from the server that does not - begin with a digit in the range 1--5. + Exception raised when a reply is received from the server that does not begin + with a digit in the range 1--5. .. seealso:: Module :mod:`netrc` - Parser for the :file:`.netrc` file format. The file :file:`.netrc` is typically - used by FTP clients to load user authentication information before prompting the - user. + Parser for the :file:`.netrc` file format. The file :file:`.netrc` is + typically used by FTP clients to load user authentication information + before prompting the user. .. index:: single: ftpmirror.py @@ -112,7 +111,7 @@ debugging output, logging each line sent and received on the control connection. -.. method:: FTP.connect(host[, port[, timeout]]) +.. method:: FTP.connect(host='', port=0[, timeout]) Connect to the given host and port. The default port number is ``21``, as specified by the FTP protocol specification. It is rarely needed to specify a @@ -133,7 +132,7 @@ that may be relevant to the user.) -.. method:: FTP.login([user[, passwd[, acct]]]) +.. method:: FTP.login(user='anonymous', passwd='', acct='') Log in as the given *user*. The *passwd* and *acct* parameters are optional and default to the empty string. If no *user* is specified, it defaults to @@ -150,33 +149,33 @@ it's worth a try. -.. method:: FTP.sendcmd(command) +.. method:: FTP.sendcmd(cmd) Send a simple command string to the server and return the response string. -.. method:: FTP.voidcmd(command) +.. method:: FTP.voidcmd(cmd) Send a simple command string to the server and handle the response. Return nothing if a response code in the range 200--299 is received. Raise an exception otherwise. -.. method:: FTP.retrbinary(command, callback[, maxblocksize[, rest]]) +.. method:: FTP.retrbinary(cmd, callback, blocksize=8192, rest=None) - Retrieve a file in binary transfer mode. *command* should be an appropriate + Retrieve a file in binary transfer mode. *cmd* should be an appropriate ``RETR`` command: ``'RETR filename'``. The *callback* function is called for each block of data received, with a single string argument giving the data - block. The optional *maxblocksize* argument specifies the maximum chunk size to + block. The optional *blocksize* argument specifies the maximum chunk size to read on the low-level socket object created to do the actual transfer (which will also be the largest size of the data blocks passed to *callback*). A reasonable default is chosen. *rest* means the same thing as in the :meth:`transfercmd` method. -.. method:: FTP.retrlines(command[, callback]) +.. method:: FTP.retrlines(cmd, callback=None) - Retrieve a file or directory listing in ASCII transfer mode. *command* + Retrieve a file or directory listing in ASCII transfer mode. *cmd* should be an appropriate ``RETR`` command (see :meth:`retrbinary`) or a command such as ``LIST``, ``NLST`` or ``MLSD`` (usually just the string ``'LIST'``). The *callback* function is called for each line, with the @@ -190,9 +189,9 @@ Passive mode is on by default. -.. method:: FTP.storbinary(command, file[, blocksize, callback]) +.. method:: FTP.storbinary(cmd, file, blocksize=8192, callback=None) - Store a file in binary transfer mode. *command* should be an appropriate + Store a file in binary transfer mode. *cmd* should be an appropriate ``STOR`` command: ``"STOR filename"``. *file* is an open file object which is read until EOF using its :meth:`read` method in blocks of size *blocksize* to provide the data to be stored. The *blocksize* argument defaults to 8192. @@ -200,16 +199,16 @@ on each block of data after it is sent. -.. method:: FTP.storlines(command, file[, callback]) +.. method:: FTP.storlines(cmd, file, callback=None) - Store a file in ASCII transfer mode. *command* should be an appropriate + Store a file in ASCII transfer mode. *cmd* should be an appropriate ``STOR`` command (see :meth:`storbinary`). Lines are read until EOF from the open file object *file* using its :meth:`readline` method to provide the data to be stored. *callback* is an optional single parameter callable that is called on each line after it is sent. -.. method:: FTP.transfercmd(cmd[, rest]) +.. method:: FTP.transfercmd(cmd, rest=None) Initiate a transfer over the data connection. If the transfer is active, send a ``EPRT`` or ``PORT`` command and the transfer command specified by *cmd*, and @@ -229,7 +228,7 @@ *rest* argument. -.. method:: FTP.ntransfercmd(cmd[, rest]) +.. method:: FTP.ntransfercmd(cmd, rest=None) Like :meth:`transfercmd`, but returns a tuple of the data connection and the expected size of the data. If the expected size could not be computed, ``None`` Modified: python/branches/py3k/Doc/library/functions.rst ============================================================================== --- python/branches/py3k/Doc/library/functions.rst (original) +++ python/branches/py3k/Doc/library/functions.rst Sun May 17 15:00:36 2009 @@ -65,14 +65,14 @@ .. index:: pair: Boolean; type -.. function:: bytearray([arg[, encoding[, errors]]]) +.. function:: bytearray([source[, encoding[, errors]]]) Return a new array of bytes. The :class:`bytearray` type is a mutable sequence of integers in the range 0 <= x < 256. It has most of the usual methods of mutable sequences, described in :ref:`typesseq-mutable`, as well as most methods that the :class:`str` type has, see :ref:`bytes-methods`. - The optional *arg* parameter can be used to initialize the array in a few + The optional *source* parameter can be used to initialize the array in a few different ways: * If it is a *string*, you must also give the *encoding* (and optionally, @@ -91,7 +91,7 @@ Without an argument, an array of size 0 is created. -.. function:: bytes([arg[, encoding[, errors]]]) +.. function:: bytes([source[, encoding[, errors]]]) Return a new "bytes" object, which is an immutable sequence of integers in the range ``0 <= x < 256``. :class:`bytes` is an immutable version of @@ -139,7 +139,7 @@ type hierarchy in :ref:`types`. -.. function:: compile(source, filename, mode[, flags[, dont_inherit]]) +.. function:: compile(source, filename, mode, flags=0, dont_inherit=False) Compile the *source* into a code or AST object. Code objects can be executed by an :keyword:`exec` statement or evaluated by a call to :func:`eval`. @@ -263,25 +263,26 @@ .. note:: Because :func:`dir` is supplied primarily as a convenience for use at an - interactive prompt, it tries to supply an interesting set of names more than it - tries to supply a rigorously or consistently defined set of names, and its - detailed behavior may change across releases. For example, metaclass attributes - are not in the result list when the argument is a class. + interactive prompt, it tries to supply an interesting set of names more + than it tries to supply a rigorously or consistently defined set of names, + and its detailed behavior may change across releases. For example, + metaclass attributes are not in the result list when the argument is a + class. .. function:: divmod(a, b) Take two (non complex) numbers as arguments and return a pair of numbers - consisting of their quotient and remainder when using integer division. With mixed - operand types, the rules for binary arithmetic operators apply. For integers, - the result is the same as ``(a // b, a % b)``. For floating point - numbers the result is ``(q, a % b)``, where *q* is usually ``math.floor(a / b)`` - but may be 1 less than that. In any case ``q * b + a % b`` is very close to - *a*, if ``a % b`` is non-zero it has the same sign as *b*, and ``0 <= abs(a % b) - < abs(b)``. + consisting of their quotient and remainder when using integer division. With + mixed operand types, the rules for binary arithmetic operators apply. For + integers, the result is the same as ``(a // b, a % b)``. For floating point + numbers the result is ``(q, a % b)``, where *q* is usually ``math.floor(a / + b)`` but may be 1 less than that. In any case ``q * b + a % b`` is very + close to *a*, if ``a % b`` is non-zero it has the same sign as *b*, and ``0 + <= abs(a % b) < abs(b)``. -.. function:: enumerate(iterable[, start=0]) +.. function:: enumerate(iterable, start=0) Return an enumerate object. *iterable* must be a sequence, an :term:`iterator`, or some other object which supports iteration. The @@ -299,7 +300,7 @@ 3 Winter -.. function:: eval(expression[, globals[, locals]]) +.. function:: eval(expression, globals=None, locals=None) The arguments are a string and optional globals and locals. If provided, *globals* must be a dictionary. If provided, *locals* can be any mapping @@ -550,18 +551,19 @@ case, a :exc:`TypeError` exception is raised. -.. function:: iter(o[, sentinel]) +.. function:: iter(object[, sentinel]) - Return an :term:`iterator` object. The first argument is interpreted very differently - depending on the presence of the second argument. Without a second argument, *o* - must be a collection object which supports the iteration protocol (the - :meth:`__iter__` method), or it must support the sequence protocol (the - :meth:`__getitem__` method with integer arguments starting at ``0``). If it - does not support either of those protocols, :exc:`TypeError` is raised. If the - second argument, *sentinel*, is given, then *o* must be a callable object. The - iterator created in this case will call *o* with no arguments for each call to - its :meth:`__next__` method; if the value returned is equal to *sentinel*, - :exc:`StopIteration` will be raised, otherwise the value will be returned. + Return an :term:`iterator` object. The first argument is interpreted very + differently depending on the presence of the second argument. Without a + second argument, *object* must be a collection object which supports the + iteration protocol (the :meth:`__iter__` method), or it must support the + sequence protocol (the :meth:`__getitem__` method with integer arguments + starting at ``0``). If it does not support either of those protocols, + :exc:`TypeError` is raised. If the second argument, *sentinel*, is given, + then *object* must be a callable object. The iterator created in this case + will call *object* with no arguments for each call to its :meth:`__next__` + method; if the value returned is equal to *sentinel*, :exc:`StopIteration` + will be raised, otherwise the value will be returned. One useful application of the second form of :func:`iter` is to read lines of a file until a certain line is reached. The following example reads a file @@ -584,22 +586,23 @@ items. *iterable* may be either a sequence, a container that supports iteration, or an iterator object. If *iterable* is already a list, a copy is made and returned, similar to ``iterable[:]``. For instance, ``list('abc')`` - returns ``['a', 'b', 'c']`` and ``list( (1, 2, 3) )`` returns ``[1, 2, 3]``. If - no argument is given, returns a new empty list, ``[]``. + returns ``['a', 'b', 'c']`` and ``list( (1, 2, 3) )`` returns ``[1, 2, 3]``. + If no argument is given, returns a new empty list, ``[]``. :class:`list` is a mutable sequence type, as documented in :ref:`typesseq`. + .. function:: locals() Update and return a dictionary representing the current local symbol table. .. note:: - The contents of this dictionary should not be modified; changes may not affect - the values of local variables used by the interpreter. + The contents of this dictionary should not be modified; changes may not + affect the values of local variables used by the interpreter. - Free variables are returned by :func:`locals` when it is called in a function block. - Modifications of free variables may not affect the values used by the + Free variables are returned by :func:`locals` when it is called in a function + block. Modifications of free variables may not affect the values used by the interpreter. Free variables are not returned in class blocks. @@ -666,7 +669,7 @@ :meth:`__index__` method that returns an integer. -.. function:: open(file[, mode='r'[, buffering=None[, encoding=None[, errors=None[, newline=None[, closefd=True]]]]]]) +.. function:: open(file, mode='r', buffering=None, encoding=None, errors=None, newline=None, closefd=True) Open *file* and return a corresponding stream. If the file cannot be opened, an :exc:`IOError` is raised. @@ -812,7 +815,7 @@ must be of integer types, and *y* must be non-negative. -.. function:: print([object, ...][, sep=' '][, end='\\n'][, file=sys.stdout]) +.. function:: print([object, ...], *, sep=' ', end='\\n', file=sys.stdout) Print *object*\(s) to the stream *file*, separated by *sep* and followed by *end*. *sep*, *end* and *file*, if present, must be given as keyword @@ -828,7 +831,7 @@ is not present or ``None``, :data:`sys.stdout` will be used. -.. function:: property([fget[, fset[, fdel[, doc]]]]) +.. function:: property(fget=None, fset=None, fdel=None, doc=None) Return a property attribute. @@ -987,7 +990,7 @@ for an alternate version that returns an iterator. -.. function:: sorted(iterable[, key[, reverse]]) +.. function:: sorted(iterable[, key][, reverse]) Return a new sorted list from the items in *iterable*. @@ -1103,7 +1106,8 @@ class C(B): def method(self, arg): - super().method(arg) # This does the same thing as: super(C, self).method(arg) + super().method(arg) # This does the same thing as: + # super(C, self).method(arg) Note that :func:`super` is implemented as part of the binding process for explicit dotted attribute lookups such as ``super().__getitem__(name)``. @@ -1209,7 +1213,7 @@ True -.. function:: __import__(name[, globals[, locals[, fromlist[, level]]]]) +.. function:: __import__(name, globals={}, locals={}, fromlist=[], level=-1) .. index:: statement: import Modified: python/branches/py3k/Doc/library/functools.rst ============================================================================== --- python/branches/py3k/Doc/library/functools.rst (original) +++ python/branches/py3k/Doc/library/functools.rst Sun May 17 15:00:36 2009 @@ -15,7 +15,7 @@ The :mod:`functools` module defines the following functions: -.. function:: partial(func[,*args][, **keywords]) +.. function:: partial(func, *args, **keywords) Return a new :class:`partial` object which when called will behave like *func* called with the positional arguments *args* and keyword arguments *keywords*. If @@ -58,7 +58,7 @@ *sequence* contains only one item, the first item is returned. -.. function:: update_wrapper(wrapper, wrapped[, assigned][, updated]) +.. function:: update_wrapper(wrapper, wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES) Update a *wrapper* function to look like the *wrapped* function. The optional arguments are tuples to specify which attributes of the original function are @@ -77,7 +77,7 @@ than helpful. -.. function:: wraps(wrapped[, assigned][, updated]) +.. function:: wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES) This is a convenience function for invoking ``partial(update_wrapper, wrapped=wrapped, assigned=assigned, updated=updated)`` as a function decorator Modified: python/branches/py3k/Doc/library/gc.rst ============================================================================== --- python/branches/py3k/Doc/library/gc.rst (original) +++ python/branches/py3k/Doc/library/gc.rst Sun May 17 15:00:36 2009 @@ -1,4 +1,3 @@ - :mod:`gc` --- Garbage Collector interface ========================================= @@ -37,7 +36,7 @@ Returns true if automatic collection is enabled. -.. function:: collect([generation]) +.. function:: collect(generations=2) With no arguments, run a full collection. The optional argument *generation* may be an integer specifying which generation to collect (from 0 to 2). A @@ -210,5 +209,3 @@ The debugging flags necessary for the collector to print information about a leaking program (equal to ``DEBUG_COLLECTABLE | DEBUG_UNCOLLECTABLE | DEBUG_SAVEALL``). - -.. rubric:: Footnotes Modified: python/branches/py3k/Doc/library/getopt.rst ============================================================================== --- python/branches/py3k/Doc/library/getopt.rst (original) +++ python/branches/py3k/Doc/library/getopt.rst Sun May 17 15:00:36 2009 @@ -1,10 +1,9 @@ - :mod:`getopt` --- Parser for command line options ================================================= .. module:: getopt - :synopsis: Portable parser for command line options; support both short and long option - names. + :synopsis: Portable parser for command line options; support both short and + long option names. This module helps scripts to parse the command line arguments in ``sys.argv``. @@ -20,27 +19,27 @@ exception: -.. function:: getopt(args, options[, long_options]) +.. function:: getopt(args, shortopts, longopts=[]) Parses command line options and parameter list. *args* is the argument list to be parsed, without the leading reference to the running program. Typically, this - means ``sys.argv[1:]``. *options* is the string of option letters that the + means ``sys.argv[1:]``. *shortopts* is the string of option letters that the script wants to recognize, with options that require an argument followed by a colon (``':'``; i.e., the same format that Unix :cfunc:`getopt` uses). .. note:: - Unlike GNU :cfunc:`getopt`, after a non-option argument, all further arguments - are considered also non-options. This is similar to the way non-GNU Unix systems - work. + Unlike GNU :cfunc:`getopt`, after a non-option argument, all further + arguments are considered also non-options. This is similar to the way + non-GNU Unix systems work. - *long_options*, if specified, must be a list of strings with the names of the + *longopts*, if specified, must be a list of strings with the names of the long options which should be supported. The leading ``'--'`` characters should not be included in the option name. Long options which require an argument should be followed by an equal sign (``'='``). To accept only long - options, *options* should be an empty string. Long options on the command line + options, *shortopts* should be an empty string. Long options on the command line can be recognized so long as they provide a prefix of the option name that - matches exactly one of the accepted options. For example, if *long_options* is + matches exactly one of the accepted options. For example, if *longopts* is ``['foo', 'frob']``, the option :option:`--fo` will match as :option:`--foo`, but :option:`--f` will not match uniquely, so :exc:`GetoptError` will be raised. @@ -55,7 +54,7 @@ allowing multiple occurrences. Long and short options may be mixed. -.. function:: gnu_getopt(args, options[, long_options]) +.. function:: gnu_getopt(args, shortopts, longopts=[]) This function works like :func:`getopt`, except that GNU style scanning mode is used by default. This means that option and non-option arguments may be Modified: python/branches/py3k/Doc/library/getpass.rst ============================================================================== --- python/branches/py3k/Doc/library/getpass.rst (original) +++ python/branches/py3k/Doc/library/getpass.rst Sun May 17 15:00:36 2009 @@ -10,7 +10,7 @@ The :mod:`getpass` module provides two functions: -.. function:: getpass([prompt[, stream]]) +.. function:: getpass(prompt='Password: ', stream=None) Prompt the user for a password without echoing. The user is prompted using the string *prompt*, which defaults to ``'Password: '``. On Unix, the prompt Modified: python/branches/py3k/Doc/library/gettext.rst ============================================================================== --- python/branches/py3k/Doc/library/gettext.rst (original) +++ python/branches/py3k/Doc/library/gettext.rst Sun May 17 15:00:36 2009 @@ -1,4 +1,3 @@ - :mod:`gettext` --- Multilingual internationalization services ============================================================= @@ -31,7 +30,7 @@ class-based API instead. -.. function:: bindtextdomain(domain[, localedir]) +.. function:: bindtextdomain(domain, localedir=None) Bind the *domain* to the locale directory *localedir*. More concretely, :mod:`gettext` will look for binary :file:`.mo` files for the given domain using @@ -43,14 +42,14 @@ returned. [#]_ -.. function:: bind_textdomain_codeset(domain[, codeset]) +.. function:: bind_textdomain_codeset(domain, codeset=None) Bind the *domain* to *codeset*, changing the encoding of strings returned by the :func:`gettext` family of functions. If *codeset* is omitted, then the current binding is returned. -.. function:: textdomain([domain]) +.. function:: textdomain(domain=None) Change or query the current global domain. If *domain* is ``None``, then the current global domain is returned, otherwise the global domain is set to @@ -141,7 +140,7 @@ :func:`_`. -.. function:: find(domain[, localedir[, languages[, all]]]) +.. 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 @@ -159,7 +158,7 @@ :func:`find` then expands and normalizes the languages, and then iterates through them, searching for an existing file built of these components: - :file:`localedir/language/LC_MESSAGES/domain.mo` + :file:`{localedir}/{language}/LC_MESSAGES/{domain}.mo` The first such file name that exists is returned by :func:`find`. If no such file is found, then ``None`` is returned. If *all* is given, it returns a list @@ -167,7 +166,7 @@ the environment variables. -.. function:: translation(domain[, localedir[, languages[, class_[, fallback[, codeset]]]]]) +.. function:: translation(domain, localedir=None, languages=None, class_=None, fallback=False, codeset=None) 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 @@ -188,7 +187,7 @@ :class:`NullTranslations` instance if *fallback* is true. -.. function:: install(domain[, localedir[, codeset[, names]]]]) +.. function:: install(domain, localedir=None, codeset=None, names=None) This installs the function :func:`_` in Python's builtin namespace, based on *domain*, *localedir*, and *codeset* which are passed to the function @@ -218,7 +217,7 @@ are the methods of :class:`NullTranslations`: -.. class:: NullTranslations([fp]) +.. class:: NullTranslations(fp=None) Takes an optional file object *fp*, which is ignored by the base class. Initializes "protected" instance variables *_info* and *_charset* which are set @@ -289,7 +288,7 @@ encoding used to return translated messages. - .. method:: install([names]) + .. method:: install(names=None) This method installs :meth:`self.gettext` into the built-in namespace, binding it to ``_``. Modified: python/branches/py3k/Doc/library/glob.rst ============================================================================== --- python/branches/py3k/Doc/library/glob.rst (original) +++ python/branches/py3k/Doc/library/glob.rst Sun May 17 15:00:36 2009 @@ -1,4 +1,3 @@ - :mod:`glob` --- Unix style pathname pattern expansion ===================================================== Modified: python/branches/py3k/Doc/library/grp.rst ============================================================================== --- python/branches/py3k/Doc/library/grp.rst (original) +++ python/branches/py3k/Doc/library/grp.rst Sun May 17 15:00:36 2009 @@ -1,4 +1,3 @@ - :mod:`grp` --- The group database ================================= Modified: python/branches/py3k/Doc/library/gzip.rst ============================================================================== --- python/branches/py3k/Doc/library/gzip.rst (original) +++ python/branches/py3k/Doc/library/gzip.rst Sun May 17 15:00:36 2009 @@ -24,7 +24,7 @@ The module defines the following items: -.. class:: GzipFile([filename[, mode[, compresslevel[, fileobj[, mtime]]]]]) +.. class:: GzipFile(filename=None, mode=None, compresslevel=9, fileobj=None, mtime=None) Constructor for the :class:`GzipFile` class, which simulates most of the methods of a file object, with the exception of the :meth:`readinto` and @@ -73,7 +73,7 @@ Support for the :keyword:`with` statement was added. -.. function:: open(filename[, mode[, compresslevel]]) +.. function:: open(filename, mode='rb', compresslevel=9) This is a shorthand for ``GzipFile(filename,`` ``mode,`` ``compresslevel)``. The *filename* argument is required; *mode* defaults to ``'rb'`` and Modified: python/branches/py3k/Doc/library/hashlib.rst ============================================================================== --- python/branches/py3k/Doc/library/hashlib.rst (original) +++ python/branches/py3k/Doc/library/hashlib.rst Sun May 17 15:00:36 2009 @@ -1,4 +1,3 @@ - :mod:`hashlib` --- Secure hashes and message digests ==================================================== Modified: python/branches/py3k/Doc/library/heapq.rst ============================================================================== --- python/branches/py3k/Doc/library/heapq.rst (original) +++ python/branches/py3k/Doc/library/heapq.rst Sun May 17 15:00:36 2009 @@ -115,7 +115,7 @@ streams is already sorted (smallest to largest). -.. function:: nlargest(n, iterable[, key]) +.. function:: nlargest(n, iterable, key=None) Return a list with the *n* largest elements from the dataset defined by *iterable*. *key*, if provided, specifies a function of one argument that is @@ -124,7 +124,7 @@ reverse=True)[:n]`` -.. function:: nsmallest(n, iterable[, key]) +.. function:: nsmallest(n, iterable, key=None) Return a list with the *n* smallest elements from the dataset defined by *iterable*. *key*, if provided, specifies a function of one argument that is Modified: python/branches/py3k/Doc/library/hmac.rst ============================================================================== --- python/branches/py3k/Doc/library/hmac.rst (original) +++ python/branches/py3k/Doc/library/hmac.rst Sun May 17 15:00:36 2009 @@ -1,4 +1,3 @@ - :mod:`hmac` --- Keyed-Hashing for Message Authentication ======================================================== @@ -11,7 +10,7 @@ This module implements the HMAC algorithm as described by :rfc:`2104`. -.. function:: new(key[, msg[, digestmod]]) +.. function:: new(key, msg=None, digestmod=None) Return a new hmac object. If *msg* is present, the method call ``update(msg)`` is made. *digestmod* is the digest constructor or module for the HMAC object to Modified: python/branches/py3k/Doc/library/http.client.rst ============================================================================== --- python/branches/py3k/Doc/library/http.client.rst (original) +++ python/branches/py3k/Doc/library/http.client.rst Sun May 17 15:00:36 2009 @@ -23,7 +23,7 @@ The module provides the following classes: -.. class:: HTTPConnection(host[, port[, strict[, timeout]]]) +.. class:: HTTPConnection(host, port=None, strict=None[, timeout]) An :class:`HTTPConnection` instance represents one transaction with an HTTP server. It should be instantiated passing it a host and optional port @@ -45,7 +45,7 @@ >>> h3 = http.client.HTTPConnection('www.cwi.nl', 80, timeout=10) -.. class:: HTTPSConnection(host[, port[, key_file[, cert_file[, strict[, timeout]]]]]) +.. class:: HTTPSConnection(host, port=None, key_file=None, cert_file=None, strict=None[, timeout]) A subclass of :class:`HTTPConnection` that uses SSL for communication with secure servers. Default port is ``443``. *key_file* is the name of a PEM @@ -57,7 +57,7 @@ This does not do any certificate verification. -.. class:: HTTPResponse(sock[, debuglevel=0][, strict=0]) +.. class:: HTTPResponse(sock, debuglevel=0, strict=0, method=None, url=None) Class whose instances are returned upon successful connection. Not instantiated directly by user. @@ -349,7 +349,7 @@ :class:`HTTPConnection` instances have the following methods: -.. method:: HTTPConnection.request(method, url[, body[, headers]]) +.. method:: HTTPConnection.request(method, url, body=None, headers={}) This will send a request to the server using the HTTP request method *method* and the selector *url*. If the *body* argument is @@ -398,7 +398,7 @@ also send your request step by step, by using the four functions below. -.. method:: HTTPConnection.putrequest(request, selector[, skip_host[, skip_accept_encoding]]) +.. method:: HTTPConnection.putrequest(request, selector, skip_host=False, skip_accept_encoding=False) This should be the first call after the connection to the server has been made. It sends a line to the server consisting of the *request* string, the *selector* @@ -444,7 +444,7 @@ Reads and returns the response body, or up to the next *amt* bytes. -.. method:: HTTPResponse.getheader(name[, default]) +.. method:: HTTPResponse.getheader(name, default=None) Get the contents of the header *name*, or *default* if there is no matching header. Modified: python/branches/py3k/Doc/library/http.cookies.rst ============================================================================== --- python/branches/py3k/Doc/library/http.cookies.rst (original) +++ python/branches/py3k/Doc/library/http.cookies.rst Sun May 17 15:00:36 2009 @@ -78,7 +78,7 @@ :meth:`value_decode` are inverses on the range of *value_decode*. -.. method:: BaseCookie.output([attrs[, header[, sep]]]) +.. method:: BaseCookie.output(attrs=None, header='Set-Cookie:', sep='\\r\\n') Return a string representation suitable to be sent as HTTP headers. *attrs* and *header* are sent to each :class:`Morsel`'s :meth:`output` method. *sep* is used @@ -86,7 +86,7 @@ (CRLF). -.. method:: BaseCookie.js_output([attrs]) +.. method:: BaseCookie.js_output(attrs=None) Return an embeddable JavaScript snippet, which, if run on a browser which supports JavaScript, will act the same as if the HTTP headers was sent. @@ -157,7 +157,7 @@ Whether *K* is a member of the set of keys of a :class:`Morsel`. -.. method:: Morsel.output([attrs[, header]]) +.. method:: Morsel.output(attrs=None, header='Set-Cookie:') Return a string representation of the Morsel, suitable to be sent as an HTTP header. By default, all the attributes are included, unless *attrs* is given, in @@ -165,7 +165,7 @@ ``"Set-Cookie:"``. -.. method:: Morsel.js_output([attrs]) +.. method:: Morsel.js_output(attrs=None) Return an embeddable JavaScript snippet, which, if run on a browser which supports JavaScript, will act the same as if the HTTP header was sent. @@ -173,7 +173,7 @@ The meaning for *attrs* is the same as in :meth:`output`. -.. method:: Morsel.OutputString([attrs]) +.. method:: Morsel.OutputString(attrs=None) Return a string representing the Morsel, without any surrounding HTTP or JavaScript. Modified: python/branches/py3k/Doc/library/http.server.rst ============================================================================== --- python/branches/py3k/Doc/library/http.server.rst (original) +++ python/branches/py3k/Doc/library/http.server.rst Sun May 17 15:00:36 2009 @@ -155,14 +155,14 @@ This method will parse and dispatch the request to the appropriate :meth:`do_\*` method. You should never need to override it. - .. method:: send_error(code[, message]) + .. method:: send_error(code, message=None) Sends and logs a complete error reply to the client. The numeric *code* specifies the HTTP error code, with *message* as optional, more specific text. A complete set of headers is sent, followed by text composed using the :attr:`error_message_format` class variable. - .. method:: send_response(code[, message]) + .. method:: send_response(code, message=None) Sends a response header and logs the accepted request. The HTTP response line is sent, followed by *Server* and *Date* headers. The values for @@ -179,7 +179,7 @@ Sends a blank line, indicating the end of the HTTP headers in the response. - .. method:: log_request([code[, size]]) + .. method:: log_request(code='-', size='-') Logs an accepted (successful) request. *code* should specify the numeric HTTP code associated with the response. If a size of the response is @@ -205,11 +205,11 @@ Returns the server software's version string. This is a combination of the :attr:`server_version` and :attr:`sys_version` class variables. - .. method:: date_time_string([timestamp]) + .. method:: date_time_string(timestamp=None) - Returns the date and time given by *timestamp* (which must be in the - format returned by :func:`time.time`), formatted for a message header. If - *timestamp* is omitted, it uses the current date and time. + Returns the date and time given by *timestamp* (which must be None or in + the format returned by :func:`time.time`), formatted for a message + header. If *timestamp* is omitted, it uses the current date and time. The result looks like ``'Sun, 06 Nov 1994 08:49:37 GMT'``. Modified: python/branches/py3k/Doc/library/i18n.rst ============================================================================== --- python/branches/py3k/Doc/library/i18n.rst (original) +++ python/branches/py3k/Doc/library/i18n.rst Sun May 17 15:00:36 2009 @@ -1,4 +1,3 @@ - .. _i18n: ******************** From buildbot at python.org Sun May 17 15:35:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 13:35:50 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian trunk Message-ID: <20090517133550.C696FD5BA@mail.python.org> The Buildbot has detected a new failure of alpha Debian trunk. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%20Debian%20trunk/builds/0 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-alpha Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_builtin ====================================================================== FAIL: test_intern (test.test_builtin.BuiltinTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/test/test_builtin.py", line 650, in test_intern self.assert_(intern(s) is s) AssertionError: False is not True ====================================================================== FAIL: test_round (test.test_builtin.BuiltinTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/doko/buildarea/trunk.klose-debian-alpha/build/Lib/test/test_builtin.py", line 1228, in test_round self.assertEqual(round(5e15+1), 5e15+1) AssertionError: 5000000000000000.0 != 5000000000000001.0 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun May 17 16:16:29 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 17 May 2009 16:16:29 +0200 (CEST) Subject: [Python-checkins] r72745 - python/trunk/Doc/conf.py Message-ID: <20090517141629.9A5F1D399@mail.python.org> Author: benjamin.peterson Date: Sun May 17 16:16:29 2009 New Revision: 72745 Log: ignore .rst files in sphinx its self Modified: python/trunk/Doc/conf.py Modified: python/trunk/Doc/conf.py ============================================================================== --- python/trunk/Doc/conf.py (original) +++ python/trunk/Doc/conf.py Sun May 17 16:16:29 2009 @@ -46,6 +46,9 @@ 'library/xml.etree', ] +# Ignore .rst in Sphinx its self. +exclude_trees = ['tools/sphinx/'] + # Relative filename of the reference count data file. refcount_file = 'data/refcounts.dat' From python-checkins at python.org Sun May 17 16:59:05 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 16:59:05 +0200 (CEST) Subject: [Python-checkins] r72746 - python/trunk/Lib/distutils/tests/test_archive_util.py Message-ID: <20090517145905.BD60BD437@mail.python.org> Author: tarek.ziade Date: Sun May 17 16:59:05 2009 New Revision: 72746 Log: fixed the test name Modified: python/trunk/Lib/distutils/tests/test_archive_util.py Modified: python/trunk/Lib/distutils/tests/test_archive_util.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_archive_util.py (original) +++ python/trunk/Lib/distutils/tests/test_archive_util.py Sun May 17 16:59:05 2009 @@ -1,5 +1,5 @@ """Tests for distutils.archive_util.""" -__revision__ = "$Id:$" +__revision__ = "$Id$" import unittest import os @@ -40,7 +40,7 @@ self.assert_(os.path.exists(tarball)) @unittest.skipUnless(ZIP_SUPPORT, 'Need zip support to run') - def test_make_tarball(self): + def test_make_zipfile(self): # creating something to tar tmpdir = self.mkdtemp() self.write_file([tmpdir, 'file1'], 'xxx') From python-checkins at python.org Sun May 17 17:00:36 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 17:00:36 +0200 (CEST) Subject: [Python-checkins] r72747 - python/branches/release26-maint Message-ID: <20090517150036.8FC86D735@mail.python.org> Author: tarek.ziade Date: Sun May 17 17:00:36 2009 New Revision: 72747 Log: Blocked revisions 72746 via svnmerge ........ r72746 | tarek.ziade | 2009-05-17 16:59:05 +0200 (Sun, 17 May 2009) | 1 line fixed the test name ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Sun May 17 17:03:23 2009 From: python-checkins at python.org (tarek.ziade) Date: Sun, 17 May 2009 17:03:23 +0200 (CEST) Subject: [Python-checkins] r72748 - in python/branches/py3k: Lib/distutils/tests/test_archive_util.py Message-ID: <20090517150323.C0B85D486@mail.python.org> Author: tarek.ziade Date: Sun May 17 17:03:23 2009 New Revision: 72748 Log: Merged revisions 72746 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72746 | tarek.ziade | 2009-05-17 16:59:05 +0200 (Sun, 17 May 2009) | 1 line fixed the test name ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_archive_util.py Modified: python/branches/py3k/Lib/distutils/tests/test_archive_util.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_archive_util.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_archive_util.py Sun May 17 17:03:23 2009 @@ -1,5 +1,5 @@ """Tests for distutils.archive_util.""" -__revision__ = "$Id:$" +__revision__ = "$Id$" import unittest import os @@ -40,7 +40,7 @@ self.assert_(os.path.exists(tarball)) @unittest.skipUnless(ZIP_SUPPORT, 'Need zip support to run') - def test_make_tarball(self): + def test_make_zipfile(self): # creating something to tar tmpdir = self.mkdtemp() self.write_file([tmpdir, 'file1'], 'xxx') From buildbot at python.org Sun May 17 17:42:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 15:42:07 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090517154207.E314ED278@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/371 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_distutils test_posix ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 45, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/Include ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sun May 17 18:29:25 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 17 May 2009 18:29:25 +0200 (CEST) Subject: [Python-checkins] r72749 - peps/trunk/pep-0383.txt Message-ID: <20090517162925.0D720D605@mail.python.org> Author: martin.v.loewis Date: Sun May 17 18:29:24 2009 New Revision: 72749 Log: Mark PEP as final. Modified: peps/trunk/pep-0383.txt Modified: peps/trunk/pep-0383.txt ============================================================================== --- peps/trunk/pep-0383.txt (original) +++ peps/trunk/pep-0383.txt Sun May 17 18:29:24 2009 @@ -3,7 +3,7 @@ Version: $Revision$ Last-Modified: $Date$ Author: Martin v. L?wis -Status: Accepted +Status: Final Type: Standards Track Content-Type: text/x-rst Created: 22-Apr-2009 From buildbot at python.org Sun May 17 18:53:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 16:53:07 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090517165307.C0236C493@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/765 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl,mark.dickinson,ronald.oussoren,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_ssl make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun May 17 18:59:27 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 17 May 2009 18:59:27 +0200 (CEST) Subject: [Python-checkins] r72750 - python/trunk/Doc/conf.py Message-ID: <20090517165927.534C8D72B@mail.python.org> Author: benjamin.peterson Date: Sun May 17 18:59:27 2009 New Revision: 72750 Log: chop off slash Modified: python/trunk/Doc/conf.py Modified: python/trunk/Doc/conf.py ============================================================================== --- python/trunk/Doc/conf.py (original) +++ python/trunk/Doc/conf.py Sun May 17 18:59:27 2009 @@ -47,7 +47,7 @@ ] # Ignore .rst in Sphinx its self. -exclude_trees = ['tools/sphinx/'] +exclude_trees = ['tools/sphinx'] # Relative filename of the reference count data file. refcount_file = 'data/refcounts.dat' From python-checkins at python.org Sun May 17 19:32:22 2009 From: python-checkins at python.org (robert.schuppenies) Date: Sun, 17 May 2009 19:32:22 +0200 (CEST) Subject: [Python-checkins] r72751 - in python/branches/py3k/Lib: _weakrefset.py test/test_weakset.py Message-ID: <20090517173222.1B7BFD508@mail.python.org> Author: robert.schuppenies Date: Sun May 17 19:32:20 2009 New Revision: 72751 Log: Issue 5964: Fixed WeakSet __eq__ comparison to handle non-WeakSet objects. Modified: python/branches/py3k/Lib/_weakrefset.py python/branches/py3k/Lib/test/test_weakset.py Modified: python/branches/py3k/Lib/_weakrefset.py ============================================================================== --- python/branches/py3k/Lib/_weakrefset.py (original) +++ python/branches/py3k/Lib/_weakrefset.py Sun May 17 19:32:20 2009 @@ -118,6 +118,8 @@ return self.data >= set(ref(item) for item in other) def __eq__(self, other): + if not isinstance(other, self.__class__): + return NotImplemented return self.data == set(ref(item) for item in other) def symmetric_difference(self, other): Modified: python/branches/py3k/Lib/test/test_weakset.py ============================================================================== --- python/branches/py3k/Lib/test/test_weakset.py (original) +++ python/branches/py3k/Lib/test/test_weakset.py Sun May 17 19:32:20 2009 @@ -134,13 +134,11 @@ def test_gc(self): # Create a nest of cycles to exercise overall ref count check - class A: - pass - s = set(A() for i in range(1000)) + s = WeakSet(Foo() for i in range(1000)) for elem in s: elem.cycle = s elem.sub = elem - elem.set = set([elem]) + elem.set = WeakSet([elem]) def test_subclass_with_custom_hash(self): # Bug #1257731 @@ -169,17 +167,12 @@ t = WeakSet(s) self.assertNotEqual(id(s), id(t)) - def test_set_literal(self): - s = set([1,2,3]) - t = {1,2,3} - self.assertEqual(s, t) - def test_hash(self): self.assertRaises(TypeError, hash, self.s) def test_clear(self): self.s.clear() - self.assertEqual(self.s, set()) + self.assertEqual(self.s, WeakSet([])) self.assertEqual(len(self.s), 0) def test_copy(self): @@ -304,6 +297,16 @@ t ^= t self.assertEqual(t, WeakSet()) + def test_eq(self): + # issue 5964 + self.assertTrue(self.s == self.s) + self.assertTrue(self.s == WeakSet(self.items)) + self.assertFalse(self.s == set(self.items)) + self.assertFalse(self.s == list(self.items)) + self.assertFalse(self.s == tuple(self.items)) + self.assertFalse(self.s == WeakSet([Foo])) + self.assertFalse(self.s == 1) + def test_main(verbose=None): support.run_unittest(TestWeakSet) From buildbot at python.org Sun May 17 20:03:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 18:03:40 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090517180340.D2843D2A8@mail.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/586 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.dickinson,ronald.oussoren,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_distutils ====================================================================== FAIL: test_ensure_relative (distutils.tests.test_dir_util.DirUtilTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\distutils\tests\test_dir_util.py", line 91, in test_ensure_relative self.assertEquals(ensure_relative('c:\\home\\foo'), 'home\\foo') AssertionError: 'c:home\\foo' != 'home\\foo' sincerely, -The Buildbot From buildbot at python.org Sun May 17 20:14:36 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 18:14:36 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090517181436.EB43CD720@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/534 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/threading.py", line 524, in __bootstrap_inner self.run() File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/bsddb/test/test_thread.py", line 306, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/bsddb/dbutils.py", line 68, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30994, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sun May 17 20:33:52 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 17 May 2009 20:33:52 +0200 (CEST) Subject: [Python-checkins] r72752 - peps/trunk/pep-0384.txt Message-ID: <20090517183352.6175AD507@mail.python.org> Author: martin.v.loewis Date: Sun May 17 20:33:52 2009 New Revision: 72752 Log: Add new PEP. Added: peps/trunk/pep-0384.txt (contents, props changed) Added: peps/trunk/pep-0384.txt ============================================================================== --- (empty file) +++ peps/trunk/pep-0384.txt Sun May 17 20:33:52 2009 @@ -0,0 +1,254 @@ +PEP: 384 +Title: Defining a Stable ABI +Version: $Revision$ +Last-Modified: $Date$ +Author: Martin v. L?wis +Status: Draft +Type: Standards Track +Content-Type: text/x-rst +Created: 17-May-2009 +Python-Version: 3.2 +Post-History: + +Abstract +======== + +Currently, each feature release introduces a new name for the +Python DLL on Windows, and may cause incompatibilities for extension +modules on Unix. This PEP proposes to define a stable set of API +functions which are guaranteed to be available for the lifetime +of Python 3, and which will also remain binary-compatible across +versions. Extension modules and applications embedding Python +can work with different feature releases as long as they restrict +themselves to this stable ABI. + +Rationale +========= + +The primary source of ABI incompatibility are changes to the lay-out +of in-memory structures. For example, the way in which string interning +works, or the data type used to represent the size of an object, have +changed during the life of Python 2.x. As a consequence, extension +modules making direct access to fields of strings, lists, or tuples, +would break if their code is loaded into a newer version of the +interpreter without recompilation: offsets of other fields may have +changed, making the extension modules access the wrong data. + +In some cases, the incompatibilities only affect internal objects of +the interpreter, such as frame or code objects. For example, the way +line numbers are represented has changed in the 2.x lifetime, as has +the way in which local variables are stored (due to the introduction +of closures). Even though most applications probably never used these +objects, changing them had required to change the PYTHON_API_VERSION. + +On Linux, changes to the ABI are often not much of a problem: the +system will provide a default Python installation, and many extension +modules are already provided pre-compiled for that version. If additional +modules are needed, or additional Python versions, users can typically +compile them themselves on the system, resulting in modules that use +the right ABI. + +On Windows, multiple simultaneous installations of different Python +versions are common, and extension modules are compiled by their +authors, not by end users. To reduce the risk of ABI incompatibilities, +Python currently introduces a new DLL name pythonXY.dll for each +feature release, whether or not ABI incompatibilities actually exist. + +With this PEP, it will be possible to reduce the dependency of binary +extension modules on a specific Python feature release, and applications +embedding Python can be made work with different releases. + +Specification +============= + +The ABI specification falls into two parts: an API specification, +specifying what function (groups) are available for use with the +ABI, and a linkage specification specifying what libraries to link +with. The actual ABI (layout of structures in memory, function +calling conventions) is not specified, but implied by the +compiler. As a recommendation, a specific ABI is recommended for +selected platforms. + +During evolution of Python, new ABI functions will be added. +Applications using them will then have a requirement on a minimum +version of Python; this PEP provides no mechanism for such +applications to fall back when the Python library is too old. + +Terminology +----------- + +Applications and extension modules that want to use this ABI +are collectively referred to as "applications" from here on. + +Header Files and Preprocessor Definitions +----------------------------------------- + +Applications shall only include the header file Python.h (before +including any system headers), or, optionally, include pyconfig.h, and +then Python.h. + +During the compilation of applications, the preprocessor macro +Py_LIMITED_API must be defined. Doing so will hide all definitions +that are not part of the ABI. + +Structures +---------- + +Only the following structures and structure fields are accessible to +applications: + +- PyObject (ob_refcnt, ob_type) +- PyVarObject (ob_base, ob_size) +- Py_buffer (buf, obj, len, itemsize, readonly, ndim, shape, + strides, suboffsets, smalltable, internal) +- PyMethodDef (ml_name, ml_meth, ml_flags, ml_doc) +- PyMemberDef (name, type, offset, flags, doc) +- PyGetSetDef (name, get, set, doc, closure) + +The accessor macros to these fields (Py_REFCNT, Py_TYPE, Py_SIZE) +are also available to applications. + +The following types are available, but opaque (i.e. incomplete): + +- PyThreadState +- PyInterpreterState + +Type Objects +------------ + +The structure of type objects is not available to applications; +declaration of "static" type objects is not possible anymore +(for applications using this ABI). +Instead, type objects get created dynamically. To allow an +easy creation of types (in particular, to be able to fill out +function pointers easily), the following structures and functions +are available:: + + typedef struct{ + int slot; /* slot id, see below */ + void *pfunc; /* function pointer */ + } PyType_Slot; + + struct{ + const char* name; + const char* doc; + int basicsize; + int itemsize; + int flags; + PyType_Slot *slots; /* terminated by slot==0. */ + } PyType_Spec; + + PyObject* PyType_FromSpec(PyType_Spec*); + +To specify a slot, a unique slot id must be provided. New Python +versions may introduce new slot ids, but slot ids will never be +recycled. Slots may get deprecated, but continue to be supported +throughout Python 3.x. + +The slot ids are named like the field names of the structures that +hold the pointers in Python 3.1, with an added ``Py_`` prefix (i.e. +Py_tp_dealloc instead of just tp_dealloc): + +- tp_dealloc, tp_print, tp_getattr, tp_setattr, tp_repr, + tp_hash, tp_call, tp_str, tp_getattro, tp_setattro, + tp_doc, tp_traverse, tp_clear, tp_richcompare, tp_iter, + tp_iternext, tp_methods, tp_base, tp_descr_set, tp_descr_set, + tp_init, tp_alloc, tp_new, tp_is_gc, tp_bases, tp_del +- nb_add nb_subtract nb_multiply nb_remainder nb_divmod nb_power + nb_negative nb_positive nb_absolute nb_bool nb_invert nb_lshift + nb_rshift nb_and nb_xor nb_or nb_int nb_float nb_inplace_add + nb_inplace_subtract nb_inplace_multiply nb_inplace_remainder + nb_inplace_power nb_inplace_lshift nb_inplace_rshift nb_inplace_and + nb_inplace_xor nb_inplace_or nb_floor_divide nb_true_divide + nb_inplace_floor_divide nb_inplace_true_divide nb_index +- sq_length sq_concat sq_repeat sq_item sq_ass_item was_sq_ass_slice + sq_contains sq_inplace_concat sq_inplace_repeat +- mp_length mp_subscript mp_ass_subscript +- bf_getbuffer bf_releasebuffer + +XXX Not supported yet: tp_weaklistoffset, tp_dictoffset + +The following fields cannot be set during type definition: +- tp_dict tp_mro tp_cache tp_subclasses tp_weaklist + +Functions and function-like Macros +---------------------------------- + +All functions starting with _Py are not available to applications. +Also, all functions that expect parameter types that are unavailable +to applications are excluded from the ABI, such as PyAST_FromNode +(which expects a ``node*``). + +All other functions are available, unless excluded below. + +Function-like macros (in particular, field access macros) remain +available to applications, but get replaced by function calls +(unless their definition only refers to features of the ABI, such +as the various _Check macros) + +ABI function declarations will not change their parameters or return +types. If a change to the signature becomes necessary, a new function +will be introduced. If the new function is source-compatible (e.g. if +just the return type changes), an alias macro may get added to +redirect calls to the new function when the applications is +recompiled. + +If continued provision of the old function is not possible, it may get +deprecated, then removed, in accordance with PEP 7, causing +applications that use that function to break. + +Excluded Functions +------------------ + +Functions declared in the following header files are not part +of the ABI: +- cellobject.h +- classobject.h +- code.h +- frameobject.h +- funcobject.h +- genobject.h +- pyarena.h +- pydebug.h +- symtable.h +- token.h +- traceback.h + +Global Variables +---------------- + +Global variables representing types and exceptions are available +to applications. +XXX provide a complete list. + +XXX should restrict list of globals to truly "builtin" stuff, +excluding everything that can also be looked up through imports. + +XXX may specify access to predefined types and exceptions through +the interpreter state, with appropriate Get macros. + +Other Macros +------------ + +All macros defining symbolic constants are available to applications; +the numeric values will not change. + +In addition, the following macros are available: + +- Py_BEGIN_ALLOW_THREADS, Py_BLOCK_THREADS, Py_UNBLOCK_THREADS, + Py_END_ALLOW_THREADS + +Copyright +========= + +This document has been placed in the public domain. + + +.. + Local Variables: + mode: indented-text + indent-tabs-mode: nil + sentence-end-double-space: t + fill-column: 70 + coding: utf-8 + End: From python-checkins at python.org Sun May 17 20:40:57 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 17 May 2009 20:40:57 +0200 (CEST) Subject: [Python-checkins] r72753 - peps/trunk/pep-0384.txt Message-ID: <20090517184057.B1330D84B@mail.python.org> Author: martin.v.loewis Date: Sun May 17 20:40:57 2009 New Revision: 72753 Log: Add keywords property. Modified: peps/trunk/pep-0384.txt (props changed) From python-checkins at python.org Sun May 17 21:14:52 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 17 May 2009 21:14:52 +0200 (CEST) Subject: [Python-checkins] r72754 - peps/trunk/pep-0384.txt Message-ID: <20090517191452.ACADFD7DA@mail.python.org> Author: martin.v.loewis Date: Sun May 17 21:14:52 2009 New Revision: 72754 Log: Add linkage and implementation sections. Modified: peps/trunk/pep-0384.txt Modified: peps/trunk/pep-0384.txt ============================================================================== --- peps/trunk/pep-0384.txt (original) +++ peps/trunk/pep-0384.txt Sun May 17 21:14:52 2009 @@ -238,6 +238,39 @@ - Py_BEGIN_ALLOW_THREADS, Py_BLOCK_THREADS, Py_UNBLOCK_THREADS, Py_END_ALLOW_THREADS +Linkage +------- + +On Windows, applications shall link with python3.dll; an import +library python3.lib will be available. This DLL will redirect all of +its API functions through /export linker options to the full +interpreter DLL, i.e. python3y.dll. + +XXX is it possible to redirect global variables in the same way? +If not, python3.dll would have to copy them, and we should verify +that all available global variables are read-only. + +On Unix systems, the ABI is typically provided by the python +executable itself. PyModule_Create is changed to pass ``3`` as the API +version if the extension module was compiled with Py_LIMITED_API; the +version check for the API version will accept either 3 or the current +PYTHON_API_VERSION as conforming. If Python is compiled as a shared +library, it is installed as both libpython3.so, and libpython3.y.so; +applications conforming to this PEP should then link to the former. + +XXX is it possible to make the soname libpython.so.3, and still +have some applications link to libpython3.y.so? + +Implementation Strategy +======================= + +This PEP will be implemented in a branch, allowing users to check +whether their modules conform to the ABI. To simplify this testing, an +additional macro Py_LIMITED_API_WITH_TYPES will expose the existing +type object layout, to let users postpone rewriting all types. When +the this branch is merged into the 3.2 code base, this macro will +be removed. + Copyright ========= From buildbot at python.org Sun May 17 21:18:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 19:18:00 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090517191800.9AF0AD3C4@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%202.6/builds/350 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_compiler test_importhooks ====================================================================== ERROR: testImpWrapper (test.test_importhooks.ImportHooksTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/test_importhooks.py", line 251, in testImpWrapper m = __import__(mname, globals(), locals(), ["__dummy__"]) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/test_importhooks.py", line 132, in load_module mod = imp.load_module(fullname, self.file, self.filename, self.stuff) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/compiler/__init__.py", line 29, in from compiler.pycodegen import compile, compileFile File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/test/test_importhooks.py", line 132, in load_module mod = imp.load_module(fullname, self.file, self.filename, self.stuff) File "/home/pybot/buildarea/2.6.klose-debian-ia64/build/Lib/compiler/pycodegen.py", line 1519, in ast.Getattr: AugGetattr, AttributeError: 'module' object has no attribute 'Getattr' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun May 17 21:54:12 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 19:54:12 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090517195412.CAF9ED516@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/706 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_import test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Sun May 17 22:32:51 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 20:32:51 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090517203251.9ACEDD4F3@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/767 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: robert.schuppenies BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_codecencodings_jp ====================================================================== ERROR: test_chunkcoding (test.test_codecencodings_jp.Test_EUC_JP_COMPAT) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_multibytecodec_support.py", line 43, in test_chunkcoding self.assertEqual(u, utf8.decode('utf-8')) UnicodeDecodeError: 'utf8' codec can't decode bytes in position 151-153: invalid data ====================================================================== ERROR: test_incrementalencoder (test.test_codecencodings_jp.Test_EUC_JP_COMPAT) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_multibytecodec_support.py", line 167, in test_incrementalencoder data = istream.read() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/codecs.py", line 476, in read newchars, decodedbytes = self.decode(data, self.errors) UnicodeDecodeError: 'utf8' codec can't decode bytes in position 221-223: invalid data ====================================================================== ERROR: test_streamwriter (test.test_codecencodings_jp.Test_EUC_JP_COMPAT) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_multibytecodec_support.py", line 245, in test_streamwriter data = func() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/codecs.py", line 476, in read newchars, decodedbytes = self.decode(data, self.errors) UnicodeDecodeError: 'utf8' codec can't decode bytes in position 221-223: invalid data ====================================================================== FAIL: test_incrementaldecoder (test.test_codecencodings_jp.Test_EUC_JP_COMPAT) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_multibytecodec_support.py", line 191, in test_incrementaldecoder self.assertEqual(ostream.getvalue(), self.tstring[1]) AssertionError: b'Python \xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba\xe3\x81\xaf\xe3\x80\x811990 \xe5\xb9\xb4\xe3\x81\x94\xe3\x82\x8d\xe3\x81\x8b\xe3\x82\x89\xe9\x96\x8b\xe5\xa7\x8b\xe3\x81\x95\xe3\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x99\xe3\x80\x82\n\xe9\x96\x8b\xe7\x99\xba\xe8\x80\x85\xe3\x81\xae Guido van Rossum \xe3\x81\xaf\xe6\x95\x99\xe8\x82\xb2\xe7\x94\xa8\xe3\x81\xae\xe3\x83\x97\xe3\x83\xad\xe3\x82\xb0\xe3\x83\xa9\xe3\x83\x9f\xe3\x83\xb3\xe3\x82\xb0\xe8\xa8\x80\xe8\xaa\x9e\xe3\x80\x8cABC\xe3\x80\x8d\xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba\xe3\x81\xab\xe5\x8f\x82\xe5\x8a\xa0\xe3\x81\x97\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x97\xe3\x81\x9f\xe3\x81\x8c\xe3\x80\x81ABC \xe3\x81\xaf\xe5\xae\x9f\xe7\x94\xa8\xe4\xb8\x8a\xe3\x81\xae\xe7\x9b\xae\xe7\x9a\x84\xe3\x81\xab\xe3\x81\xaf\xe3\x81\x82\xe3\x81\xbe\xe3\x82\x8a\xe9\x81\xa9\xe3\x81\x97\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x9b\xe3\x82\x93\xe3\x81\xa7\xe3\x81\x97\xe3\x81\x9f\xe3\x80\x82\n\xe3\x81\x93\xe3\x81\xae\xe3\x81\x9f\xe3\x82\x81\xe3\x80\x81Guido \xe3\x81\xaf\xe3\x82\x88\xe3\x82\x8a\xe5\xae\x9f\xe7\x94\xa8\xe7\x9a\x84\xe3\x81\xaa\xe3\x83\x97\xe3\x83\xad\xe3\x82\xb0\xe3\x83\xa9\xe3\x83\x9f\xe3\x83\xb3\xe3\x82\xb0\xe8\xa8\x80\xe8\xaa\x9e\xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba\xe3\x82\x92\xe9\x96\x8b\xe5\xa7\x8b\xe3\x81\x97\xe3\x80\x81\xe8\x8b\xb1\xe5\x9b\xbd BBS \xe6\x94\xbe\xe9\x80\x81\xe3\x81\xae\xe3\x82\xb3\xe3\x83\xa1\xe3\x83\x87\xe3\x82\xa3\xe7\x95\xaa\xe7\xb5\x84\xe3\x80\x8c\xe3\x83\xa2\xe3\x83\xb3\xe3\x83\x86\xe3\x82\xa3 \xe3\x83\x91\xe3\x82\xa4\xe3\x82\xbd\xe3\x83\xb3\xe3\x80\x8d\xe3\x81\xae\xe3\x83\x95\xe3\x82\xa1\xe3\x83\xb3\xe3\x81\xa7\xe3\x81\x82\xe3\x82\x8b Guido \xe3\x81\xaf\xe3\x81\x93\xe3\x81\xae\xe8\xa8\x80\xe8\xaa\x9e\xe3\x82\x92\xe3\x80\x8cPython\xe3\x80\x8d\xe3\x81\xa8\xe5\x90\x8d\xe3\x81\xa5\xe3\x81\x91\xe3\x81\xbe\xe3\x81\x97\xe3\x81\x9f\xe3\x80\x82\n\xe3\x81\x93\xe3\x81\xae\xe3\x82\x88\xe3\x81\x86\xe3\x81\xaa\xe8\x83\x8c\xe6\x99\xaf\xe3\x81\x8b\xe3\x82\x89\xe7\x94\x9f\xe3\x81\xbe\xe3\x82\x8c\xe3\x81\x9f Python \xe3\x81\xae\xe8\xa8\x80\xe8\xaa\x9e\xe8\xa8\xad\xe8\xa8\x88\xe3\x81\xaf\xe3\x80\x81\xe3\x80\x8c\xe3\x82\xb7\xe3\x83\xb3\xe3\x83\x97\xe3\x83\xab\xe3\x80\x8d\xe3\x81\xa7\xe3\x80\x8c\xe7\xbf\x92\xe5\xbe\x97\xe3\x81\x8c\xe5\xae\xb9\xe6\x98\x93\xe3\x80\x8d\xe3\x81\xa8\xe3\x81\x84\xe3\x81\x86\xe7\x9b\xae\xe6\xa8\x99\xe3\x81\xab\xe9\x87\x8d\xe7\x82\xb9\xe3\x81\x8c\xe7\xbd\xae\xe3\x81\x8b\xe3\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x99\xe3\x80\x82\n\xe5\xa4\x9a\xe3\x81\x8f\xe3\x81\xae\xe3\x82\xb9\xe3\x82\xaf\xe3\x83\xaa\xe3\x83\x97\xe3\x83\x88\xe7\xb3\xbb\xe8\xa8\x80\xe8\xaa\x9e\xe3\x81\xa7\xe3\x81\xaf\xe3\x83\xa6\xe3\x83\xbc\xe3\x82\xb6\xe3\x81\xae\xe7\x9b\xae\xe5\x85\x88\xe3\x81\xae\xe5\x88\xa9\xe4\xbe\xbf\xe6\x80\xa7\xe3\x82\x92\xe5\x84\xaa\xe5\x85\x88\xe3\x81\x97\xe3\x81\xa6\xe8\x89\xb2\xe3\x80\x85\xe3\x81\xaa\xe6\xa9\x9f\xe8\x83\xbd\xe3\x82\x92\xe8\xa8\x80\xe8\xaa\x9e\xe8\xa6\x81\xe7\xb4\xa0\xe3\x81\xa8\xe3\x81\x97\xe3\x81\xa6\xe5\x8f\x96\xe3\x82\x8a\xe5\x85\xa5\xe3\x82\x8c\xe3\x82\x8b\xe5\xa0\xb4\xe5\x90\x88\xe3\x81\x8c\xe5\xa4\x9a\xe3\x81\x84\xe3\x81\xae\xe3\x81\xa7\xe3\x81\x99\xe3\x81\x8c\xe3\x80\x81Python \xe3\x81\xa7\xe3\x81\xaf\xe3\x81\x9d\xe3\x81\x86\xe3\x81\x84\xe3\x81\xa3\xe3\x81\x9f\xe5\xb0\x8f\xe7\xb4\xb0\xe5\xb7\xa5\xe3\x81\x8c\xe8\xbf\xbd\xe5\x8a\xa0\xe3\x81\x95\xe3\x82\x8c\xe3\x82\x8b\xe3\x81\x93\xe3\x81\xa8\xe3\x81\xaf\xe3\x81\x82\xe3\x81\xbe\xe3\x82\x8a\xe3\x81\x82\xe3\x82\x8a\xe3\x81\xbe\xe3\x81\x9b\xe3\x82\x93\xe3\x80\x82\n\xe8\xa8\x80\xe8\xaa\x9e\xe8\x87\xaa\xe4\xbd\x93\xe3\x81\xae\xe6\xa9\x9f\xe8\x83\xbd\xe3\x81\xaf\xe6\x9c\x80\xe5\xb0\x8f\xe9\x99\x90\xe3\x81\xab\xe6\x8a\xbc\xe3\x81\x95\xe3\x81\x88\xe3\x80\x81\xe5\xbf\x85\xe8\xa6\x81\xe3\x81\xaa\xe6\xa9\x9f\xe8\x83\xbd\xe3\x81\xaf\xe6\x8b\xa1\xe5\xbc\xb5\xe3\x83\xa2\xe3\x82\xb8\xe3\x83\xa5\xe3\x83\xbc\xe3\x83\xab\xe3\x81\xa8\xe3\x81\x97\xe3\x81\xa6\xe8\xbf\xbd\xe5\x8a\xa0\xe3\x81\x99\xe3\x82\x8b\xe3\x80\x81\xe3\x81\xa8\xe3\x81\x84\xe3\x81\x86\xe3\x81\xae\xe3\x81\x8c Python \xe3\x81\xae\xe3\x83\x9d\xe3\x83\xaa\xe3\x82\xb7\xe3\x83\xbc\xe3\x81\xa7\xe3\x81\x99\xe3\x80\x82\n\n' != b'Python \xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba\xe3\x81\xaf\xe3\x80\x811990 \xe5\xb9\xb4\xe3\x81\x94\xe3\x82\x8d\xe3\x81\x8b\xe3\x82\x89\xe9\x96\x8b\xe5\xa7\x8b\xe3\x81\x95\xe3\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x99\xe3\x80\x82\n\xe9\x96\x8b\xe7\x99\xba\xe8\x80\x85\xe3\x81\xae Guido van Rossum \xe3\x81\xaf\xe6\x95\x99\xe8\x82\xb2\xe7\x94\xa8\xe3\x81\xae\xe3\x83\x97\xe3\x83\xad\xe3\x82\xb0\xe3\x83\xa9\xe3\x83\x9f\xe3\x83\xb3\xe3\x82\xb0\xe8\xa8\x80\xe8\xaa\x9e\xe3\x80\x8cABC\xe3\x80\x8d\xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba\xe3\x81\xab\xe5\x8f\x82\xe5\x8a\xa0\xe3\x81\x97\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x97\xe3\x81\x9f\xe3\x81\x8c\xe3\x80\x81ABC \xe3\x81\xaf\xe5\xae\x9f\xe7\x94\xa8\xe4\xb8\x8a\xe3\x81\xae\xe7\x9b\xae\xe7\x9a\x84\xe3\x81\xab\xe3xe3\x81\x8c Python \xe3\x81\xae\xe3\x83\x9d\xe3\x83\xaa\xe3\x82\xb7\xe3\x83\xbc\xe3\x81\xa7\xe3\x81\x99\xe3\x80\x82\n\n' ====================================================================== FAIL: test_streamreader (test.test_codecencodings_jp.Test_EUC_JP_COMPAT) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_multibytecodec_support.py", line 230, in test_streamreader self.assertEqual(ostream.getvalue(), self.tstring[1]) AssertionError: b'Python \xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba\xe3\x81\xaf\xe3\x80\x811990 \xe5\xb9\xb4\xe3\x81\x94\xe3\x82\x8d\xe3\x81\x8b\xe3\x82\x89\xe9\x96\x8b\xe5\xa7\x8b\xe3\x81\x95\xe3\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x99\xe3\x80\x82\n\xe9\x96\x8b\xe7\x99\xba\xe8\x80\x85\xe3\x81\xae Guido van Rossum \xe3\x81\xaf\xe6\x95\x99\xe8\x82\xb2\xe7\x94\xa8\xe3\x81\xae\xe3\x83\x97\xe3\x83\xad\xe3\x82\xb0\xe3\x83\xa9\xe3\x83\x9f\xe3\x83\xb3\xe3\x82\xb0\xe8\xa8\x80\xe8\xaa\x9e\xe3\x80\x8cABC\xe3\x80\x8d\xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba\xe3\x81\xab\xe5\x8f\x82\xe5\x8a\xa0\xe3\x81\x97\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x97\xe3\x81\x9f\xe3\x81\x8c\xe3\x80\x81ABC \xe3\x81\xaf\xe5\xae\x9f\xe7\x94\xa8\xe4\xb8\x8a\xe3\x81\xae\xe7\x9b\xae\xe7\x9a\x84\xe3\x81\xab\xe3\x81\xaf\xe3\x81\x82\xe3\x81\xbe\xe3\x82\x8a\xe9\x81\xa9\xe3\x81\x97\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x9b\xe3\x82\x93\xe3\x81\xa7\xe3\x81\x97\xe3\x81\x9f\xe3\x80\x82\n\xe3\x81\x93\xe3\x81\xae\xe3\x81\x9f\xe3\x82\x81\xe3\x80\x81Guido \xe3\x81\xaf\xe3\x82\x88\xe3\x82\x8a\xe5\xae\x9f\xe7\x94\xa8\xe7\x9a\x84\xe3\x81\xaa\xe3\x83\x97\xe3\x83\xad\xe3\x82\xb0\xe3\x83\xa9\xe3\x83\x9f\xe3\x83\xb3\xe3\x82\xb0\xe8\xa8\x80\xe8\xaa\x9e\xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba\xe3\x82\x92\xe9\x96\x8b\xe5\xa7\x8b\xe3\x81\x97\xe3\x80\x81\xe8\x8b\xb1\xe5\x9b\xbd BBS \xe6\x94\xbe\xe9\x80\x81\xe3\x81\xae\xe3\x82\xb3\xe3\x83\xa1\xe3\x83\x87\xe3\x82\xa3\xe7\x95\xaa\xe7\xb5\x84\xe3\x80\x8c\xe3\x83\xa2\xe3\x83\xb3\xe3\x83\x86\xe3\x82\xa3 \xe3\x83\x91\xe3\x82\xa4\xe3\x82\xbd\xe3\x83\xb3\xe3\x80\x8d\xe3\x81\xae\xe3\x83\x95\xe3\x82\xa1\xe3\x83\xb3\xe3\x81\xa7\xe3\x81\x82\xe3\x82\x8b Guido \xe3\x81\xaf\xe3\x81\x93\xe3\x81\xae\xe8\xa8\x80\xe8\xaa\x9e\xe3\x82\x92\xe3\x80\x8cPython\xe3\x80\x8d\xe3\x81\xa8\xe5\x90\x8d\xe3\x81\xa5\xe3\x81\x91\xe3\x81\xbe\xe3\x81\x97\xe3\x81\x9f\xe3\x80\x82\n\xe3\x81\x93\xe3\x81\xae\xe3\x82\x88\xe3\x81\x86\xe3\x81\xaa\xe8\x83\x8c\xe6\x99\xaf\xe3\x81\x8b\xe3\x82\x89\xe7\x94\x9f\xe3\x81\xbe\xe3\x82\x8c\xe3\x81\x9f Python \xe3\x81\xae\xe8\xa8\x80\xe8\xaa\x9e\xe8\xa8\xad\xe8\xa8\x88\xe3\x81\xaf\xe3\x80\x81\xe3\x80\x8c\xe3\x82\xb7\xe3\x83\xb3\xe3\x83\x97\xe3\x83\xab\xe3\x80\x8d\xe3\x81\xa7\xe3\x80\x8c\xe7\xbf\x92\xe5\xbe\x97\xe3\x81\x8c\xe5\xae\xb9\xe6\x98\x93\xe3\x80\x8d\xe3\x81\xa8\xe3\x81\x84\xe3\x81\x86\xe7\x9b\xae\xe6\xa8\x99\xe3\x81\xab\xe9\x87\x8d\xe7\x82\xb9\xe3\x81\x8c\xe7\xbd\xae\xe3\x81\x8b\xe3\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x99\xe3\x80\x82\n\xe5\xa4\x9a\xe3\x81\x8f\xe3\x81\xae\xe3\x82\xb9\xe3\x82\xaf\xe3\x83\xaa\xe3\x83\x97\xe3\x83\x88\xe7\xb3\xbb\xe8\xa8\x80\xe8\xaa\x9e\xe3\x81\xa7\xe3\x81\xaf\xe3\x83\xa6\xe3\x83\xbc\xe3\x82\xb6\xe3\x81\xae\xe7\x9b\xae\xe5\x85\x88\xe3\x81\xae\xe5\x88\xa9\xe4\xbe\xbf\xe6\x80\xa7\xe3\x82\x92\xe5\x84\xaa\xe5\x85\x88\xe3\x81\x97\xe3\x81\xa6\xe8\x89\xb2\xe3\x80\x85\xe3\x81\xaa\xe6\xa9\x9f\xe8\x83\xbd\xe3\x82\x92\xe8\xa8\x80\xe8\xaa\x9e\xe8\xa6\x81\xe7\xb4\xa0\xe3\x81\xa8\xe3\x81\x97\xe3\x81\xa6\xe5\x8f\x96\xe3\x82\x8a\xe5\x85\xa5\xe3\x82\x8c\xe3\x82\x8b\xe5\xa0\xb4\xe5\x90\x88\xe3\x81\x8c\xe5\xa4\x9a\xe3\x81\x84\xe3\x81\xae\xe3\x81\xa7\xe3\x81\x99\xe3\x81\x8c\xe3\x80\x81Python \xe3\x81\xa7\xe3\x81\xaf\xe3\x81\x9d\xe3\x81\x86\xe3\x81\x84\xe3\x81\xa3\xe3\x81\x9f\xe5\xb0\x8f\xe7\xb4\xb0\xe5\xb7\xa5\xe3\x81\x8c\xe8\xbf\xbd\xe5\x8a\xa0\xe3\x81\x95\xe3\x82\x8c\xe3\x82\x8b\xe3\x81\x93\xe3\x81\xa8\xe3\x81\xaf\xe3\x81\x82\xe3\x81\xbe\xe3\x82\x8a\xe3\x81\x82\xe3\x82\x8a\xe3\x81\xbe\xe3\x81\x9b\xe3\x82\x93\xe3\x80\x82\n\xe8\xa8\x80\xe8\xaa\x9e\xe8\x87\xaa\xe4\xbd\x93\xe3\x81\xae\xe6\xa9\x9f\xe8\x83\xbd\xe3\x81\xaf\xe6\x9c\x80\xe5\xb0\x8f\xe9\x99\x90\xe3\x81\xab\xe6\x8a\xbc\xe3\x81\x95\xe3\x81\x88\xe3\x80\x81\xe5\xbf\x85\xe8\xa6\x81\xe3\x81\xaa\xe6\xa9\x9f\xe8\x83\xbd\xe3\x81\xaf\xe6\x8b\xa1\xe5\xbc\xb5\xe3\x83\xa2\xe3\x82\xb8\xe3\x83\xa5\xe3\x83\xbc\xe3\x83\xab\xe3\x81\xa8\xe3\x81\x97\xe3\x81\xa6\xe8\xbf\xbd\xe5\x8a\xa0\xe3\x81\x99\xe3\x82\x8b\xe3\x80\x81\xe3\x81\xa8\xe3\x81\x84\xe3\x81\x86\xe3\x81\xae\xe3\x81\x8c Python \xe3\x81\xae\xe3\x83\x9d\xe3\x83\xaa\xe3\x82\xb7\xe3\x83\xbc\xe3\x81\xa7\xe3\x81\x99\xe3\x80\x82\n\n' != b'Python \xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba\xe3\x81\xaf\xe3\x80\x811990 \xe5\xb9\xb4\xe3\x81\x94\xe3\x82\x8d\xe3\x81\x8b\xe3\x82\x89\xe9\x96\x8b\xe5\xa7\x8b\xe3\x81\x95\xe3\x82\x8c\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x99\xe3\x80\x82\n\xe9\x96\x8b\xe7\x99\xba\xe8\x80\x85\xe3\x81\xae Guido van Rossum \xe3\x81\xaf\xe6\x95\x99\xe8\x82\xb2\xe7\x94\xa8\xe3\x81\xae\xe3\x83\x97\xe3\x83\xad\xe3\x82\xb0\xe3\x83\xa9\xe3\x83\x9f\xe3\x83\xb3\xe3\x82\xb0\xe8\xa8\x80\xe8\xaa\x9e\xe3\x80\x8cABC\xe3\x80\x8d\xe3\x81\xae\xe9\x96\x8b\xe7\x99\xba\xe3\x81\xab\xe5\x8f\x82\xe5\x8a\xa0\xe3\x81\x97\xe3\x81\xa6\xe3\x81\x84\xe3\x81\xbe\xe3\x81\x97\xe3\x81\x9f\xe3\x81\x8c\xe3\x80\x81ABC \xe3\x81\xaf\xe5\xae\x9f\xe7\x94\xa8\xe4\xb8\x8a\xe3\x81\xae\xe7\x9b\xae\xe7\x9a\x84\xe3\x81\xab\xe3xe3\x81\x8c Python \xe3\x81\xae\xe3\x83\x9d\xe3\x83\xaa\xe3\x82\xb7\xe3\x83\xbc\xe3\x81\xa7\xe3\x81\x99\xe3\x80\x82\n\n' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun May 17 22:53:10 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 20:53:10 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc trunk Message-ID: <20090517205310.ECB02D473@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%20trunk/builds/438 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson,tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_poplib sincerely, -The Buildbot From python-checkins at python.org Mon May 18 00:03:27 2009 From: python-checkins at python.org (robert.schuppenies) Date: Mon, 18 May 2009 00:03:27 +0200 (CEST) Subject: [Python-checkins] r72755 - in python/branches/release30-maint: Lib/_weakrefset.py Lib/test/test_weakset.py Message-ID: <20090517220327.700D0D45B@mail.python.org> Author: robert.schuppenies Date: Mon May 18 00:03:27 2009 New Revision: 72755 Log: Merged revisions 72751 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r72751 | robert.schuppenies | 2009-05-17 10:32:20 -0700 (Sun, 17 May 2009) | 2 lines Issue 5964: Fixed WeakSet __eq__ comparison to handle non-WeakSet objects. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/_weakrefset.py python/branches/release30-maint/Lib/test/test_weakset.py Modified: python/branches/release30-maint/Lib/_weakrefset.py ============================================================================== --- python/branches/release30-maint/Lib/_weakrefset.py (original) +++ python/branches/release30-maint/Lib/_weakrefset.py Mon May 18 00:03:27 2009 @@ -118,6 +118,8 @@ return self.data >= set(ref(item) for item in other) def __eq__(self, other): + if not isinstance(other, self.__class__): + return NotImplemented return self.data == set(ref(item) for item in other) def symmetric_difference(self, other): Modified: python/branches/release30-maint/Lib/test/test_weakset.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_weakset.py (original) +++ python/branches/release30-maint/Lib/test/test_weakset.py Mon May 18 00:03:27 2009 @@ -134,13 +134,11 @@ def test_gc(self): # Create a nest of cycles to exercise overall ref count check - class A: - pass - s = set(A() for i in range(1000)) + s = WeakSet(Foo() for i in range(1000)) for elem in s: elem.cycle = s elem.sub = elem - elem.set = set([elem]) + elem.set = WeakSet([elem]) def test_subclass_with_custom_hash(self): # Bug #1257731 @@ -169,17 +167,12 @@ t = WeakSet(s) self.assertNotEqual(id(s), id(t)) - def test_set_literal(self): - s = set([1,2,3]) - t = {1,2,3} - self.assertEqual(s, t) - def test_hash(self): self.assertRaises(TypeError, hash, self.s) def test_clear(self): self.s.clear() - self.assertEqual(self.s, set()) + self.assertEqual(self.s, WeakSet([])) self.assertEqual(len(self.s), 0) def test_copy(self): @@ -304,6 +297,16 @@ t ^= t self.assertEqual(t, WeakSet()) + def test_eq(self): + # issue 5964 + self.assertTrue(self.s == self.s) + self.assertTrue(self.s == WeakSet(self.items)) + self.assertFalse(self.s == set(self.items)) + self.assertFalse(self.s == list(self.items)) + self.assertFalse(self.s == tuple(self.items)) + self.assertFalse(self.s == WeakSet([Foo])) + self.assertFalse(self.s == 1) + def test_main(verbose=None): support.run_unittest(TestWeakSet) From python-checkins at python.org Mon May 18 00:07:13 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 18 May 2009 00:07:13 +0200 (CEST) Subject: [Python-checkins] r72756 - peps/trunk/pep-0101.txt Message-ID: <20090517220713.54309C2C5@mail.python.org> Author: georg.brandl Date: Mon May 18 00:07:13 2009 New Revision: 72756 Log: #5980: add more tracker tasks Modified: peps/trunk/pep-0101.txt Modified: peps/trunk/pep-0101.txt ============================================================================== --- peps/trunk/pep-0101.txt (original) +++ peps/trunk/pep-0101.txt Mon May 18 00:07:13 2009 @@ -548,8 +548,20 @@ ___ Update any release PEPs (e.g. 361) with the release dates. - ___ In the tracker at http://bugs.python.org, flip all the deferred blocker - issues back to release blocker for the next release. + ___ Update the tracker at http://bugs.python.org: + + ___ Flip all the deferred blocker issues back to release blocker + for the next release. + + ___ Add version X.Y+1 as when version X.Y enters alpha. + + ___ Change non-doc RFEs to version X.Y+1 when version X.Y enters beta. + + ___ Update 'behavior' issues from versions that your release make + unsupported to the next supported version. + + ___ Review open issues, as this might find lurking showstopper bugs, + besides reminding people to fix the easy ones they forgot about. What Next? From python-checkins at python.org Mon May 18 00:19:14 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 18 May 2009 00:19:14 +0200 (CEST) Subject: [Python-checkins] r72757 - python/branches/py3k/Include/pycapsule.h Message-ID: <20090517221914.640B5D82F@mail.python.org> Author: georg.brandl Date: Mon May 18 00:19:14 2009 New Revision: 72757 Log: Remove trailing whitespace. Modified: python/branches/py3k/Include/pycapsule.h Modified: python/branches/py3k/Include/pycapsule.h ============================================================================== --- python/branches/py3k/Include/pycapsule.h (original) +++ python/branches/py3k/Include/pycapsule.h Mon May 18 00:19:14 2009 @@ -2,12 +2,12 @@ /* Capsule objects let you wrap a C "void *" pointer in a Python object. They're a way of passing data through the Python interpreter without creating your own custom type. - + Capsules are used for communication between extension modules. They provide a way for an extension module to export a C interface to other extension modules, so that extension modules can use the Python import mechanism to link to one another. - + For more information, please see "c-api/capsule.html" in the documentation. */ @@ -26,7 +26,7 @@ PyAPI_FUNC(PyObject *) PyCapsule_New( - void *pointer, + void *pointer, const char *name, PyCapsule_Destructor destructor); From buildbot at python.org Mon May 18 01:17:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 23:17:34 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090517231734.28C3BD63F@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/373 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: robert.schuppenies BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Mon May 18 01:58:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 17 May 2009 23:58:27 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090517235827.81C4ED4DB@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/708 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Mon May 18 10:03:38 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 18 May 2009 10:03:38 +0200 (CEST) Subject: [Python-checkins] r72758 - in python/trunk: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090518080338.13C60C487@mail.python.org> Author: tarek.ziade Date: Mon May 18 10:03:37 2009 New Revision: 72758 Log: Fixed the library extension when distutils build_ext is used inplace Modified: python/trunk/Lib/distutils/command/build_ext.py python/trunk/Lib/distutils/tests/test_build_ext.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/command/build_ext.py ============================================================================== --- python/trunk/Lib/distutils/command/build_ext.py (original) +++ python/trunk/Lib/distutils/command/build_ext.py Mon May 18 10:03:37 2009 @@ -649,7 +649,8 @@ base = modpath[-1] build_py = self.get_finalized_command('build_py') package_dir = os.path.abspath(build_py.get_package_dir(package)) - return os.path.join(package_dir, base) + filename = self.get_ext_filename(ext_name) + return os.path.join(package_dir, filename) else: filename = self.get_ext_filename(ext_name) return os.path.join(self.build_lib, filename) @@ -663,12 +664,11 @@ else: return self.package + '.' + ext_name - def get_ext_filename (self, ext_name): + def get_ext_filename(self, ext_name): r"""Convert the name of an extension (eg. "foo.bar") into the name of the file from which it will be loaded (eg. "foo/bar.so", or "foo\bar.pyd"). """ - from distutils.sysconfig import get_config_var ext_path = string.split(ext_name, '.') # OS/2 has an 8 character module (extension) limit :-( Modified: python/trunk/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_build_ext.py (original) +++ python/trunk/Lib/distutils/tests/test_build_ext.py Mon May 18 10:03:37 2009 @@ -19,12 +19,6 @@ # Don't load the xx module more than once. ALREADY_TESTED = False -if sys.platform != 'win32': - UNDER_MSVC8 = False -else: - from distutils.msvccompiler import get_build_version - UNDER_MSVC8 = get_build_version() < 8.0 - def _get_source_filename(): srcdir = sysconfig.get_config_var('srcdir') return os.path.join(srcdir, 'Modules', 'xxmodule.c') @@ -299,7 +293,6 @@ cmd.run() self.assertEquals(cmd.compiler, 'unix') - @unittest.skipIf(UNDER_MSVC8, 'not running this test for MSVC < 8') def test_get_outputs(self): tmp_dir = self.mkdtemp() c_file = os.path.join(tmp_dir, 'foo.c') @@ -329,6 +322,8 @@ finally: os.chdir(old_wd) self.assert_(os.path.exists(so_file)) + self.assertEquals(os.path.splitext(so_file)[-1], + sysconfig.get_config_var('SO')) so_dir = os.path.dirname(so_file) self.assertEquals(so_dir, other_tmp_dir) @@ -336,6 +331,8 @@ cmd.run() so_file = cmd.get_outputs()[0] self.assert_(os.path.exists(so_file)) + self.assertEquals(os.path.splitext(so_file)[-1], + sysconfig.get_config_var('SO')) so_dir = os.path.dirname(so_file) self.assertEquals(so_dir, cmd.build_lib) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon May 18 10:03:37 2009 @@ -298,6 +298,9 @@ Library ------- +- Issue #6046: Fixed the library extension when distutils build_ext is used + inplace. Initial patch by Roumen Petrov. + - Issue #6041: Now distutils `sdist` and `register` commands use `check` as a subcommand. From python-checkins at python.org Mon May 18 10:05:17 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 18 May 2009 10:05:17 +0200 (CEST) Subject: [Python-checkins] r72759 - in python/branches/release26-maint: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090518080517.9645FD5F2@mail.python.org> Author: tarek.ziade Date: Mon May 18 10:05:17 2009 New Revision: 72759 Log: Merged revisions 72758 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72758 | tarek.ziade | 2009-05-18 10:03:37 +0200 (Mon, 18 May 2009) | 1 line Fixed the library extension when distutils build_ext is used inplace ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/command/build_ext.py python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/distutils/command/build_ext.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/command/build_ext.py (original) +++ python/branches/release26-maint/Lib/distutils/command/build_ext.py Mon May 18 10:05:17 2009 @@ -635,7 +635,8 @@ base = modpath[-1] build_py = self.get_finalized_command('build_py') package_dir = os.path.abspath(build_py.get_package_dir(package)) - return os.path.join(package_dir, base) + filename = self.get_ext_filename(ext_name) + return os.path.join(package_dir, filename) else: filename = self.get_ext_filename(ext_name) return os.path.join(self.build_lib, filename) @@ -649,12 +650,11 @@ else: return self.package + '.' + ext_name - def get_ext_filename (self, ext_name): + def get_ext_filename(self, ext_name): r"""Convert the name of an extension (eg. "foo.bar") into the name of the file from which it will be loaded (eg. "foo/bar.so", or "foo\bar.pyd"). """ - from distutils.sysconfig import get_config_var ext_path = string.split(ext_name, '.') # OS/2 has an 8 character module (extension) limit :-( Modified: python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py Mon May 18 10:05:17 2009 @@ -17,12 +17,6 @@ # Don't load the xx module more than once. ALREADY_TESTED = False -if sys.platform != 'win32': - UNDER_MSVC8 = False -else: - from distutils.msvccompiler import get_build_version - UNDER_MSVC8 = get_build_version() < 8.0 - class BuildExtTestCase(support.TempdirManager, support.LoggingSilencer, unittest.TestCase): @@ -267,6 +261,8 @@ finally: os.chdir(old_wd) self.assert_(os.path.exists(so_file)) + self.assertEquals(os.path.splitext(so_file)[-1], + sysconfig.get_config_var('SO')) so_dir = os.path.dirname(so_file) self.assertEquals(so_dir, other_tmp_dir) @@ -274,6 +270,8 @@ cmd.run() so_file = cmd.get_outputs()[0] self.assert_(os.path.exists(so_file)) + self.assertEquals(os.path.splitext(so_file)[-1], + sysconfig.get_config_var('SO')) so_dir = os.path.dirname(so_file) self.assertEquals(so_dir, cmd.build_lib) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Mon May 18 10:05:17 2009 @@ -198,6 +198,9 @@ Library ------- +- Issue #6046: Fixed the library extension when distutils build_ext is used + inplace. Initial patch by Roumen Petrov. + - Issue #6022: a test file was created in the current working directory by test_get_outputs in Distutils. From python-checkins at python.org Mon May 18 10:07:46 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 18 May 2009 10:07:46 +0200 (CEST) Subject: [Python-checkins] r72760 - in python/branches/py3k: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090518080746.AFD73D628@mail.python.org> Author: tarek.ziade Date: Mon May 18 10:07:46 2009 New Revision: 72760 Log: Merged revisions 72758 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72758 | tarek.ziade | 2009-05-18 10:03:37 +0200 (Mon, 18 May 2009) | 1 line Fixed the library extension when distutils build_ext is used inplace ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/command/build_ext.py python/branches/py3k/Lib/distutils/tests/test_build_ext.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/distutils/command/build_ext.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/build_ext.py (original) +++ python/branches/py3k/Lib/distutils/command/build_ext.py Mon May 18 10:07:46 2009 @@ -636,7 +636,8 @@ base = modpath[-1] build_py = self.get_finalized_command('build_py') package_dir = os.path.abspath(build_py.get_package_dir(package)) - return os.path.join(package_dir, base) + filename = self.get_ext_filename(ext_name) + return os.path.join(package_dir, filename) else: filename = self.get_ext_filename(ext_name) return os.path.join(self.build_lib, filename) Modified: python/branches/py3k/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_build_ext.py Mon May 18 10:07:46 2009 @@ -20,12 +20,6 @@ # Don't load the xx module more than once. ALREADY_TESTED = False -if sys.platform != 'win32': - UNDER_MSVC8 = False -else: - from distutils.msvccompiler import get_build_version - UNDER_MSVC8 = get_build_version() < 8.0 - def _get_source_filename(): srcdir = sysconfig.get_config_var('srcdir') return os.path.join(srcdir, 'Modules', 'xxmodule.c') @@ -299,7 +293,6 @@ cmd.run() self.assertEquals(cmd.compiler, 'unix') - @unittest.skipIf(UNDER_MSVC8, 'not running this test for MSVC < 8') def test_get_outputs(self): tmp_dir = self.mkdtemp() c_file = os.path.join(tmp_dir, 'foo.c') @@ -329,6 +322,8 @@ finally: os.chdir(old_wd) self.assert_(os.path.exists(so_file)) + self.assertEquals(os.path.splitext(so_file)[-1], + sysconfig.get_config_var('SO')) so_dir = os.path.dirname(so_file) self.assertEquals(so_dir, other_tmp_dir) @@ -336,6 +331,8 @@ cmd.run() so_file = cmd.get_outputs()[0] self.assert_(os.path.exists(so_file)) + self.assertEquals(os.path.splitext(so_file)[-1], + sysconfig.get_config_var('SO')) so_dir = os.path.dirname(so_file) self.assertEquals(so_dir, cmd.build_lib) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon May 18 10:07:46 2009 @@ -618,6 +618,9 @@ Library ------- +- Issue #6046: Fixed the library extension when distutils build_ext is used + inplace. Initial patch by Roumen Petrov. + - Issue #6041: Now distutils `sdist` and `register` commands use `check` as a subcommand. From python-checkins at python.org Mon May 18 10:08:31 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 18 May 2009 10:08:31 +0200 (CEST) Subject: [Python-checkins] r72761 - python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py Message-ID: <20090518080831.CC1B1D628@mail.python.org> Author: tarek.ziade Date: Mon May 18 10:08:31 2009 New Revision: 72761 Log: removed badly merged section Modified: python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py Modified: python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py Mon May 18 10:08:31 2009 @@ -231,8 +231,6 @@ self.assertEquals(cmd.compiler, 'unix') def test_get_outputs(self): - if UNDER_MSVC8: - return # not running this test for MSVC < 8 tmp_dir = self.mkdtemp() c_file = os.path.join(tmp_dir, 'foo.c') self.write_file(c_file, 'void initfoo(void) {};\n') From python-checkins at python.org Mon May 18 10:09:37 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 18 May 2009 10:09:37 +0200 (CEST) Subject: [Python-checkins] r72762 - python/branches/release30-maint Message-ID: <20090518080937.961ACD634@mail.python.org> Author: tarek.ziade Date: Mon May 18 10:09:37 2009 New Revision: 72762 Log: Blocked revisions 72748 via svnmerge ................ r72748 | tarek.ziade | 2009-05-17 17:03:23 +0200 (Sun, 17 May 2009) | 9 lines Merged revisions 72746 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72746 | tarek.ziade | 2009-05-17 16:59:05 +0200 (Sun, 17 May 2009) | 1 line fixed the test name ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Mon May 18 10:11:23 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 18 May 2009 10:11:23 +0200 (CEST) Subject: [Python-checkins] r72763 - in python/branches/release30-maint: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090518081123.C5729D66E@mail.python.org> Author: tarek.ziade Date: Mon May 18 10:11:23 2009 New Revision: 72763 Log: Merged revisions 72760 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72760 | tarek.ziade | 2009-05-18 10:07:46 +0200 (Mon, 18 May 2009) | 9 lines Merged revisions 72758 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72758 | tarek.ziade | 2009-05-18 10:03:37 +0200 (Mon, 18 May 2009) | 1 line Fixed the library extension when distutils build_ext is used inplace ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/command/build_ext.py python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/distutils/command/build_ext.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/command/build_ext.py (original) +++ python/branches/release30-maint/Lib/distutils/command/build_ext.py Mon May 18 10:11:23 2009 @@ -620,7 +620,8 @@ base = modpath[-1] build_py = self.get_finalized_command('build_py') package_dir = os.path.abspath(build_py.get_package_dir(package)) - return os.path.join(package_dir, base) + filename = self.get_ext_filename(ext_name) + return os.path.join(package_dir, filename) else: filename = self.get_ext_filename(ext_name) return os.path.join(self.build_lib, filename) Modified: python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py Mon May 18 10:11:23 2009 @@ -18,12 +18,6 @@ # Don't load the xx module more than once. ALREADY_TESTED = False -if sys.platform != 'win32': - UNDER_MSVC8 = False -else: - from distutils.msvccompiler import get_build_version - UNDER_MSVC8 = get_build_version() < 8.0 - class BuildExtTestCase(TempdirManager, LoggingSilencer, unittest.TestCase): @@ -238,8 +232,6 @@ self.assertEquals(cmd.compiler, 'unix') def test_get_outputs(self): - if UNDER_MSVC8: - return tmp_dir = self.mkdtemp() c_file = os.path.join(tmp_dir, 'foo.c') self.write_file(c_file, 'void initfoo(void) {};\n') @@ -268,6 +260,8 @@ finally: os.chdir(old_wd) self.assert_(os.path.exists(so_file)) + self.assertEquals(os.path.splitext(so_file)[-1], + sysconfig.get_config_var('SO')) so_dir = os.path.dirname(so_file) self.assertEquals(so_dir, other_tmp_dir) @@ -275,6 +269,8 @@ cmd.run() so_file = cmd.get_outputs()[0] self.assert_(os.path.exists(so_file)) + self.assertEquals(os.path.splitext(so_file)[-1], + sysconfig.get_config_var('SO')) so_dir = os.path.dirname(so_file) self.assertEquals(so_dir, cmd.build_lib) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Mon May 18 10:11:23 2009 @@ -285,6 +285,9 @@ Library ------- +- Issue #6046: Fixed the library extension when distutils build_ext is used + inplace. Initial patch by Roumen Petrov. + - Issue #6022: a test file was created in the current working directory by test_get_outputs in Distutils. From python-checkins at python.org Mon May 18 10:20:55 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 18 May 2009 10:20:55 +0200 (CEST) Subject: [Python-checkins] r72764 - python/trunk/Lib/distutils/tests/test_archive_util.py Message-ID: <20090518082055.D5649D7AB@mail.python.org> Author: tarek.ziade Date: Mon May 18 10:20:55 2009 New Revision: 72764 Log: working with relative paths to avoid tar warnings on absolute paths Modified: python/trunk/Lib/distutils/tests/test_archive_util.py Modified: python/trunk/Lib/distutils/tests/test_archive_util.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_archive_util.py (original) +++ python/trunk/Lib/distutils/tests/test_archive_util.py Mon May 18 10:20:55 2009 @@ -27,7 +27,14 @@ tmpdir2 = self.mkdtemp() base_name = os.path.join(tmpdir2, 'archive') - make_tarball(base_name, tmpdir) + + # working with relative paths to avoid tar warnings + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + make_tarball(base_name, '.') + finally: + os.chdir(old_dir) # check if the compressed tarball was created tarball = base_name + '.tar.gz' @@ -35,7 +42,12 @@ # trying an uncompressed one base_name = os.path.join(tmpdir2, 'archive') - make_tarball(base_name, tmpdir, compress=None) + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + make_tarball(base_name, '.', compress=None) + finally: + os.chdir(old_dir) tarball = base_name + '.tar' self.assert_(os.path.exists(tarball)) From python-checkins at python.org Mon May 18 10:21:42 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 18 May 2009 10:21:42 +0200 (CEST) Subject: [Python-checkins] r72765 - python/branches/release26-maint Message-ID: <20090518082142.A9A98D7AB@mail.python.org> Author: tarek.ziade Date: Mon May 18 10:21:42 2009 New Revision: 72765 Log: Blocked revisions 72764 via svnmerge ........ r72764 | tarek.ziade | 2009-05-18 10:20:55 +0200 (Mon, 18 May 2009) | 1 line working with relative paths to avoid tar warnings on absolute paths ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Mon May 18 10:22:38 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 18 May 2009 10:22:38 +0200 (CEST) Subject: [Python-checkins] r72766 - in python/branches/py3k: Lib/distutils/tests/test_archive_util.py Message-ID: <20090518082238.77683D749@mail.python.org> Author: tarek.ziade Date: Mon May 18 10:22:38 2009 New Revision: 72766 Log: Merged revisions 72764 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72764 | tarek.ziade | 2009-05-18 10:20:55 +0200 (Mon, 18 May 2009) | 1 line working with relative paths to avoid tar warnings on absolute paths ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_archive_util.py Modified: python/branches/py3k/Lib/distutils/tests/test_archive_util.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_archive_util.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_archive_util.py Mon May 18 10:22:38 2009 @@ -27,7 +27,14 @@ tmpdir2 = self.mkdtemp() base_name = os.path.join(tmpdir2, 'archive') - make_tarball(base_name, tmpdir) + + # working with relative paths to avoid tar warnings + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + make_tarball(base_name, '.') + finally: + os.chdir(old_dir) # check if the compressed tarball was created tarball = base_name + '.tar.gz' @@ -35,7 +42,12 @@ # trying an uncompressed one base_name = os.path.join(tmpdir2, 'archive') - make_tarball(base_name, tmpdir, compress=None) + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + make_tarball(base_name, '.', compress=None) + finally: + os.chdir(old_dir) tarball = base_name + '.tar' self.assert_(os.path.exists(tarball)) From python-checkins at python.org Mon May 18 10:23:39 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 18 May 2009 10:23:39 +0200 (CEST) Subject: [Python-checkins] r72767 - python/branches/release30-maint Message-ID: <20090518082339.3CC79D7B8@mail.python.org> Author: tarek.ziade Date: Mon May 18 10:23:39 2009 New Revision: 72767 Log: Blocked revisions 72766 via svnmerge ................ r72766 | tarek.ziade | 2009-05-18 10:22:38 +0200 (Mon, 18 May 2009) | 9 lines Merged revisions 72764 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72764 | tarek.ziade | 2009-05-18 10:20:55 +0200 (Mon, 18 May 2009) | 1 line working with relative paths to avoid tar warnings on absolute paths ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Mon May 18 11:00:16 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 18 May 2009 09:00:16 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090518090017.0F98ED8F6@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%202.6/builds/371 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From nnorwitz at gmail.com Mon May 18 12:24:40 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 18 May 2009 06:24:40 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090518102440.GA4869@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 Less important issues: ---------------------- test_docxmlrpc leaked [33, -1, -28] references, sum=4 test_popen2 leaked [0, 54, -25] references, sum=29 test_smtplib leaked [6, 0, 0] references, sum=6 test_threading leaked [48, 48, 48] references, sum=144 test_urllib2_localnet leaked [3, 3, 3] references, sum=9 test_xmlrpc leaked [-85, 0, 34] references, sum=-51 From python-checkins at python.org Mon May 18 14:21:26 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 18 May 2009 14:21:26 +0200 (CEST) Subject: [Python-checkins] r72768 - in python/trunk: Lib/distutils/tests/test_archive_util.py Lib/distutils/tests/test_dir_util.py Misc/NEWS Message-ID: <20090518122126.DD6EFD46C@mail.python.org> Author: tarek.ziade Date: Mon May 18 14:21:26 2009 New Revision: 72768 Log: Fixed #6053 - win32 fixes for distutils tests Modified: python/trunk/Lib/distutils/tests/test_archive_util.py python/trunk/Lib/distutils/tests/test_dir_util.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/tests/test_archive_util.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_archive_util.py (original) +++ python/trunk/Lib/distutils/tests/test_archive_util.py Mon May 18 14:21:26 2009 @@ -3,6 +3,7 @@ import unittest import os +from os.path import splitdrive from distutils.archive_util import (check_archive_formats, make_tarball, make_zipfile, make_archive) @@ -26,13 +27,16 @@ self.write_file([tmpdir, 'file2'], 'xxx') tmpdir2 = self.mkdtemp() + unittest.skipUnless(splitdrive(tmpdir)[0] == splitdrive(tmpdir2)[0], + "Source and target should be on same drive") + base_name = os.path.join(tmpdir2, 'archive') # working with relative paths to avoid tar warnings old_dir = os.getcwd() os.chdir(tmpdir) try: - make_tarball(base_name, '.') + make_tarball(splitdrive(base_name)[1], '.') finally: os.chdir(old_dir) @@ -45,7 +49,7 @@ old_dir = os.getcwd() os.chdir(tmpdir) try: - make_tarball(base_name, '.', compress=None) + make_tarball(splitdrive(base_name)[1], '.', compress=None) finally: os.chdir(old_dir) tarball = base_name + '.tar' Modified: python/trunk/Lib/distutils/tests/test_dir_util.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_dir_util.py (original) +++ python/trunk/Lib/distutils/tests/test_dir_util.py Mon May 18 14:21:26 2009 @@ -88,7 +88,7 @@ self.assertEquals(ensure_relative('/home/foo'), 'home/foo') self.assertEquals(ensure_relative('some/path'), 'some/path') else: # \\ - self.assertEquals(ensure_relative('c:\\home\\foo'), 'home\\foo') + self.assertEquals(ensure_relative('c:\\home\\foo'), 'c:home\\foo') self.assertEquals(ensure_relative('home\\foo'), 'home\\foo') def test_suite(): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon May 18 14:21:26 2009 @@ -298,6 +298,8 @@ Library ------- +- Issue #6053: Fixed distutils tests on win32. patch by Hirokazu Yamamoto. + - Issue #6046: Fixed the library extension when distutils build_ext is used inplace. Initial patch by Roumen Petrov. From python-checkins at python.org Mon May 18 14:27:48 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 18 May 2009 14:27:48 +0200 (CEST) Subject: [Python-checkins] r72769 - python/branches/release26-maint Message-ID: <20090518122748.338C2D420@mail.python.org> Author: tarek.ziade Date: Mon May 18 14:27:48 2009 New Revision: 72769 Log: Blocked revisions 72768 via svnmerge ........ r72768 | tarek.ziade | 2009-05-18 14:21:26 +0200 (Mon, 18 May 2009) | 1 line Fixed #6053 - win32 fixes for distutils tests ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Mon May 18 14:29:07 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 18 May 2009 14:29:07 +0200 (CEST) Subject: [Python-checkins] r72770 - in python/branches/py3k: Lib/distutils/tests/test_archive_util.py Lib/distutils/tests/test_dir_util.py Misc/NEWS Message-ID: <20090518122907.06BF2D45F@mail.python.org> Author: tarek.ziade Date: Mon May 18 14:29:06 2009 New Revision: 72770 Log: Merged revisions 72768 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72768 | tarek.ziade | 2009-05-18 14:21:26 +0200 (Mon, 18 May 2009) | 1 line Fixed #6053 - win32 fixes for distutils tests ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_archive_util.py python/branches/py3k/Lib/distutils/tests/test_dir_util.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/distutils/tests/test_archive_util.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_archive_util.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_archive_util.py Mon May 18 14:29:06 2009 @@ -3,6 +3,7 @@ import unittest import os +from os.path import splitdrive from distutils.archive_util import (check_archive_formats, make_tarball, make_zipfile, make_archive) @@ -26,13 +27,16 @@ self.write_file([tmpdir, 'file2'], 'xxx') tmpdir2 = self.mkdtemp() + unittest.skipUnless(splitdrive(tmpdir)[0] == splitdrive(tmpdir2)[0], + "Source and target should be on same drive") + base_name = os.path.join(tmpdir2, 'archive') # working with relative paths to avoid tar warnings old_dir = os.getcwd() os.chdir(tmpdir) try: - make_tarball(base_name, '.') + make_tarball(splitdrive(base_name)[1], '.') finally: os.chdir(old_dir) @@ -45,7 +49,7 @@ old_dir = os.getcwd() os.chdir(tmpdir) try: - make_tarball(base_name, '.', compress=None) + make_tarball(splitdrive(base_name)[1], '.', compress=None) finally: os.chdir(old_dir) tarball = base_name + '.tar' Modified: python/branches/py3k/Lib/distutils/tests/test_dir_util.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_dir_util.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_dir_util.py Mon May 18 14:29:06 2009 @@ -88,7 +88,7 @@ self.assertEquals(ensure_relative('/home/foo'), 'home/foo') self.assertEquals(ensure_relative('some/path'), 'some/path') else: # \\ - self.assertEquals(ensure_relative('c:\\home\\foo'), 'home\\foo') + self.assertEquals(ensure_relative('c:\\home\\foo'), 'c:home\\foo') self.assertEquals(ensure_relative('home\\foo'), 'home\\foo') def test_suite(): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon May 18 14:29:06 2009 @@ -618,6 +618,8 @@ Library ------- +- Issue #6053: Fixed distutils tests on win32. patch by Hirokazu Yamamoto. + - Issue #6046: Fixed the library extension when distutils build_ext is used inplace. Initial patch by Roumen Petrov. From python-checkins at python.org Mon May 18 14:31:22 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 18 May 2009 14:31:22 +0200 (CEST) Subject: [Python-checkins] r72771 - python/branches/release30-maint Message-ID: <20090518123122.76F1ED4DF@mail.python.org> Author: tarek.ziade Date: Mon May 18 14:31:22 2009 New Revision: 72771 Log: Blocked revisions 72770 via svnmerge ................ r72770 | tarek.ziade | 2009-05-18 14:29:06 +0200 (Mon, 18 May 2009) | 9 lines Merged revisions 72768 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72768 | tarek.ziade | 2009-05-18 14:21:26 +0200 (Mon, 18 May 2009) | 1 line Fixed #6053 - win32 fixes for distutils tests ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Mon May 18 15:01:21 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 18 May 2009 13:01:21 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090518130121.AE5D7D6D4@mail.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/5023 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Mon May 18 15:36:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 18 May 2009 13:36:35 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 2.6 Message-ID: <20090518133635.2A5D9C302@mail.python.org> The Buildbot has detected a new failure of x86 gentoo 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%202.6/builds/341 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Mon May 18 15:36:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 18 May 2009 13:36:48 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090518133648.64008C39E@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%202.6/builds/373 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Mon May 18 15:37:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 18 May 2009 13:37:30 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090518133730.D4A8DD2A8@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/648 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon May 18 15:47:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 18 May 2009 13:47:09 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090518134710.0E4F5C3EC@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/537 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox ====================================================================== FAIL: test_update (test.test_mailbox.TestMaildir) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/trunk.klose-debian-ppc/build/Lib/test/test_mailbox.py", line 362, in test_update self.assert_(len(self._box) == 3) AssertionError: False is not True make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon May 18 16:25:10 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 18 May 2009 14:25:10 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090518142510.F1C5EC485@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%202.6/builds/355 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon May 18 17:17:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 18 May 2009 15:17:04 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090518151704.5CD28D595@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/375 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 45, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/Include ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Mon May 18 17:35:26 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 18 May 2009 17:35:26 +0200 (CEST) Subject: [Python-checkins] r72772 - python/branches/py3k/Lib/_abcoll.py Message-ID: <20090518153526.3EB9CD5FA@mail.python.org> Author: raymond.hettinger Date: Mon May 18 17:35:26 2009 New Revision: 72772 Log: Issue 6037: MutableSequence.__iadd__ should return self. Modified: python/branches/py3k/Lib/_abcoll.py Modified: python/branches/py3k/Lib/_abcoll.py ============================================================================== --- python/branches/py3k/Lib/_abcoll.py (original) +++ python/branches/py3k/Lib/_abcoll.py Mon May 18 17:35:26 2009 @@ -598,6 +598,7 @@ def __iadd__(self, values): self.extend(values) + return self MutableSequence.register(list) MutableSequence.register(bytearray) # Multiply inheriting, see ByteString From python-checkins at python.org Mon May 18 17:49:55 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 18 May 2009 17:49:55 +0200 (CEST) Subject: [Python-checkins] r72773 - python/branches/release30-maint/Lib/_abcoll.py Message-ID: <20090518154955.561D0C43C@mail.python.org> Author: raymond.hettinger Date: Mon May 18 17:49:55 2009 New Revision: 72773 Log: Issue 6037: MutableSequence.__iadd__ should return self. Modified: python/branches/release30-maint/Lib/_abcoll.py Modified: python/branches/release30-maint/Lib/_abcoll.py ============================================================================== --- python/branches/release30-maint/Lib/_abcoll.py (original) +++ python/branches/release30-maint/Lib/_abcoll.py Mon May 18 17:49:55 2009 @@ -595,6 +595,7 @@ def __iadd__(self, values): self.extend(values) + return self MutableSequence.register(list) MutableSequence.register(bytearray) # Multiply inheriting, see ByteString From python-checkins at python.org Mon May 18 17:51:59 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 18 May 2009 17:51:59 +0200 (CEST) Subject: [Python-checkins] r72774 - python/trunk/Lib/_abcoll.py Message-ID: <20090518155159.8B756D397@mail.python.org> Author: raymond.hettinger Date: Mon May 18 17:51:59 2009 New Revision: 72774 Log: Issue 6037: MutableSequence.__iadd__ should return self. Modified: python/trunk/Lib/_abcoll.py Modified: python/trunk/Lib/_abcoll.py ============================================================================== --- python/trunk/Lib/_abcoll.py (original) +++ python/trunk/Lib/_abcoll.py Mon May 18 17:51:59 2009 @@ -560,5 +560,6 @@ def __iadd__(self, values): self.extend(values) + return self MutableSequence.register(list) From python-checkins at python.org Mon May 18 17:56:38 2009 From: python-checkins at python.org (raymond.hettinger) Date: Mon, 18 May 2009 17:56:38 +0200 (CEST) Subject: [Python-checkins] r72775 - python/branches/release26-maint/Lib/_abcoll.py Message-ID: <20090518155638.C407BC492@mail.python.org> Author: raymond.hettinger Date: Mon May 18 17:56:38 2009 New Revision: 72775 Log: Issue 6037: MutableSequence.__iadd__ should return self. Modified: python/branches/release26-maint/Lib/_abcoll.py Modified: python/branches/release26-maint/Lib/_abcoll.py ============================================================================== --- python/branches/release26-maint/Lib/_abcoll.py (original) +++ python/branches/release26-maint/Lib/_abcoll.py Mon May 18 17:56:38 2009 @@ -557,5 +557,6 @@ def __iadd__(self, values): self.extend(values) + return self MutableSequence.register(list) From buildbot at python.org Mon May 18 18:23:28 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 18 May 2009 16:23:28 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090518162328.9D8CDC499@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.0/builds/23 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon May 18 18:29:32 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 18 May 2009 16:29:32 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090518162932.52EC1D415@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/772 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/process.py", line 232, in _bootstrap self.run() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/process.py", line 88, in run self._target(*self._args, **self._kwargs) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_multiprocessing.py", line 1203, in _putter manager.connect() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 478, in connect dispatch(conn, None, 'dummy') File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 78, in dispatch c.send((id, methodname, args, kwds)) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 394, in send s = self._dumps(obj) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 401, in _xml_dumps return xmlrpclib.dumps((obj,), None, None, None, 1).encode('utf8') AttributeError: 'module' object has no attribute 'dumps' Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/threading.py", line 509, in _bootstrap_inner self.run() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/threading.py", line 462, in run self._target(*self._args, **self._kwargs) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_multiprocessing.py", line 1203, in _putter manager.connect() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 478, in connect dispatch(conn, None, 'dummy') File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 78, in dispatch c.send((id, methodname, args, kwds)) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 394, in send s = self._dumps(obj) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 401, in _xml_dumps return xmlrpclib.dumps((obj,), None, None, None, 1).encode('utf8') AttributeError: 'module' object has no attribute 'dumps' Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/process.py", line 232, in _bootstrap self.run() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/process.py", line 88, in run self._target(*self._args, **self._kwargs) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_multiprocessing.py", line 1203, in _putter manager.connect() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 478, in connect dispatch(conn, None, 'dummy') File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 78, in dispatch c.send((id, methodname, args, kwds)) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 394, in send s = self._dumps(obj) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 401, in _xml_dumps return xmlrpclib.dumps((obj,), None, None, None, 1).encode('utf8') AttributeError: 'module' object has no attribute 'dumps' Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/process.py", line 232, in _bootstrap self.run() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/process.py", line 88, in run self._target(*self._args, **self._kwargs) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_multiprocessing.py", line 1166, in _putter manager.connect() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 478, in connect dispatch(conn, None, 'dummy') File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 78, in dispatch c.send((id, methodname, args, kwds)) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 394, in send s = self._dumps(obj) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 401, in _xml_dumps return xmlrpclib.dumps((obj,), None, None, None, 1).encode('utf8') AttributeError: 'module' object has no attribute 'dumps' 4 tests failed: test_docxmlrpc test_multiprocessing test_xmlrpc test_xmlrpc_net Traceback (most recent call last): File "./Lib/test/regrtest.py", line 614, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_docxmlrpc.py", line 1, in from xmlrpc.server import DocXMLRPCServer File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/xmlrpc/server.py", line 107, in from xmlrpc.client import Fault, dumps, loads ImportError: cannot import name Fault Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/process.py", line 232, in _bootstrap self.run() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/process.py", line 88, in run self._target(*self._args, **self._kwargs) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_multiprocessing.py", line 1203, in _putter manager.connect() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 478, in connect dispatch(conn, None, 'dummy') File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 78, in dispatch c.send((id, methodname, args, kwds)) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 394, in send s = self._dumps(obj) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 401, in _xml_dumps return xmlrpclib.dumps((obj,), None, None, None, 1).encode('utf8') AttributeError: 'module' object has no attribute 'dumps' Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/threading.py", line 509, in _bootstrap_inner self.run() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/threading.py", line 462, in run self._target(*self._args, **self._kwargs) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_multiprocessing.py", line 1203, in _putter manager.connect() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 478, in connect dispatch(conn, None, 'dummy') File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 78, in dispatch c.send((id, methodname, args, kwds)) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 394, in send s = self._dumps(obj) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 401, in _xml_dumps return xmlrpclib.dumps((obj,), None, None, None, 1).encode('utf8') AttributeError: 'module' object has no attribute 'dumps' Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/process.py", line 232, in _bootstrap self.run() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/process.py", line 88, in run self._target(*self._args, **self._kwargs) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_multiprocessing.py", line 1203, in _putter manager.connect() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 478, in connect dispatch(conn, None, 'dummy') File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 78, in dispatch c.send((id, methodname, args, kwds)) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 394, in send s = self._dumps(obj) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 401, in _xml_dumps return xmlrpclib.dumps((obj,), None, None, None, 1).encode('utf8') AttributeError: 'module' object has no attribute 'dumps' Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/process.py", line 232, in _bootstrap self.run() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/process.py", line 88, in run self._target(*self._args, **self._kwargs) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_multiprocessing.py", line 1166, in _putter manager.connect() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 478, in connect dispatch(conn, None, 'dummy') File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 78, in dispatch c.send((id, methodname, args, kwds)) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 394, in send s = self._dumps(obj) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 401, in _xml_dumps return xmlrpclib.dumps((obj,), None, None, None, 1).encode('utf8') AttributeError: 'module' object has no attribute 'dumps' ====================================================================== ERROR: test_rapid_restart (test.test_multiprocessing.WithProcessesTestManagerRestart) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_multiprocessing.py", line 1215, in test_rapid_restart queue = manager.get_queue() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 644, in temp token, exp = self._create(typeid, *args, **kwds) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 544, in _create id, exposed = dispatch(conn, None, 'create', (typeid,)+args, kwds) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 78, in dispatch c.send((id, methodname, args, kwds)) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 394, in send s = self._dumps(obj) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 401, in _xml_dumps return xmlrpclib.dumps((obj,), None, None, None, 1).encode('utf8') AttributeError: 'module' object has no attribute 'dumps' ====================================================================== ERROR: test_rapid_restart (test.test_multiprocessing.WithThreadsTestManagerRestart) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_multiprocessing.py", line 1215, in test_rapid_restart queue = manager.get_queue() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 644, in temp token, exp = self._create(typeid, *args, **kwds) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 544, in _create id, exposed = dispatch(conn, None, 'create', (typeid,)+args, kwds) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 78, in dispatch c.send((id, methodname, args, kwds)) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 394, in send s = self._dumps(obj) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 401, in _xml_dumps return xmlrpclib.dumps((obj,), None, None, None, 1).encode('utf8') AttributeError: 'module' object has no attribute 'dumps' ====================================================================== ERROR: test_rapid_restart (test.test_multiprocessing.WithManagerTestManagerRestart) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_multiprocessing.py", line 1215, in test_rapid_restart queue = manager.get_queue() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 644, in temp token, exp = self._create(typeid, *args, **kwds) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 544, in _create id, exposed = dispatch(conn, None, 'create', (typeid,)+args, kwds) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 78, in dispatch c.send((id, methodname, args, kwds)) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 394, in send s = self._dumps(obj) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 401, in _xml_dumps return xmlrpclib.dumps((obj,), None, None, None, 1).encode('utf8') AttributeError: 'module' object has no attribute 'dumps' ====================================================================== ERROR: test_remote (test.test_multiprocessing.WithManagerTestRemoteManager) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_multiprocessing.py", line 1184, in test_remote manager2.connect() File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 478, in connect dispatch(conn, None, 'dummy') File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/managers.py", line 78, in dispatch c.send((id, methodname, args, kwds)) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 394, in send s = self._dumps(obj) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/multiprocessing/connection.py", line 401, in _xml_dumps return xmlrpclib.dumps((obj,), None, None, None, 1).encode('utf8') AttributeError: 'module' object has no attribute 'dumps' ====================================================================== FAIL: test_number_of_objects (test.test_multiprocessing.WithManagerTestZZZNumberOfObjects) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_multiprocessing.py", line 1070, in test_number_of_objects self.assertEqual(refs, EXPECTED_NUMBER) AssertionError: 6 != 1 Traceback (most recent call last): File "./Lib/test/regrtest.py", line 614, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_xmlrpc.py", line 7, in import xmlrpc.server File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/xmlrpc/server.py", line 107, in from xmlrpc.client import Fault, dumps, loads ImportError: cannot import name Fault ====================================================================== ERROR: test_current_time (test.test_xmlrpc_net.CurrentTimeTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_xmlrpc_net.py", line 16, in test_current_time server = xmlrpclib.ServerProxy("http://time.xmlrpc.com/RPC2") AttributeError: 'module' object has no attribute 'ServerProxy' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Mon May 18 22:23:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 18 May 2009 20:23:57 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090518202357.46442D644@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/712 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Mon May 18 23:14:54 2009 From: python-checkins at python.org (jeffrey.yasskin) Date: Mon, 18 May 2009 23:14:54 +0200 (CEST) Subject: [Python-checkins] r72776 - in python/trunk: Lib/test/test_trace.py Objects/frameobject.c Message-ID: <20090518211454.CC74DD438@mail.python.org> Author: jeffrey.yasskin Date: Mon May 18 23:14:54 2009 New Revision: 72776 Log: While I was modifying test_trace, it threw an exception when I accidentally made it try to set the line number from the trace callback for a 'call' event. This patch makes the error message a little more helpful in that case, and makes it a little less likely that a future editor will make the same mistake in test_trace. Modified: python/trunk/Lib/test/test_trace.py python/trunk/Objects/frameobject.c Modified: python/trunk/Lib/test/test_trace.py ============================================================================== --- python/trunk/Lib/test/test_trace.py (original) +++ python/trunk/Lib/test/test_trace.py Mon May 18 23:14:54 2009 @@ -471,7 +471,7 @@ def trace(self, frame, event, arg): if not self.done and frame.f_code == self.function.func_code: firstLine = frame.f_code.co_firstlineno - if frame.f_lineno == firstLine + self.jumpFrom: + if event == 'line' and frame.f_lineno == firstLine + self.jumpFrom: # Cope with non-integer self.jumpTo (because of # no_jump_to_non_integers below). try: Modified: python/trunk/Objects/frameobject.c ============================================================================== --- python/trunk/Objects/frameobject.c (original) +++ python/trunk/Objects/frameobject.c Mon May 18 23:14:54 2009 @@ -127,7 +127,8 @@ if (!f->f_trace) { PyErr_Format(PyExc_ValueError, - "f_lineno can only be set by a trace function"); + "f_lineno can only be set by a" + " line trace function"); return -1; } From nnorwitz at gmail.com Mon May 18 23:31:33 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 18 May 2009 17:31:33 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (3) Message-ID: <20090518213133.GA17818@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 test_ssl leaked [403, 0, 0] references, sum=403 test_warnings leaked [0, 0, 60] references, sum=60 Less important issues: ---------------------- test_asynchat leaked [126, -126, 0] references, sum=0 test_cmd_line leaked [0, 0, -25] references, sum=-25 test_file leaked [-77, 0, 0] references, sum=-77 test_smtplib leaked [88, -88, 0] references, sum=0 test_sys leaked [42, -42, 42] references, sum=42 test_threading leaked [48, 53, 43] references, sum=144 test_urllib2_localnet leaked [3, 3, 285] references, sum=291 test_xmlrpc leaked [-94, 8, -8] references, sum=-94 From python-checkins at python.org Mon May 18 23:35:41 2009 From: python-checkins at python.org (collin.winter) Date: Mon, 18 May 2009 23:35:41 +0200 (CEST) Subject: [Python-checkins] r72777 - in python/trunk: Lib/test/test_urllib2_localnet.py Misc/build.sh Message-ID: <20090518213541.2F289D5E0@mail.python.org> Author: collin.winter Date: Mon May 18 23:35:40 2009 New Revision: 72777 Log: Issue 6032: fix refleaks in test_urllib2_localnet. Modified: python/trunk/Lib/test/test_urllib2_localnet.py python/trunk/Misc/build.sh Modified: python/trunk/Lib/test/test_urllib2_localnet.py ============================================================================== --- python/trunk/Lib/test/test_urllib2_localnet.py (original) +++ python/trunk/Lib/test/test_urllib2_localnet.py Mon May 18 23:35:40 2009 @@ -195,7 +195,11 @@ testing. """ - digest_auth_handler = DigestAuthHandler() + def __init__(self, digest_auth_handler, *args, **kwargs): + # This has to be set before calling our parent's __init__(), which will + # try to call do_GET(). + self.digest_auth_handler = digest_auth_handler + BaseHTTPServer.BaseHTTPRequestHandler.__init__(self, *args, **kwargs) def log_message(self, format, *args): # Uncomment the next line for debugging. @@ -224,49 +228,50 @@ REALM = "TestRealm" def setUp(self): - FakeProxyHandler.digest_auth_handler.set_users({ - self.USER : self.PASSWD - }) - FakeProxyHandler.digest_auth_handler.set_realm(self.REALM) + self.digest_auth_handler = DigestAuthHandler() + self.digest_auth_handler.set_users({self.USER: self.PASSWD}) + self.digest_auth_handler.set_realm(self.REALM) + def create_fake_proxy_handler(*args, **kwargs): + return FakeProxyHandler(self.digest_auth_handler, *args, **kwargs) - self.server = LoopbackHttpServerThread(FakeProxyHandler) + self.server = LoopbackHttpServerThread(create_fake_proxy_handler) self.server.start() self.server.ready.wait() proxy_url = "http://127.0.0.1:%d" % self.server.port handler = urllib2.ProxyHandler({"http" : proxy_url}) - self._digest_auth_handler = urllib2.ProxyDigestAuthHandler() - self.opener = urllib2.build_opener(handler, self._digest_auth_handler) + self.proxy_digest_handler = urllib2.ProxyDigestAuthHandler() + self.opener = urllib2.build_opener(handler, self.proxy_digest_handler) def tearDown(self): self.server.stop() def test_proxy_with_bad_password_raises_httperror(self): - self._digest_auth_handler.add_password(self.REALM, self.URL, + self.proxy_digest_handler.add_password(self.REALM, self.URL, self.USER, self.PASSWD+"bad") - FakeProxyHandler.digest_auth_handler.set_qop("auth") + self.digest_auth_handler.set_qop("auth") self.assertRaises(urllib2.HTTPError, self.opener.open, self.URL) def test_proxy_with_no_password_raises_httperror(self): - FakeProxyHandler.digest_auth_handler.set_qop("auth") + self.digest_auth_handler.set_qop("auth") self.assertRaises(urllib2.HTTPError, self.opener.open, self.URL) def test_proxy_qop_auth_works(self): - self._digest_auth_handler.add_password(self.REALM, self.URL, + self.proxy_digest_handler.add_password(self.REALM, self.URL, self.USER, self.PASSWD) - FakeProxyHandler.digest_auth_handler.set_qop("auth") + self.digest_auth_handler.set_qop("auth") result = self.opener.open(self.URL) while result.read(): pass result.close() def test_proxy_qop_auth_int_works_or_throws_urlerror(self): - self._digest_auth_handler.add_password(self.REALM, self.URL, + self.proxy_digest_handler.add_password(self.REALM, self.URL, self.USER, self.PASSWD) - FakeProxyHandler.digest_auth_handler.set_qop("auth-int") + self.digest_auth_handler.set_qop("auth-int") try: result = self.opener.open(self.URL) except urllib2.URLError: @@ -484,8 +489,7 @@ # the next line. #test_support.requires("network") - test_support.run_unittest(ProxyAuthTests) - test_support.run_unittest(TestUrlopen) + test_support.run_unittest(ProxyAuthTests, TestUrlopen) if __name__ == "__main__": test_main() Modified: python/trunk/Misc/build.sh ============================================================================== --- python/trunk/Misc/build.sh (original) +++ python/trunk/Misc/build.sh Mon May 18 23:35:40 2009 @@ -67,7 +67,7 @@ # Note: test_XXX (none currently) really leak, but are disabled # so we don't send spam. Any test which really leaks should only # be listed here if there are also test cases under Lib/test/leakers. -LEAKY_TESTS="test_(asynchat|cmd_line|docxmlrpc|dumbdbm|file|ftplib|httpservers|imaplib|popen2|socket|smtplib|sys|telnetlib|threadedtempfile|threading|threadsignals|urllib2_localnet|xmlrpc)" +LEAKY_TESTS="test_(asynchat|cmd_line|docxmlrpc|dumbdbm|file|ftplib|httpservers|imaplib|popen2|socket|smtplib|sys|telnetlib|threadedtempfile|threading|threadsignals|xmlrpc)" # Skip these tests altogether when looking for leaks. These tests # do not need to be stored above in LEAKY_TESTS too. From python-checkins at python.org Tue May 19 00:32:26 2009 From: python-checkins at python.org (collin.winter) Date: Tue, 19 May 2009 00:32:26 +0200 (CEST) Subject: [Python-checkins] r72778 - in python/branches/py3k: Lib/test/test_urllib2_localnet.py Misc/build.sh Message-ID: <20090518223226.DC6D9C3BC@mail.python.org> Author: collin.winter Date: Tue May 19 00:32:26 2009 New Revision: 72778 Log: Merged revisions 72777 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72777 | collin.winter | 2009-05-18 14:35:40 -0700 (Mon, 18 May 2009) | 1 line Issue 6032: fix refleaks in test_urllib2_localnet. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_urllib2_localnet.py python/branches/py3k/Misc/build.sh Modified: python/branches/py3k/Lib/test/test_urllib2_localnet.py ============================================================================== --- python/branches/py3k/Lib/test/test_urllib2_localnet.py (original) +++ python/branches/py3k/Lib/test/test_urllib2_localnet.py Tue May 19 00:32:26 2009 @@ -195,7 +195,11 @@ testing. """ - digest_auth_handler = DigestAuthHandler() + def __init__(self, digest_auth_handler, *args, **kwargs): + # This has to be set before calling our parent's __init__(), which will + # try to call do_GET(). + self.digest_auth_handler = digest_auth_handler + http.server.BaseHTTPRequestHandler.__init__(self, *args, **kwargs) def log_message(self, format, *args): # Uncomment the next line for debugging. @@ -225,50 +229,51 @@ REALM = "TestRealm" def setUp(self): - FakeProxyHandler.digest_auth_handler.set_users({ - self.USER : self.PASSWD - }) - FakeProxyHandler.digest_auth_handler.set_realm(self.REALM) + self.digest_auth_handler = DigestAuthHandler() + self.digest_auth_handler.set_users({self.USER: self.PASSWD}) + self.digest_auth_handler.set_realm(self.REALM) + def create_fake_proxy_handler(*args, **kwargs): + return FakeProxyHandler(self.digest_auth_handler, *args, **kwargs) - self.server = LoopbackHttpServerThread(FakeProxyHandler) + self.server = LoopbackHttpServerThread(create_fake_proxy_handler) self.server.start() self.server.ready.wait() proxy_url = "http://127.0.0.1:%d" % self.server.port handler = urllib.request.ProxyHandler({"http" : proxy_url}) - self._digest_auth_handler = urllib.request.ProxyDigestAuthHandler() + self.proxy_digest_handler = urllib.request.ProxyDigestAuthHandler() self.opener = urllib.request.build_opener( - handler, self._digest_auth_handler) + handler, self.proxy_digest_handler) def tearDown(self): self.server.stop() def test_proxy_with_bad_password_raises_httperror(self): - self._digest_auth_handler.add_password(self.REALM, self.URL, + self.proxy_digest_handler.add_password(self.REALM, self.URL, self.USER, self.PASSWD+"bad") - FakeProxyHandler.digest_auth_handler.set_qop("auth") + self.digest_auth_handler.set_qop("auth") self.assertRaises(urllib.error.HTTPError, self.opener.open, self.URL) def test_proxy_with_no_password_raises_httperror(self): - FakeProxyHandler.digest_auth_handler.set_qop("auth") + self.digest_auth_handler.set_qop("auth") self.assertRaises(urllib.error.HTTPError, self.opener.open, self.URL) def test_proxy_qop_auth_works(self): - self._digest_auth_handler.add_password(self.REALM, self.URL, + self.proxy_digest_handler.add_password(self.REALM, self.URL, self.USER, self.PASSWD) - FakeProxyHandler.digest_auth_handler.set_qop("auth") + self.digest_auth_handler.set_qop("auth") result = self.opener.open(self.URL) while result.read(): pass result.close() def test_proxy_qop_auth_int_works_or_throws_urlerror(self): - self._digest_auth_handler.add_password(self.REALM, self.URL, + self.proxy_digest_handler.add_password(self.REALM, self.URL, self.USER, self.PASSWD) - FakeProxyHandler.digest_auth_handler.set_qop("auth-int") + self.digest_auth_handler.set_qop("auth-int") try: result = self.opener.open(self.URL) except urllib.error.URLError: @@ -474,8 +479,7 @@ "http://sadflkjsasf.i.nvali.d/") def test_main(): - support.run_unittest(ProxyAuthTests) - support.run_unittest(TestUrlopen) + support.run_unittest(ProxyAuthTests, TestUrlopen) if __name__ == "__main__": test_main() Modified: python/branches/py3k/Misc/build.sh ============================================================================== --- python/branches/py3k/Misc/build.sh (original) +++ python/branches/py3k/Misc/build.sh Tue May 19 00:32:26 2009 @@ -67,7 +67,7 @@ # Note: test_XXX (none currently) really leak, but are disabled # so we don't send spam. Any test which really leaks should only # be listed here if there are also test cases under Lib/test/leakers. -LEAKY_TESTS="test_(asynchat|cmd_line|docxmlrpc|dumbdbm|file|ftplib|httpservers|imaplib|popen2|socket|smtplib|sys|telnetlib|threadedtempfile|threading|threadsignals|urllib2_localnet|xmlrpc)" +LEAKY_TESTS="test_(asynchat|cmd_line|docxmlrpc|dumbdbm|file|ftplib|httpservers|imaplib|popen2|socket|smtplib|sys|telnetlib|threadedtempfile|threading|threadsignals|xmlrpc)" # These tests always fail, so skip them so we don't get false positives. _ALWAYS_SKIP="" From buildbot at python.org Tue May 19 00:55:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 18 May 2009 22:55:27 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090518225527.7C702D558@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/540 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: collin.winter BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Tue May 19 11:28:35 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 19 May 2009 05:28:35 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090519092835.GA30790@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 Less important issues: ---------------------- test_file leaked [0, 0, 77] references, sum=77 test_smtplib leaked [-83, 8, -8] references, sum=-83 test_sys leaked [-21, -21, 42] references, sum=0 test_threading leaked [48, 53, 43] references, sum=144 test_threadsignals leaked [0, 0, -8] references, sum=-8 From python-checkins at python.org Tue May 19 13:27:26 2009 From: python-checkins at python.org (ronald.oussoren) Date: Tue, 19 May 2009 13:27:26 +0200 (CEST) Subject: [Python-checkins] r72779 - in python/branches/py3k/Mac: BuildScript BuildScript/build-installer.py Makefile.in Resources/app/Resources/English.lproj Message-ID: <20090519112726.270E3D4C2@mail.python.org> Author: ronald.oussoren Date: Tue May 19 13:27:25 2009 New Revision: 72779 Log: MACOSX * Remove junk documentation resources from the Python.app inside the framework (This is a left-over from the ancient Python IDE, which was removed before 2.5) * Ensure that the documentation is installed in a location where IDLE will see it Removed: python/branches/py3k/Mac/Resources/app/Resources/English.lproj/ Modified: python/branches/py3k/Mac/BuildScript/ (props changed) python/branches/py3k/Mac/BuildScript/build-installer.py python/branches/py3k/Mac/Makefile.in Modified: python/branches/py3k/Mac/BuildScript/build-installer.py ============================================================================== --- python/branches/py3k/Mac/BuildScript/build-installer.py (original) +++ python/branches/py3k/Mac/BuildScript/build-installer.py Tue May 19 13:27:25 2009 @@ -614,10 +614,9 @@ runCommand('make update') runCommand('make html') os.chdir(curDir) - if not os.path.exists(docdir): - os.mkdir(docdir) - os.rename(os.path.join(buildDir, 'build', 'html'), - os.path.join(docdir, 'python-docs-html')) + if os.path.exists(docdir): + os.rmdir(docdir) + os.rename(os.path.join(buildDir, 'build', 'html'), docdir) def buildPython(): @@ -663,7 +662,7 @@ runCommand("make") print "Running make frameworkinstall" - runCommand("make frameworkinstall DESTDIR=%s"%( + runCommand("make install DESTDIR=%s"%( shellQuote(rootDir))) print "Running make frameworkinstallextras" Modified: python/branches/py3k/Mac/Makefile.in ============================================================================== --- python/branches/py3k/Mac/Makefile.in (original) +++ python/branches/py3k/Mac/Makefile.in Tue May 19 13:27:25 2009 @@ -38,12 +38,7 @@ CPMAC=/Developer/Tools/CpMac APPTEMPLATE=$(srcdir)/Resources/app -APPSUBDIRS=MacOS Resources Resources/English.lproj \ - Resources/English.lproj/Documentation \ - Resources/English.lproj/Documentation/doc \ - Resources/English.lproj/Documentation/ide -DOCDIR=$(srcdir)/Resources/app/Resources/English.lproj/Documentation -DOCINDEX=$(DOCDIR)/"Documentation idx" +APPSUBDIRS=MacOS Resources compileall=$(srcdir)/../Lib/compileall.py installapps: install_Python install_PythonLauncher install_IDLE \ @@ -157,9 +152,6 @@ cd PythonLauncher && make install DESTDIR=$(DESTDIR) install_Python: - @if test ! -f $(DOCINDEX); then \ - echo WARNING: you should run Apple Help Indexing Tool on $(DOCDIR); \ - fi @for i in "$(PYTHONAPPSDIR)" "$(APPINSTALLDIR)" "$(APPINSTALLDIR)/Contents"; do \ if test ! -d "$(DESTDIR)$$i"; then \ echo "Creating directory $(DESTDIR)$$i"; \ From buildbot at python.org Tue May 19 13:53:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 19 May 2009 11:53:07 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090519115307.298C2D274@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/651 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: ronald.oussoren BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue May 19 14:00:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 19 May 2009 12:00:52 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090519120052.71A95D478@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/999 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: ronald.oussoren BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Tue May 19 14:03:51 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 19 May 2009 12:03:51 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090519120352.15F2CD2AC@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/835 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: ronald.oussoren BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue May 19 14:10:32 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 19 May 2009 12:10:32 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090519121032.99CE3D3AE@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/774 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: ronald.oussoren BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue May 19 14:15:58 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 19 May 2009 12:15:58 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090519121558.8C614D51C@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/714 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: ronald.oussoren BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Tue May 19 14:43:34 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 19 May 2009 14:43:34 +0200 (CEST) Subject: [Python-checkins] r72780 - peps/trunk/pep-0376.txt Message-ID: <20090519124334.CE2E1D5E1@mail.python.org> Author: tarek.ziade Date: Tue May 19 14:43:34 2009 New Revision: 72780 Log: changes from pje feedback Modified: peps/trunk/pep-0376.txt Modified: peps/trunk/pep-0376.txt ============================================================================== --- peps/trunk/pep-0376.txt (original) +++ peps/trunk/pep-0376.txt Tue May 19 14:43:34 2009 @@ -152,14 +152,14 @@ ----------------- The `RECORD` file is composed of records, one line per installed file. -Each record is composed of three elements separated by a `;` character: +Each record is composed of three elements separated by a character: - the file's full **path** - - if the installed file is located in a directory in `site-packages`, - it will be a '/'-separated relative path, no matter what is the target - system. This makes this information cross-compatible and allows simple - installation to be relocatable. + - if the installed file is located in the directory where the .egg-info + directory of the package is located, it will be a '/'-separated relative + path, no matter what is the target system. This makes this information + cross-compatible and allows simple installation to be relocatable. - if the installed file is located elsewhere in the system, a '/'-separated absolute path is used. @@ -181,11 +181,11 @@ And the RECORD file will contain:: - zlib/include/zconf.h;b690274f621402dda63bf11ba5373bf2;9544 - zlib/include/zlib.h;9c4b84aff68aa55f2e9bf70481b94333;66188 - zlib/lib/libz.a;e6d43fb94292411909404b07d0692d46;91128 - zlib/share/man/man3/zlib.3;785dc03452f0508ff0678fba2457e0ba;4486 - zlib-2.5.2.egg-info/PKG-INFO;6fe57de576d749536082d8e205b77748;195 + zlib/include/zconf.h b690274f621402dda63bf11ba5373bf2 9544 + zlib/include/zlib.h 9c4b84aff68aa55f2e9bf70481b94333 66188 + zlib/lib/libz.a e6d43fb94292411909404b07d0692d46 91128 + zlib/share/man/man3/zlib.3 785dc03452f0508ff0678fba2457e0ba 4486 + zlib-2.5.2.egg-info/PKG-INFO 6fe57de576d749536082d8e205b77748 195 zlib-2.5.2.egg-info/RECORD Notice that: @@ -202,6 +202,12 @@ The new functions added in the package are : +- get_projects() -> iterator + + Provides an iterator that will return (name, path) tuples, where `name` + is the name of a registered project and `path` the path to its `egg-info` + directory. + - get_egg_info(project_name) -> path or None Scans all elements in `sys.path` and looks for all directories ending with @@ -219,25 +225,36 @@ Uses `get_egg_info` to get the `PKG-INFO` file, and returns a `DistributionMetadata` instance that contains the metadata. -- get_files(project_name) -> iterator of (path, hash, size, other_projects) +- get_files(project_name, local=False) -> iterator of (path, hash, size, + other_projects) Uses `get_egg_info` to get the `RECORD` file, and returns an iterator. Each returned element is a tuple `(path, hash, size, other_projects)` where ``path``, ``hash``, ``size`` are the values found in the RECORD file. + `path` is the raw value founded in the RECORD file. If `local` is + set to True, `path` will be translated to its real absolute path, using + the local path separator. + `other_projects` is a tuple containing the name of the projects that are also referring to this file in their own RECORD file (same path). If `other_projects` is empty, it means that the file is only referred by the current project. In other words, it can be removed if the project is removed. -- get_egg_info_file(project_name, path) -> file object or None +- get_egg_info_file(project_name, path, binary=False) -> file object or None Uses `get_egg_info` and gets any element inside the directory, pointed by its relative path. `get_egg_info_file` will perform an `os.path.join` on `get_egg_info(project_name)` and `path` to build the - whole path. + whole path. + + `path` can be a '/'-separated path or can use the local separator. + `get_egg_info_file` will automatically convert it using the platform path + separator, to look for the file. + + If `binary` is set True, the file will be opened using the binary mode. Let's use it with our `zlib` example:: From python-checkins at python.org Tue May 19 18:17:21 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 19 May 2009 18:17:21 +0200 (CEST) Subject: [Python-checkins] r72781 - in python/trunk: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090519161721.9F380D66B@mail.python.org> Author: tarek.ziade Date: Tue May 19 18:17:21 2009 New Revision: 72781 Log: fixed the 'package' option of build_ext Modified: python/trunk/Lib/distutils/command/build_ext.py python/trunk/Lib/distutils/tests/test_build_ext.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/command/build_ext.py ============================================================================== --- python/trunk/Lib/distutils/command/build_ext.py (original) +++ python/trunk/Lib/distutils/command/build_ext.py Tue May 19 18:17:21 2009 @@ -642,19 +642,21 @@ The file is located in `build_lib` or directly in the package (inplace option). """ - if self.inplace: - fullname = self.get_ext_fullname(ext_name) - modpath = fullname.split('.') - package = '.'.join(modpath[0:-1]) - base = modpath[-1] - build_py = self.get_finalized_command('build_py') - package_dir = os.path.abspath(build_py.get_package_dir(package)) - filename = self.get_ext_filename(ext_name) - return os.path.join(package_dir, filename) - else: - filename = self.get_ext_filename(ext_name) + fullname = self.get_ext_fullname(ext_name) + filename = self.get_ext_filename(fullname) + if not self.inplace: + # no further work needed return os.path.join(self.build_lib, filename) + # the inplace option requires to find the package directory + # using the build_py command + modpath = fullname.split('.') + package = '.'.join(modpath[0:-1]) + base = modpath[-1] + build_py = self.get_finalized_command('build_py') + package_dir = os.path.abspath(build_py.get_package_dir(package)) + return os.path.join(package_dir, filename) + def get_ext_fullname(self, ext_name): """Returns the fullname of a given extension name. Modified: python/trunk/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_build_ext.py (original) +++ python/trunk/Lib/distutils/tests/test_build_ext.py Tue May 19 18:17:21 2009 @@ -336,6 +336,28 @@ so_dir = os.path.dirname(so_file) self.assertEquals(so_dir, cmd.build_lib) + # inplace = 0, cmd.package = 'bar' + cmd.package = 'bar' + path = cmd.get_ext_fullpath('foo') + # checking that the last directory is bar + path = os.path.split(path)[0] + lastdir = os.path.split(path)[-1] + self.assertEquals(lastdir, cmd.package) + + # inplace = 1, cmd.package = 'bar' + cmd.inplace = 1 + other_tmp_dir = os.path.realpath(self.mkdtemp()) + old_wd = os.getcwd() + os.chdir(other_tmp_dir) + try: + path = cmd.get_ext_fullpath('foo') + finally: + os.chdir(old_wd) + # checking that the last directory is bar + path = os.path.split(path)[0] + lastdir = os.path.split(path)[-1] + self.assertEquals(lastdir, cmd.package) + def test_suite(): src = _get_source_filename() if not os.path.exists(src): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Tue May 19 18:17:21 2009 @@ -298,6 +298,9 @@ Library ------- +- Issue #6062: In distutils, fixed the package option of build_ext. Feedback + and tests on pywin32 by Tim Golden. + - Issue #6053: Fixed distutils tests on win32. patch by Hirokazu Yamamoto. - Issue #6046: Fixed the library extension when distutils build_ext is used From python-checkins at python.org Tue May 19 18:19:15 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 19 May 2009 18:19:15 +0200 (CEST) Subject: [Python-checkins] r72782 - in python/branches/release26-maint: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090519161915.80286D9F8@mail.python.org> Author: tarek.ziade Date: Tue May 19 18:19:15 2009 New Revision: 72782 Log: Merged revisions 72781 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72781 | tarek.ziade | 2009-05-19 18:17:21 +0200 (Tue, 19 May 2009) | 1 line fixed the 'package' option of build_ext ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/distutils/command/build_ext.py python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/distutils/command/build_ext.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/command/build_ext.py (original) +++ python/branches/release26-maint/Lib/distutils/command/build_ext.py Tue May 19 18:19:15 2009 @@ -628,19 +628,21 @@ The file is located in `build_lib` or directly in the package (inplace option). """ - if self.inplace: - fullname = self.get_ext_fullname(ext_name) - modpath = fullname.split('.') - package = '.'.join(modpath[0:-1]) - base = modpath[-1] - build_py = self.get_finalized_command('build_py') - package_dir = os.path.abspath(build_py.get_package_dir(package)) - filename = self.get_ext_filename(ext_name) - return os.path.join(package_dir, filename) - else: - filename = self.get_ext_filename(ext_name) + fullname = self.get_ext_fullname(ext_name) + filename = self.get_ext_filename(fullname) + if not self.inplace: + # no further work needed return os.path.join(self.build_lib, filename) + # the inplace option requires to find the package directory + # using the build_py command + modpath = fullname.split('.') + package = '.'.join(modpath[0:-1]) + base = modpath[-1] + build_py = self.get_finalized_command('build_py') + package_dir = os.path.abspath(build_py.get_package_dir(package)) + return os.path.join(package_dir, filename) + def get_ext_fullname(self, ext_name): """Returns the fullname of a given extension name. Modified: python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/release26-maint/Lib/distutils/tests/test_build_ext.py Tue May 19 18:19:15 2009 @@ -273,6 +273,28 @@ so_dir = os.path.dirname(so_file) self.assertEquals(so_dir, cmd.build_lib) + # inplace = 0, cmd.package = 'bar' + cmd.package = 'bar' + path = cmd.get_ext_fullpath('foo') + # checking that the last directory is bar + path = os.path.split(path)[0] + lastdir = os.path.split(path)[-1] + self.assertEquals(lastdir, cmd.package) + + # inplace = 1, cmd.package = 'bar' + cmd.inplace = 1 + other_tmp_dir = os.path.realpath(self.mkdtemp()) + old_wd = os.getcwd() + os.chdir(other_tmp_dir) + try: + path = cmd.get_ext_fullpath('foo') + finally: + os.chdir(old_wd) + # checking that the last directory is bar + path = os.path.split(path)[0] + lastdir = os.path.split(path)[-1] + self.assertEquals(lastdir, cmd.package) + def test_suite(): if not sysconfig.python_build: if test_support.verbose: Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Tue May 19 18:19:15 2009 @@ -198,6 +198,9 @@ Library ------- +- Issue #6062: In distutils, fixed the package option of build_ext. Feedback + and tests on pywin32 by Tim Golden. + - Issue #6046: Fixed the library extension when distutils build_ext is used inplace. Initial patch by Roumen Petrov. From python-checkins at python.org Tue May 19 18:22:57 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 19 May 2009 18:22:57 +0200 (CEST) Subject: [Python-checkins] r72783 - in python/branches/py3k: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090519162257.EF2E5D814@mail.python.org> Author: tarek.ziade Date: Tue May 19 18:22:57 2009 New Revision: 72783 Log: Merged revisions 72781 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72781 | tarek.ziade | 2009-05-19 18:17:21 +0200 (Tue, 19 May 2009) | 1 line fixed the 'package' option of build_ext ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/command/build_ext.py python/branches/py3k/Lib/distutils/tests/test_build_ext.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/distutils/command/build_ext.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/build_ext.py (original) +++ python/branches/py3k/Lib/distutils/command/build_ext.py Tue May 19 18:22:57 2009 @@ -629,19 +629,21 @@ The file is located in `build_lib` or directly in the package (inplace option). """ - if self.inplace: - fullname = self.get_ext_fullname(ext_name) - modpath = fullname.split('.') - package = '.'.join(modpath[0:-1]) - base = modpath[-1] - build_py = self.get_finalized_command('build_py') - package_dir = os.path.abspath(build_py.get_package_dir(package)) - filename = self.get_ext_filename(ext_name) - return os.path.join(package_dir, filename) - else: - filename = self.get_ext_filename(ext_name) + fullname = self.get_ext_fullname(ext_name) + filename = self.get_ext_filename(fullname) + if not self.inplace: + # no further work needed return os.path.join(self.build_lib, filename) + # the inplace option requires to find the package directory + # using the build_py command + modpath = fullname.split('.') + package = '.'.join(modpath[0:-1]) + base = modpath[-1] + build_py = self.get_finalized_command('build_py') + package_dir = os.path.abspath(build_py.get_package_dir(package)) + return os.path.join(package_dir, filename) + def get_ext_fullname(self, ext_name): """Returns the fullname of a given extension name. Modified: python/branches/py3k/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_build_ext.py Tue May 19 18:22:57 2009 @@ -336,6 +336,28 @@ so_dir = os.path.dirname(so_file) self.assertEquals(so_dir, cmd.build_lib) + # inplace = 0, cmd.package = 'bar' + cmd.package = 'bar' + path = cmd.get_ext_fullpath('foo') + # checking that the last directory is bar + path = os.path.split(path)[0] + lastdir = os.path.split(path)[-1] + self.assertEquals(lastdir, cmd.package) + + # inplace = 1, cmd.package = 'bar' + cmd.inplace = 1 + other_tmp_dir = os.path.realpath(self.mkdtemp()) + old_wd = os.getcwd() + os.chdir(other_tmp_dir) + try: + path = cmd.get_ext_fullpath('foo') + finally: + os.chdir(old_wd) + # checking that the last directory is bar + path = os.path.split(path)[0] + lastdir = os.path.split(path)[-1] + self.assertEquals(lastdir, cmd.package) + def test_suite(): src = _get_source_filename() if not os.path.exists(src): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue May 19 18:22:57 2009 @@ -618,6 +618,9 @@ Library ------- +- Issue #6062: In distutils, fixed the package option of build_ext. Feedback + and tests on pywin32 by Tim Golden. + - Issue #6053: Fixed distutils tests on win32. patch by Hirokazu Yamamoto. - Issue #6046: Fixed the library extension when distutils build_ext is used From python-checkins at python.org Tue May 19 18:24:16 2009 From: python-checkins at python.org (tarek.ziade) Date: Tue, 19 May 2009 18:24:16 +0200 (CEST) Subject: [Python-checkins] r72784 - in python/branches/release30-maint: Lib/distutils/command/build_ext.py Lib/distutils/tests/test_build_ext.py Misc/NEWS Message-ID: <20090519162416.53EB7D33F@mail.python.org> Author: tarek.ziade Date: Tue May 19 18:24:16 2009 New Revision: 72784 Log: Merged revisions 72783 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72783 | tarek.ziade | 2009-05-19 18:22:57 +0200 (Tue, 19 May 2009) | 9 lines Merged revisions 72781 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72781 | tarek.ziade | 2009-05-19 18:17:21 +0200 (Tue, 19 May 2009) | 1 line fixed the 'package' option of build_ext ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/distutils/command/build_ext.py python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/distutils/command/build_ext.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/command/build_ext.py (original) +++ python/branches/release30-maint/Lib/distutils/command/build_ext.py Tue May 19 18:24:16 2009 @@ -613,19 +613,21 @@ The file is located in `build_lib` or directly in the package (inplace option). """ - if self.inplace: - fullname = self.get_ext_fullname(ext_name) - modpath = fullname.split('.') - package = '.'.join(modpath[0:-1]) - base = modpath[-1] - build_py = self.get_finalized_command('build_py') - package_dir = os.path.abspath(build_py.get_package_dir(package)) - filename = self.get_ext_filename(ext_name) - return os.path.join(package_dir, filename) - else: - filename = self.get_ext_filename(ext_name) + fullname = self.get_ext_fullname(ext_name) + filename = self.get_ext_filename(fullname) + if not self.inplace: + # no further work needed return os.path.join(self.build_lib, filename) + # the inplace option requires to find the package directory + # using the build_py command + modpath = fullname.split('.') + package = '.'.join(modpath[0:-1]) + base = modpath[-1] + build_py = self.get_finalized_command('build_py') + package_dir = os.path.abspath(build_py.get_package_dir(package)) + return os.path.join(package_dir, filename) + def get_ext_fullname(self, ext_name): """Returns the fullname of a given extension name. Modified: python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py (original) +++ python/branches/release30-maint/Lib/distutils/tests/test_build_ext.py Tue May 19 18:24:16 2009 @@ -274,6 +274,28 @@ so_dir = os.path.dirname(so_file) self.assertEquals(so_dir, cmd.build_lib) + # inplace = 0, cmd.package = 'bar' + cmd.package = 'bar' + path = cmd.get_ext_fullpath('foo') + # checking that the last directory is bar + path = os.path.split(path)[0] + lastdir = os.path.split(path)[-1] + self.assertEquals(lastdir, cmd.package) + + # inplace = 1, cmd.package = 'bar' + cmd.inplace = 1 + other_tmp_dir = os.path.realpath(self.mkdtemp()) + old_wd = os.getcwd() + os.chdir(other_tmp_dir) + try: + path = cmd.get_ext_fullpath('foo') + finally: + os.chdir(old_wd) + # checking that the last directory is bar + path = os.path.split(path)[0] + lastdir = os.path.split(path)[-1] + self.assertEquals(lastdir, cmd.package) + def test_suite(): if not sysconfig.python_build: if support.verbose: Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Tue May 19 18:24:16 2009 @@ -285,6 +285,9 @@ Library ------- +- Issue #6062: In distutils, fixed the package option of build_ext. Feedback + and tests on pywin32 by Tim Golden. + - Issue #6046: Fixed the library extension when distutils build_ext is used inplace. Initial patch by Roumen Petrov. From buildbot at python.org Tue May 19 19:07:16 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 19 May 2009 17:07:16 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090519170716.8B7A4D61B@mail.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/5027 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Tue May 19 19:40:07 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 19 May 2009 19:40:07 +0200 (CEST) Subject: [Python-checkins] r72785 - python/branches/py3k/Doc/library/collections.rst Message-ID: <20090519174007.4DF4BD72C@mail.python.org> Author: raymond.hettinger Date: Tue May 19 19:40:07 2009 New Revision: 72785 Log: Note that ordered dictionaries work with reversed(). Modified: python/branches/py3k/Doc/library/collections.rst Modified: python/branches/py3k/Doc/library/collections.rst ============================================================================== --- python/branches/py3k/Doc/library/collections.rst (original) +++ python/branches/py3k/Doc/library/collections.rst Tue May 19 19:40:07 2009 @@ -844,6 +844,9 @@ a (key, value) pair. The pairs are returned in LIFO order if *last* is true or FIFO order if false. +In addition to the usual mapping methods, ordered dictionaries also support +reverse iteration using :func:`reversed`. + Equality tests between :class:`OrderedDict` objects are order-sensitive and are implemented as ``list(od1.items())==list(od2.items())``. Equality tests between :class:`OrderedDict` objects and other From python-checkins at python.org Tue May 19 19:43:59 2009 From: python-checkins at python.org (raymond.hettinger) Date: Tue, 19 May 2009 19:43:59 +0200 (CEST) Subject: [Python-checkins] r72786 - python/trunk/Doc/library/collections.rst Message-ID: <20090519174359.63B06D94D@mail.python.org> Author: raymond.hettinger Date: Tue May 19 19:43:59 2009 New Revision: 72786 Log: Note that ordered dictionaries work with reversed(). Modified: python/trunk/Doc/library/collections.rst Modified: python/trunk/Doc/library/collections.rst ============================================================================== --- python/trunk/Doc/library/collections.rst (original) +++ python/trunk/Doc/library/collections.rst Tue May 19 19:43:59 2009 @@ -868,6 +868,9 @@ a (key, value) pair. The pairs are returned in LIFO order if *last* is true or FIFO order if false. +In addition to the usual mapping methods, ordered dictionaries also support +reverse iteration using :func:`reversed`. + Equality tests between :class:`OrderedDict` objects are order-sensitive and are implemented as ``list(od1.items())==list(od2.items())``. Equality tests between :class:`OrderedDict` objects and other From python-checkins at python.org Tue May 19 21:06:38 2009 From: python-checkins at python.org (ronald.oussoren) Date: Tue, 19 May 2009 21:06:38 +0200 (CEST) Subject: [Python-checkins] r72787 - python/trunk/Makefile.pre.in Message-ID: <20090519190638.DB039D967@mail.python.org> Author: ronald.oussoren Date: Tue May 19 21:06:38 2009 New Revision: 72787 Log: This patch ensures that the pydoc_data package gets installed. This is needed to make it possible to use pydoc to get access to the language reference. That is, without this patch the folllowing won't work: >>> help('if') Modified: python/trunk/Makefile.pre.in Modified: python/trunk/Makefile.pre.in ============================================================================== --- python/trunk/Makefile.pre.in (original) +++ python/trunk/Makefile.pre.in Tue May 19 21:06:38 2009 @@ -837,7 +837,7 @@ distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \ multiprocessing multiprocessing/dummy \ lib-old \ - curses $(MACHDEPS) + curses pydoc_data $(MACHDEPS) libinstall: build_all $(srcdir)/Lib/$(PLATDIR) @for i in $(SCRIPTDIR) $(LIBDEST); \ do \ From python-checkins at python.org Tue May 19 21:07:43 2009 From: python-checkins at python.org (ronald.oussoren) Date: Tue, 19 May 2009 21:07:43 +0200 (CEST) Subject: [Python-checkins] r72788 - in python/branches/py3k: Makefile.pre.in Message-ID: <20090519190743.2B5A4D26C@mail.python.org> Author: ronald.oussoren Date: Tue May 19 21:07:43 2009 New Revision: 72788 Log: Merged revisions 72787 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72787 | ronald.oussoren | 2009-05-19 21:06:38 +0200 (Tue, 19 May 2009) | 8 lines This patch ensures that the pydoc_data package gets installed. This is needed to make it possible to use pydoc to get access to the language reference. That is, without this patch the folllowing won't work: >>> help('if') ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Makefile.pre.in Modified: python/branches/py3k/Makefile.pre.in ============================================================================== --- python/branches/py3k/Makefile.pre.in (original) +++ python/branches/py3k/Makefile.pre.in Tue May 19 21:07:43 2009 @@ -866,7 +866,7 @@ importlib/test/import_ importlib/test/source \ setuptools setuptools/command setuptools/tests setuptools.egg-info \ multiprocessing multiprocessing/dummy \ - curses $(MACHDEPS) + curses pydoc_data $(MACHDEPS) libinstall: build_all $(srcdir)/Lib/$(PLATDIR) @for i in $(SCRIPTDIR) $(LIBDEST); \ do \ From python-checkins at python.org Tue May 19 21:29:24 2009 From: python-checkins at python.org (ronald.oussoren) Date: Tue, 19 May 2009 21:29:24 +0200 (CEST) Subject: [Python-checkins] r72789 - in python/trunk/Mac/BuildScript: resources/ReadMe.txt resources/Welcome.rtf scripts/postflight.patch-profile Message-ID: <20090519192924.A57B3D7D3@mail.python.org> Author: ronald.oussoren Date: Tue May 19 21:29:24 2009 New Revision: 72789 Log: Remove some traces of 'MacPython' Modified: python/trunk/Mac/BuildScript/ (props changed) python/trunk/Mac/BuildScript/resources/ReadMe.txt python/trunk/Mac/BuildScript/resources/Welcome.rtf python/trunk/Mac/BuildScript/scripts/postflight.patch-profile Modified: python/trunk/Mac/BuildScript/resources/ReadMe.txt ============================================================================== --- python/trunk/Mac/BuildScript/resources/ReadMe.txt (original) +++ python/trunk/Mac/BuildScript/resources/ReadMe.txt Tue May 19 21:29:24 2009 @@ -1,4 +1,4 @@ -This package will install MacPython $FULL_VERSION for Mac OS X +This package will install Python $FULL_VERSION for Mac OS X $MACOSX_DEPLOYMENT_TARGET for the following architecture(s): $ARCHITECTURES. @@ -12,7 +12,7 @@ though the installer does not enforce this, otherwise things will not work. -MacPython consists of the Python programming language +Python consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac users including an integrated development environment, IDLE, plus a set of pre-built extension modules @@ -23,8 +23,5 @@ /usr/local/bin and the underlying machinery in $PYTHONFRAMEWORKINSTALLDIR. -More information on MacPython can be found at -http://www.python.org/download/mac/. - More information on Python in general can be found at http://www.python.org. Modified: python/trunk/Mac/BuildScript/resources/Welcome.rtf ============================================================================== --- python/trunk/Mac/BuildScript/resources/Welcome.rtf (original) +++ python/trunk/Mac/BuildScript/resources/Welcome.rtf Tue May 19 21:29:24 2009 @@ -5,14 +5,14 @@ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural \f0\fs24 \cf0 This package will install -\f1\b MacPython $FULL_VERSION +\f1\b Python $FULL_VERSION \f0\b0 for \f1\b Mac OS X $MACOSX_DEPLOYMENT_TARGET \f0\b0 .\ \ -MacPython consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac users including an integrated development environment \b IDLE\b0 plus a set of pre-built extension modules that open up specific Macintosh technologies to Python programs.\ +Python consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac users including an integrated development environment \b IDLE\b0 plus a set of pre-built extension modules that open up specific Macintosh technologies to Python programs.\ \ See the ReadMe file for more information.\ \ \ -This package will by default update your shell profile to ensure that this version of Python is on the search path of your shell. Please deselect the "Shell profile updater" package on the package customization screen if you want to avoid this modification. Double-click \b Update Shell Profile\b0 at any time to make $FULL_VERSION the default Python.} \ No newline at end of file +This package will by default update your shell profile to ensure that this version of Python is on the search path of your shell. Please deselect the "Shell profile updater" package on the package customization screen if you want to avoid this modification. Double-click \b Update Shell Profile\b0 at any time to make $FULL_VERSION the default Python.} Modified: python/trunk/Mac/BuildScript/scripts/postflight.patch-profile ============================================================================== --- python/trunk/Mac/BuildScript/scripts/postflight.patch-profile (original) +++ python/trunk/Mac/BuildScript/scripts/postflight.patch-profile Tue May 19 21:29:24 2009 @@ -57,7 +57,7 @@ cp -fp "${RC}" "${RC}.pysave" fi echo "" >> "${RC}" - echo "# Setting PATH for MacPython ${PYVER}" >> "${RC}" + echo "# Setting PATH for Python ${PYVER}" >> "${RC}" echo "# The orginal version is saved in .cshrc.pysave" >> "${RC}" echo "set path=(${PYTHON_ROOT}/bin "'$path'")" >> "${RC}" if [ `id -ur` = 0 ]; then @@ -86,7 +86,7 @@ cp -fp "${PR}" "${PR}.pysave" fi echo "" >> "${PR}" -echo "# Setting PATH for MacPython ${PYVER}" >> "${PR}" +echo "# Setting PATH for Python ${PYVER}" >> "${PR}" echo "# The orginal version is saved in `basename ${PR}`.pysave" >> "${PR}" echo 'PATH="'"${PYTHON_ROOT}/bin"':${PATH}"' >> "${PR}" echo 'export PATH' >> "${PR}" From python-checkins at python.org Tue May 19 21:30:44 2009 From: python-checkins at python.org (ronald.oussoren) Date: Tue, 19 May 2009 21:30:44 +0200 (CEST) Subject: [Python-checkins] r72790 - in python/branches/py3k: Mac/BuildScript/resources/ReadMe.txt Mac/BuildScript/scripts/postflight.patch-profile Message-ID: <20090519193044.E587BD7DF@mail.python.org> Author: ronald.oussoren Date: Tue May 19 21:30:44 2009 New Revision: 72790 Log: Merged revisions 72789 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72789 | ronald.oussoren | 2009-05-19 21:29:24 +0200 (Tue, 19 May 2009) | 2 lines Remove some traces of 'MacPython' ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Mac/BuildScript/resources/ReadMe.txt python/branches/py3k/Mac/BuildScript/scripts/postflight.patch-profile Modified: python/branches/py3k/Mac/BuildScript/resources/ReadMe.txt ============================================================================== --- python/branches/py3k/Mac/BuildScript/resources/ReadMe.txt (original) +++ python/branches/py3k/Mac/BuildScript/resources/ReadMe.txt Tue May 19 21:30:44 2009 @@ -1,4 +1,4 @@ -This package will install MacPython $FULL_VERSION for Mac OS X +This package will install Python $FULL_VERSION for Mac OS X $MACOSX_DEPLOYMENT_TARGET for the following architecture(s): $ARCHITECTURES. @@ -12,7 +12,7 @@ though the installer does not enforce this, otherwise things will not work. -MacPython consists of the Python programming language +Python consists of the Python programming language interpreter, plus a set of programs to allow easy access to it for Mac users including an integrated development environment, IDLE, plus a set of pre-built extension modules @@ -25,8 +25,5 @@ by default you have to add the "bin" directory inside the framework to you shell's search path. -More information on MacPython can be found at -http://www.python.org/download/mac/. - More information on Python in general can be found at http://www.python.org. Modified: python/branches/py3k/Mac/BuildScript/scripts/postflight.patch-profile ============================================================================== --- python/branches/py3k/Mac/BuildScript/scripts/postflight.patch-profile (original) +++ python/branches/py3k/Mac/BuildScript/scripts/postflight.patch-profile Tue May 19 21:30:44 2009 @@ -57,7 +57,7 @@ cp -fp "${RC}" "${RC}.pysave" fi echo "" >> "${RC}" - echo "# Setting PATH for MacPython ${PYVER}" >> "${RC}" + echo "# Setting PATH for Python ${PYVER}" >> "${RC}" echo "# The orginal version is saved in .cshrc.pysave" >> "${RC}" echo "set path=(${PYTHON_ROOT}/bin "'$path'")" >> "${RC}" if [ `id -ur` = 0 ]; then @@ -86,7 +86,7 @@ cp -fp "${PR}" "${PR}.pysave" fi echo "" >> "${PR}" -echo "# Setting PATH for MacPython ${PYVER}" >> "${PR}" +echo "# Setting PATH for Python ${PYVER}" >> "${PR}" echo "# The orginal version is saved in `basename ${PR}`.pysave" >> "${PR}" echo 'PATH="'"${PYTHON_ROOT}/bin"':${PATH}"' >> "${PR}" echo 'export PATH' >> "${PR}" From buildbot at python.org Tue May 19 21:48:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 19 May 2009 19:48:26 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090519194826.9E5BFD832@mail.python.org> The Buildbot has detected a new failure of x86 XP-4 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%202.6/builds/282 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 ====================================================================== ERROR: test01_badpointer (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 21, in test01_badpointer dbs = dbshelve.open(self.filename) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\dbshelve.py", line 106, in open d.open(filename, dbname, filetype, flags, mode) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\dbshelve.py", line 171, in open self.db.open(*args, **kwargs) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test03_repr_closed_db (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 37, in test03_repr_closed_db db = hashopen(self.filename) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test04_repr_db (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 43, in test04_repr_db db = hashopen(self.filename) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test05_double_free_make_key_dbt (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 65, in test05_double_free_make_key_dbt db.DB_CREATE | db.DB_THREAD) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test06_key_with_null_bytes (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 77, in test06_key_with_null_bytes db1.open(self.filename, None, db.DB_HASH, db.DB_CREATE) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test07_DB_set_flags_persists (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 101, in test07_DB_set_flags_persists db1.open(self.filename, db.DB_HASH, db.DB_CREATE) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test01_basic_replication (bsddb.test.test_replication.DBReplicationManager) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_replication.py", line 170, in test01_basic_replication mode=0666, txn=txn) DBNoSuchFileError: (2, 'No such file or directory -- connection closed: Successful return: 0') ====================================================================== ERROR: test01_basic_replication (bsddb.test.test_replication.DBReplicationManager) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_replication.py", line 58, in tearDown if self.dbClient : DBError: (0, 'DB object has been closed') ====================================================================== FAIL: test01_basic_replication (bsddb.test.test_replication.DBBaseReplication) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_replication.py", line 315, in test01_basic_replication self.assertTrue(time.time() Author: ronald.oussoren Date: Tue May 19 22:12:17 2009 New Revision: 72791 Log: Remove some old MacPython files that are no longer relevant. Removed: python/trunk/Mac/Resources/app/Resources/English.lproj/ python/trunk/Mac/Resources/iconsrc/ python/trunk/Mac/Tools/Doc/ Modified: python/trunk/Mac/Makefile.in Modified: python/trunk/Mac/Makefile.in ============================================================================== --- python/trunk/Mac/Makefile.in (original) +++ python/trunk/Mac/Makefile.in Tue May 19 22:12:17 2009 @@ -38,12 +38,7 @@ CPMAC=/Developer/Tools/CpMac APPTEMPLATE=$(srcdir)/Resources/app -APPSUBDIRS=MacOS Resources Resources/English.lproj \ - Resources/English.lproj/Documentation \ - Resources/English.lproj/Documentation/doc \ - Resources/English.lproj/Documentation/ide -DOCDIR=$(srcdir)/Resources/app/Resources/English.lproj/Documentation -DOCINDEX=$(DOCDIR)/"Documentation idx" +APPSUBDIRS=MacOS Resources CACHERSRC=$(srcdir)/scripts/cachersrc.py compileall=$(srcdir)/../Lib/compileall.py @@ -161,9 +156,6 @@ cd PythonLauncher && make install DESTDIR=$(DESTDIR) install_Python: - @if test ! -f $(DOCINDEX); then \ - echo WARNING: you should run Apple Help Indexing Tool on $(DOCDIR); \ - fi @for i in "$(PYTHONAPPSDIR)" "$(APPINSTALLDIR)" "$(APPINSTALLDIR)/Contents"; do \ if test ! -d "$(DESTDIR)$$i"; then \ echo "Creating directory $(DESTDIR)$$i"; \ From buildbot at python.org Tue May 19 22:45:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 19 May 2009 20:45:11 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090519204511.DFB59D90A@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/654 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: ronald.oussoren BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue May 19 23:00:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 19 May 2009 21:00:57 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090519210058.0AB41D7D1@mail.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/5030 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: ronald.oussoren BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue May 19 23:31:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 19 May 2009 21:31:19 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090519213119.75DF6D6F2@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/716 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger,ronald.oussoren BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From nnorwitz at gmail.com Tue May 19 23:49:08 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 19 May 2009 17:49:08 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090519214908.GA26127@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 Less important issues: ---------------------- test_asynchat leaked [126, -126, 0] references, sum=0 test_cmd_line leaked [0, 0, -25] references, sum=-25 test_file leaked [80, -80, 0] references, sum=0 test_smtplib leaked [-5, 0, -83] references, sum=-88 test_socketserver leaked [0, 83, -83] references, sum=0 test_sys leaked [42, -42, 21] references, sum=21 test_threading leaked [47, 54, 43] references, sum=144 test_urllib2_localnet leaked [0, 283, -283] references, sum=0 From nnorwitz at gmail.com Wed May 20 11:28:53 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 20 May 2009 05:28:53 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (2) Message-ID: <20090520092853.GA6337@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 test_ssl leaked [0, -81, 429] references, sum=348 Less important issues: ---------------------- test_asynchat leaked [0, 139, -139] references, sum=0 test_cmd_line leaked [25, -25, 0] references, sum=0 test_smtplib leaked [88, -88, 0] references, sum=0 test_socketserver leaked [6, -83, 0] references, sum=-77 test_sys leaked [42, -21, -21] references, sum=0 test_threading leaked [47, 49, 48] references, sum=144 test_threadsignals leaked [0, -8, 8] references, sum=0 test_urllib2_localnet leaked [290, -290, 0] references, sum=0 From python-checkins at python.org Wed May 20 18:49:12 2009 From: python-checkins at python.org (collin.winter) Date: Wed, 20 May 2009 18:49:12 +0200 (CEST) Subject: [Python-checkins] r72792 - python/trunk/Lib/pickletools.py Message-ID: <20090520164912.5F949DB8F@mail.python.org> Author: collin.winter Date: Wed May 20 18:49:12 2009 New Revision: 72792 Log: Issue 6066: POP_MARK was not in pickle protocol 0. Modified: python/trunk/Lib/pickletools.py Modified: python/trunk/Lib/pickletools.py ============================================================================== --- python/trunk/Lib/pickletools.py (original) +++ python/trunk/Lib/pickletools.py Wed May 20 18:49:12 2009 @@ -1348,7 +1348,7 @@ arg=None, stack_before=[markobject, stackslice], stack_after=[], - proto=0, + proto=1, doc="""Pop all the stack objects at and above the topmost markobject. When an opcode using a variable number of stack objects is done, From python-checkins at python.org Wed May 20 19:46:47 2009 From: python-checkins at python.org (collin.winter) Date: Wed, 20 May 2009 19:46:47 +0200 (CEST) Subject: [Python-checkins] r72793 - in python/branches/py3k: Lib/pickletools.py Message-ID: <20090520174647.6A71BDBE0@mail.python.org> Author: collin.winter Date: Wed May 20 19:46:47 2009 New Revision: 72793 Log: Merge r72792: POP_MARK was not in pickle protocol 0, SHORT_BINBYTES was not in protocol 1. Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/pickletools.py Modified: python/branches/py3k/Lib/pickletools.py ============================================================================== --- python/branches/py3k/Lib/pickletools.py (original) +++ python/branches/py3k/Lib/pickletools.py Wed May 20 19:46:47 2009 @@ -1057,7 +1057,7 @@ arg=string1, stack_before=[], stack_after=[pybytes], - proto=1, + proto=3, doc="""Push a Python string object. There are two arguments: the first is a 1-byte unsigned int giving @@ -1384,7 +1384,7 @@ arg=None, stack_before=[markobject, stackslice], stack_after=[], - proto=0, + proto=1, doc="""Pop all the stack objects at and above the topmost markobject. When an opcode using a variable number of stack objects is done, From python-checkins at python.org Wed May 20 19:55:31 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 20 May 2009 19:55:31 +0200 (CEST) Subject: [Python-checkins] r72794 - python/trunk/Modules/_ctypes/_ctypes.c Message-ID: <20090520175531.BC4CBDB8D@mail.python.org> Author: mark.dickinson Date: Wed May 20 19:55:31 2009 New Revision: 72794 Log: typos in ctypes Module Modified: python/trunk/Modules/_ctypes/_ctypes.c Modified: python/trunk/Modules/_ctypes/_ctypes.c ============================================================================== --- python/trunk/Modules/_ctypes/_ctypes.c (original) +++ python/trunk/Modules/_ctypes/_ctypes.c Wed May 20 19:55:31 2009 @@ -477,7 +477,7 @@ if (offset < 0) { PyErr_SetString(PyExc_ValueError, - "offset cannit be negative"); + "offset cannot be negative"); return NULL; } if (dict->size > buffer_len - offset) { @@ -533,7 +533,7 @@ if (offset < 0) { PyErr_SetString(PyExc_ValueError, - "offset cannit be negative"); + "offset cannot be negative"); return NULL; } From python-checkins at python.org Wed May 20 19:57:28 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 20 May 2009 19:57:28 +0200 (CEST) Subject: [Python-checkins] r72795 - in python/branches/py3k: Modules/_ctypes/_ctypes.c Message-ID: <20090520175728.7759DDBD1@mail.python.org> Author: mark.dickinson Date: Wed May 20 19:57:28 2009 New Revision: 72795 Log: Merged revisions 72794 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72794 | mark.dickinson | 2009-05-20 18:55:31 +0100 (Wed, 20 May 2009) | 1 line typos in ctypes Module ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Modules/_ctypes/_ctypes.c Modified: python/branches/py3k/Modules/_ctypes/_ctypes.c ============================================================================== --- python/branches/py3k/Modules/_ctypes/_ctypes.c (original) +++ python/branches/py3k/Modules/_ctypes/_ctypes.c Wed May 20 19:57:28 2009 @@ -444,7 +444,7 @@ if (offset < 0) { PyErr_SetString(PyExc_ValueError, - "offset cannit be negative"); + "offset cannot be negative"); return NULL; } if (dict->size > buffer_len - offset) { @@ -500,7 +500,7 @@ if (offset < 0) { PyErr_SetString(PyExc_ValueError, - "offset cannit be negative"); + "offset cannot be negative"); return NULL; } From python-checkins at python.org Wed May 20 19:57:57 2009 From: python-checkins at python.org (jeffrey.yasskin) Date: Wed, 20 May 2009 19:57:57 +0200 (CEST) Subject: [Python-checkins] r72796 - in python/trunk: Lib/test/test_trace.py Objects/frameobject.c Message-ID: <20090520175757.C2521D90C@mail.python.org> Author: jeffrey.yasskin Date: Wed May 20 19:57:57 2009 New Revision: 72796 Log: Fix issue #1689458 by teaching frame_setlineno how to jump to the first line of a code object. Modified: python/trunk/Lib/test/test_trace.py python/trunk/Objects/frameobject.c Modified: python/trunk/Lib/test/test_trace.py ============================================================================== --- python/trunk/Lib/test/test_trace.py (original) +++ python/trunk/Lib/test/test_trace.py Wed May 20 19:57:57 2009 @@ -740,6 +740,27 @@ def test_19_no_jump_without_trace_function(self): no_jump_without_trace_function() + def test_jump_to_firstlineno(self): + # This tests that PDB can jump back to the first line in a + # file. See issue #1689458. It can only be triggered in a + # function call if the function is defined on a single line. + code = compile(""" +# Comments don't count. +output.append(2) # firstlineno is here. +output.append(3) +output.append(4) +""", "", "exec") + class fake_function: + func_code = code + jump = (2, 0) + tracer = JumpTracer(fake_function) + sys.settrace(tracer.trace) + namespace = {"output": []} + exec code in namespace + sys.settrace(None) + self.compare_jump_output([2, 3, 2, 3, 4], namespace["output"]) + + def test_main(): test_support.run_unittest( TraceTestCase, Modified: python/trunk/Objects/frameobject.c ============================================================================== --- python/trunk/Objects/frameobject.c (original) +++ python/trunk/Objects/frameobject.c Wed May 20 19:57:57 2009 @@ -140,20 +140,26 @@ new_lineno); return -1; } - - /* Find the bytecode offset for the start of the given line, or the - * first code-owning line after it. */ - PyString_AsStringAndSize(f->f_code->co_lnotab, &lnotab, &lnotab_len); - addr = 0; - line = f->f_code->co_firstlineno; - new_lasti = -1; - for (offset = 0; offset < lnotab_len; offset += 2) { - addr += lnotab[offset]; - line += lnotab[offset+1]; - if (line >= new_lineno) { - new_lasti = addr; - new_lineno = line; - break; + else if (new_lineno == f->f_code->co_firstlineno) { + new_lasti = 0; + new_lineno = f->f_code->co_firstlineno; + } + else { + /* Find the bytecode offset for the start of the given + * line, or the first code-owning line after it. */ + PyString_AsStringAndSize(f->f_code->co_lnotab, + &lnotab, &lnotab_len); + addr = 0; + line = f->f_code->co_firstlineno; + new_lasti = -1; + for (offset = 0; offset < lnotab_len; offset += 2) { + addr += lnotab[offset]; + line += lnotab[offset+1]; + if (line >= new_lineno) { + new_lasti = addr; + new_lineno = line; + break; + } } } From python-checkins at python.org Wed May 20 19:58:15 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 20 May 2009 19:58:15 +0200 (CEST) Subject: [Python-checkins] r72797 - in python/branches/release26-maint: Modules/_ctypes/_ctypes.c Message-ID: <20090520175815.7AFE1DB75@mail.python.org> Author: mark.dickinson Date: Wed May 20 19:58:15 2009 New Revision: 72797 Log: Merged revisions 72794 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72794 | mark.dickinson | 2009-05-20 18:55:31 +0100 (Wed, 20 May 2009) | 1 line typos in ctypes Module ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Modules/_ctypes/_ctypes.c Modified: python/branches/release26-maint/Modules/_ctypes/_ctypes.c ============================================================================== --- python/branches/release26-maint/Modules/_ctypes/_ctypes.c (original) +++ python/branches/release26-maint/Modules/_ctypes/_ctypes.c Wed May 20 19:58:15 2009 @@ -477,7 +477,7 @@ if (offset < 0) { PyErr_SetString(PyExc_ValueError, - "offset cannit be negative"); + "offset cannot be negative"); return NULL; } if (dict->size > buffer_len - offset) { @@ -533,7 +533,7 @@ if (offset < 0) { PyErr_SetString(PyExc_ValueError, - "offset cannit be negative"); + "offset cannot be negative"); return NULL; } From python-checkins at python.org Wed May 20 19:59:15 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 20 May 2009 19:59:15 +0200 (CEST) Subject: [Python-checkins] r72798 - in python/branches/release30-maint: Modules/_ctypes/_ctypes.c Message-ID: <20090520175915.ACEFDD90C@mail.python.org> Author: mark.dickinson Date: Wed May 20 19:59:15 2009 New Revision: 72798 Log: Merged revisions 72795 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72795 | mark.dickinson | 2009-05-20 18:57:28 +0100 (Wed, 20 May 2009) | 9 lines Merged revisions 72794 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72794 | mark.dickinson | 2009-05-20 18:55:31 +0100 (Wed, 20 May 2009) | 1 line typos in ctypes Module ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Modules/_ctypes/_ctypes.c Modified: python/branches/release30-maint/Modules/_ctypes/_ctypes.c ============================================================================== --- python/branches/release30-maint/Modules/_ctypes/_ctypes.c (original) +++ python/branches/release30-maint/Modules/_ctypes/_ctypes.c Wed May 20 19:59:15 2009 @@ -444,7 +444,7 @@ if (offset < 0) { PyErr_SetString(PyExc_ValueError, - "offset cannit be negative"); + "offset cannot be negative"); return NULL; } if (dict->size > buffer_len - offset) { @@ -500,7 +500,7 @@ if (offset < 0) { PyErr_SetString(PyExc_ValueError, - "offset cannit be negative"); + "offset cannot be negative"); return NULL; } From buildbot at python.org Wed May 20 20:24:02 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 20 May 2009 18:24:02 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090520182402.E4F04D896@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1347 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: jeffrey.yasskin,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_xpickle make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed May 20 20:24:08 2009 From: python-checkins at python.org (georg.brandl) Date: Wed, 20 May 2009 20:24:08 +0200 (CEST) Subject: [Python-checkins] r72799 - in python/trunk: configure configure.in Message-ID: <20090520182408.7DDBBC4AB@mail.python.org> Author: georg.brandl Date: Wed May 20 20:24:08 2009 New Revision: 72799 Log: Update bug tracker URL. Modified: python/trunk/configure python/trunk/configure.in Modified: python/trunk/configure ============================================================================== --- python/trunk/configure (original) +++ python/trunk/configure Wed May 20 20:24:08 2009 @@ -1,9 +1,9 @@ #! /bin/sh -# From configure.in Revision: 72445 . +# From configure.in Revision: 72497 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.7. # -# Report bugs to . +# Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -577,7 +577,7 @@ PACKAGE_TARNAME='python' PACKAGE_VERSION='2.7' PACKAGE_STRING='python 2.7' -PACKAGE_BUGREPORT='http://www.python.org/python-bugs' +PACKAGE_BUGREPORT='http://bugs.python.org/' ac_unique_file="Include/object.h" # Factoring default headers for most tests. @@ -1380,7 +1380,7 @@ Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . +Report bugs to . _ACEOF ac_status=$? fi @@ -5750,9 +5750,9 @@ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to http://www.python.org/python-bugs ## -## ------------------------------------------------ ## +## -------------------------------------- ## +## Report this to http://bugs.python.org/ ## +## -------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; @@ -6185,9 +6185,9 @@ { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to http://www.python.org/python-bugs ## -## ------------------------------------------------ ## +## -------------------------------------- ## +## Report this to http://bugs.python.org/ ## +## -------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; @@ -6326,9 +6326,9 @@ { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to http://www.python.org/python-bugs ## -## ------------------------------------------------ ## +## -------------------------------------- ## +## Report this to http://bugs.python.org/ ## +## -------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; @@ -14596,9 +14596,9 @@ { echo "$as_me:$LINENO: WARNING: cthreads.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: cthreads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to http://www.python.org/python-bugs ## -## ------------------------------------------------ ## +## -------------------------------------- ## +## Report this to http://bugs.python.org/ ## +## -------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; @@ -14744,9 +14744,9 @@ { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to http://www.python.org/python-bugs ## -## ------------------------------------------------ ## +## -------------------------------------- ## +## Report this to http://bugs.python.org/ ## +## -------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; @@ -15061,9 +15061,9 @@ { echo "$as_me:$LINENO: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to http://www.python.org/python-bugs ## -## ------------------------------------------------ ## +## -------------------------------------- ## +## Report this to http://bugs.python.org/ ## +## -------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; @@ -15204,9 +15204,9 @@ { echo "$as_me:$LINENO: WARNING: kernel/OS.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: kernel/OS.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to http://www.python.org/python-bugs ## -## ------------------------------------------------ ## +## -------------------------------------- ## +## Report this to http://bugs.python.org/ ## +## -------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; @@ -22674,9 +22674,9 @@ { echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to http://www.python.org/python-bugs ## -## ------------------------------------------------ ## +## -------------------------------------- ## +## Report this to http://bugs.python.org/ ## +## -------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; Modified: python/trunk/configure.in ============================================================================== --- python/trunk/configure.in (original) +++ python/trunk/configure.in Wed May 20 20:24:08 2009 @@ -8,7 +8,7 @@ AC_REVISION($Revision$) AC_PREREQ(2.61) -AC_INIT(python, PYTHON_VERSION, http://www.python.org/python-bugs) +AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/) AC_CONFIG_SRCDIR([Include/object.h]) AC_CONFIG_HEADER(pyconfig.h) From python-checkins at python.org Wed May 20 20:25:10 2009 From: python-checkins at python.org (georg.brandl) Date: Wed, 20 May 2009 20:25:10 +0200 (CEST) Subject: [Python-checkins] r72800 - in python/branches/py3k: configure configure.in Message-ID: <20090520182510.E539ED896@mail.python.org> Author: georg.brandl Date: Wed May 20 20:25:10 2009 New Revision: 72800 Log: Merged revisions 72799 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72799 | georg.brandl | 2009-05-20 20:24:08 +0200 (Mi, 20 Mai 2009) | 1 line Update bug tracker URL. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/configure python/branches/py3k/configure.in Modified: python/branches/py3k/configure ============================================================================== --- python/branches/py3k/configure (original) +++ python/branches/py3k/configure Wed May 20 20:25:10 2009 @@ -1,9 +1,9 @@ #! /bin/sh -# From configure.in Revision: 72446 . +# From configure.in Revision: 72504 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 3.1. # -# Report bugs to . +# Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. @@ -577,7 +577,7 @@ PACKAGE_TARNAME='python' PACKAGE_VERSION='3.1' PACKAGE_STRING='python 3.1' -PACKAGE_BUGREPORT='http://www.python.org/python-bugs' +PACKAGE_BUGREPORT='http://bugs.python.org/' ac_unique_file="Include/object.h" # Factoring default headers for most tests. @@ -1377,7 +1377,7 @@ Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . +Report bugs to . _ACEOF ac_status=$? fi @@ -5697,9 +5697,9 @@ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to http://www.python.org/python-bugs ## -## ------------------------------------------------ ## +## -------------------------------------- ## +## Report this to http://bugs.python.org/ ## +## -------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; @@ -6132,9 +6132,9 @@ { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to http://www.python.org/python-bugs ## -## ------------------------------------------------ ## +## -------------------------------------- ## +## Report this to http://bugs.python.org/ ## +## -------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; @@ -6273,9 +6273,9 @@ { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to http://www.python.org/python-bugs ## -## ------------------------------------------------ ## +## -------------------------------------- ## +## Report this to http://bugs.python.org/ ## +## -------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; @@ -14435,9 +14435,9 @@ { echo "$as_me:$LINENO: WARNING: cthreads.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: cthreads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to http://www.python.org/python-bugs ## -## ------------------------------------------------ ## +## -------------------------------------- ## +## Report this to http://bugs.python.org/ ## +## -------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; @@ -14583,9 +14583,9 @@ { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to http://www.python.org/python-bugs ## -## ------------------------------------------------ ## +## -------------------------------------- ## +## Report this to http://bugs.python.org/ ## +## -------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; @@ -14900,9 +14900,9 @@ { echo "$as_me:$LINENO: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to http://www.python.org/python-bugs ## -## ------------------------------------------------ ## +## -------------------------------------- ## +## Report this to http://bugs.python.org/ ## +## -------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; @@ -22659,9 +22659,9 @@ { echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX -## ------------------------------------------------ ## -## Report this to http://www.python.org/python-bugs ## -## ------------------------------------------------ ## +## -------------------------------------- ## +## Report this to http://bugs.python.org/ ## +## -------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; Modified: python/branches/py3k/configure.in ============================================================================== --- python/branches/py3k/configure.in (original) +++ python/branches/py3k/configure.in Wed May 20 20:25:10 2009 @@ -8,7 +8,7 @@ AC_REVISION($Revision$) AC_PREREQ(2.61) -AC_INIT(python, PYTHON_VERSION, http://www.python.org/python-bugs) +AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/) AC_CONFIG_SRCDIR([Include/object.h]) AC_CONFIG_HEADER(pyconfig.h) From python-checkins at python.org Wed May 20 20:31:14 2009 From: python-checkins at python.org (georg.brandl) Date: Wed, 20 May 2009 20:31:14 +0200 (CEST) Subject: [Python-checkins] r72801 - in python/trunk/Doc: includes/sqlite3/text_factory.py library/sqlite3.rst Message-ID: <20090520183114.5D7CDDA05@mail.python.org> Author: georg.brandl Date: Wed May 20 20:31:14 2009 New Revision: 72801 Log: #6055: refer to "sqlite3" consistently. Modified: python/trunk/Doc/includes/sqlite3/text_factory.py python/trunk/Doc/library/sqlite3.rst Modified: python/trunk/Doc/includes/sqlite3/text_factory.py ============================================================================== --- python/trunk/Doc/includes/sqlite3/text_factory.py (original) +++ python/trunk/Doc/includes/sqlite3/text_factory.py Wed May 20 20:31:14 2009 @@ -13,7 +13,7 @@ row = cur.fetchone() assert row[0] == AUSTRIA -# but we can make pysqlite always return bytestrings ... +# but we can make sqlite3 always return bytestrings ... con.text_factory = str cur.execute("select ?", (AUSTRIA,)) row = cur.fetchone() @@ -26,11 +26,12 @@ # here we implement one that will ignore Unicode characters that cannot be # decoded from UTF-8 con.text_factory = lambda x: unicode(x, "utf-8", "ignore") -cur.execute("select ?", ("this is latin1 and would normally create errors" + u"\xe4\xf6\xfc".encode("latin1"),)) +cur.execute("select ?", ("this is latin1 and would normally create errors" + + u"\xe4\xf6\xfc".encode("latin1"),)) row = cur.fetchone() assert type(row[0]) == unicode -# pysqlite offers a builtin optimized text_factory that will return bytestring +# sqlite3 offers a builtin optimized text_factory that will return bytestring # objects, if the data is in ASCII only, and otherwise return unicode objects con.text_factory = sqlite3.OptimizedUnicode cur.execute("select ?", (AUSTRIA,)) Modified: python/trunk/Doc/library/sqlite3.rst ============================================================================== --- python/trunk/Doc/library/sqlite3.rst (original) +++ python/trunk/Doc/library/sqlite3.rst Wed May 20 20:31:14 2009 @@ -15,7 +15,7 @@ application using SQLite and then port the code to a larger database such as PostgreSQL or Oracle. -pysqlite was written by Gerhard H?ring and provides a SQL interface compliant +sqlite3 was written by Gerhard H?ring and provides a SQL interface compliant with the DB-API 2.0 specification described by :pep:`249`. To use the module, you must first create a :class:`Connection` object that @@ -52,8 +52,9 @@ Instead, use the DB-API's parameter substitution. Put ``?`` as a placeholder wherever you want to use a value, and then provide a tuple of values as the -second argument to the cursor's :meth:`~Cursor.execute` method. (Other database modules -may use a different placeholder, such as ``%s`` or ``:1``.) For example:: +second argument to the cursor's :meth:`~Cursor.execute` method. (Other database +modules may use a different placeholder, such as ``%s`` or ``:1``.) For +example:: # Never do this -- insecure! symbol = 'IBM' @@ -92,11 +93,12 @@ .. seealso:: http://www.pysqlite.org - The pysqlite web page. + The pysqlite web page -- sqlite3 is developed externally under the name + "pysqlite". http://www.sqlite.org - The SQLite web page; the documentation describes the syntax and the available - data types for the supported SQL dialect. + The SQLite web page; the documentation describes the syntax and the + available data types for the supported SQL dialect. :pep:`249` - Database API Specification 2.0 PEP written by Marc-Andr? Lemburg. @@ -802,10 +804,10 @@ ...``, ``VACUUM``, ``PRAGMA``, the :mod:`sqlite3` module will commit implicitly before executing that command. There are two reasons for doing that. The first is that some of these commands don't work within transactions. The other reason -is that pysqlite needs to keep track of the transaction state (if a transaction +is that sqlite3 needs to keep track of the transaction state (if a transaction is active or not). -You can control which kind of ``BEGIN`` statements pysqlite implicitly executes +You can control which kind of ``BEGIN`` statements sqlite3 implicitly executes (or none at all) via the *isolation_level* parameter to the :func:`connect` call, or via the :attr:`isolation_level` property of connections. @@ -817,8 +819,8 @@ -Using pysqlite efficiently --------------------------- +Using :mod:`sqlite3` efficiently +-------------------------------- Using shortcut methods From python-checkins at python.org Wed May 20 20:35:27 2009 From: python-checkins at python.org (georg.brandl) Date: Wed, 20 May 2009 20:35:27 +0200 (CEST) Subject: [Python-checkins] r72802 - in python/trunk/Doc/library: email-examples.rst smtplib.rst Message-ID: <20090520183527.EC0C2D9A9@mail.python.org> Author: georg.brandl Date: Wed May 20 20:35:27 2009 New Revision: 72802 Log: #6051: refer to email examples for better way to construct email messages. Modified: python/trunk/Doc/library/email-examples.rst python/trunk/Doc/library/smtplib.rst Modified: python/trunk/Doc/library/email-examples.rst ============================================================================== --- python/trunk/Doc/library/email-examples.rst (original) +++ python/trunk/Doc/library/email-examples.rst Wed May 20 20:35:27 2009 @@ -1,3 +1,5 @@ +.. _email-examples: + :mod:`email`: Examples ---------------------- Modified: python/trunk/Doc/library/smtplib.rst ============================================================================== --- python/trunk/Doc/library/smtplib.rst (original) +++ python/trunk/Doc/library/smtplib.rst Wed May 20 20:35:27 2009 @@ -380,3 +380,8 @@ server.sendmail(fromaddr, toaddrs, msg) server.quit() +.. note:: + + In general, you will want to use the :mod:`email` package's features to + construct an email message, which you can then convert to a string and send + via :meth:`sendmail`; see :ref:`email-examples`. From buildbot at python.org Wed May 20 20:39:10 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 20 May 2009 18:39:10 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090520183910.B0876D85A@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/718 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: collin.winter BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_posix test_smtplib ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Wed May 20 20:41:04 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 20 May 2009 20:41:04 +0200 (CEST) Subject: [Python-checkins] r72803 - in python/branches/py3k: Lib/test/test_complex.py Misc/NEWS Objects/complexobject.c Message-ID: <20090520184104.B361FD8C5@mail.python.org> Author: mark.dickinson Date: Wed May 20 20:41:04 2009 New Revision: 72803 Log: Issue #5829: complex('1e500') shouldn't raise OverflowError Modified: python/branches/py3k/Lib/test/test_complex.py python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/complexobject.c Modified: python/branches/py3k/Lib/test/test_complex.py ============================================================================== --- python/branches/py3k/Lib/test/test_complex.py (original) +++ python/branches/py3k/Lib/test/test_complex.py Wed May 20 20:41:04 2009 @@ -409,6 +409,13 @@ @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"), "test requires IEEE 754 doubles") + def test_overflow(self): + self.assertEqual(complex("1e500"), complex(INF, 0.0)) + self.assertEqual(complex("-1e500j"), complex(0.0, -INF)) + self.assertEqual(complex("-1e500+1.8e308j"), complex(-INF, INF)) + + @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"), + "test requires IEEE 754 doubles") def test_repr_roundtrip(self): vals = [0.0, 1e-500, 1e-315, 1e-200, 0.0123, 3.1415, 1e50, INF, NAN] vals += [-v for v in vals] Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed May 20 20:41:04 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #5829: complex("1e500") no longer raises OverflowError. This + makes it consistent with float("1e500") and interpretation of real + and imaginary literals. + - Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more. - Issue #5994: the marshal module now has docstrings. Modified: python/branches/py3k/Objects/complexobject.c ============================================================================== --- python/branches/py3k/Objects/complexobject.c (original) +++ python/branches/py3k/Objects/complexobject.c Wed May 20 20:41:04 2009 @@ -799,7 +799,7 @@ */ /* first look for forms starting with */ - z = PyOS_string_to_double(s, &end, PyExc_OverflowError); + z = PyOS_string_to_double(s, &end, NULL); if (z == -1.0 && PyErr_Occurred()) { if (PyErr_ExceptionMatches(PyExc_ValueError)) PyErr_Clear(); @@ -812,7 +812,7 @@ if (*s == '+' || *s == '-') { /* j | j */ x = z; - y = PyOS_string_to_double(s, &end, PyExc_OverflowError); + y = PyOS_string_to_double(s, &end, NULL); if (y == -1.0 && PyErr_Occurred()) { if (PyErr_ExceptionMatches(PyExc_ValueError)) PyErr_Clear(); From python-checkins at python.org Wed May 20 20:41:34 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 20 May 2009 20:41:34 +0200 (CEST) Subject: [Python-checkins] r72804 - python/branches/release30-maint Message-ID: <20090520184134.A9D59DB33@mail.python.org> Author: mark.dickinson Date: Wed May 20 20:41:34 2009 New Revision: 72804 Log: Blocked revisions 72803 via svnmerge ........ r72803 | mark.dickinson | 2009-05-20 19:41:04 +0100 (Wed, 20 May 2009) | 1 line Issue #5829: complex('1e500') shouldn't raise OverflowError ........ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Wed May 20 20:43:07 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 20 May 2009 20:43:07 +0200 (CEST) Subject: [Python-checkins] r72805 - in python/trunk: Lib/test/test_complex.py Misc/NEWS Objects/complexobject.c Message-ID: <20090520184307.DDAA2D990@mail.python.org> Author: mark.dickinson Date: Wed May 20 20:43:07 2009 New Revision: 72805 Log: Issue #5829: don't raise OverflowError for complex('1e500'). Backport of r72803. Modified: python/trunk/Lib/test/test_complex.py python/trunk/Misc/NEWS python/trunk/Objects/complexobject.c Modified: python/trunk/Lib/test/test_complex.py ============================================================================== --- python/trunk/Lib/test/test_complex.py (original) +++ python/trunk/Lib/test/test_complex.py Wed May 20 20:43:07 2009 @@ -431,6 +431,13 @@ @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"), "test requires IEEE 754 doubles") + def test_overflow(self): + self.assertEqual(complex("1e500"), complex(INF, 0.0)) + self.assertEqual(complex("-1e500j"), complex(0.0, -INF)) + self.assertEqual(complex("-1e500+1.8e308j"), complex(-INF, INF)) + + @unittest.skipUnless(float.__getformat__("double").startswith("IEEE"), + "test requires IEEE 754 doubles") def test_repr_roundtrip(self): vals = [0.0, 1e-500, 1e-315, 1e-200, 0.0123, 3.1415, 1e50, INF, NAN] vals += [-v for v in vals] Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed May 20 20:43:07 2009 @@ -12,6 +12,10 @@ Core and Builtins ----------------- +- Issue #5829: complex("1e500") no longer raises OverflowError. This + makes it consistent with float("1e500") and interpretation of real + and imaginary literals. + - Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more. - __instancecheck__ and __subclasscheck__ are now completely ignored on classic Modified: python/trunk/Objects/complexobject.c ============================================================================== --- python/trunk/Objects/complexobject.c (original) +++ python/trunk/Objects/complexobject.c Wed May 20 20:43:07 2009 @@ -989,8 +989,6 @@ z = PyOS_ascii_strtod(s, &end); if (end == s && errno == ENOMEM) return PyErr_NoMemory(); - if (errno == ERANGE && fabs(z) >= 1.0) - goto overflow; if (end != s) { /* all 4 forms starting with land here */ @@ -1002,8 +1000,6 @@ y = PyOS_ascii_strtod(s, &end); if (end == s && errno == ENOMEM) return PyErr_NoMemory(); - if (errno == ERANGE && fabs(y) >= 1.0) - goto overflow; if (end != s) /* j */ s = end; @@ -1063,11 +1059,6 @@ PyErr_SetString(PyExc_ValueError, "complex() arg is a malformed string"); return NULL; - - overflow: - PyErr_SetString(PyExc_OverflowError, - "complex() arg overflow"); - return NULL; } static PyObject * From python-checkins at python.org Wed May 20 20:43:28 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 20 May 2009 20:43:28 +0200 (CEST) Subject: [Python-checkins] r72806 - python/branches/py3k Message-ID: <20090520184328.D9E86DC1C@mail.python.org> Author: mark.dickinson Date: Wed May 20 20:43:28 2009 New Revision: 72806 Log: Blocked revisions 72805 via svnmerge ........ r72805 | mark.dickinson | 2009-05-20 19:43:07 +0100 (Wed, 20 May 2009) | 1 line Issue #5829: don't raise OverflowError for complex('1e500'). Backport of r72803. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Wed May 20 20:44:00 2009 From: python-checkins at python.org (mark.dickinson) Date: Wed, 20 May 2009 20:44:00 +0200 (CEST) Subject: [Python-checkins] r72807 - python/branches/release26-maint Message-ID: <20090520184400.4EBF0D38F@mail.python.org> Author: mark.dickinson Date: Wed May 20 20:44:00 2009 New Revision: 72807 Log: Blocked revisions 72805 via svnmerge ........ r72805 | mark.dickinson | 2009-05-20 19:43:07 +0100 (Wed, 20 May 2009) | 1 line Issue #5829: don't raise OverflowError for complex('1e500'). Backport of r72803. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Wed May 20 21:05:16 2009 From: python-checkins at python.org (collin.winter) Date: Wed, 20 May 2009 21:05:16 +0200 (CEST) Subject: [Python-checkins] r72808 - in python/branches/release26-maint: Lib/pickletools.py Message-ID: <20090520190516.BC903DAEB@mail.python.org> Author: collin.winter Date: Wed May 20 21:05:16 2009 New Revision: 72808 Log: Merged revisions 72792 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72792 | collin.winter | 2009-05-20 09:49:12 -0700 (Wed, 20 May 2009) | 1 line Issue 6066: POP_MARK was not in pickle protocol 0. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/pickletools.py Modified: python/branches/release26-maint/Lib/pickletools.py ============================================================================== --- python/branches/release26-maint/Lib/pickletools.py (original) +++ python/branches/release26-maint/Lib/pickletools.py Wed May 20 21:05:16 2009 @@ -1348,7 +1348,7 @@ arg=None, stack_before=[markobject, stackslice], stack_after=[], - proto=0, + proto=1, doc="""Pop all the stack objects at and above the topmost markobject. When an opcode using a variable number of stack objects is done, From python-checkins at python.org Wed May 20 21:09:05 2009 From: python-checkins at python.org (jeffrey.yasskin) Date: Wed, 20 May 2009 21:09:05 +0200 (CEST) Subject: [Python-checkins] r72809 - in python/branches/py3k: Lib/test/test_trace.py Objects/frameobject.c Message-ID: <20090520190905.A34F5DB12@mail.python.org> Author: jeffrey.yasskin Date: Wed May 20 21:09:05 2009 New Revision: 72809 Log: Merged revisions 72776,72796 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72776 | jeffrey.yasskin | 2009-05-18 14:14:54 -0700 (Mon, 18 May 2009) | 6 lines While I was modifying test_trace, it threw an exception when I accidentally made it try to set the line number from the trace callback for a 'call' event. This patch makes the error message a little more helpful in that case, and makes it a little less likely that a future editor will make the same mistake in test_trace. ........ r72796 | jeffrey.yasskin | 2009-05-20 10:57:57 -0700 (Wed, 20 May 2009) | 3 lines Fix issue #1689458 by teaching frame_setlineno how to jump to the first line of a code object. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_trace.py python/branches/py3k/Objects/frameobject.c Modified: python/branches/py3k/Lib/test/test_trace.py ============================================================================== --- python/branches/py3k/Lib/test/test_trace.py (original) +++ python/branches/py3k/Lib/test/test_trace.py Wed May 20 21:09:05 2009 @@ -472,7 +472,7 @@ def trace(self, frame, event, arg): if not self.done and frame.f_code == self.function.__code__: firstLine = frame.f_code.co_firstlineno - if frame.f_lineno == firstLine + self.jumpFrom: + if event == 'line' and frame.f_lineno == firstLine + self.jumpFrom: # Cope with non-integer self.jumpTo (because of # no_jump_to_non_integers below). try: @@ -741,6 +741,27 @@ def test_19_no_jump_without_trace_function(self): no_jump_without_trace_function() + def test_jump_to_firstlineno(self): + # This tests that PDB can jump back to the first line in a + # file. See issue #1689458. It can only be triggered in a + # function call if the function is defined on a single line. + code = compile(""" +# Comments don't count. +output.append(2) # firstlineno is here. +output.append(3) +output.append(4) +""", "", "exec") + class fake_function: + __code__ = code + jump = (2, 0) + tracer = JumpTracer(fake_function) + sys.settrace(tracer.trace) + namespace = {"output": []} + exec(code, namespace) + sys.settrace(None) + self.compare_jump_output([2, 3, 2, 3, 4], namespace["output"]) + + def test_main(): support.run_unittest( TraceTestCase, Modified: python/branches/py3k/Objects/frameobject.c ============================================================================== --- python/branches/py3k/Objects/frameobject.c (original) +++ python/branches/py3k/Objects/frameobject.c Wed May 20 21:09:05 2009 @@ -98,7 +98,8 @@ if (!f->f_trace) { PyErr_Format(PyExc_ValueError, - "f_lineno can only be set by a trace function"); + "f_lineno can only be set by a" + " line trace function"); return -1; } @@ -122,20 +123,26 @@ new_lineno); return -1; } - - /* Find the bytecode offset for the start of the given line, or the - * first code-owning line after it. */ - PyBytes_AsStringAndSize(f->f_code->co_lnotab, &lnotab, &lnotab_len); - addr = 0; - line = f->f_code->co_firstlineno; - new_lasti = -1; - for (offset = 0; offset < lnotab_len; offset += 2) { - addr += lnotab[offset]; - line += lnotab[offset+1]; - if (line >= new_lineno) { - new_lasti = addr; - new_lineno = line; - break; + else if (new_lineno == f->f_code->co_firstlineno) { + new_lasti = 0; + new_lineno = f->f_code->co_firstlineno; + } + else { + /* Find the bytecode offset for the start of the given + * line, or the first code-owning line after it. */ + PyBytes_AsStringAndSize(f->f_code->co_lnotab, + &lnotab, &lnotab_len); + addr = 0; + line = f->f_code->co_firstlineno; + new_lasti = -1; + for (offset = 0; offset < lnotab_len; offset += 2) { + addr += lnotab[offset]; + line += lnotab[offset+1]; + if (line >= new_lineno) { + new_lasti = addr; + new_lineno = line; + break; + } } } From buildbot at python.org Wed May 20 21:39:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 20 May 2009 19:39:09 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 3.0 Message-ID: <20090520193909.DA7BDD7CE@mail.python.org> The Buildbot has detected a new failure of alpha Debian 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%20Debian%203.0/builds/4 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-alpha Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_doctest make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed May 20 21:50:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 20 May 2009 19:50:23 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090520195023.F08AAD3A6@mail.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/5033 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed May 20 23:05:52 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 20 May 2009 21:05:52 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090520210552.1BBEAD3E8@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.0/builds/26 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Wed May 20 23:19:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 20 May 2009 21:19:56 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090520211956.48F6EC2B8@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/379 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Thu May 21 00:05:26 2009 From: python-checkins at python.org (mark.dickinson) Date: Thu, 21 May 2009 00:05:26 +0200 (CEST) Subject: [Python-checkins] r72810 - in python/branches/py3k: Include/pystrtod.h Lib/test/test_float.py Objects/floatobject.c Python/dtoa.c Python/pystrtod.c Message-ID: <20090520220526.27EFAD38D@mail.python.org> Author: mark.dickinson Date: Thu May 21 00:05:25 2009 New Revision: 72810 Log: Refactor to remove duplicated nan/inf parsing code in pystrtod.c, floatobject.c and dtoa.c. Modified: python/branches/py3k/Include/pystrtod.h python/branches/py3k/Lib/test/test_float.py python/branches/py3k/Objects/floatobject.c python/branches/py3k/Python/dtoa.c python/branches/py3k/Python/pystrtod.c Modified: python/branches/py3k/Include/pystrtod.h ============================================================================== --- python/branches/py3k/Include/pystrtod.h (original) +++ python/branches/py3k/Include/pystrtod.h Thu May 21 00:05:25 2009 @@ -21,6 +21,8 @@ int flags, int *type); +PyAPI_FUNC(double) _Py_parse_inf_or_nan(const char *p, char **endptr); + /* PyOS_double_to_string's "flags" parameter can be set to 0 or more of: */ #define Py_DTSF_SIGN 0x01 /* always add the sign */ Modified: python/branches/py3k/Lib/test/test_float.py ============================================================================== --- python/branches/py3k/Lib/test/test_float.py (original) +++ python/branches/py3k/Lib/test/test_float.py Thu May 21 00:05:25 2009 @@ -532,6 +532,11 @@ self.assertRaises(ValueError, float, "-INFI") self.assertRaises(ValueError, float, "infinitys") + self.assertRaises(ValueError, float, "++Inf") + self.assertRaises(ValueError, float, "-+inf") + self.assertRaises(ValueError, float, "+-infinity") + self.assertRaises(ValueError, float, "--Infinity") + def test_inf_as_str(self): self.assertEqual(repr(1e300 * 1e300), "inf") self.assertEqual(repr(-1e300 * 1e300), "-inf") @@ -563,6 +568,11 @@ self.assertRaises(ValueError, float, "+na") self.assertRaises(ValueError, float, "-na") + self.assertRaises(ValueError, float, "++nan") + self.assertRaises(ValueError, float, "-+NAN") + self.assertRaises(ValueError, float, "+-NaN") + self.assertRaises(ValueError, float, "--nAn") + def test_nan_as_str(self): self.assertEqual(repr(1e300 * 1e300 * 0), "nan") self.assertEqual(repr(-1e300 * 1e300 * 0), "nan") Modified: python/branches/py3k/Objects/floatobject.c ============================================================================== --- python/branches/py3k/Objects/floatobject.c (original) +++ python/branches/py3k/Objects/floatobject.c Thu May 21 00:05:25 2009 @@ -1157,20 +1157,6 @@ >>> 3.14159.hex()\n\ '0x1.921f9f01b866ep+1'"); -/* Case-insensitive locale-independent string match used for nan and inf - detection. t should be lower-case and null-terminated. Return a nonzero - result if the first strlen(t) characters of s match t and 0 otherwise. */ - -static int -case_insensitive_match(const char *s, const char *t) -{ - while(*t && Py_TOLOWER(*s) == *t) { - s++; - t++; - } - return *t ? 0 : 1; -} - /* Convert a hexadecimal string to a float. */ static PyObject * @@ -1180,7 +1166,7 @@ double x; long exp, top_exp, lsb, key_digit; char *s, *coeff_start, *s_store, *coeff_end, *exp_start, *s_end; - int half_eps, digit, round_up, sign=1; + int half_eps, digit, round_up, negate=0; Py_ssize_t length, ndigits, fdigits, i; /* @@ -1237,33 +1223,24 @@ * Parse the string * ********************/ - /* leading whitespace and optional sign */ + /* leading whitespace */ while (Py_ISSPACE(*s)) s++; - if (*s == '-') { - s++; - sign = -1; - } - else if (*s == '+') - s++; /* infinities and nans */ - if (*s == 'i' || *s == 'I') { - if (!case_insensitive_match(s+1, "nf")) - goto parse_error; - s += 3; - x = Py_HUGE_VAL; - if (case_insensitive_match(s, "inity")) - s += 5; + x = _Py_parse_inf_or_nan(s, &coeff_end); + if (coeff_end != s) { + s = coeff_end; goto finished; } - if (*s == 'n' || *s == 'N') { - if (!case_insensitive_match(s+1, "an")) - goto parse_error; - s += 3; - x = Py_NAN; - goto finished; + + /* optional sign */ + if (*s == '-') { + s++; + negate = 1; } + else if (*s == '+') + s++; /* [0x] */ s_store = s; @@ -1400,7 +1377,7 @@ s++; if (s != s_end) goto parse_error; - result_as_float = Py_BuildValue("(d)", sign * x); + result_as_float = Py_BuildValue("(d)", negate ? -x : x); if (result_as_float == NULL) return NULL; result = PyObject_CallObject(cls, result_as_float); Modified: python/branches/py3k/Python/dtoa.c ============================================================================== --- python/branches/py3k/Python/dtoa.c (original) +++ python/branches/py3k/Python/dtoa.c Thu May 21 00:05:25 2009 @@ -264,15 +264,6 @@ #define Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1)) #define Big1 0xffffffff -#ifndef NAN_WORD0 -#define NAN_WORD0 0x7ff80000 -#endif - -#ifndef NAN_WORD1 -#define NAN_WORD1 0 -#endif - - /* struct BCinfo is used to pass information from _Py_dg_strtod to bigcomp */ typedef struct BCinfo BCinfo; @@ -1026,25 +1017,6 @@ #define Scale_Bit 0x10 #define n_bigtens 5 -/* case insensitive string match, for recognising 'inf[inity]' and - 'nan' strings. */ - -static int -match(const char **sp, char *t) -{ - int c, d; - const char *s = *sp; - - while((d = *t++)) { - if ((c = *++s) >= 'A' && c <= 'Z') - c += 'a' - 'A'; - if (c != d) - return 0; - } - *sp = s + 1; - return 1; -} - #define ULbits 32 #define kshift 5 #define kmask 31 @@ -1459,28 +1431,6 @@ } if (!nd) { if (!nz && !nz0) { - /* Check for Nan and Infinity */ - if (!bc.dplen) - switch(c) { - case 'i': - case 'I': - if (match(&s,"nf")) { - --s; - if (!match(&s,"inity")) - ++s; - word0(&rv) = 0x7ff00000; - word1(&rv) = 0; - goto ret; - } - break; - case 'n': - case 'N': - if (match(&s, "an")) { - word0(&rv) = NAN_WORD0; - word1(&rv) = NAN_WORD1; - goto ret; - } - } ret0: s = s00; sign = 0; Modified: python/branches/py3k/Python/pystrtod.c ============================================================================== --- python/branches/py3k/Python/pystrtod.c (original) +++ python/branches/py3k/Python/pystrtod.c Thu May 21 00:05:25 2009 @@ -3,6 +3,57 @@ #include #include +/* _Py_parse_inf_or_nan: Attempt to parse a string of the form "nan", "inf" or + "infinity", with an optional leading sign of "+" or "-". On success, + return the NaN or Infinity as a double and set *endptr to point just beyond + the successfully parsed portion of the string. On failure, return -1.0 and + set *endptr to point to the start of the string. */ + +static int +case_insensitive_match(const char *s, const char *t) +{ + while(*t && Py_TOLOWER(*s) == *t) { + s++; + t++; + } + return *t ? 0 : 1; +} + +double +_Py_parse_inf_or_nan(const char *p, char **endptr) +{ + double retval; + const char *s; + int negate = 0; + + s = p; + if (*s == '-') { + negate = 1; + s++; + } + else if (*s == '+') { + s++; + } + if (case_insensitive_match(s, "inf")) { + s += 3; + if (case_insensitive_match(s, "inity")) + s += 5; + retval = negate ? -Py_HUGE_VAL : Py_HUGE_VAL; + } +#ifdef Py_NAN + else if (case_insensitive_match(s, "nan")) { + s += 3; + retval = negate ? -Py_NAN : Py_NAN; + } +#endif + else { + s = p; + retval = -1.0; + } + *endptr = (char *)s; + return retval; +} + /** * PyOS_ascii_strtod: * @nptr: the string to convert to a numeric value. @@ -49,6 +100,10 @@ result = _Py_dg_strtod(nptr, endptr); _Py_SET_53BIT_PRECISION_END; + if (*endptr == nptr) + /* string might represent and inf or nan */ + result = _Py_parse_inf_or_nan(nptr, endptr); + return result; } @@ -63,19 +118,6 @@ correctly rounded results. */ -/* Case-insensitive string match used for nan and inf detection; t should be - lower-case. Returns 1 for a successful match, 0 otherwise. */ - -static int -case_insensitive_match(const char *s, const char *t) -{ - while(*t && Py_TOLOWER(*s) == *t) { - s++; - t++; - } - return *t ? 0 : 1; -} - double _PyOS_ascii_strtod(const char *nptr, char **endptr) { @@ -101,6 +143,11 @@ decimal_point_pos = NULL; + /* Parse infinities and nans */ + val = _Py_parse_inf_or_nan(nptr, endptr); + if (*endptr != nptr) + return val; + /* Set errno to zero, so that we can distinguish zero results and underflows */ errno = 0; @@ -118,31 +165,6 @@ p++; } - /* Parse infinities and nans */ - if (*p == 'i' || *p == 'I') { - if (case_insensitive_match(p+1, "nf")) { - val = Py_HUGE_VAL; - if (case_insensitive_match(p+3, "inity")) - fail_pos = (char *)p+8; - else - fail_pos = (char *)p+3; - goto got_val; - } - else - goto invalid_string; - } -#ifdef Py_NAN - if (*p == 'n' || *p == 'N') { - if (case_insensitive_match(p+1, "an")) { - val = Py_NAN; - fail_pos = (char *)p+3; - goto got_val; - } - else - goto invalid_string; - } -#endif - /* Some platform strtods accept hex floats; Python shouldn't (at the moment), so we check explicitly for strings starting with '0x'. */ if (*p == '0' && (*(p+1) == 'x' || *(p+1) == 'X')) @@ -231,7 +253,6 @@ if (fail_pos == digits_pos) goto invalid_string; - got_val: if (negate && fail_pos != nptr) val = -val; *endptr = fail_pos; From python-checkins at python.org Thu May 21 00:05:59 2009 From: python-checkins at python.org (mark.dickinson) Date: Thu, 21 May 2009 00:05:59 +0200 (CEST) Subject: [Python-checkins] r72811 - python/branches/release30-maint Message-ID: <20090520220559.3D459D38D@mail.python.org> Author: mark.dickinson Date: Thu May 21 00:05:59 2009 New Revision: 72811 Log: Blocked revisions 72810 via svnmerge ........ r72810 | mark.dickinson | 2009-05-20 23:05:25 +0100 (Wed, 20 May 2009) | 3 lines Refactor to remove duplicated nan/inf parsing code in pystrtod.c, floatobject.c and dtoa.c. ........ Modified: python/branches/release30-maint/ (props changed) From nnorwitz at gmail.com Thu May 21 00:11:45 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 20 May 2009 18:11:45 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090520221145.GA4526@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 Less important issues: ---------------------- test_docxmlrpc leaked [4, 0, 185] references, sum=189 test_smtplib leaked [-199, 88, 23] references, sum=-88 test_socketserver leaked [0, 0, 91] references, sum=91 test_ssl leaked [26, -26, 0] references, sum=0 test_sys leaked [-42, 0, 42] references, sum=0 test_threading leaked [48, 48, 48] references, sum=144 test_xmlrpc leaked [6, 0, 0] references, sum=6 From buildbot at python.org Thu May 21 01:02:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 20 May 2009 23:02:26 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc trunk Message-ID: <20090520230226.63060C3CD@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%20trunk/builds/450 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_poplib sincerely, -The Buildbot From buildbot at python.org Thu May 21 02:20:02 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 21 May 2009 00:20:02 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.0 Message-ID: <20090521002002.92E19C496@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.0/builds/344 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu May 21 03:20:42 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 21 May 2009 01:20:42 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090521012042.8094CD638@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/720 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: jeffrey.yasskin,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Thu May 21 04:07:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 21 May 2009 02:07:50 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090521020750.8DC6ED3BA@mail.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/597 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl,jeffrey.yasskin,mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_codecs test_io ====================================================================== ERROR: test_basics (test.test_codecs.BasicUnicodeTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_codecs.py", line 1360, in test_basics encodedresult += encoder.encode(c) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: test_decoder_state (test.test_codecs.BasicUnicodeTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_codecs.py", line 1445, in test_decoder_state self.check_state_handling_decode(encoding, u, u.encode(encoding)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_codecs.py", line 30, in check_state_handling_decode part1 = d.decode(s[:i]) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_basic_io (test.test_io.CTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1735, in test_basic_io self.assertEquals(f.read(), "abc") File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_encoding_errors_reading (test.test_io.CTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1557, in test_encoding_errors_reading self.assertRaises(UnicodeError, t.read) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 582, in assertRaises callableObj(*args, **kwargs) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_1 (test.test_io.CTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1926, in test_issue1395_1 c = txt.read(1) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_2 (test.test_io.CTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1938, in test_issue1395_2 c = txt.read(4) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_3 (test.test_io.CTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1948, in test_issue1395_3 reads = txt.read(4) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_4 (test.test_io.CTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1959, in test_issue1395_4 reads = txt.read(4) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_5 (test.test_io.CTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1967, in test_issue1395_5 reads = txt.read(4) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_newlines_input (test.test_io.CTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1649, in test_newlines_input self.assertEquals(txt.readlines(), expected) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_basic_io (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1730, in test_basic_io self.assertEquals(f.write("abc"), 3) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1519, in write b = encoder.encode(s) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: test_destructor (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1680, in test_destructor t.write("abc") File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1519, in write b = encoder.encode(s) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: test_detach (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1521, in test_detach t.write("howdy") File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1519, in write b = encoder.encode(s) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: test_encoding_errors_reading (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1557, in test_encoding_errors_reading self.assertRaises(UnicodeError, t.read) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 582, in assertRaises callableObj(*args, **kwargs) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1774, in read decoder.decode(self.buffer.read(), final=True)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1302, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_encoding_errors_writing (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1575, in test_encoding_errors_writing self.assertRaises(UnicodeError, t.write, "\xff") File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 582, in assertRaises callableObj(*args, **kwargs) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1519, in write b = encoder.encode(s) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: test_issue1395_1 (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1926, in test_issue1395_1 c = txt.read(1) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1783, in read eof = not self._read_chunk() File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1590, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1302, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_2 (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1938, in test_issue1395_2 c = txt.read(4) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1783, in read eof = not self._read_chunk() File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1590, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1302, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_3 (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1948, in test_issue1395_3 reads = txt.read(4) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1783, in read eof = not self._read_chunk() File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1590, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1302, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_4 (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1959, in test_issue1395_4 reads = txt.read(4) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1783, in read eof = not self._read_chunk() File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1590, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1302, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_5 (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1967, in test_issue1395_5 reads = txt.read(4) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1783, in read eof = not self._read_chunk() File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1590, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1302, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_newlines_input (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1649, in test_newlines_input self.assertEquals(txt.readlines(), expected) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 493, in readlines return list(self) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1789, in __next__ line = self.readline() File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1866, in readline while self._read_chunk(): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1590, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1302, in decode output = self.decoder.decode(input, final=final) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_newlines_output (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_io.py", line 1664, in test_newlines_output txt.write("AAA\nB") File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\_pyio.py", line 1519, in write b = encoder.encode(s) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\encodings\ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' sincerely, -The Buildbot From buildbot at python.org Thu May 21 04:11:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 21 May 2009 02:11:50 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090521021150.CFBFBD4EA@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/381 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_distutils test_posix ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 45, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/Include ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Thu May 21 04:32:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 21 May 2009 02:32:46 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090521023246.3DF48C3E3@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/781 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: mark.dickinson BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Thu May 21 11:28:25 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 21 May 2009 05:28:25 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090521092825.GA10285@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 Less important issues: ---------------------- test_smtplib leaked [-83, 88, -88] references, sum=-83 test_socketserver leaked [-80, 0, 0] references, sum=-80 test_sys leaked [42, -21, -21] references, sum=0 test_threading leaked [48, 48, 48] references, sum=144 From nnorwitz at gmail.com Thu May 21 23:28:26 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 21 May 2009 17:28:26 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090521212826.GA21754@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 Less important issues: ---------------------- test_asynchat leaked [139, -139, 0] references, sum=0 test_smtplib leaked [0, -4, 87] references, sum=83 test_socketserver leaked [-83, 0, 0] references, sum=-83 test_sys leaked [-21, 0, 42] references, sum=21 test_threading leaked [48, 48, 48] references, sum=144 From python-checkins at python.org Fri May 22 00:57:12 2009 From: python-checkins at python.org (michael.foord) Date: Fri, 22 May 2009 00:57:12 +0200 (CEST) Subject: [Python-checkins] r72812 - in python/trunk/Lib: test/test_unittest.py unittest.py Message-ID: <20090521225712.6926FD35D@mail.python.org> Author: michael.foord Date: Fri May 22 00:57:02 2009 New Revision: 72812 Log: Rename TestCase._result to _resultForDoCleanups to avoid potential clashes in TestCase subclasses. Issue 6072. Modified: python/trunk/Lib/test/test_unittest.py python/trunk/Lib/unittest.py Modified: python/trunk/Lib/test/test_unittest.py ============================================================================== --- python/trunk/Lib/test/test_unittest.py (original) +++ python/trunk/Lib/test/test_unittest.py Fri May 22 00:57:02 2009 @@ -3203,7 +3203,7 @@ result = MockResult() test = TestableTest('testNothing') - test._result = result + test._resultForDoCleanups = result exc1 = Exception('foo') exc2 = Exception('bar') Modified: python/trunk/Lib/unittest.py ============================================================================== --- python/trunk/Lib/unittest.py (original) +++ python/trunk/Lib/unittest.py Fri May 22 00:57:02 2009 @@ -352,7 +352,7 @@ not have a method with the specified name. """ self._testMethodName = methodName - self._result = None + self._resultForDoCleanups = None try: testMethod = getattr(self, methodName) except AttributeError: @@ -456,7 +456,7 @@ if startTestRun is not None: startTestRun() - self._result = result + self._resultForDoCleanups = result result.startTest(self) testMethod = getattr(self, self._testMethodName) try: @@ -503,7 +503,7 @@ def doCleanups(self): """Execute all cleanup functions. Normally called for you after tearDown.""" - result = self._result + result = self._resultForDoCleanups ok = True while self._cleanups: function, args, kwargs = self._cleanups.pop(-1) From buildbot at python.org Fri May 22 01:03:36 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 21 May 2009 23:03:36 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable trunk Message-ID: <20090521230336.C89F4D2FA@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable trunk. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%20trunk/builds/548 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: michael.foord BUILD FAILED: failed svn sincerely, -The Buildbot From python-checkins at python.org Fri May 22 03:06:44 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 22 May 2009 03:06:44 +0200 (CEST) Subject: [Python-checkins] r72813 - python/trunk/Doc/library/collections.rst Message-ID: <20090522010644.A5C21C495@mail.python.org> Author: raymond.hettinger Date: Fri May 22 03:06:44 2009 New Revision: 72813 Log: Fix-up moving average example. Modified: python/trunk/Doc/library/collections.rst Modified: python/trunk/Doc/library/collections.rst ============================================================================== --- python/trunk/Doc/library/collections.rst (original) +++ python/trunk/Doc/library/collections.rst Fri May 22 03:06:44 2009 @@ -476,16 +476,14 @@ def moving_average(iterable, n=3): # moving_average([40, 30, 50, 46, 39, 44]) --> 40.0 42.0 45.0 43.0 # http://en.wikipedia.org/wiki/Moving_average - n = float(n) it = iter(iterable) - d = deque(itertools.islice(it, n)) + d = deque(itertools.islice(it, n-1)) + d.appendleft(0) s = sum(d) - if len(d) == n: - yield s / n for elem in it: s += elem - d.popleft() d.append(elem) - yield s / n + yield s / float(n) The :meth:`rotate` method provides a way to implement :class:`deque` slicing and deletion. For example, a pure python implementation of ``del d[n]`` relies on From python-checkins at python.org Fri May 22 03:11:26 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 22 May 2009 03:11:26 +0200 (CEST) Subject: [Python-checkins] r72814 - python/branches/py3k/Doc/library/collections.rst Message-ID: <20090522011126.4D688C3D3@mail.python.org> Author: raymond.hettinger Date: Fri May 22 03:11:26 2009 New Revision: 72814 Log: Fix-up moving average example. Modified: python/branches/py3k/Doc/library/collections.rst Modified: python/branches/py3k/Doc/library/collections.rst ============================================================================== --- python/branches/py3k/Doc/library/collections.rst (original) +++ python/branches/py3k/Doc/library/collections.rst Fri May 22 03:11:26 2009 @@ -455,10 +455,9 @@ # moving_average([40, 30, 50, 46, 39, 44]) --> 40.0 42.0 45.0 43.0 # http://en.wikipedia.org/wiki/Moving_average it = iter(iterable) - d = deque(itertools.islice(it, n)) + d = deque(itertools.islice(it, n-1)) + d.appendleft(0) s = sum(d) - if len(d) == n: - yield s / n for elem in it: s += elem - d.popleft() d.append(elem) From python-checkins at python.org Fri May 22 03:14:18 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 22 May 2009 03:14:18 +0200 (CEST) Subject: [Python-checkins] r72815 - python/branches/release30-maint/Doc/library/collections.rst Message-ID: <20090522011418.226F2D5AA@mail.python.org> Author: raymond.hettinger Date: Fri May 22 03:14:17 2009 New Revision: 72815 Log: Sync-up examples with Py3k updates. Modified: python/branches/release30-maint/Doc/library/collections.rst Modified: python/branches/release30-maint/Doc/library/collections.rst ============================================================================== --- python/branches/release30-maint/Doc/library/collections.rst (original) +++ python/branches/release30-maint/Doc/library/collections.rst Fri May 22 03:14:17 2009 @@ -298,6 +298,28 @@ This section shows various approaches to working with deques. +Bounded length deques provide functionality similar to the ``tail`` filter +in Unix:: + + def tail(filename, n=10): + 'Return the last n lines of a file' + return deque(open(filename), n) + +Another approach to using deques is to maintain a sequence of recently +added elements by appending to the right and popping to the left:: + + def moving_average(iterable, n=3): + # moving_average([40, 30, 50, 46, 39, 44]) --> 40.0 42.0 45.0 43.0 + # http://en.wikipedia.org/wiki/Moving_average + it = iter(iterable) + d = deque(itertools.islice(it, n-1)) + d.appendleft(0) + s = sum(d) + for elem in it: + s += elem - d.popleft() + d.append(elem) + yield s / n + The :meth:`rotate` method provides a way to implement :class:`deque` slicing and deletion. For example, a pure python implementation of ``del d[n]`` relies on the :meth:`rotate` method to position elements to be popped:: @@ -315,31 +337,6 @@ stack manipulations such as ``dup``, ``drop``, ``swap``, ``over``, ``pick``, ``rot``, and ``roll``. -Multi-pass data reduction algorithms can be succinctly expressed and efficiently -coded by extracting elements with multiple calls to :meth:`popleft`, applying -a reduction function, and calling :meth:`append` to add the result back to the -deque. - -For example, building a balanced binary tree of nested lists entails reducing -two adjacent nodes into one by grouping them in a list: - - >>> def maketree(iterable): - ... d = deque(iterable) - ... while len(d) > 1: - ... pair = [d.popleft(), d.popleft()] - ... d.append(pair) - ... return list(d) - ... - >>> print(maketree('abcdefgh')) - [[[['a', 'b'], ['c', 'd']], [['e', 'f'], ['g', 'h']]]] - -Bounded length deques provide functionality similar to the ``tail`` filter -in Unix:: - - def tail(filename, n=10): - 'Return the last n lines of a file' - return deque(open(filename), n) - .. _defaultdict-objects: :class:`defaultdict` objects From python-checkins at python.org Fri May 22 03:16:46 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 22 May 2009 03:16:46 +0200 (CEST) Subject: [Python-checkins] r72816 - python/branches/release26-maint/Doc/library/collections.rst Message-ID: <20090522011646.96065C483@mail.python.org> Author: raymond.hettinger Date: Fri May 22 03:16:46 2009 New Revision: 72816 Log: Sync-up examples with Py2.7 updates. Modified: python/branches/release26-maint/Doc/library/collections.rst Modified: python/branches/release26-maint/Doc/library/collections.rst ============================================================================== --- python/branches/release26-maint/Doc/library/collections.rst (original) +++ python/branches/release26-maint/Doc/library/collections.rst Fri May 22 03:16:46 2009 @@ -316,6 +316,28 @@ This section shows various approaches to working with deques. +Bounded length deques provide functionality similar to the ``tail`` filter +in Unix:: + + def tail(filename, n=10): + 'Return the last n lines of a file' + return deque(open(filename), n) + +Another approach to using deques is to maintain a sequence of recently +added elements by appending to the right and popping to the left:: + + def moving_average(iterable, n=3): + # moving_average([40, 30, 50, 46, 39, 44]) --> 40.0 42.0 45.0 43.0 + # http://en.wikipedia.org/wiki/Moving_average + it = iter(iterable) + d = deque(itertools.islice(it, n-1)) + d.appendleft(0) + s = sum(d) + for elem in it: + s += elem - d.popleft() + d.append(elem) + yield s / float(n) + The :meth:`rotate` method provides a way to implement :class:`deque` slicing and deletion. For example, a pure python implementation of ``del d[n]`` relies on the :meth:`rotate` method to position elements to be popped:: @@ -333,31 +355,6 @@ stack manipulations such as ``dup``, ``drop``, ``swap``, ``over``, ``pick``, ``rot``, and ``roll``. -Multi-pass data reduction algorithms can be succinctly expressed and efficiently -coded by extracting elements with multiple calls to :meth:`popleft`, applying -a reduction function, and calling :meth:`append` to add the result back to the -deque. - -For example, building a balanced binary tree of nested lists entails reducing -two adjacent nodes into one by grouping them in a list: - - >>> def maketree(iterable): - ... d = deque(iterable) - ... while len(d) > 1: - ... pair = [d.popleft(), d.popleft()] - ... d.append(pair) - ... return list(d) - ... - >>> print maketree('abcdefgh') - [[[['a', 'b'], ['c', 'd']], [['e', 'f'], ['g', 'h']]]] - -Bounded length deques provide functionality similar to the ``tail`` filter -in Unix:: - - def tail(filename, n=10): - 'Return the last n lines of a file' - return deque(open(filename), n) - .. _defaultdict-objects: :class:`defaultdict` objects From python-checkins at python.org Fri May 22 07:35:33 2009 From: python-checkins at python.org (philip.jenvey) Date: Fri, 22 May 2009 07:35:33 +0200 (CEST) Subject: [Python-checkins] r72817 - in python/trunk: Doc/library/subprocess.rst Lib/test/test_cmd_line.py Message-ID: <20090522053533.224C9C428@mail.python.org> Author: philip.jenvey Date: Fri May 22 07:35:32 2009 New Revision: 72817 Log: don't use subprocess.call with PIPEs as the child can fill the pipe buf and deadlock. add a warning to subprocess docs about this, similar to Popen.wait's. refs http://bugs.jython.org/issue1351 Modified: python/trunk/Doc/library/subprocess.rst python/trunk/Lib/test/test_cmd_line.py Modified: python/trunk/Doc/library/subprocess.rst ============================================================================== --- python/trunk/Doc/library/subprocess.rst (original) +++ python/trunk/Doc/library/subprocess.rst Fri May 22 07:35:32 2009 @@ -157,6 +157,12 @@ retcode = call(["ls", "-l"]) + .. warning:: + + Like :meth:`Popen.wait`, this will deadlock if the child process + generates enough output to a stdout or stderr pipe such that it blocks + waiting for the OS pipe buffer to accept more data. + .. function:: check_call(*popenargs, **kwargs) @@ -171,6 +177,10 @@ .. versionadded:: 2.5 + .. warning:: + + See the warning for :func:`call`. + .. function:: check_output(*popenargs, **kwargs) Modified: python/trunk/Lib/test/test_cmd_line.py ============================================================================== --- python/trunk/Lib/test/test_cmd_line.py (original) +++ python/trunk/Lib/test/test_cmd_line.py Fri May 22 07:35:32 2009 @@ -2,6 +2,7 @@ # All tests are executed with environment variables ignored # See test_cmd_line_script.py for testing of script execution +import os import test.test_support, unittest import sys import subprocess @@ -29,8 +30,9 @@ def exit_code(self, *args): cmd_line = [sys.executable, '-E'] cmd_line.extend(args) - return subprocess.call(cmd_line, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) + with open(os.devnull, 'w') as devnull: + return subprocess.call(cmd_line, stdout=devnull, + stderr=subprocess.STDOUT) def test_directories(self): self.assertNotEqual(self.exit_code('.'), 0) From python-checkins at python.org Fri May 22 07:39:55 2009 From: python-checkins at python.org (philip.jenvey) Date: Fri, 22 May 2009 07:39:55 +0200 (CEST) Subject: [Python-checkins] r72818 - python/branches/release26-maint Message-ID: <20090522053955.7FF84C3DC@mail.python.org> Author: philip.jenvey Date: Fri May 22 07:39:55 2009 New Revision: 72818 Log: Blocked revisions 72817 via svnmerge ........ r72817 | philip.jenvey | 2009-05-21 22:35:32 -0700 (Thu, 21 May 2009) | 4 lines don't use subprocess.call with PIPEs as the child can fill the pipe buf and deadlock. add a warning to subprocess docs about this, similar to Popen.wait's. refs http://bugs.jython.org/issue1351 ........ Modified: python/branches/release26-maint/ (props changed) From buildbot at python.org Fri May 22 07:45:03 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 22 May 2009 05:45:03 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 2.6 Message-ID: <20090522054503.64117C46A@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%202.6/builds/360 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: philip.jenvey,raymond.hettinger BUILD FAILED: failed svn sincerely, -The Buildbot From python-checkins at python.org Fri May 22 07:46:35 2009 From: python-checkins at python.org (philip.jenvey) Date: Fri, 22 May 2009 07:46:35 +0200 (CEST) Subject: [Python-checkins] r72819 - in python/branches/py3k: Doc/library/subprocess.rst Lib/test/test_cmd_line.py Message-ID: <20090522054635.A8E19D3D2@mail.python.org> Author: philip.jenvey Date: Fri May 22 07:46:35 2009 New Revision: 72819 Log: Merged revisions 72817 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72817 | philip.jenvey | 2009-05-21 22:35:32 -0700 (Thu, 21 May 2009) | 4 lines don't use subprocess.call with PIPEs as the child can fill the pipe buf and deadlock. add a warning to subprocess docs about this, similar to Popen.wait's. refs http://bugs.jython.org/issue1351 ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/subprocess.rst python/branches/py3k/Lib/test/test_cmd_line.py Modified: python/branches/py3k/Doc/library/subprocess.rst ============================================================================== --- python/branches/py3k/Doc/library/subprocess.rst (original) +++ python/branches/py3k/Doc/library/subprocess.rst Fri May 22 07:46:35 2009 @@ -152,6 +152,12 @@ retcode = call(["ls", "-l"]) + .. warning:: + + Like :meth:`Popen.wait`, this will deadlock if the child process + generates enough output to a stdout or stderr pipe such that it blocks + waiting for the OS pipe buffer to accept more data. + .. function:: check_call(*popenargs, **kwargs) @@ -164,6 +170,10 @@ check_call(["ls", "-l"]) + .. warning:: + + See the warning for :func:`call`. + .. function:: check_output(*popenargs, **kwargs) Modified: python/branches/py3k/Lib/test/test_cmd_line.py ============================================================================== --- python/branches/py3k/Lib/test/test_cmd_line.py (original) +++ python/branches/py3k/Lib/test/test_cmd_line.py Fri May 22 07:46:35 2009 @@ -2,6 +2,7 @@ # All tests are executed with environment variables ignored # See test_cmd_line_script.py for testing of script execution +import os import test.support, unittest import os import sys @@ -40,8 +41,9 @@ def exit_code(self, *args): cmd_line = [sys.executable, '-E'] cmd_line.extend(args) - return subprocess.call(cmd_line, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) + with open(os.devnull, 'w') as devnull: + return subprocess.call(cmd_line, stdout=devnull, + stderr=subprocess.STDOUT) def test_directories(self): self.assertNotEqual(self.exit_code('.'), 0) From buildbot at python.org Fri May 22 07:51:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 22 May 2009 05:51:40 +0000 Subject: [Python-checkins] buildbot failure in ppc Debian unstable 3.x Message-ID: <20090522055140.546C8C42B@mail.python.org> The Buildbot has detected a new failure of ppc Debian unstable 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ppc%20Debian%20unstable%203.x/builds/843 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ppc Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: philip.jenvey,raymond.hettinger BUILD FAILED: failed svn sincerely, -The Buildbot From python-checkins at python.org Fri May 22 09:23:32 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 22 May 2009 09:23:32 +0200 (CEST) Subject: [Python-checkins] r72820 - python/trunk/Doc/tutorial/errors.rst Message-ID: <20090522072332.B2C75D32C@mail.python.org> Author: georg.brandl Date: Fri May 22 09:23:32 2009 New Revision: 72820 Log: Use raise X(y). Modified: python/trunk/Doc/tutorial/errors.rst Modified: python/trunk/Doc/tutorial/errors.rst ============================================================================== --- python/trunk/Doc/tutorial/errors.rst (original) +++ python/trunk/Doc/tutorial/errors.rst Fri May 22 09:23:32 2009 @@ -216,7 +216,7 @@ The :keyword:`raise` statement allows the programmer to force a specified exception to occur. For example:: - >>> raise NameError, 'HiThere' + >>> raise NameError('HiThere') Traceback (most recent call last): File "", line 1, in ? NameError: HiThere @@ -231,7 +231,7 @@ re-raise the exception:: >>> try: - ... raise NameError, 'HiThere' + ... raise NameError('HiThere') ... except NameError: ... print 'An exception flew by!' ... raise @@ -263,7 +263,7 @@ ... print 'My exception occurred, value:', e.value ... My exception occurred, value: 4 - >>> raise MyError, 'oops!' + >>> raise MyError('oops!') Traceback (most recent call last): File "", line 1, in ? __main__.MyError: 'oops!' From python-checkins at python.org Fri May 22 09:38:58 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 22 May 2009 09:38:58 +0200 (CEST) Subject: [Python-checkins] r72821 - python/branches/py3k Message-ID: <20090522073858.BB3AED4DE@mail.python.org> Author: georg.brandl Date: Fri May 22 09:38:58 2009 New Revision: 72821 Log: Recorded merge of revisions 72813 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72813 | raymond.hettinger | 2009-05-22 03:06:44 +0200 (Fr, 22 Mai 2009) | 1 line Fix-up moving average example. ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Fri May 22 09:51:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 22 May 2009 07:51:57 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090522075157.D8369D4DE@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%202.6/builds/358 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: philip.jenvey,raymond.hettinger BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From buildbot at python.org Fri May 22 10:32:49 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 22 May 2009 08:32:49 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090522083249.AC983C425@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/722 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: philip.jenvey,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_coding test_posix ====================================================================== ERROR: test_file_parse (test.test_coding.CodingTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_coding.py", line 45, in test_file_parse __import__(TESTFN) ImportError: No module named @test ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From nnorwitz at gmail.com Fri May 22 11:27:24 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Fri, 22 May 2009 05:27:24 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090522092724.GA7666@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 Less important issues: ---------------------- test_asynchat leaked [0, 139, -139] references, sum=0 test_file leaked [69, -69, 0] references, sum=0 test_smtplib leaked [-88, 83, 5] references, sum=0 test_sys leaked [-21, 0, 0] references, sum=-21 test_threading leaked [48, 53, 43] references, sum=144 From python-checkins at python.org Fri May 22 11:33:25 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 22 May 2009 11:33:25 +0200 (CEST) Subject: [Python-checkins] r72822 - python/trunk/Doc/library/functions.rst Message-ID: <20090522093325.7E2B6C31D@mail.python.org> Author: georg.brandl Date: Fri May 22 11:33:25 2009 New Revision: 72822 Log: #6084: fix example. Modified: python/trunk/Doc/library/functions.rst Modified: python/trunk/Doc/library/functions.rst ============================================================================== --- python/trunk/Doc/library/functions.rst (original) +++ python/trunk/Doc/library/functions.rst Fri May 22 11:33:25 2009 @@ -1413,7 +1413,7 @@ >>> zipped [(1, 4), (2, 5), (3, 6)] >>> x2, y2 = zip(*zipped) - >>> x == x2, y == y2 + >>> x == list(x2) and y == list(y2) True .. versionadded:: 2.0 From python-checkins at python.org Fri May 22 11:42:43 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 22 May 2009 11:42:43 +0200 (CEST) Subject: [Python-checkins] r72823 - python/trunk/Lib/distutils/command/bdist_msi.py Message-ID: <20090522094243.C41A3C2C6@mail.python.org> Author: tarek.ziade Date: Fri May 22 11:42:43 2009 New Revision: 72823 Log: fixed encoding Modified: python/trunk/Lib/distutils/command/bdist_msi.py Modified: python/trunk/Lib/distutils/command/bdist_msi.py ============================================================================== --- python/trunk/Lib/distutils/command/bdist_msi.py (original) +++ python/trunk/Lib/distutils/command/bdist_msi.py Fri May 22 11:42:43 2009 @@ -1,5 +1,5 @@ -# -*- coding: iso-8859-1 -*- -# Copyright (C) 2005, 2006 Martin v. L?wis +# -*- coding: utf-8 -*- +# Copyright (C) 2005, 2006 Martin von L??wis # Licensed to PSF under a Contributor Agreement. # The bdist_wininst command proper # based on bdist_wininst From python-checkins at python.org Fri May 22 11:43:17 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 22 May 2009 11:43:17 +0200 (CEST) Subject: [Python-checkins] r72824 - python/trunk/Doc/library/os.rst Message-ID: <20090522094317.5A8D3C2D5@mail.python.org> Author: georg.brandl Date: Fri May 22 11:43:17 2009 New Revision: 72824 Log: Fix references to file-related functions and methods (os.* vs file.*). Modified: python/trunk/Doc/library/os.rst Modified: python/trunk/Doc/library/os.rst ============================================================================== --- python/trunk/Doc/library/os.rst (original) +++ python/trunk/Doc/library/os.rst Fri May 22 11:43:17 2009 @@ -354,7 +354,7 @@ is ``'r'`` (default) or ``'w'``. The *bufsize* argument has the same meaning as the corresponding argument to the built-in :func:`open` function. The exit status of the command (encoded in the format specified for :func:`wait`) is - available as the return value of the :meth:`close` method of the file object, + available as the return value of the :meth:`~file.close` method of the file object, except that when the exit status is zero (termination without errors), ``None`` is returned. Availability: Unix, Windows. @@ -475,9 +475,9 @@ .. note:: This function is intended for low-level I/O and must be applied to a file - descriptor as returned by :func:`open` or :func:`pipe`. To close a "file + descriptor as returned by :func:`os.open` or :func:`pipe`. To close a "file object" returned by the built-in function :func:`open` or by :func:`popen` or - :func:`fdopen`, use its :meth:`close` method. + :func:`fdopen`, use its :meth:`~file.close` method. .. function:: closerange(fd_low, fd_high) @@ -604,8 +604,8 @@ .. note:: This function is intended for low-level I/O. For normal usage, use the built-in - function :func:`open`, which returns a "file object" with :meth:`read` and - :meth:`write` methods (and many more). To wrap a file descriptor in a "file + function :func:`open`, which returns a "file object" with :meth:`~file.read` and + :meth:`~file.write` methods (and many more). To wrap a file descriptor in a "file object", use :func:`fdopen`. @@ -634,22 +634,22 @@ .. note:: This function is intended for low-level I/O and must be applied to a file - descriptor as returned by :func:`open` or :func:`pipe`. To read a "file object" + descriptor as returned by :func:`os.open` or :func:`pipe`. To read a "file object" returned by the built-in function :func:`open` or by :func:`popen` or - :func:`fdopen`, or :data:`sys.stdin`, use its :meth:`read` or :meth:`readline` - methods. + :func:`fdopen`, or :data:`sys.stdin`, use its :meth:`~file.read` or + :meth:`~file.readline` methods. .. function:: tcgetpgrp(fd) Return the process group associated with the terminal given by *fd* (an open - file descriptor as returned by :func:`open`). Availability: Unix. + file descriptor as returned by :func:`os.open`). Availability: Unix. .. function:: tcsetpgrp(fd, pg) Set the process group associated with the terminal given by *fd* (an open file - descriptor as returned by :func:`open`) to *pg*. Availability: Unix. + descriptor as returned by :func:`os.open`) to *pg*. Availability: Unix. .. function:: ttyname(fd) @@ -667,13 +667,13 @@ .. note:: This function is intended for low-level I/O and must be applied to a file - descriptor as returned by :func:`open` or :func:`pipe`. To write a "file + descriptor as returned by :func:`os.open` or :func:`pipe`. To write a "file object" returned by the built-in function :func:`open` or by :func:`popen` or - :func:`fdopen`, or :data:`sys.stdout` or :data:`sys.stderr`, use its :meth:`write` - method. + :func:`fdopen`, or :data:`sys.stdout` or :data:`sys.stderr`, use its + :meth:`~file.write` method. The following constants are options for the *flags* parameter to the -:func:`open` function. They can be combined using the bitwise OR operator +:func:`~os.open` function. They can be combined using the bitwise OR operator ``|``. Some of them are not available on all platforms. For descriptions of their availability and use, consult the :manpage:`open(2)` manual page on Unix or `the MSDN ` on Windows. @@ -752,7 +752,7 @@ .. note:: Using :func:`access` to check if a user is authorized to e.g. open a file before - actually doing so using :func:`open` creates a security hole, because the user + actually doing so using :func:`open` creates a security hole, because the user might exploit the short time interval between checking and opening the file to manipulate it. From python-checkins at python.org Fri May 22 11:43:59 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 22 May 2009 11:43:59 +0200 (CEST) Subject: [Python-checkins] r72825 - python/branches/release26-maint Message-ID: <20090522094359.2214BC2D5@mail.python.org> Author: tarek.ziade Date: Fri May 22 11:43:59 2009 New Revision: 72825 Log: Blocked revisions 72823 via svnmerge ........ r72823 | tarek.ziade | 2009-05-22 11:42:43 +0200 (Fri, 22 May 2009) | 1 line fixed encoding ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri May 22 11:49:42 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 22 May 2009 11:49:42 +0200 (CEST) Subject: [Python-checkins] r72826 - python/trunk/Doc/library/functions.rst Message-ID: <20090522094942.84F82C2C0@mail.python.org> Author: georg.brandl Date: Fri May 22 11:49:42 2009 New Revision: 72826 Log: Fix confusing wording. Modified: python/trunk/Doc/library/functions.rst Modified: python/trunk/Doc/library/functions.rst ============================================================================== --- python/trunk/Doc/library/functions.rst (original) +++ python/trunk/Doc/library/functions.rst Fri May 22 11:49:42 2009 @@ -1483,7 +1483,7 @@ names. If you simply want to import a module (potentially within a package) by name, - you can get it from :data:`sys.modules`:: + you can use :func:`__import__` and then look it up in :data:`sys.modules`:: >>> import sys >>> name = 'foo.bar.baz' From python-checkins at python.org Fri May 22 11:50:30 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 22 May 2009 11:50:30 +0200 (CEST) Subject: [Python-checkins] r72827 - python/trunk/Doc/library/functions.rst Message-ID: <20090522095030.DCA2CC2F6@mail.python.org> Author: georg.brandl Date: Fri May 22 11:50:30 2009 New Revision: 72827 Log: s/use/call/ Modified: python/trunk/Doc/library/functions.rst Modified: python/trunk/Doc/library/functions.rst ============================================================================== --- python/trunk/Doc/library/functions.rst (original) +++ python/trunk/Doc/library/functions.rst Fri May 22 11:50:30 2009 @@ -1483,7 +1483,7 @@ names. If you simply want to import a module (potentially within a package) by name, - you can use :func:`__import__` and then look it up in :data:`sys.modules`:: + you can call :func:`__import__` and then look it up in :data:`sys.modules`:: >>> import sys >>> name = 'foo.bar.baz' From python-checkins at python.org Fri May 22 11:58:48 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 22 May 2009 11:58:48 +0200 (CEST) Subject: [Python-checkins] r72828 - python/trunk/Doc/reference/simple_stmts.rst Message-ID: <20090522095848.8CB2DC424@mail.python.org> Author: georg.brandl Date: Fri May 22 11:58:48 2009 New Revision: 72828 Log: Correction in softspace behavior description. Modified: python/trunk/Doc/reference/simple_stmts.rst Modified: python/trunk/Doc/reference/simple_stmts.rst ============================================================================== --- python/trunk/Doc/reference/simple_stmts.rst (original) +++ python/trunk/Doc/reference/simple_stmts.rst Fri May 22 11:58:48 2009 @@ -386,9 +386,10 @@ object is (converted and) written, unless the output system believes it is positioned at the beginning of a line. This is the case (1) when no characters have yet been written to standard output, (2) when the last character written to -standard output is ``'\n'``, or (3) when the last write operation on standard -output was not a :keyword:`print` statement. (In some cases it may be -functional to write an empty string to standard output for this reason.) +standard output is a whitespace character except ``' '``, or (3) when the last +write operation on standard output was not a :keyword:`print` statement. +(In some cases it may be functional to write an empty string to standard output +for this reason.) .. note:: From python-checkins at python.org Fri May 22 12:01:58 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 22 May 2009 12:01:58 +0200 (CEST) Subject: [Python-checkins] r72829 - python/branches/py3k Message-ID: <20090522100158.3A958D364@mail.python.org> Author: georg.brandl Date: Fri May 22 12:01:58 2009 New Revision: 72829 Log: Blocked revisions 72828 via svnmerge ........ r72828 | georg.brandl | 2009-05-22 11:58:48 +0200 (Fr, 22 Mai 2009) | 1 line Correction in softspace behavior description. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Fri May 22 12:40:00 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 22 May 2009 12:40:00 +0200 (CEST) Subject: [Python-checkins] r72830 - in python/trunk/Doc/howto: doanddont.rst urllib2.rst Message-ID: <20090522104000.47AD3C300@mail.python.org> Author: georg.brandl Date: Fri May 22 12:40:00 2009 New Revision: 72830 Log: #6086: fix spelling and use a better exception to catch. Modified: python/trunk/Doc/howto/doanddont.rst python/trunk/Doc/howto/urllib2.rst Modified: python/trunk/Doc/howto/doanddont.rst ============================================================================== --- python/trunk/Doc/howto/doanddont.rst (original) +++ python/trunk/Doc/howto/doanddont.rst Fri May 22 12:40:00 2009 @@ -30,7 +30,7 @@ ``from module import *`` is *invalid* inside function definitions. While many versions of Python do not check for the invalidity, it does not make it more -valid, no more then having a smart lawyer makes a man innocent. Do not use it +valid, no more than having a smart lawyer makes a man innocent. Do not use it like that ever. Even in versions where it was accepted, it made the function execution slower, because the compiler could not be certain which names are local and which are global. In Python 2.1 this construct causes warnings, and @@ -111,7 +111,7 @@ from module import name1, name2 ------------------------------- -This is a "don't" which is much weaker then the previous "don't"s but is still +This is a "don't" which is much weaker than the previous "don't"s but is still something you should not do if you don't have good reasons to do that. The reason it is usually bad idea is because you suddenly have an object which lives in two separate namespaces. When the binding in one namespace changes, the @@ -245,11 +245,11 @@ Every so often, people seem to be writing stuff in the Python library again, usually poorly. While the occasional module has a poor interface, it is usually much better to use the rich standard library and data types that come with -Python then inventing your own. +Python than inventing your own. A useful module very few people know about is :mod:`os.path`. It always has the correct path arithmetic for your operating system, and will usually be much -better then whatever you come up with yourself. +better than whatever you come up with yourself. Compare:: @@ -284,7 +284,7 @@ ====================================== Since Python treats a newline as a statement terminator, and since statements -are often more then is comfortable to put in one line, many people do:: +are often more than is comfortable to put in one line, many people do:: if foo.bar()['first'][0] == baz.quux(1, 2)[5:9] and \ calculate_number(10, 20) != forbulate(500, 360): Modified: python/trunk/Doc/howto/urllib2.rst ============================================================================== --- python/trunk/Doc/howto/urllib2.rst (original) +++ python/trunk/Doc/howto/urllib2.rst Fri May 22 12:40:00 2009 @@ -311,7 +311,7 @@ >>> req = urllib2.Request('http://www.python.org/fish.html') >>> try: >>> urllib2.urlopen(req) - >>> except URLError, e: + >>> except HTTPError, e: >>> print e.code >>> print e.read() >>> From buildbot at python.org Fri May 22 12:43:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 22 May 2009 10:43:09 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090522104309.A77F9C42B@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/1010 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Fri May 22 12:44:31 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 22 May 2009 12:44:31 +0200 (CEST) Subject: [Python-checkins] r72831 - in python/branches/py3k: Doc/howto/doanddont.rst Doc/howto/urllib2.rst Message-ID: <20090522104431.970ECC2C7@mail.python.org> Author: georg.brandl Date: Fri May 22 12:44:31 2009 New Revision: 72831 Log: Recorded merge of revisions 72830 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72830 | georg.brandl | 2009-05-22 12:40:00 +0200 (Fr, 22 Mai 2009) | 1 line #6086: fix spelling and use a better exception to catch. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/howto/doanddont.rst python/branches/py3k/Doc/howto/urllib2.rst Modified: python/branches/py3k/Doc/howto/doanddont.rst ============================================================================== --- python/branches/py3k/Doc/howto/doanddont.rst (original) +++ python/branches/py3k/Doc/howto/doanddont.rst Fri May 22 12:44:31 2009 @@ -30,7 +30,7 @@ ``from module import *`` is *invalid* inside function definitions. While many versions of Python do not check for the invalidity, it does not make it more -valid, no more then having a smart lawyer makes a man innocent. Do not use it +valid, no more than having a smart lawyer makes a man innocent. Do not use it like that ever. Even in versions where it was accepted, it made the function execution slower, because the compiler could not be certain which names are local and which are global. In Python 2.1 this construct causes warnings, and @@ -78,7 +78,7 @@ from module import name1, name2 ------------------------------- -This is a "don't" which is much weaker then the previous "don't"s but is still +This is a "don't" which is much weaker than the previous "don't"s but is still something you should not do if you don't have good reasons to do that. The reason it is usually bad idea is because you suddenly have an object which lives in two separate namespaces. When the binding in one namespace changes, the @@ -212,11 +212,11 @@ Every so often, people seem to be writing stuff in the Python library again, usually poorly. While the occasional module has a poor interface, it is usually much better to use the rich standard library and data types that come with -Python then inventing your own. +Python than inventing your own. A useful module very few people know about is :mod:`os.path`. It always has the correct path arithmetic for your operating system, and will usually be much -better then whatever you come up with yourself. +better than whatever you come up with yourself. Compare:: @@ -252,7 +252,7 @@ ====================================== Since Python treats a newline as a statement terminator, and since statements -are often more then is comfortable to put in one line, many people do:: +are often more than is comfortable to put in one line, many people do:: if foo.bar()['first'][0] == baz.quux(1, 2)[5:9] and \ calculate_number(10, 20) != forbulate(500, 360): Modified: python/branches/py3k/Doc/howto/urllib2.rst ============================================================================== --- python/branches/py3k/Doc/howto/urllib2.rst (original) +++ python/branches/py3k/Doc/howto/urllib2.rst Fri May 22 12:44:31 2009 @@ -313,7 +313,7 @@ >>> req = urllib.request.Request('http://www.python.org/fish.html') >>> try: >>> urllib.request.urlopen(req) - >>> except urllib.error.URLError as e: + >>> except urllib.error.HTTPError as e: >>> print(e.code) >>> print(e.read()) >>> From buildbot at python.org Fri May 22 13:00:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 22 May 2009 11:00:30 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090522110030.9EDE5C2DE@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/661 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_codecs test_io ====================================================================== ERROR: test_basics (test.test_codecs.BasicUnicodeTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_codecs.py", line 1360, in test_basics encodedresult += encoder.encode(c) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: test_decoder_state (test.test_codecs.BasicUnicodeTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_codecs.py", line 1445, in test_decoder_state self.check_state_handling_decode(encoding, u, u.encode(encoding)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_codecs.py", line 30, in check_state_handling_decode part1 = d.decode(s[:i]) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_basic_io (test.test_io.CTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1735, in test_basic_io self.assertEquals(f.read(), "abc") File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_encoding_errors_reading (test.test_io.CTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1557, in test_encoding_errors_reading self.assertRaises(UnicodeError, t.read) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/unittest.py", line 582, in assertRaises callableObj(*args, **kwargs) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_1 (test.test_io.CTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1926, in test_issue1395_1 c = txt.read(1) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_2 (test.test_io.CTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1938, in test_issue1395_2 c = txt.read(4) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_3 (test.test_io.CTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1948, in test_issue1395_3 reads = txt.read(4) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_4 (test.test_io.CTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1959, in test_issue1395_4 reads = txt.read(4) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_5 (test.test_io.CTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1967, in test_issue1395_5 reads = txt.read(4) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_newlines_input (test.test_io.CTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1649, in test_newlines_input self.assertEquals(txt.readlines(), expected) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_basic_io (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1730, in test_basic_io self.assertEquals(f.write("abc"), 3) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1519, in write b = encoder.encode(s) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: test_destructor (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1680, in test_destructor t.write("abc") File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1519, in write b = encoder.encode(s) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: test_detach (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1521, in test_detach t.write("howdy") File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1519, in write b = encoder.encode(s) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: test_encoding_errors_reading (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1557, in test_encoding_errors_reading self.assertRaises(UnicodeError, t.read) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/unittest.py", line 582, in assertRaises callableObj(*args, **kwargs) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1774, in read decoder.decode(self.buffer.read(), final=True)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1302, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_encoding_errors_writing (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1575, in test_encoding_errors_writing self.assertRaises(UnicodeError, t.write, "\xff") File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/unittest.py", line 582, in assertRaises callableObj(*args, **kwargs) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1519, in write b = encoder.encode(s) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: test_issue1395_1 (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1926, in test_issue1395_1 c = txt.read(1) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1783, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1590, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1302, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_2 (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1938, in test_issue1395_2 c = txt.read(4) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1783, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1590, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1302, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_3 (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1948, in test_issue1395_3 reads = txt.read(4) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1783, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1590, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1302, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_4 (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1959, in test_issue1395_4 reads = txt.read(4) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1783, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1590, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1302, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_issue1395_5 (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1967, in test_issue1395_5 reads = txt.read(4) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1783, in read eof = not self._read_chunk() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1590, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1302, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_newlines_input (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1649, in test_newlines_input self.assertEquals(txt.readlines(), expected) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 493, in readlines return list(self) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1789, in __next__ line = self.readline() File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1866, in readline while self._read_chunk(): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1590, in _read_chunk self._set_decoded_chars(self._decoder.decode(input_chunk, eof)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1302, in decode output = self.decoder.decode(input, final=final) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' ====================================================================== ERROR: test_newlines_output (test.test_io.PyTextIOWrapperTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_io.py", line 1664, in test_newlines_output txt.write("AAA\nB") File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/_pyio.py", line 1519, in write b = encoder.encode(s) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri May 22 14:13:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 22 May 2009 12:13:18 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090522121318.D6861C308@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/724 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Fri May 22 16:17:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 22 May 2009 14:17:15 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090522141715.8E9E2C413@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/785 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bytes make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri May 22 18:44:06 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 22 May 2009 18:44:06 +0200 (CEST) Subject: [Python-checkins] r72832 - python/branches/py3k/Doc/library/xmlrpc.client.rst Message-ID: <20090522164406.5986BC49D@mail.python.org> Author: georg.brandl Date: Fri May 22 18:44:06 2009 New Revision: 72832 Log: #6079: use 3k except syntax in examples. Modified: python/branches/py3k/Doc/library/xmlrpc.client.rst Modified: python/branches/py3k/Doc/library/xmlrpc.client.rst ============================================================================== --- python/branches/py3k/Doc/library/xmlrpc.client.rst (original) +++ python/branches/py3k/Doc/library/xmlrpc.client.rst Fri May 22 18:44:06 2009 @@ -343,7 +343,7 @@ proxy = xmlrpc.client.ServerProxy("http://localhost:8000/") try: proxy.add(2, 5) - except xmlrpc.client.Fault, err: + except xmlrpc.client.Fault as err: print("A fault occurred") print("Fault code: %d" % err.faultCode) print("Fault string: %s" % err.faultString) @@ -390,7 +390,7 @@ try: proxy.some_method() - except xmlrpc.client.ProtocolError, err: + except xmlrpc.client.ProtocolError as err: print("A protocol error occurred") print("URL: %s" % err.url) print("HTTP/HTTPS headers: %s" % err.headers) From python-checkins at python.org Fri May 22 19:00:17 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 22 May 2009 19:00:17 +0200 (CEST) Subject: [Python-checkins] r72833 - python/trunk/Tools/freeze/makeconfig.py Message-ID: <20090522170017.C5B14D29D@mail.python.org> Author: georg.brandl Date: Fri May 22 19:00:17 2009 New Revision: 72833 Log: #6078: _warnings is a builtin module and has no standard init_warnings function. Modified: python/trunk/Tools/freeze/makeconfig.py Modified: python/trunk/Tools/freeze/makeconfig.py ============================================================================== --- python/trunk/Tools/freeze/makeconfig.py (original) +++ python/trunk/Tools/freeze/makeconfig.py Fri May 22 19:00:17 2009 @@ -3,7 +3,7 @@ # Write the config.c file -never = ['marshal', '__main__', '__builtin__', 'sys', 'exceptions'] +never = ['marshal', '__main__', '__builtin__', 'sys', 'exceptions', '_warnings'] def makeconfig(infp, outfp, modules, with_ifdef=0): m1 = re.compile('-- ADDMODULE MARKER 1 --') From buildbot at python.org Fri May 22 19:38:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 22 May 2009 17:38:45 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090522173845.DC0D3C380@mail.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/5038 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Fri May 22 21:44:14 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 22 May 2009 21:44:14 +0200 (CEST) Subject: [Python-checkins] r72834 - peps/trunk/pep-0384.txt Message-ID: <20090522194414.01BF2C401@mail.python.org> Author: martin.v.loewis Date: Fri May 22 21:44:13 2009 New Revision: 72834 Log: Ban FILE* functions. Modified: peps/trunk/pep-0384.txt Modified: peps/trunk/pep-0384.txt ============================================================================== --- peps/trunk/pep-0384.txt (original) +++ peps/trunk/pep-0384.txt Fri May 22 21:44:13 2009 @@ -214,6 +214,10 @@ - token.h - traceback.h +In addition, functions expecting ``FILE*`` are not part of +the ABI, to avoid depending on a specific version of the +Microsoft C runtime DLL on Windows. + Global Variables ---------------- From martin at v.loewis.de Fri May 22 22:01:06 2009 From: martin at v.loewis.de (=?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?=) Date: Fri, 22 May 2009 22:01:06 +0200 Subject: [Python-checkins] r72823 - python/trunk/Lib/distutils/command/bdist_msi.py In-Reply-To: <20090522094243.C41A3C2C6@mail.python.org> References: <20090522094243.C41A3C2C6@mail.python.org> Message-ID: <4A170482.4090205@v.loewis.de> > fixed encoding > > Modified: > python/trunk/Lib/distutils/command/bdist_msi.py > > Modified: python/trunk/Lib/distutils/command/bdist_msi.py > ============================================================================== > --- python/trunk/Lib/distutils/command/bdist_msi.py (original) > +++ python/trunk/Lib/distutils/command/bdist_msi.py Fri May 22 11:42:43 2009 > @@ -1,5 +1,5 @@ > -# -*- coding: iso-8859-1 -*- > +# -*- coding: utf-8 -*- Why is that a fix? It wasn't broken before (AFAICT), and it violates PEP 8 (Encodings) now. Regards, Martin From python-checkins at python.org Sat May 23 02:48:58 2009 From: python-checkins at python.org (r.david.murray) Date: Sat, 23 May 2009 02:48:58 +0200 (CEST) Subject: [Python-checkins] r72835 - in python/trunk: Lib/smtplib.py Lib/test/test_smtpnet.py Misc/ACKS Misc/NEWS Message-ID: <20090523004858.3BA3FD32E@mail.python.org> Author: r.david.murray Date: Sat May 23 02:48:58 2009 New Revision: 72835 Log: Fix Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket. Patch by Farhan Ahmad, test by Marcin Bachry. Added: python/trunk/Lib/test/test_smtpnet.py Modified: python/trunk/Lib/smtplib.py python/trunk/Misc/ACKS python/trunk/Misc/NEWS Modified: python/trunk/Lib/smtplib.py ============================================================================== --- python/trunk/Lib/smtplib.py (original) +++ python/trunk/Lib/smtplib.py Sat May 23 02:48:58 2009 @@ -754,9 +754,10 @@ def _get_socket(self, host, port, timeout): if self.debuglevel > 0: print>>stderr, 'connect:', (host, port) - self.sock = socket.create_connection((host, port), timeout) - self.sock = ssl.wrap_socket(self.sock, self.keyfile, self.certfile) - self.file = SSLFakeFile(self.sock) + new_socket = socket.create_connection((host, port), timeout) + new_socket = ssl.wrap_socket(new_socket, self.keyfile, self.certfile) + self.file = SSLFakeFile(new_socket) + return new_socket __all__.append("SMTP_SSL") Added: python/trunk/Lib/test/test_smtpnet.py ============================================================================== --- (empty file) +++ python/trunk/Lib/test/test_smtpnet.py Sat May 23 02:48:58 2009 @@ -0,0 +1,26 @@ +#!/usr/bin/env python + +import unittest +from test import test_support +import smtplib + +test_support.requires( + "network", + "use of network resource is not enabled and " + "test requires Internet access for communication with smtp.gmail.com:465", + ) + +class SmtpSSLTest(unittest.TestCase): + testServer = 'smtp.gmail.com' + remotePort = 465 + + def test_connect(self): + server = smtplib.SMTP_SSL(self.testServer, self.remotePort) + server.ehlo() + server.quit() + +def test_main(): + test_support.run_unittest(SmtpSSLTest) + +if __name__ == "__main__": + test_main() Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Sat May 23 02:48:58 2009 @@ -12,6 +12,7 @@ David Abrahams Jim Ahlstrom +Farhan Ahmad Jyrki Alakuijala Billy G. Allie Kevin Altis @@ -29,6 +30,7 @@ Donovan Baarda Attila Babo Alfonso Baciero +Marcin Bachry Dwayne Bailey Stig Bakken Greg Ball Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat May 23 02:48:58 2009 @@ -302,6 +302,9 @@ Library ------- +- Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket. + Patch by Farhan Ahmad, test by Marcin Bachry. + - Issue #6062: In distutils, fixed the package option of build_ext. Feedback and tests on pywin32 by Tim Golden. From python-checkins at python.org Sat May 23 03:30:26 2009 From: python-checkins at python.org (r.david.murray) Date: Sat, 23 May 2009 03:30:26 +0200 (CEST) Subject: [Python-checkins] r72836 - in python/branches/py3k: Lib/smtplib.py Lib/test/test_smtpnet.py Misc/ACKS Misc/NEWS Message-ID: <20090523013026.87C87C336@mail.python.org> Author: r.david.murray Date: Sat May 23 03:30:26 2009 New Revision: 72836 Log: Merged revisions 72835 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72835 | r.david.murray | 2009-05-22 20:48:58 -0400 (Fri, 22 May 2009) | 4 lines Fix Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket. Patch by Farhan Ahmad, test by Marcin Bachry. ........ Added: python/branches/py3k/Lib/test/test_smtpnet.py - copied, changed from r72835, /python/trunk/Lib/test/test_smtpnet.py Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/smtplib.py python/branches/py3k/Misc/ACKS python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/smtplib.py ============================================================================== --- python/branches/py3k/Lib/smtplib.py (original) +++ python/branches/py3k/Lib/smtplib.py Sat May 23 03:30:26 2009 @@ -757,9 +757,10 @@ def _get_socket(self, host, port, timeout): if self.debuglevel > 0: print('connect:', (host, port), file=stderr) - self.sock = socket.create_connection((host, port), timeout) - self.sock = ssl.wrap_socket(self.sock, self.keyfile, self.certfile) - self.file = SSLFakeFile(self.sock) + new_socket = socket.create_connection((host, port), timeout) + new_socket = ssl.wrap_socket(new_socket, self.keyfile, self.certfile) + self.file = SSLFakeFile(new_socket) + return new_socket __all__.append("SMTP_SSL") Copied: python/branches/py3k/Lib/test/test_smtpnet.py (from r72835, /python/trunk/Lib/test/test_smtpnet.py) ============================================================================== --- /python/trunk/Lib/test/test_smtpnet.py (original) +++ python/branches/py3k/Lib/test/test_smtpnet.py Sat May 23 03:30:26 2009 @@ -1,10 +1,10 @@ #!/usr/bin/env python import unittest -from test import test_support +from test import support import smtplib -test_support.requires( +support.requires( "network", "use of network resource is not enabled and " "test requires Internet access for communication with smtp.gmail.com:465", @@ -20,7 +20,7 @@ server.quit() def test_main(): - test_support.run_unittest(SmtpSSLTest) + support.run_unittest(SmtpSSLTest) if __name__ == "__main__": test_main() Modified: python/branches/py3k/Misc/ACKS ============================================================================== --- python/branches/py3k/Misc/ACKS (original) +++ python/branches/py3k/Misc/ACKS Sat May 23 03:30:26 2009 @@ -11,6 +11,7 @@ David Abrahams Jim Ahlstrom +Farhan Ahmad Jyrki Alakuijala Billy G. Allie Kevin Altis @@ -28,6 +29,7 @@ Donovan Baarda Attila Babo Alfonso Baciero +Marcin Bachry Dwayne Bailey Stig Bakken Greg Ball Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 23 03:30:26 2009 @@ -29,6 +29,9 @@ Library ------- +- Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket. + Patch by Farhan Ahmad, test by Marcin Bachry. + - Issue #2116: Weak references and weak dictionaries now support copy()ing and deepcopy()ing. From python-checkins at python.org Sat May 23 03:42:43 2009 From: python-checkins at python.org (r.david.murray) Date: Sat, 23 May 2009 03:42:43 +0200 (CEST) Subject: [Python-checkins] r72837 - in python/branches/release26-maint: Lib/smtplib.py Lib/test/test_smtpnet.py Misc/ACKS Misc/NEWS Message-ID: <20090523014243.1EE3CC3D8@mail.python.org> Author: r.david.murray Date: Sat May 23 03:42:42 2009 New Revision: 72837 Log: Merged revisions 72835 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72835 | r.david.murray | 2009-05-22 20:48:58 -0400 (Fri, 22 May 2009) | 4 lines Fix Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket. Patch by Farhan Ahmad, test by Marcin Bachry. ........ Added: python/branches/release26-maint/Lib/test/test_smtpnet.py - copied unchanged from r72835, /python/trunk/Lib/test/test_smtpnet.py Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/smtplib.py python/branches/release26-maint/Misc/ACKS python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/smtplib.py ============================================================================== --- python/branches/release26-maint/Lib/smtplib.py (original) +++ python/branches/release26-maint/Lib/smtplib.py Sat May 23 03:42:42 2009 @@ -751,9 +751,10 @@ def _get_socket(self, host, port, timeout): if self.debuglevel > 0: print>>stderr, 'connect:', (host, port) - self.sock = socket.create_connection((host, port), timeout) - self.sock = ssl.wrap_socket(self.sock, self.keyfile, self.certfile) - self.file = SSLFakeFile(self.sock) + new_socket = socket.create_connection((host, port), timeout) + new_socket = ssl.wrap_socket(new_socket, self.keyfile, self.certfile) + self.file = SSLFakeFile(new_socket) + return new_socket __all__.append("SMTP_SSL") Modified: python/branches/release26-maint/Misc/ACKS ============================================================================== --- python/branches/release26-maint/Misc/ACKS (original) +++ python/branches/release26-maint/Misc/ACKS Sat May 23 03:42:42 2009 @@ -12,6 +12,7 @@ David Abrahams Jim Ahlstrom +Farhan Ahmad Jyrki Alakuijala Billy G. Allie Kevin Altis @@ -29,6 +30,7 @@ Donovan Baarda Attila Babo Alfonso Baciero +Marcin Bachry Dwayne Bailey Stig Bakken Greg Ball @@ -166,6 +168,7 @@ Raghuram Devarakonda Toby Dickenson Mark Dickinson +Daniel Diniz Yves Dionne Daniel Dittmar Jaromir Dolecek Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sat May 23 03:42:42 2009 @@ -47,6 +47,9 @@ Library ------- +- Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket. + Patch by Farhan Ahmad, test by Marcin Bachry. + - Issue #1655: Make imaplib IPv6-capable. Patch by Derek Morr. - Issue #1664: Make nntplib IPv6-capable. Patch by Derek Morr. From buildbot at python.org Sat May 23 03:47:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 01:47:17 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090523014717.43C06C468@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1354 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sat May 23 03:50:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 01:50:23 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc trunk Message-ID: <20090523015023.76C79C383@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%20trunk/builds/455 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtpnet ====================================================================== ERROR: test_connect (test.test_smtpnet.SmtpSSLTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/trunk.loewis-sun/build/Lib/test/test_smtpnet.py", line 18, in test_connect server = smtplib.SMTP_SSL(self.testServer, self.remotePort) AttributeError: 'module' object has no attribute 'SMTP_SSL' sincerely, -The Buildbot From python-checkins at python.org Sat May 23 04:16:59 2009 From: python-checkins at python.org (r.david.murray) Date: Sat, 23 May 2009 04:16:59 +0200 (CEST) Subject: [Python-checkins] r72838 - python/trunk/Lib/test/test_smtpnet.py Message-ID: <20090523021659.14E8BC4A4@mail.python.org> Author: r.david.murray Date: Sat May 23 04:16:58 2009 New Revision: 72838 Log: Don't be so wordy in requires('network') in case other tests are added later, and skip the existing test if SSL is not available. Modified: python/trunk/Lib/test/test_smtpnet.py Modified: python/trunk/Lib/test/test_smtpnet.py ============================================================================== --- python/trunk/Lib/test/test_smtpnet.py (original) +++ python/trunk/Lib/test/test_smtpnet.py Sat May 23 04:16:58 2009 @@ -4,17 +4,14 @@ from test import test_support import smtplib -test_support.requires( - "network", - "use of network resource is not enabled and " - "test requires Internet access for communication with smtp.gmail.com:465", - ) +test_support.requires("network") class SmtpSSLTest(unittest.TestCase): testServer = 'smtp.gmail.com' remotePort = 465 def test_connect(self): + test_support.get_attribute(smtplib, 'SMTP_SSLX') server = smtplib.SMTP_SSL(self.testServer, self.remotePort) server.ehlo() server.quit() From python-checkins at python.org Sat May 23 04:19:36 2009 From: python-checkins at python.org (r.david.murray) Date: Sat, 23 May 2009 04:19:36 +0200 (CEST) Subject: [Python-checkins] r72839 - python/trunk/Lib/test/test_smtpnet.py Message-ID: <20090523021936.64E7CC32C@mail.python.org> Author: r.david.murray Date: Sat May 23 04:19:36 2009 New Revision: 72839 Log: Fix spelling left over from testing. Modified: python/trunk/Lib/test/test_smtpnet.py Modified: python/trunk/Lib/test/test_smtpnet.py ============================================================================== --- python/trunk/Lib/test/test_smtpnet.py (original) +++ python/trunk/Lib/test/test_smtpnet.py Sat May 23 04:19:36 2009 @@ -11,7 +11,7 @@ remotePort = 465 def test_connect(self): - test_support.get_attribute(smtplib, 'SMTP_SSLX') + test_support.get_attribute(smtplib, 'SMTP_SSL') server = smtplib.SMTP_SSL(self.testServer, self.remotePort) server.ehlo() server.quit() From python-checkins at python.org Sat May 23 04:30:55 2009 From: python-checkins at python.org (r.david.murray) Date: Sat, 23 May 2009 04:30:55 +0200 (CEST) Subject: [Python-checkins] r72840 - in python/branches/release26-maint: Lib/test/test_smtpnet.py Message-ID: <20090523023055.70FC1D29E@mail.python.org> Author: r.david.murray Date: Sat May 23 04:30:55 2009 New Revision: 72840 Log: Merged revisions 72838-72839 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72838 | r.david.murray | 2009-05-22 22:16:58 -0400 (Fri, 22 May 2009) | 3 lines Don't be so wordy in requires('network') in case other tests are added later, and skip the existing test if SSL is not available. ........ r72839 | r.david.murray | 2009-05-22 22:19:36 -0400 (Fri, 22 May 2009) | 2 lines Fix spelling left over from testing. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_smtpnet.py Modified: python/branches/release26-maint/Lib/test/test_smtpnet.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_smtpnet.py (original) +++ python/branches/release26-maint/Lib/test/test_smtpnet.py Sat May 23 04:30:55 2009 @@ -4,17 +4,15 @@ from test import test_support import smtplib -test_support.requires( - "network", - "use of network resource is not enabled and " - "test requires Internet access for communication with smtp.gmail.com:465", - ) +test_support.requires("network") class SmtpSSLTest(unittest.TestCase): testServer = 'smtp.gmail.com' remotePort = 465 def test_connect(self): + #Silently skip test if no SSL; in 2.7 we use SkipTest instead. + if not hasattr(smtplib, 'SMTP_SSL'): return server = smtplib.SMTP_SSL(self.testServer, self.remotePort) server.ehlo() server.quit() From buildbot at python.org Sat May 23 04:33:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 02:33:07 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090523023307.E56ABD253@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/726 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl,r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_posix test_smtpnet ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== ERROR: test_connect (test.test_smtpnet.SmtpSSLTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_smtpnet.py", line 18, in test_connect server = smtplib.SMTP_SSL(self.testServer, self.remotePort) AttributeError: 'module' object has no attribute 'SMTP_SSL' sincerely, -The Buildbot From python-checkins at python.org Sat May 23 04:36:15 2009 From: python-checkins at python.org (r.david.murray) Date: Sat, 23 May 2009 04:36:15 +0200 (CEST) Subject: [Python-checkins] r72841 - in python/branches/py3k: Lib/test/test_smtpnet.py Message-ID: <20090523023615.30A56D265@mail.python.org> Author: r.david.murray Date: Sat May 23 04:36:15 2009 New Revision: 72841 Log: Merged revisions 72838-72839 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72838 | r.david.murray | 2009-05-22 22:16:58 -0400 (Fri, 22 May 2009) | 3 lines Don't be so wordy in requires('network') in case other tests are added later, and skip the existing test if SSL is not available. ........ r72839 | r.david.murray | 2009-05-22 22:19:36 -0400 (Fri, 22 May 2009) | 2 lines Fix spelling left over from testing. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_smtpnet.py Modified: python/branches/py3k/Lib/test/test_smtpnet.py ============================================================================== --- python/branches/py3k/Lib/test/test_smtpnet.py (original) +++ python/branches/py3k/Lib/test/test_smtpnet.py Sat May 23 04:36:15 2009 @@ -4,17 +4,14 @@ from test import support import smtplib -support.requires( - "network", - "use of network resource is not enabled and " - "test requires Internet access for communication with smtp.gmail.com:465", - ) +support.requires("network") class SmtpSSLTest(unittest.TestCase): testServer = 'smtp.gmail.com' remotePort = 465 def test_connect(self): + support.get_attribute(smtplib, 'SMTP_SSL') server = smtplib.SMTP_SSL(self.testServer, self.remotePort) server.ehlo() server.quit() From python-checkins at python.org Sat May 23 04:37:56 2009 From: python-checkins at python.org (r.david.murray) Date: Sat, 23 May 2009 04:37:56 +0200 (CEST) Subject: [Python-checkins] r72842 - in python/branches/release30-maint: Lib/smtplib.py Lib/test/test_smtpnet.py Misc/ACKS Misc/NEWS Message-ID: <20090523023756.1C0C0D265@mail.python.org> Author: r.david.murray Date: Sat May 23 04:37:55 2009 New Revision: 72842 Log: Merged revisions 72836 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72836 | r.david.murray | 2009-05-22 21:30:26 -0400 (Fri, 22 May 2009) | 10 lines Merged revisions 72835 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72835 | r.david.murray | 2009-05-22 20:48:58 -0400 (Fri, 22 May 2009) | 4 lines Fix Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket. Patch by Farhan Ahmad, test by Marcin Bachry. ........ ................ Added: python/branches/release30-maint/Lib/test/test_smtpnet.py - copied unchanged from r72836, /python/branches/py3k/Lib/test/test_smtpnet.py Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/smtplib.py python/branches/release30-maint/Misc/ACKS python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/smtplib.py ============================================================================== --- python/branches/release30-maint/Lib/smtplib.py (original) +++ python/branches/release30-maint/Lib/smtplib.py Sat May 23 04:37:55 2009 @@ -754,9 +754,10 @@ def _get_socket(self, host, port, timeout): if self.debuglevel > 0: print('connect:', (host, port), file=stderr) - self.sock = socket.create_connection((host, port), timeout) - self.sock = ssl.wrap_socket(self.sock, self.keyfile, self.certfile) - self.file = SSLFakeFile(self.sock) + new_socket = socket.create_connection((host, port), timeout) + new_socket = ssl.wrap_socket(new_socket, self.keyfile, self.certfile) + self.file = SSLFakeFile(new_socket) + return new_socket __all__.append("SMTP_SSL") Modified: python/branches/release30-maint/Misc/ACKS ============================================================================== --- python/branches/release30-maint/Misc/ACKS (original) +++ python/branches/release30-maint/Misc/ACKS Sat May 23 04:37:55 2009 @@ -11,6 +11,7 @@ David Abrahams Jim Ahlstrom +Farhan Ahmad Jyrki Alakuijala Billy G. Allie Kevin Altis @@ -28,6 +29,7 @@ Donovan Baarda Attila Babo Alfonso Baciero +Marcin Bachry Dwayne Bailey Stig Bakken Greg Ball @@ -165,6 +167,7 @@ Raghuram Devarakonda Toby Dickenson Mark Dickinson +Daniel Diniz Humberto Diogenes Yves Dionne Daniel Dittmar Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat May 23 04:37:55 2009 @@ -62,6 +62,9 @@ Library ------- +- Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket. + Patch by Farhan Ahmad, test by Marcin Bachry. + - Issue #5955: aifc's close method did not close the file it wrapped, now it does. This also means getfp method now returns the real fp. From python-checkins at python.org Sat May 23 04:42:08 2009 From: python-checkins at python.org (r.david.murray) Date: Sat, 23 May 2009 04:42:08 +0200 (CEST) Subject: [Python-checkins] r72843 - in python/branches/release30-maint: Lib/test/test_smtpnet.py Message-ID: <20090523024208.34823C380@mail.python.org> Author: r.david.murray Date: Sat May 23 04:42:08 2009 New Revision: 72843 Log: Merged revisions 72841 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72841 | r.david.murray | 2009-05-22 22:36:15 -0400 (Fri, 22 May 2009) | 14 lines Merged revisions 72838-72839 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72838 | r.david.murray | 2009-05-22 22:16:58 -0400 (Fri, 22 May 2009) | 3 lines Don't be so wordy in requires('network') in case other tests are added later, and skip the existing test if SSL is not available. ........ r72839 | r.david.murray | 2009-05-22 22:19:36 -0400 (Fri, 22 May 2009) | 2 lines Fix spelling left over from testing. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_smtpnet.py Modified: python/branches/release30-maint/Lib/test/test_smtpnet.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_smtpnet.py (original) +++ python/branches/release30-maint/Lib/test/test_smtpnet.py Sat May 23 04:42:08 2009 @@ -4,17 +4,15 @@ from test import support import smtplib -support.requires( - "network", - "use of network resource is not enabled and " - "test requires Internet access for communication with smtp.gmail.com:465", - ) +support.requires("network") class SmtpSSLTest(unittest.TestCase): testServer = 'smtp.gmail.com' remotePort = 465 def test_connect(self): + #Skip test silently if no SSL; in 3.1 we use SkipTest + if not hasattr(smtplib, 'SMTP_SSL'): return server = smtplib.SMTP_SSL(self.testServer, self.remotePort) server.ehlo() server.quit() From buildbot at python.org Sat May 23 05:30:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 03:30:46 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090523033046.C1F22C46A@mail.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/602 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl,r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtpnet ====================================================================== ERROR: test_connect (test.test_smtpnet.SmtpSSLTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_smtpnet.py", line 18, in test_connect server = smtplib.SMTP_SSL(self.testServer, self.remotePort) AttributeError: 'module' object has no attribute 'SMTP_SSL' sincerely, -The Buildbot From buildbot at python.org Sat May 23 05:33:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 03:33:35 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090523033335.DF290C46A@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/664 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat May 23 05:55:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 03:55:35 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090523035535.DC2F1C389@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.0/builds/28 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: r.david.murray,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sat May 23 07:18:06 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 05:18:06 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090523051806.7C7DBC475@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/787 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_http_cookiejar make: *** [buildbottest] Error 1 sincerely, -The Buildbot From nnorwitz at gmail.com Sat May 23 11:28:11 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 23 May 2009 05:28:11 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (2) Message-ID: <20090523092811.GA22345@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 test_ssl leaked [0, 0, 322] references, sum=322 Less important issues: ---------------------- test_asynchat leaked [0, 0, 139] references, sum=139 test_cmd_line leaked [-25, 25, -25] references, sum=-25 test_file leaked [0, 0, 80] references, sum=80 test_smtplib leaked [-88, 0, 0] references, sum=-88 test_sys leaked [42, -21, -21] references, sum=0 test_threading leaked [48, 48, 48] references, sum=144 test_threadsignals leaked [0, -8, 8] references, sum=0 From python-checkins at python.org Sat May 23 12:38:26 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 23 May 2009 12:38:26 +0200 (CEST) Subject: [Python-checkins] r72844 - in python/branches/py3k: Misc/NEWS Modules/_localemodule.c Message-ID: <20090523103826.94FC4C46A@mail.python.org> Author: martin.v.loewis Date: Sat May 23 12:38:26 2009 New Revision: 72844 Log: Issue #6093: Fix off-by-one error in locale.strxfrm. Modified: python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_localemodule.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 23 12:38:26 2009 @@ -54,6 +54,11 @@ now it does. This also means getfp method now returns the real fp. +Extension Modules +----------------- + +- Issue #6093: Fix off-by-one error in locale.strxfrm. + Tests ----- Modified: python/branches/py3k/Modules/_localemodule.c ============================================================================== --- python/branches/py3k/Modules/_localemodule.c (original) +++ python/branches/py3k/Modules/_localemodule.c Sat May 23 12:38:26 2009 @@ -314,7 +314,7 @@ PyErr_NoMemory(); goto exit; } - n2 = wcsxfrm(buf, s, n2); + n2 = wcsxfrm(buf, s, n2+1); } result = PyUnicode_FromWideChar(buf, n2); exit: From python-checkins at python.org Sat May 23 12:44:10 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 23 May 2009 12:44:10 +0200 (CEST) Subject: [Python-checkins] r72845 - in python/branches/release30-maint: Misc/NEWS Modules/_localemodule.c Message-ID: <20090523104410.D6067C463@mail.python.org> Author: martin.v.loewis Date: Sat May 23 12:44:10 2009 New Revision: 72845 Log: Merged revisions 72844 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r72844 | martin.v.loewis | 2009-05-23 12:38:26 +0200 (Sa, 23 Mai 2009) | 2 lines Issue #6093: Fix off-by-one error in locale.strxfrm. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/_localemodule.c Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat May 23 12:44:10 2009 @@ -160,6 +160,11 @@ - Issue #2703: SimpleXMLRPCDispatcher.__init__: Provide default values for new arguments introduced in 2.5. +Extension Modules +----------------- + +- Issue #6093: Fix off-by-one error in locale.strxfrm. + Build ----- Modified: python/branches/release30-maint/Modules/_localemodule.c ============================================================================== --- python/branches/release30-maint/Modules/_localemodule.c (original) +++ python/branches/release30-maint/Modules/_localemodule.c Sat May 23 12:44:10 2009 @@ -314,7 +314,7 @@ PyErr_NoMemory(); goto exit; } - n2 = wcsxfrm(buf, s, n2); + n2 = wcsxfrm(buf, s, n2+1); } result = PyUnicode_FromWideChar(buf, n2); exit: From buildbot at python.org Sat May 23 13:26:39 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 11:26:39 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090523112639.3C5D5C42B@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/728 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sat May 23 14:06:28 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 23 May 2009 14:06:28 +0200 (CEST) Subject: [Python-checkins] r72846 - tracker/roundup-src/roundup/mailer.py Message-ID: <20090523120628.A516DC3D3@mail.python.org> Author: martin.v.loewis Date: Sat May 23 14:06:28 2009 New Revision: 72846 Log: Only header-encode user name, not email address. Modified: tracker/roundup-src/roundup/mailer.py Modified: tracker/roundup-src/roundup/mailer.py ============================================================================== --- tracker/roundup-src/roundup/mailer.py (original) +++ tracker/roundup-src/roundup/mailer.py Sat May 23 14:06:28 2009 @@ -13,6 +13,7 @@ from email.Utils import formatdate, formataddr from email.Message import Message from email.Header import Header +from email.Charset import Charset from email.MIMEText import MIMEText from email.MIMEMultipart import MIMEMultipart @@ -65,6 +66,10 @@ author = formataddr((tracker_name, self.config.ADMIN_EMAIL)) else: name = unicode(author[0], 'utf-8') + try: + name.encode('ascii') + except UnicodeError: + name = Charset(charset).header_encode(name) author = formataddr((name, author[1])) if multipart: @@ -79,10 +84,9 @@ except UnicodeError: message['Subject'] = Header(subject, charset) message['To'] = ', '.join(to) - try: - message['From'] = author.encode('ascii') - except UnicodeError: - message['From'] = Header(author, charset) + # This should not fail, since we already encoded non-ASCII + # name characters + message['From'] = author.encode('ascii') message['Date'] = formatdate(localtime=True) # add a Precedence header so autoresponders ignore us From buildbot at python.org Sat May 23 14:18:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 12:18:22 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090523121823.03D9BD25B@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/383 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sat May 23 14:19:07 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 23 May 2009 14:19:07 +0200 (CEST) Subject: [Python-checkins] r72847 - tracker/roundup-src/roundup/mailer.py Message-ID: <20090523121907.3E3C0D25B@mail.python.org> Author: martin.v.loewis Date: Sat May 23 14:19:07 2009 New Revision: 72847 Log: Encode names to charset before passing them to Charset constructor :-( Modified: tracker/roundup-src/roundup/mailer.py Modified: tracker/roundup-src/roundup/mailer.py ============================================================================== --- tracker/roundup-src/roundup/mailer.py (original) +++ tracker/roundup-src/roundup/mailer.py Sat May 23 14:19:07 2009 @@ -69,7 +69,7 @@ try: name.encode('ascii') except UnicodeError: - name = Charset(charset).header_encode(name) + name = Charset(charset).header_encode(name.encode(charset)) author = formataddr((name, author[1])) if multipart: From python-checkins at python.org Sat May 23 15:56:13 2009 From: python-checkins at python.org (eric.smith) Date: Sat, 23 May 2009 15:56:13 +0200 (CEST) Subject: [Python-checkins] r72848 - in python/trunk: Lib/test/test_str.py Lib/test/test_unicode.py Objects/stringlib/string_format.h Message-ID: <20090523135613.7E8F6C462@mail.python.org> Author: eric.smith Date: Sat May 23 15:56:13 2009 New Revision: 72848 Log: Issue 6089: str.format raises SystemError. Modified: python/trunk/Lib/test/test_str.py python/trunk/Lib/test/test_unicode.py python/trunk/Objects/stringlib/string_format.h Modified: python/trunk/Lib/test/test_str.py ============================================================================== --- python/trunk/Lib/test/test_str.py (original) +++ python/trunk/Lib/test/test_str.py Sat May 23 15:56:13 2009 @@ -351,6 +351,10 @@ self.assertRaises(IndexError, "{:s}".format) self.assertRaises(IndexError, "{}".format) + # issue 6089 + self.assertRaises(ValueError, "{0[0]x}".format, [None]) + self.assertRaises(ValueError, "{0[0](10)}".format, [None]) + # can't have a replacement on the field name portion self.assertRaises(TypeError, '{0[{1}]}'.format, 'abcdefg', 4) Modified: python/trunk/Lib/test/test_unicode.py ============================================================================== --- python/trunk/Lib/test/test_unicode.py (original) +++ python/trunk/Lib/test/test_unicode.py Sat May 23 15:56:13 2009 @@ -1100,6 +1100,10 @@ self.assertRaises(IndexError, u"{:s}".format) self.assertRaises(IndexError, u"{}".format) + # issue 6089 + self.assertRaises(ValueError, u"{0[0]x}".format, [None]) + self.assertRaises(ValueError, u"{0[0](10)}".format, [None]) + # can't have a replacement on the field name portion self.assertRaises(TypeError, u'{0[{1}]}'.format, u'abcdefg', 4) Modified: python/trunk/Objects/stringlib/string_format.h ============================================================================== --- python/trunk/Objects/stringlib/string_format.h (original) +++ python/trunk/Objects/stringlib/string_format.h Sat May 23 15:56:13 2009 @@ -375,8 +375,9 @@ *name_idx = get_integer(name); break; default: - /* interal error, can't get here */ - assert(0); + /* Invalid character follows ']' */ + PyErr_SetString(PyExc_ValueError, "Only '.' or '[' may " + "follow ']' in format field specifier"); return 0; } From python-checkins at python.org Sat May 23 16:04:33 2009 From: python-checkins at python.org (eric.smith) Date: Sat, 23 May 2009 16:04:33 +0200 (CEST) Subject: [Python-checkins] r72849 - in python/branches/release26-maint: Lib/test/test_str.py Lib/test/test_unicode.py Misc/NEWS Objects/stringlib/string_format.h Message-ID: <20090523140433.C5259C388@mail.python.org> Author: eric.smith Date: Sat May 23 16:04:31 2009 New Revision: 72849 Log: Merged revisions 72848 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72848 | eric.smith | 2009-05-23 09:56:13 -0400 (Sat, 23 May 2009) | 1 line Issue 6089: str.format raises SystemError. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_str.py python/branches/release26-maint/Lib/test/test_unicode.py python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Objects/stringlib/string_format.h Modified: python/branches/release26-maint/Lib/test/test_str.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_str.py (original) +++ python/branches/release26-maint/Lib/test/test_str.py Sat May 23 16:04:31 2009 @@ -351,6 +351,10 @@ self.assertRaises(ValueError, "{:s}".format) self.assertRaises(ValueError, "{}".format) + # issue 6089 + self.assertRaises(ValueError, "{0[0]x}".format, [None]) + self.assertRaises(ValueError, "{0[0](10)}".format, [None]) + # can't have a replacement on the field name portion self.assertRaises(TypeError, '{0[{1}]}'.format, 'abcdefg', 4) Modified: python/branches/release26-maint/Lib/test/test_unicode.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_unicode.py (original) +++ python/branches/release26-maint/Lib/test/test_unicode.py Sat May 23 16:04:31 2009 @@ -1091,6 +1091,10 @@ self.assertRaises(ValueError, u"{:s}".format) self.assertRaises(ValueError, u"{}".format) + # issue 6089 + self.assertRaises(ValueError, u"{0[0]x}".format, [None]) + self.assertRaises(ValueError, u"{0[0](10)}".format, [None]) + # can't have a replacement on the field name portion self.assertRaises(TypeError, u'{0[{1}]}'.format, u'abcdefg', 4) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sat May 23 16:04:31 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #6089: str.format can raise SystemError with certain invalid + field specifiers. + - Issue #5994: the marshal module now has docstrings. - Issue #5981: Fix two minor inf/nan issues in float.fromhex: (1) inf Modified: python/branches/release26-maint/Objects/stringlib/string_format.h ============================================================================== --- python/branches/release26-maint/Objects/stringlib/string_format.h (original) +++ python/branches/release26-maint/Objects/stringlib/string_format.h Sat May 23 16:04:31 2009 @@ -329,8 +329,9 @@ *name_idx = get_integer(name); break; default: - /* interal error, can't get here */ - assert(0); + /* Invalid character follows ']' */ + PyErr_SetString(PyExc_ValueError, "Only '.' or '[' may " + "follow ']' in format field specifier"); return 0; } From python-checkins at python.org Sat May 23 16:23:22 2009 From: python-checkins at python.org (eric.smith) Date: Sat, 23 May 2009 16:23:22 +0200 (CEST) Subject: [Python-checkins] r72850 - in python/branches/py3k: Lib/test/test_unicode.py Misc/NEWS Objects/stringlib/string_format.h Message-ID: <20090523142322.3B1E4D3E6@mail.python.org> Author: eric.smith Date: Sat May 23 16:23:22 2009 New Revision: 72850 Log: Merged revisions 72848 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72848 | eric.smith | 2009-05-23 09:56:13 -0400 (Sat, 23 May 2009) | 1 line Issue 6089: str.format raises SystemError. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_unicode.py python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/stringlib/string_format.h Modified: python/branches/py3k/Lib/test/test_unicode.py ============================================================================== --- python/branches/py3k/Lib/test/test_unicode.py (original) +++ python/branches/py3k/Lib/test/test_unicode.py Sat May 23 16:23:22 2009 @@ -688,6 +688,10 @@ self.assertRaises(IndexError, "{:s}".format) self.assertRaises(IndexError, "{}".format) + # issue 6089 + self.assertRaises(ValueError, "{0[0]x}".format, [None]) + self.assertRaises(ValueError, "{0[0](10)}".format, [None]) + # can't have a replacement on the field name portion self.assertRaises(TypeError, '{0[{1}]}'.format, 'abcdefg', 4) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 23 16:23:22 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #6089: Fixed str.format with certain invalid field specifiers + that would raise SystemError. + - Issue #5829: complex("1e500") no longer raises OverflowError. This makes it consistent with float("1e500") and interpretation of real and imaginary literals. Modified: python/branches/py3k/Objects/stringlib/string_format.h ============================================================================== --- python/branches/py3k/Objects/stringlib/string_format.h (original) +++ python/branches/py3k/Objects/stringlib/string_format.h Sat May 23 16:23:22 2009 @@ -375,8 +375,9 @@ *name_idx = get_integer(name); break; default: - /* interal error, can't get here */ - assert(0); + /* Invalid character follows ']' */ + PyErr_SetString(PyExc_ValueError, "Only '.' or '[' may " + "follow ']' in format field specifier"); return 0; } From buildbot at python.org Sat May 23 16:27:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 14:27:35 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090523142735.3A3ADD42B@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%20trunk/builds/52 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: eric.smith BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtpnet make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat May 23 16:38:19 2009 From: python-checkins at python.org (eric.smith) Date: Sat, 23 May 2009 16:38:19 +0200 (CEST) Subject: [Python-checkins] r72851 - in python/branches/release30-maint: Lib/test/test_unicode.py Misc/NEWS Objects/stringlib/string_format.h Message-ID: <20090523143819.A294BD385@mail.python.org> Author: eric.smith Date: Sat May 23 16:38:19 2009 New Revision: 72851 Log: Merged revisions 72850 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72850 | eric.smith | 2009-05-23 10:23:22 -0400 (Sat, 23 May 2009) | 9 lines Merged revisions 72848 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72848 | eric.smith | 2009-05-23 09:56:13 -0400 (Sat, 23 May 2009) | 1 line Issue 6089: str.format raises SystemError. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_unicode.py python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Objects/stringlib/string_format.h Modified: python/branches/release30-maint/Lib/test/test_unicode.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_unicode.py (original) +++ python/branches/release30-maint/Lib/test/test_unicode.py Sat May 23 16:38:19 2009 @@ -688,6 +688,10 @@ self.assertRaises(ValueError, "{:s}".format) self.assertRaises(ValueError, "{}".format) + # issue 6089 + self.assertRaises(ValueError, "{0[0]x}".format, [None]) + self.assertRaises(ValueError, "{0[0](10)}".format, [None]) + # can't have a replacement on the field name portion self.assertRaises(TypeError, '{0[{1}]}'.format, 'abcdefg', 4) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat May 23 16:38:19 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #6089: Fixed str.format with certain invalid field specifiers + that would raise SystemError. + - Issue #5994: the marshal module now has docstrings. - Issue #5981: Fix two minor inf/nan issues in float.fromhex: (1) inf Modified: python/branches/release30-maint/Objects/stringlib/string_format.h ============================================================================== --- python/branches/release30-maint/Objects/stringlib/string_format.h (original) +++ python/branches/release30-maint/Objects/stringlib/string_format.h Sat May 23 16:38:19 2009 @@ -329,8 +329,9 @@ *name_idx = get_integer(name); break; default: - /* interal error, can't get here */ - assert(0); + /* Invalid character follows ']' */ + PyErr_SetString(PyExc_ValueError, "Only '.' or '[' may " + "follow ']' in format field specifier"); return 0; } From buildbot at python.org Sat May 23 16:54:49 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 14:54:49 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 2.6 Message-ID: <20090523145449.4C48FC403@mail.python.org> The Buildbot has detected a new failure of x86 gentoo 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%202.6/builds/351 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: eric.smith BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sat May 23 17:37:45 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 23 May 2009 17:37:45 +0200 (CEST) Subject: [Python-checkins] r72852 - in python/trunk: Misc/NEWS Modules/posixmodule.c Message-ID: <20090523153745.72FDBD52B@mail.python.org> Author: antoine.pitrou Date: Sat May 23 17:37:45 2009 New Revision: 72852 Log: Issue #1983: Fix functions taking or returning a process identifier to use the dedicated C type `pid_t` instead of a C `int`. Some platforms have a process identifier type wider than the standard C integer type. Modified: python/trunk/Misc/NEWS python/trunk/Modules/posixmodule.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat May 23 17:37:45 2009 @@ -302,6 +302,10 @@ Library ------- +- Issue #1983: Fix functions taking or returning a process identifier to use + the dedicated C type ``pid_t`` instead of a C ``int``. Some platforms have + a process identifier type wider than the standard C integer type. + - Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket. Patch by Farhan Ahmad, test by Marcin Bachry. Modified: python/trunk/Modules/posixmodule.c ============================================================================== --- python/trunk/Modules/posixmodule.c (original) +++ python/trunk/Modules/posixmodule.c Sat May 23 17:37:45 2009 @@ -311,6 +311,25 @@ #define WAIT_STATUS_INT(s) (s) #endif /* UNION_WAIT */ +/* Issue #1983: pid_t can be longer than a C long on some systems */ +#ifdef SIZEOF_PID_T +#if SIZEOF_PID_T == SIZEOF_INT +#define PARSE_PID "i" +#define PyLong_FromPid PyInt_FromLong +#define PyLong_AsPid PyInt_AsLong +#elif SIZEOF_PID_T == SIZEOF_LONG +#define PARSE_PID "l" +#define PyLong_FromPid PyInt_FromLong +#define PyLong_AsPid PyInt_AsLong +#elif defined(SIZEOF_LONG_LONG) && SIZEOF_PID_T == SIZEOF_LONG_LONG +#define PARSE_PID "L" +#define PyLong_FromPid PyLong_FromLongLong +#define PyLong_AsPid PyInt_AsLongLong +#else +#error "sizeof(pid_t) is neither sizeof(int), sizeof(long) or sizeof(long long)" +#endif +#endif /* SIZEOF_PID_T */ + /* Don't use the "_r" form if we don't need it (also, won't have a prototype for it, at least on Solaris -- maybe others as well?). */ #if defined(HAVE_CTERMID_R) && defined(WITH_THREAD) @@ -3704,7 +3723,7 @@ return posix_error(); if (pid == 0) PyOS_AfterFork(); - return PyInt_FromLong(pid); + return PyLong_FromPid(pid); } #endif @@ -3723,7 +3742,7 @@ return posix_error(); if (pid == 0) PyOS_AfterFork(); - return PyInt_FromLong(pid); + return PyLong_FromPid(pid); } #endif @@ -3833,7 +3852,7 @@ return posix_error(); if (pid == 0) PyOS_AfterFork(); - return Py_BuildValue("(li)", pid, master_fd); + return Py_BuildValue("(Ni)", PyLong_FromPid(pid), master_fd); } #endif @@ -4050,7 +4069,7 @@ { pid_t pid; int sig; - if (!PyArg_ParseTuple(args, "ii:kill", &pid, &sig)) + if (!PyArg_ParseTuple(args, PARSE_PID "i:kill", &pid, &sig)) return NULL; #if defined(PYOS_OS2) && !defined(PYCC_GCC) if (sig == XCPT_SIGNAL_INTR || sig == XCPT_SIGNAL_BREAK) { @@ -4619,7 +4638,7 @@ ins_rc[0] = ins_rc[1] = ins_rc[2] = 0; procObj = PyList_New(2); - pidObj = PyInt_FromLong((long) pipe_pid); + pidObj = PyLong_FromPid(pipe_pid); intObj = PyInt_FromLong((long) file_count); if (procObj && pidObj && intObj) @@ -4745,7 +4764,7 @@ (pidObj = PyList_GetItem(procObj,0)) != NULL && (intObj = PyList_GetItem(procObj,1)) != NULL) { - pipe_pid = (int) PyInt_AsLong(pidObj); + pipe_pid = (pid_t) PyLong_AsPid(pidObj); file_count = (int) PyInt_AsLong(intObj); if (file_count > 1) @@ -5862,7 +5881,7 @@ return NULL; } - return Py_BuildValue("iiN", pid, status, result); + return Py_BuildValue("NiN", PyLong_FromPid(pid), status, result); } #endif /* HAVE_WAIT3 || HAVE_WAIT4 */ @@ -5905,7 +5924,7 @@ WAIT_TYPE status; WAIT_STATUS_INT(status) = 0; - if (!PyArg_ParseTuple(args, "ii:wait4", &pid, &options)) + if (!PyArg_ParseTuple(args, PARSE_PID "i:wait4", &pid, &options)) return NULL; Py_BEGIN_ALLOW_THREADS @@ -5929,7 +5948,7 @@ WAIT_TYPE status; WAIT_STATUS_INT(status) = 0; - if (!PyArg_ParseTuple(args, "ii:waitpid", &pid, &options)) + if (!PyArg_ParseTuple(args, PARSE_PID "i:waitpid", &pid, &options)) return NULL; Py_BEGIN_ALLOW_THREADS pid = waitpid(pid, &status, options); @@ -5937,7 +5956,7 @@ if (pid == -1) return posix_error(); - return Py_BuildValue("ii", pid, WAIT_STATUS_INT(status)); + return Py_BuildValue("Ni", PyLong_FromPid(pid), WAIT_STATUS_INT(status)); } #elif defined(HAVE_CWAIT) @@ -5953,7 +5972,7 @@ Py_intptr_t pid; int status, options; - if (!PyArg_ParseTuple(args, "ii:waitpid", &pid, &options)) + if (!PyArg_ParseTuple(args, PARSE_PID "i:waitpid", &pid, &options)) return NULL; Py_BEGIN_ALLOW_THREADS pid = _cwait(&status, pid, options); @@ -5962,7 +5981,7 @@ return posix_error(); /* shift the status left a byte so this is more like the POSIX waitpid */ - return Py_BuildValue("ii", pid, status << 8); + return Py_BuildValue("Ni", PyLong_FromPid(pid), status << 8); } #endif /* HAVE_WAITPID || HAVE_CWAIT */ @@ -5984,7 +6003,7 @@ if (pid == -1) return posix_error(); - return Py_BuildValue("ii", pid, WAIT_STATUS_INT(status)); + return Py_BuildValue("Ni", PyLong_FromPid(pid), WAIT_STATUS_INT(status)); } #endif @@ -6175,7 +6194,7 @@ { pid_t pid; int sid; - if (!PyArg_ParseTuple(args, "i:getsid", &pid)) + if (!PyArg_ParseTuple(args, PARSE_PID ":getsid", &pid)) return NULL; sid = getsid(pid); if (sid < 0) @@ -6210,7 +6229,7 @@ { pid_t pid; int pgrp; - if (!PyArg_ParseTuple(args, "ii:setpgid", &pid, &pgrp)) + if (!PyArg_ParseTuple(args, PARSE_PID "i:setpgid", &pid, &pgrp)) return NULL; if (setpgid(pid, pgrp) < 0) return posix_error(); @@ -6235,7 +6254,7 @@ pgid = tcgetpgrp(fd); if (pgid < 0) return posix_error(); - return PyInt_FromLong((long)pgid); + return PyLong_FromPid(pgid); } #endif /* HAVE_TCGETPGRP */ From python-checkins at python.org Sat May 23 17:47:13 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 23 May 2009 17:47:13 +0200 (CEST) Subject: [Python-checkins] r72853 - in python/branches/release26-maint: Misc/NEWS Modules/posixmodule.c Message-ID: <20090523154713.8F3ACD371@mail.python.org> Author: antoine.pitrou Date: Sat May 23 17:47:13 2009 New Revision: 72853 Log: Merged revisions 72852 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72852 | antoine.pitrou | 2009-05-23 17:37:45 +0200 (sam., 23 mai 2009) | 5 lines Issue #1983: Fix functions taking or returning a process identifier to use the dedicated C type `pid_t` instead of a C `int`. Some platforms have a process identifier type wider than the standard C integer type. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/posixmodule.c Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sat May 23 17:47:13 2009 @@ -50,6 +50,10 @@ Library ------- +- Issue #1983: Fix functions taking or returning a process identifier to use + the dedicated C type ``pid_t`` instead of a C ``int``. Some platforms have + a process identifier type wider than the standard C integer type. + - Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket. Patch by Farhan Ahmad, test by Marcin Bachry. Modified: python/branches/release26-maint/Modules/posixmodule.c ============================================================================== --- python/branches/release26-maint/Modules/posixmodule.c (original) +++ python/branches/release26-maint/Modules/posixmodule.c Sat May 23 17:47:13 2009 @@ -310,6 +310,25 @@ #define WAIT_STATUS_INT(s) (s) #endif /* UNION_WAIT */ +/* Issue #1983: pid_t can be longer than a C long on some systems */ +#ifdef SIZEOF_PID_T +#if SIZEOF_PID_T == SIZEOF_INT +#define PARSE_PID "i" +#define PyLong_FromPid PyInt_FromLong +#define PyLong_AsPid PyInt_AsLong +#elif SIZEOF_PID_T == SIZEOF_LONG +#define PARSE_PID "l" +#define PyLong_FromPid PyInt_FromLong +#define PyLong_AsPid PyInt_AsLong +#elif defined(SIZEOF_LONG_LONG) && SIZEOF_PID_T == SIZEOF_LONG_LONG +#define PARSE_PID "L" +#define PyLong_FromPid PyLong_FromLongLong +#define PyLong_AsPid PyInt_AsLongLong +#else +#error "sizeof(pid_t) is neither sizeof(int), sizeof(long) or sizeof(long long)" +#endif +#endif /* SIZEOF_PID_T */ + /* Don't use the "_r" form if we don't need it (also, won't have a prototype for it, at least on Solaris -- maybe others as well?). */ #if defined(HAVE_CTERMID_R) && defined(WITH_THREAD) @@ -3618,7 +3637,7 @@ return posix_error(); if (pid == 0) PyOS_AfterFork(); - return PyInt_FromLong(pid); + return PyLong_FromPid(pid); } #endif @@ -3637,7 +3656,7 @@ return posix_error(); if (pid == 0) PyOS_AfterFork(); - return PyInt_FromLong(pid); + return PyLong_FromPid(pid); } #endif @@ -3747,7 +3766,7 @@ return posix_error(); if (pid == 0) PyOS_AfterFork(); - return Py_BuildValue("(li)", pid, master_fd); + return Py_BuildValue("(Ni)", PyLong_FromPid(pid), master_fd); } #endif @@ -3964,7 +3983,7 @@ { pid_t pid; int sig; - if (!PyArg_ParseTuple(args, "ii:kill", &pid, &sig)) + if (!PyArg_ParseTuple(args, PARSE_PID "i:kill", &pid, &sig)) return NULL; #if defined(PYOS_OS2) && !defined(PYCC_GCC) if (sig == XCPT_SIGNAL_INTR || sig == XCPT_SIGNAL_BREAK) { @@ -4533,7 +4552,7 @@ ins_rc[0] = ins_rc[1] = ins_rc[2] = 0; procObj = PyList_New(2); - pidObj = PyInt_FromLong((long) pipe_pid); + pidObj = PyLong_FromPid(pipe_pid); intObj = PyInt_FromLong((long) file_count); if (procObj && pidObj && intObj) @@ -4659,7 +4678,7 @@ (pidObj = PyList_GetItem(procObj,0)) != NULL && (intObj = PyList_GetItem(procObj,1)) != NULL) { - pipe_pid = (int) PyInt_AsLong(pidObj); + pipe_pid = (pid_t) PyLong_AsPid(pidObj); file_count = (int) PyInt_AsLong(intObj); if (file_count > 1) @@ -5776,7 +5795,7 @@ return NULL; } - return Py_BuildValue("iiN", pid, status, result); + return Py_BuildValue("NiN", PyLong_FromPid(pid), status, result); } #endif /* HAVE_WAIT3 || HAVE_WAIT4 */ @@ -5819,7 +5838,7 @@ WAIT_TYPE status; WAIT_STATUS_INT(status) = 0; - if (!PyArg_ParseTuple(args, "ii:wait4", &pid, &options)) + if (!PyArg_ParseTuple(args, PARSE_PID "i:wait4", &pid, &options)) return NULL; Py_BEGIN_ALLOW_THREADS @@ -5843,7 +5862,7 @@ WAIT_TYPE status; WAIT_STATUS_INT(status) = 0; - if (!PyArg_ParseTuple(args, "ii:waitpid", &pid, &options)) + if (!PyArg_ParseTuple(args, PARSE_PID "i:waitpid", &pid, &options)) return NULL; Py_BEGIN_ALLOW_THREADS pid = waitpid(pid, &status, options); @@ -5851,7 +5870,7 @@ if (pid == -1) return posix_error(); - return Py_BuildValue("ii", pid, WAIT_STATUS_INT(status)); + return Py_BuildValue("Ni", PyLong_FromPid(pid), WAIT_STATUS_INT(status)); } #elif defined(HAVE_CWAIT) @@ -5867,7 +5886,7 @@ Py_intptr_t pid; int status, options; - if (!PyArg_ParseTuple(args, "ii:waitpid", &pid, &options)) + if (!PyArg_ParseTuple(args, PARSE_PID "i:waitpid", &pid, &options)) return NULL; Py_BEGIN_ALLOW_THREADS pid = _cwait(&status, pid, options); @@ -5876,7 +5895,7 @@ return posix_error(); /* shift the status left a byte so this is more like the POSIX waitpid */ - return Py_BuildValue("ii", pid, status << 8); + return Py_BuildValue("Ni", PyLong_FromPid(pid), status << 8); } #endif /* HAVE_WAITPID || HAVE_CWAIT */ @@ -5898,7 +5917,7 @@ if (pid == -1) return posix_error(); - return Py_BuildValue("ii", pid, WAIT_STATUS_INT(status)); + return Py_BuildValue("Ni", PyLong_FromPid(pid), WAIT_STATUS_INT(status)); } #endif @@ -6089,7 +6108,7 @@ { pid_t pid; int sid; - if (!PyArg_ParseTuple(args, "i:getsid", &pid)) + if (!PyArg_ParseTuple(args, PARSE_PID ":getsid", &pid)) return NULL; sid = getsid(pid); if (sid < 0) @@ -6124,7 +6143,7 @@ { pid_t pid; int pgrp; - if (!PyArg_ParseTuple(args, "ii:setpgid", &pid, &pgrp)) + if (!PyArg_ParseTuple(args, PARSE_PID "i:setpgid", &pid, &pgrp)) return NULL; if (setpgid(pid, pgrp) < 0) return posix_error(); @@ -6149,7 +6168,7 @@ pgid = tcgetpgrp(fd); if (pgid < 0) return posix_error(); - return PyInt_FromLong((long)pgid); + return PyLong_FromPid(pgid); } #endif /* HAVE_TCGETPGRP */ From python-checkins at python.org Sat May 23 18:02:33 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 23 May 2009 18:02:33 +0200 (CEST) Subject: [Python-checkins] r72854 - in python/branches/py3k: Misc/NEWS Modules/posixmodule.c Message-ID: <20090523160233.9BC0BD444@mail.python.org> Author: antoine.pitrou Date: Sat May 23 18:02:33 2009 New Revision: 72854 Log: Merged revisions 72852 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72852 | antoine.pitrou | 2009-05-23 17:37:45 +0200 (sam., 23 mai 2009) | 5 lines Issue #1983: Fix functions taking or returning a process identifier to use the dedicated C type `pid_t` instead of a C `int`. Some platforms have a process identifier type wider than the standard C integer type. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/posixmodule.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 23 18:02:33 2009 @@ -32,6 +32,10 @@ Library ------- +- Issue #1983: Fix functions taking or returning a process identifier to use + the dedicated C type ``pid_t`` instead of a C ``int``. Some platforms have + a process identifier type wider than the standard C integer type. + - Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket. Patch by Farhan Ahmad, test by Marcin Bachry. Modified: python/branches/py3k/Modules/posixmodule.c ============================================================================== --- python/branches/py3k/Modules/posixmodule.c (original) +++ python/branches/py3k/Modules/posixmodule.c Sat May 23 18:02:33 2009 @@ -303,6 +303,25 @@ #define WAIT_STATUS_INT(s) (s) #endif /* UNION_WAIT */ +/* Issue #1983: pid_t can be longer than a C long on some systems */ +#ifdef SIZEOF_PID_T +#if SIZEOF_PID_T == SIZEOF_INT +#define PARSE_PID "i" +#define PyLong_FromPid PyLong_FromLong +#define PyLong_AsPid PyLong_AsLong +#elif SIZEOF_PID_T == SIZEOF_LONG +#define PARSE_PID "l" +#define PyLong_FromPid PyLong_FromLong +#define PyLong_AsPid PyLong_AsLong +#elif defined(SIZEOF_LONG_LONG) && SIZEOF_PID_T == SIZEOF_LONG_LONG +#define PARSE_PID "L" +#define PyLong_FromPid PyLong_FromLongLong +#define PyLong_AsPid PyLong_AsLongLong +#else +#error "sizeof(pid_t) is neither sizeof(int), sizeof(long) or sizeof(long long)" +#endif +#endif /* SIZEOF_PID_T */ + /* Don't use the "_r" form if we don't need it (also, won't have a prototype for it, at least on Solaris -- maybe others as well?). */ #if defined(HAVE_CTERMID_R) && defined(WITH_THREAD) @@ -3820,7 +3839,7 @@ return posix_error(); if (pid == 0) PyOS_AfterFork(); - return PyLong_FromLong(pid); + return PyLong_FromPid(pid); } #endif @@ -3839,7 +3858,7 @@ return posix_error(); if (pid == 0) PyOS_AfterFork(); - return PyLong_FromLong(pid); + return PyLong_FromPid(pid); } #endif @@ -3949,7 +3968,7 @@ return posix_error(); if (pid == 0) PyOS_AfterFork(); - return Py_BuildValue("(li)", pid, master_fd); + return Py_BuildValue("(Ni)", PyLong_FromPid(pid), master_fd); } #endif @@ -4166,7 +4185,7 @@ { pid_t pid; int sig; - if (!PyArg_ParseTuple(args, "ii:kill", &pid, &sig)) + if (!PyArg_ParseTuple(args, PARSE_PID "i:kill", &pid, &sig)) return NULL; #if defined(PYOS_OS2) && !defined(PYCC_GCC) if (sig == XCPT_SIGNAL_INTR || sig == XCPT_SIGNAL_BREAK) { @@ -4231,9 +4250,6 @@ } #endif - - - #ifdef HAVE_SETUID PyDoc_STRVAR(posix_setuid__doc__, "setuid(uid)\n\n\ @@ -4502,7 +4518,7 @@ return NULL; } - return Py_BuildValue("iiN", pid, status, result); + return Py_BuildValue("NiN", PyLong_FromPid(pid), status, result); } #endif /* HAVE_WAIT3 || HAVE_WAIT4 */ @@ -4545,7 +4561,7 @@ WAIT_TYPE status; WAIT_STATUS_INT(status) = 0; - if (!PyArg_ParseTuple(args, "ii:wait4", &pid, &options)) + if (!PyArg_ParseTuple(args, PARSE_PID "i:wait4", &pid, &options)) return NULL; Py_BEGIN_ALLOW_THREADS @@ -4569,7 +4585,7 @@ WAIT_TYPE status; WAIT_STATUS_INT(status) = 0; - if (!PyArg_ParseTuple(args, "ii:waitpid", &pid, &options)) + if (!PyArg_ParseTuple(args, PARSE_PID "i:waitpid", &pid, &options)) return NULL; Py_BEGIN_ALLOW_THREADS pid = waitpid(pid, &status, options); @@ -4577,7 +4593,7 @@ if (pid == -1) return posix_error(); - return Py_BuildValue("ii", pid, WAIT_STATUS_INT(status)); + return Py_BuildValue("Ni", PyLong_FromPid(pid), WAIT_STATUS_INT(status)); } #elif defined(HAVE_CWAIT) @@ -4593,7 +4609,7 @@ Py_intptr_t pid; int status, options; - if (!PyArg_ParseTuple(args, "ii:waitpid", &pid, &options)) + if (!PyArg_ParseTuple(args, PARSE_PID "i:waitpid", &pid, &options)) return NULL; Py_BEGIN_ALLOW_THREADS pid = _cwait(&status, pid, options); @@ -4602,7 +4618,7 @@ return posix_error(); /* shift the status left a byte so this is more like the POSIX waitpid */ - return Py_BuildValue("ii", pid, status << 8); + return Py_BuildValue("Ni", PyLong_FromPid(pid), status << 8); } #endif /* HAVE_WAITPID || HAVE_CWAIT */ @@ -4624,7 +4640,7 @@ if (pid == -1) return posix_error(); - return Py_BuildValue("ii", pid, WAIT_STATUS_INT(status)); + return Py_BuildValue("Ni", PyLong_FromPid(pid), WAIT_STATUS_INT(status)); } #endif @@ -4809,7 +4825,7 @@ { pid_t pid; int sid; - if (!PyArg_ParseTuple(args, "i:getsid", &pid)) + if (!PyArg_ParseTuple(args, PARSE_PID ":getsid", &pid)) return NULL; sid = getsid(pid); if (sid < 0) @@ -4844,7 +4860,7 @@ { pid_t pid; int pgrp; - if (!PyArg_ParseTuple(args, "ii:setpgid", &pid, &pgrp)) + if (!PyArg_ParseTuple(args, PARSE_PID "i:setpgid", &pid, &pgrp)) return NULL; if (setpgid(pid, pgrp) < 0) return posix_error(); @@ -4869,7 +4885,7 @@ pgid = tcgetpgrp(fd); if (pgid < 0) return posix_error(); - return PyLong_FromLong((long)pgid); + return PyLong_FromPid(pgid); } #endif /* HAVE_TCGETPGRP */ From python-checkins at python.org Sat May 23 18:06:50 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 23 May 2009 18:06:50 +0200 (CEST) Subject: [Python-checkins] r72855 - python/trunk/Modules/posixmodule.c Message-ID: <20090523160650.21C44C3D7@mail.python.org> Author: antoine.pitrou Date: Sat May 23 18:06:49 2009 New Revision: 72855 Log: Some pid_t-expecting or producing functions were forgotten in r72852. Modified: python/trunk/Modules/posixmodule.c Modified: python/trunk/Modules/posixmodule.c ============================================================================== --- python/trunk/Modules/posixmodule.c (original) +++ python/trunk/Modules/posixmodule.c Sat May 23 18:06:49 2009 @@ -3902,7 +3902,7 @@ static PyObject * posix_getpid(PyObject *self, PyObject *noargs) { - return PyInt_FromLong((long)getpid()); + return PyLong_FromPid(getpid()); } @@ -3956,13 +3956,13 @@ static PyObject * posix_getpgid(PyObject *self, PyObject *args) { - int pid, pgid; - if (!PyArg_ParseTuple(args, "i:getpgid", &pid)) + pid_t pid, pgid; + if (!PyArg_ParseTuple(args, PARSE_PID ":getpgid", &pid)) return NULL; pgid = getpgid(pid); if (pgid < 0) return posix_error(); - return PyInt_FromLong((long)pgid); + return PyLong_FromPid(pgid); } #endif /* HAVE_GETPGID */ @@ -3976,9 +3976,9 @@ posix_getpgrp(PyObject *self, PyObject *noargs) { #ifdef GETPGRP_HAVE_ARG - return PyInt_FromLong((long)getpgrp(0)); + return PyLong_FromPid(getpgrp(0)); #else /* GETPGRP_HAVE_ARG */ - return PyInt_FromLong((long)getpgrp()); + return PyLong_FromPid(getpgrp()); #endif /* GETPGRP_HAVE_ARG */ } #endif /* HAVE_GETPGRP */ @@ -4012,7 +4012,7 @@ static PyObject * posix_getppid(PyObject *self, PyObject *noargs) { - return PyInt_FromLong(getppid()); + return PyLong_FromPid(getppid()); } #endif @@ -4101,8 +4101,13 @@ static PyObject * posix_killpg(PyObject *self, PyObject *args) { - int pgid, sig; - if (!PyArg_ParseTuple(args, "ii:killpg", &pgid, &sig)) + int sig; + pid_t pgid; + /* XXX some man pages make the `pgid` parameter an int, others + a pid_t. Since getpgrp() returns a pid_t, we assume killpg should + take the same type. Moreover, pid_t is always at least as wide as + int (else compilation of this module fails), which is safe. */ + if (!PyArg_ParseTuple(args, PARSE_PID "i:killpg", &pgid, &sig)) return NULL; if (killpg(pgid, sig) == -1) return posix_error(); @@ -6267,8 +6272,9 @@ static PyObject * posix_tcsetpgrp(PyObject *self, PyObject *args) { - int fd, pgid; - if (!PyArg_ParseTuple(args, "ii:tcsetpgrp", &fd, &pgid)) + int fd; + pid_t pgid; + if (!PyArg_ParseTuple(args, "i" PARSE_PID ":tcsetpgrp", &fd, &pgid)) return NULL; if (tcsetpgrp(fd, pgid) < 0) return posix_error(); From python-checkins at python.org Sat May 23 18:14:27 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 23 May 2009 18:14:27 +0200 (CEST) Subject: [Python-checkins] r72856 - in python/branches/py3k: Modules/posixmodule.c Message-ID: <20090523161427.DE6C5C43F@mail.python.org> Author: antoine.pitrou Date: Sat May 23 18:14:27 2009 New Revision: 72856 Log: Merged revisions 72855 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72855 | antoine.pitrou | 2009-05-23 18:06:49 +0200 (sam., 23 mai 2009) | 3 lines Some pid_t-expecting or producing functions were forgotten in r72852. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Modules/posixmodule.c Modified: python/branches/py3k/Modules/posixmodule.c ============================================================================== --- python/branches/py3k/Modules/posixmodule.c (original) +++ python/branches/py3k/Modules/posixmodule.c Sat May 23 18:14:27 2009 @@ -4018,7 +4018,7 @@ static PyObject * posix_getpid(PyObject *self, PyObject *noargs) { - return PyLong_FromLong((long)getpid()); + return PyLong_FromPid(getpid()); } @@ -4072,13 +4072,13 @@ static PyObject * posix_getpgid(PyObject *self, PyObject *args) { - int pid, pgid; - if (!PyArg_ParseTuple(args, "i:getpgid", &pid)) + pid_t pid, pgid; + if (!PyArg_ParseTuple(args, PARSE_PID ":getpgid", &pid)) return NULL; pgid = getpgid(pid); if (pgid < 0) return posix_error(); - return PyLong_FromLong((long)pgid); + return PyLong_FromPid(pgid); } #endif /* HAVE_GETPGID */ @@ -4092,9 +4092,9 @@ posix_getpgrp(PyObject *self, PyObject *noargs) { #ifdef GETPGRP_HAVE_ARG - return PyLong_FromLong((long)getpgrp(0)); + return PyLong_FromPid(getpgrp(0)); #else /* GETPGRP_HAVE_ARG */ - return PyLong_FromLong((long)getpgrp()); + return PyLong_FromPid(getpgrp()); #endif /* GETPGRP_HAVE_ARG */ } #endif /* HAVE_GETPGRP */ @@ -4128,7 +4128,7 @@ static PyObject * posix_getppid(PyObject *self, PyObject *noargs) { - return PyLong_FromLong((long)getppid()); + return PyLong_FromPid(getppid()); } #endif @@ -4217,8 +4217,13 @@ static PyObject * posix_killpg(PyObject *self, PyObject *args) { - int pgid, sig; - if (!PyArg_ParseTuple(args, "ii:killpg", &pgid, &sig)) + int sig; + pid_t pgid; + /* XXX some man pages make the `pgid` parameter an int, others + a pid_t. Since getpgrp() returns a pid_t, we assume killpg should + take the same type. Moreover, pid_t is always at least as wide as + int (else compilation of this module fails), which is safe. */ + if (!PyArg_ParseTuple(args, PARSE_PID "i:killpg", &pgid, &sig)) return NULL; if (killpg(pgid, sig) == -1) return posix_error(); @@ -4898,8 +4903,9 @@ static PyObject * posix_tcsetpgrp(PyObject *self, PyObject *args) { - int fd, pgid; - if (!PyArg_ParseTuple(args, "ii:tcsetpgrp", &fd, &pgid)) + int fd; + pid_t pgid; + if (!PyArg_ParseTuple(args, "i" PARSE_PID ":tcsetpgrp", &fd, &pgid)) return NULL; if (tcsetpgrp(fd, pgid) < 0) return posix_error(); From python-checkins at python.org Sat May 23 18:14:33 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 23 May 2009 18:14:33 +0200 (CEST) Subject: [Python-checkins] r72857 - in python/branches/py3k: Makefile.pre.in Misc/NEWS README Message-ID: <20090523161433.EF30CD3F8@mail.python.org> Author: benjamin.peterson Date: Sat May 23 18:14:33 2009 New Revision: 72857 Log: remove the fullinstall target since py3k will always be known as python3 #6047 Modified: python/branches/py3k/Makefile.pre.in python/branches/py3k/Misc/NEWS python/branches/py3k/README Modified: python/branches/py3k/Makefile.pre.in ============================================================================== --- python/branches/py3k/Makefile.pre.in (original) +++ python/branches/py3k/Makefile.pre.in Sat May 23 18:14:33 2009 @@ -754,18 +754,8 @@ -$(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS) $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS) -# Install everything, and install Python 3 to "python" -fullinstall: @FRAMEWORKINSTALLFIRST@ altinstall bininstall @FRAMEWORKINSTALLLAST@ +install: altinstall bininstall -# "make install" is an alias for "make altinstall" since we don't want to -# overwrite Python 2.x by default. -install: altinstall - @echo "* Note: not installed as 'python'." - @echo "* Use 'make fullinstall' to install as 'python'." - @echo "* However, 'make fullinstall' is discouraged," - @echo "* as it will clobber your Python 2.x installation." - -# Install almost everything without disturbing 2.x versions altinstall: @FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall libainstall \ sharedinstall oldsharedinstall maninstall @FRAMEWORKALTINSTALLLAST@ @@ -790,20 +780,9 @@ fi; \ done - -# Install the interpreter (by creating a hard link to python$(VERSION)) -bininstall: altbininstall - -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON)$(EXE) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON)$(EXE); \ - then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON)$(EXE); \ - else true; \ - fi - (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON)$(EXE)) - -rm -f $(DESTDIR)$(BINDIR)/python-config - (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config) - # Install the interpreter with $(VERSION) affixed # This goes into $(exec_prefix) -altbininstall: $(BUILDPYTHON) +altbininstall: $(BUILDPYTHON) @for i in $(BINDIR) $(LIBDIR); \ do \ if test ! -d $(DESTDIR)$$i; then \ @@ -824,6 +803,8 @@ fi; \ else true; \ fi + +bininstall: altbininstall -if test -f $(DESTDIR)$(BINDIR)/$(PYTHON)3$(EXE) -o -h $(DESTDIR)$(BINDIR)/$(PYTHON)3$(EXE); \ then rm -f $(DESTDIR)$(BINDIR)/$(PYTHON)3$(EXE); \ else true; \ Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 23 18:14:33 2009 @@ -60,6 +60,11 @@ - Issue 5955: aifc's close method did not close the file it wrapped, now it does. This also means getfp method now returns the real fp. +Installation +------------ + +- Issue #6047: fullinstall has been removed because Python 3's executable will + now be known as python3. Extension Modules ----------------- Modified: python/branches/py3k/README ============================================================================== --- python/branches/py3k/README (original) +++ python/branches/py3k/README Sat May 23 18:14:33 2009 @@ -119,7 +119,7 @@ overwritten by the installation of a different versio. All files and directories installed using "make altinstall" contain the major and minor version and can thus live side-by-side. "make install" also creates -${prefix}/bin/python which refers to ${prefix}/bin/pythonX.Y. If you intend +${prefix}/bin/python3 which refers to ${prefix}/bin/pythonX.Y. If you intend to install multiple versions using the same prefix you must decide which version (if any) is your "primary" version. Install that version using "make install". Install all other versions using "make altinstall". @@ -167,7 +167,7 @@ ./configure make make test - sudo make install # or "make altinstall" + sudo make install You can pass many options to the configure script; run "./configure --help" to find out more. On OSX and Cygwin, the executable is called From python-checkins at python.org Sat May 23 18:19:25 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 23 May 2009 18:19:25 +0200 (CEST) Subject: [Python-checkins] r72858 - in python/branches/release26-maint: Modules/posixmodule.c Message-ID: <20090523161925.2E110C403@mail.python.org> Author: antoine.pitrou Date: Sat May 23 18:19:24 2009 New Revision: 72858 Log: Merged revisions 72855 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72855 | antoine.pitrou | 2009-05-23 18:06:49 +0200 (sam., 23 mai 2009) | 3 lines Some pid_t-expecting or producing functions were forgotten in r72852. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Modules/posixmodule.c Modified: python/branches/release26-maint/Modules/posixmodule.c ============================================================================== --- python/branches/release26-maint/Modules/posixmodule.c (original) +++ python/branches/release26-maint/Modules/posixmodule.c Sat May 23 18:19:24 2009 @@ -3816,7 +3816,7 @@ static PyObject * posix_getpid(PyObject *self, PyObject *noargs) { - return PyInt_FromLong((long)getpid()); + return PyLong_FromPid(getpid()); } @@ -3870,13 +3870,13 @@ static PyObject * posix_getpgid(PyObject *self, PyObject *args) { - int pid, pgid; - if (!PyArg_ParseTuple(args, "i:getpgid", &pid)) + pid_t pid, pgid; + if (!PyArg_ParseTuple(args, PARSE_PID ":getpgid", &pid)) return NULL; pgid = getpgid(pid); if (pgid < 0) return posix_error(); - return PyInt_FromLong((long)pgid); + return PyLong_FromPid(pgid); } #endif /* HAVE_GETPGID */ @@ -3890,9 +3890,9 @@ posix_getpgrp(PyObject *self, PyObject *noargs) { #ifdef GETPGRP_HAVE_ARG - return PyInt_FromLong((long)getpgrp(0)); + return PyLong_FromPid(getpgrp(0)); #else /* GETPGRP_HAVE_ARG */ - return PyInt_FromLong((long)getpgrp()); + return PyLong_FromPid(getpgrp()); #endif /* GETPGRP_HAVE_ARG */ } #endif /* HAVE_GETPGRP */ @@ -3926,7 +3926,7 @@ static PyObject * posix_getppid(PyObject *self, PyObject *noargs) { - return PyInt_FromLong(getppid()); + return PyLong_FromPid(getppid()); } #endif @@ -4015,8 +4015,13 @@ static PyObject * posix_killpg(PyObject *self, PyObject *args) { - int pgid, sig; - if (!PyArg_ParseTuple(args, "ii:killpg", &pgid, &sig)) + int sig; + pid_t pgid; + /* XXX some man pages make the `pgid` parameter an int, others + a pid_t. Since getpgrp() returns a pid_t, we assume killpg should + take the same type. Moreover, pid_t is always at least as wide as + int (else compilation of this module fails), which is safe. */ + if (!PyArg_ParseTuple(args, PARSE_PID "i:killpg", &pgid, &sig)) return NULL; if (killpg(pgid, sig) == -1) return posix_error(); @@ -6181,8 +6186,9 @@ static PyObject * posix_tcsetpgrp(PyObject *self, PyObject *args) { - int fd, pgid; - if (!PyArg_ParseTuple(args, "ii:tcsetpgrp", &fd, &pgid)) + int fd; + pid_t pgid; + if (!PyArg_ParseTuple(args, "i" PARSE_PID ":tcsetpgrp", &fd, &pgid)) return NULL; if (tcsetpgrp(fd, pgid) < 0) return posix_error(); From python-checkins at python.org Sat May 23 18:32:32 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 23 May 2009 18:32:32 +0200 (CEST) Subject: [Python-checkins] r72859 - python/trunk/Lib/test/test_fileio.py Message-ID: <20090523163232.48A3EC425@mail.python.org> Author: antoine.pitrou Date: Sat May 23 18:32:32 2009 New Revision: 72859 Log: Issue #3877: skip a test_fileio subtest on all BSDs, not only FreeBSD Modified: python/trunk/Lib/test/test_fileio.py Modified: python/trunk/Lib/test/test_fileio.py ============================================================================== --- python/trunk/Lib/test/test_fileio.py (original) +++ python/trunk/Lib/test/test_fileio.py Sat May 23 18:32:32 2009 @@ -151,7 +151,7 @@ self.assertEquals(f.readable(), False) self.assertEquals(f.writable(), True) if sys.platform != "darwin" and \ - not sys.platform.startswith('freebsd') and \ + 'bsd' not in sys.platform and \ not sys.platform.startswith('sunos'): # Somehow /dev/tty appears seekable on some BSDs self.assertEquals(f.seekable(), False) From python-checkins at python.org Sat May 23 18:33:31 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 23 May 2009 18:33:31 +0200 (CEST) Subject: [Python-checkins] r72860 - in python/branches/release26-maint: Lib/test/test_fileio.py Message-ID: <20090523163331.7D0E4C425@mail.python.org> Author: antoine.pitrou Date: Sat May 23 18:33:31 2009 New Revision: 72860 Log: Merged revisions 72859 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72859 | antoine.pitrou | 2009-05-23 18:32:32 +0200 (sam., 23 mai 2009) | 3 lines Issue #3877: skip a test_fileio subtest on all BSDs, not only FreeBSD ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_fileio.py Modified: python/branches/release26-maint/Lib/test/test_fileio.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_fileio.py (original) +++ python/branches/release26-maint/Lib/test/test_fileio.py Sat May 23 18:33:31 2009 @@ -151,7 +151,7 @@ self.assertEquals(f.readable(), False) self.assertEquals(f.writable(), True) if sys.platform != "darwin" and \ - not sys.platform.startswith('freebsd') and \ + 'bsd' not in sys.platform and \ not sys.platform.startswith('sunos'): # Somehow /dev/tty appears seekable on some BSDs self.assertEquals(f.seekable(), False) From python-checkins at python.org Sat May 23 18:34:24 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 23 May 2009 18:34:24 +0200 (CEST) Subject: [Python-checkins] r72861 - in python/branches/py3k: configure configure.in setup.py Message-ID: <20090523163424.150CDC426@mail.python.org> Author: benjamin.peterson Date: Sat May 23 18:34:23 2009 New Revision: 72861 Log: build _functools and _locale into the core library Modified: python/branches/py3k/configure python/branches/py3k/configure.in python/branches/py3k/setup.py Modified: python/branches/py3k/configure ============================================================================== --- python/branches/py3k/configure (original) +++ python/branches/py3k/configure Sat May 23 18:34:23 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 72504 . +# From configure.in Revision: 72800 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 3.1. # @@ -13524,7 +13524,7 @@ # slowdown in stead of a speedup, maybe due to the large number of # dynamic loads Python does. - LINKFORSHARED="$extra_undefs" + LINKFORSHARED="$extra_undefs -framework CoreFoundation" if test "$enable_framework" then LINKFORSHARED="$LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' Modified: python/branches/py3k/configure.in ============================================================================== --- python/branches/py3k/configure.in (original) +++ python/branches/py3k/configure.in Sat May 23 18:34:23 2009 @@ -1744,7 +1744,7 @@ # slowdown in stead of a speedup, maybe due to the large number of # dynamic loads Python does. - LINKFORSHARED="$extra_undefs" + LINKFORSHARED="$extra_undefs -framework CoreFoundation" if test "$enable_framework" then LINKFORSHARED="$LINKFORSHARED "'$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)' Modified: python/branches/py3k/setup.py ============================================================================== --- python/branches/py3k/setup.py (original) +++ python/branches/py3k/setup.py Sat May 23 18:34:23 2009 @@ -424,8 +424,6 @@ exts.append( Extension("_heapq", ["_heapqmodule.c"]) ) # operator.add() and similar goodies exts.append( Extension('operator', ['operator.c']) ) - # _functools - exts.append( Extension("_functools", ["_functoolsmodule.c"]) ) # C-optimized pickle replacement exts.append( Extension("_pickle", ["_pickle.c"]) ) # atexit @@ -439,22 +437,6 @@ exts.append( Extension('_lsprof', ['_lsprof.c', 'rotatingtree.c']) ) # static Unicode character database exts.append( Extension('unicodedata', ['unicodedata.c']) ) - # access to ISO C locale support - data = open('pyconfig.h').read() - m = re.search(r"#s*define\s+WITH_LIBINTL\s+1\s*", data) - if m is not None: - locale_libs = ['intl'] - else: - locale_libs = [] - if platform == 'darwin': - locale_extra_link_args = ['-framework', 'CoreFoundation'] - else: - locale_extra_link_args = [] - - - exts.append( Extension('_locale', ['_localemodule.c'], - libraries=locale_libs, - extra_link_args=locale_extra_link_args) ) # Modules with some UNIX dependencies -- on by default: # (If you have a really backward UNIX, select and socket may not be From python-checkins at python.org Sat May 23 18:34:50 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 23 May 2009 18:34:50 +0200 (CEST) Subject: [Python-checkins] r72862 - in python/branches/py3k: Lib/test/test_fileio.py Message-ID: <20090523163450.D91FBC313@mail.python.org> Author: antoine.pitrou Date: Sat May 23 18:34:50 2009 New Revision: 72862 Log: Merged revisions 72859 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72859 | antoine.pitrou | 2009-05-23 18:32:32 +0200 (sam., 23 mai 2009) | 3 lines Issue #3877: skip a test_fileio subtest on all BSDs, not only FreeBSD ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_fileio.py Modified: python/branches/py3k/Lib/test/test_fileio.py ============================================================================== --- python/branches/py3k/Lib/test/test_fileio.py (original) +++ python/branches/py3k/Lib/test/test_fileio.py Sat May 23 18:34:50 2009 @@ -252,7 +252,7 @@ self.assertEquals(f.readable(), False) self.assertEquals(f.writable(), True) if sys.platform != "darwin" and \ - not sys.platform.startswith('freebsd') and \ + 'bsd' not in sys.platform and \ not sys.platform.startswith('sunos'): # Somehow /dev/tty appears seekable on some BSDs self.assertEquals(f.seekable(), False) From python-checkins at python.org Sat May 23 18:37:50 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 23 May 2009 18:37:50 +0200 (CEST) Subject: [Python-checkins] r72863 - python/branches/py3k/Modules/Setup.dist Message-ID: <20090523163750.8475AC472@mail.python.org> Author: benjamin.peterson Date: Sat May 23 18:37:50 2009 New Revision: 72863 Log: adjust Setup.dist to build _functools and _locale Modified: python/branches/py3k/Modules/Setup.dist Modified: python/branches/py3k/Modules/Setup.dist ============================================================================== --- python/branches/py3k/Modules/Setup.dist (original) +++ python/branches/py3k/Modules/Setup.dist Sat May 23 18:37:50 2009 @@ -112,6 +112,10 @@ _sre _sre.c # Fredrik Lundh's new regular expressions _codecs _codecsmodule.c # access to the builtin codecs and codec registry _weakref _weakref.c # weak references +_functools _functoolsmodule.c # Tools for working with functions and callable objects + +# access to ISO C locale support +_locale _localemodule.c # -lintl # Standard I/O baseline _io -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 @@ -164,7 +168,6 @@ #_collections _collectionsmodule.c # Container types #itertools itertoolsmodule.c # Functions creating iterators for efficient looping #atexit atexitmodule.c # Register functions to be run at interpreter-shutdown -#_functools _functoolsmodule.c # Tools for working with functions and callable objects #_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator #_pickle _pickle.c # pickle accelerator #datetime datetimemodule.c # date/time type @@ -173,9 +176,6 @@ #unicodedata unicodedata.c # static Unicode character database -# access to ISO C locale support -#_locale _localemodule.c # -lintl - # Modules with some UNIX dependencies -- on by default: # (If you have a really backward UNIX, select and socket may not be From buildbot at python.org Sat May 23 19:06:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 17:06:41 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090523170641.7D5A0D536@mail.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/5043 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sat May 23 19:09:43 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 23 May 2009 19:09:43 +0200 (CEST) Subject: [Python-checkins] r72864 - python/branches/py3k/Misc/NEWS Message-ID: <20090523170943.87E09C41B@mail.python.org> Author: benjamin.peterson Date: Sat May 23 19:09:43 2009 New Revision: 72864 Log: update NEWS Modified: python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 23 19:09:43 2009 @@ -71,6 +71,8 @@ - Issue #6093: Fix off-by-one error in locale.strxfrm. +- The _functools and _locale modules are now built into the shared library. + Tests ----- From python-checkins at python.org Sat May 23 19:12:14 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 23 May 2009 19:12:14 +0200 (CEST) Subject: [Python-checkins] r72865 - python/branches/py3k/configure.in Message-ID: <20090523171214.11CCFD40D@mail.python.org> Author: benjamin.peterson Date: Sat May 23 19:12:13 2009 New Revision: 72865 Log: kill old comment Modified: python/branches/py3k/configure.in Modified: python/branches/py3k/configure.in ============================================================================== --- python/branches/py3k/configure.in (original) +++ python/branches/py3k/configure.in Sat May 23 19:12:13 2009 @@ -1736,14 +1736,6 @@ Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";; # -u libsys_s pulls in all symbols in libsys Darwin/*) - # -u _PyMac_Error is needed to pull in the mac toolbox glue, - # which is - # not used by the core itself but which needs to be in the core so - # that dynamically loaded extension modules have access to it. - # -prebind is no longer used, because it actually seems to give a - # slowdown in stead of a speedup, maybe due to the large number of - # dynamic loads Python does. - LINKFORSHARED="$extra_undefs -framework CoreFoundation" if test "$enable_framework" then From python-checkins at python.org Sat May 23 19:13:14 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 23 May 2009 19:13:14 +0200 (CEST) Subject: [Python-checkins] r72866 - python/branches/py3k/setup.py Message-ID: <20090523171314.908B4D509@mail.python.org> Author: benjamin.peterson Date: Sat May 23 19:13:14 2009 New Revision: 72866 Log: install 2to3, overwritting any old installations #5756 Modified: python/branches/py3k/setup.py Modified: python/branches/py3k/setup.py ============================================================================== --- python/branches/py3k/setup.py (original) +++ python/branches/py3k/setup.py Sat May 23 19:13:14 2009 @@ -1666,7 +1666,8 @@ # called unless there's at least one extension module defined. ext_modules=[Extension('_struct', ['_struct.c'])], - scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3"] + scripts = ["Tools/scripts/pydoc3", "Tools/scripts/idle3", + "Tools/scripts/2to3"] ) # --install-platlib From python-checkins at python.org Sat May 23 20:24:14 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 23 May 2009 20:24:14 +0200 (CEST) Subject: [Python-checkins] r72867 - sandbox/trunk/2to3/2to3 Message-ID: <20090523182414.0D715D434@mail.python.org> Author: benjamin.peterson Date: Sat May 23 20:24:13 2009 New Revision: 72867 Log: *nit* reorder imports Modified: sandbox/trunk/2to3/2to3 Modified: sandbox/trunk/2to3/2to3 ============================================================================== --- sandbox/trunk/2to3/2to3 (original) +++ sandbox/trunk/2to3/2to3 Sat May 23 20:24:13 2009 @@ -1,6 +1,5 @@ #!/usr/bin/env python -from lib2to3.main import main import sys -import os +from lib2to3.main import main sys.exit(main("lib2to3.fixes")) From buildbot at python.org Sat May 23 20:31:36 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 18:31:36 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 3.x Message-ID: <20090523183137.1A1C3D4D5@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%203.x/builds/1018 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou,benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sat May 23 20:49:56 2009 From: python-checkins at python.org (r.david.murray) Date: Sat, 23 May 2009 20:49:56 +0200 (CEST) Subject: [Python-checkins] r72868 - in python/branches/py3k: Lib/smtplib.py Lib/test/test_smtplib.py Misc/ACKS Misc/NEWS Message-ID: <20090523184956.4D11AD46A@mail.python.org> Author: r.david.murray Date: Sat May 23 20:49:56 2009 New Revision: 72868 Log: Fix for issue 5259: ASCII encode the username and password before passing it to encode_base64, which requires bytes in py3k. Fix by Musashi Tamura, tests by Marcin Bachry. Modified: python/branches/py3k/Lib/smtplib.py python/branches/py3k/Lib/test/test_smtplib.py python/branches/py3k/Misc/ACKS python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/smtplib.py ============================================================================== --- python/branches/py3k/Lib/smtplib.py (original) +++ python/branches/py3k/Lib/smtplib.py Sat May 23 20:49:56 2009 @@ -545,7 +545,8 @@ return encode_base64(response) def encode_plain(user, password): - return encode_base64("\0%s\0%s" % (user, password)) + s = "\0%s\0%s" % (user, password) + return encode_base64(s.encode('ascii'), eol='') AUTH_PLAIN = "PLAIN" Modified: python/branches/py3k/Lib/test/test_smtplib.py ============================================================================== --- python/branches/py3k/Lib/test/test_smtplib.py (original) +++ python/branches/py3k/Lib/test/test_smtplib.py Sat May 23 20:49:56 2009 @@ -284,6 +284,9 @@ 'Mrs.C at somewhereesle.com':'Ruth C', } +sim_auth = ('Mr.A at somewhere.com', 'somepassword') +sim_auth_b64encoded = 'AE1yLkFAc29tZXdoZXJlLmNvbQBzb21lcGFzc3dvcmQ=' + sim_lists = {'list-1':['Mr.A at somewhere.com','Mrs.C at somewhereesle.com'], 'list-2':['Ms.B at somewhere.com',], } @@ -296,6 +299,7 @@ '250-SIZE 20000000\r\n' \ '250-STARTTLS\r\n' \ '250-DELIVERBY\r\n' \ + '250-AUTH PLAIN\r\n' \ '250 HELP' self.push(resp) @@ -324,6 +328,16 @@ else: self.push('550 No access for you!') + def smtp_AUTH(self, arg): + mech, auth = arg.split() + if mech.lower() == 'plain': + if auth == sim_auth_b64encoded: + self.push('235 ok, go ahead') + else: + self.push('550 No access for you!') + else: + self.push('504 auth type unimplemented') + class SimSMTPServer(smtpd.SMTPServer): def handle_accept(self): @@ -372,6 +386,7 @@ 'size': '20000000', 'starttls': '', 'deliverby': '', + 'auth': ' PLAIN', 'help': '', } @@ -412,6 +427,11 @@ self.assertEqual(smtp.expn(u), expected_unknown) smtp.quit() + def testAUTH(self): + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + + expected_auth_ok = (235, b'ok, go ahead') + self.assertEqual(smtp.login(sim_auth[0], sim_auth[1]), expected_auth_ok) def test_main(verbose=None): Modified: python/branches/py3k/Misc/ACKS ============================================================================== --- python/branches/py3k/Misc/ACKS (original) +++ python/branches/py3k/Misc/ACKS Sat May 23 20:49:56 2009 @@ -710,6 +710,7 @@ Paul Swartz Thenault Sylvain Geoff Talvola +Musashi Tamura William Tanksley Christian Tanzer Steven Taschuk Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 23 20:49:56 2009 @@ -32,6 +32,9 @@ Library ------- +- Issue #5259: smtplib plain auth login no longer gives a traceback. Fix + by Musashi Tamura, tests by Marcin Bachry. + - Issue #1983: Fix functions taking or returning a process identifier to use the dedicated C type ``pid_t`` instead of a C ``int``. Some platforms have a process identifier type wider than the standard C integer type. From python-checkins at python.org Sat May 23 20:51:49 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 23 May 2009 20:51:49 +0200 (CEST) Subject: [Python-checkins] r72869 - python/branches/py3k/Misc/NEWS Message-ID: <20090523185149.712A3D50A@mail.python.org> Author: benjamin.peterson Date: Sat May 23 20:51:49 2009 New Revision: 72869 Log: clarify Modified: python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 23 20:51:49 2009 @@ -74,7 +74,8 @@ - Issue #6093: Fix off-by-one error in locale.strxfrm. -- The _functools and _locale modules are now built into the shared library. +- The _functools and _locale modules are now built into the libpython shared + library instead of as extension modules. Tests ----- From python-checkins at python.org Sat May 23 21:04:03 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 23 May 2009 21:04:03 +0200 (CEST) Subject: [Python-checkins] r72870 - in python/branches/py3k: Lib/_pyio.py Lib/test/test_fileio.py Lib/test/test_io.py Misc/NEWS Modules/_io/bufferedio.c Modules/_io/fileio.c Modules/_io/textio.c Message-ID: <20090523190403.D2DC3D3E3@mail.python.org> Author: antoine.pitrou Date: Sat May 23 21:04:03 2009 New Revision: 72870 Log: Issue #5761: Add the name of the underlying file to the repr() of various IO objects. Modified: python/branches/py3k/Lib/_pyio.py python/branches/py3k/Lib/test/test_fileio.py python/branches/py3k/Lib/test/test_io.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_io/bufferedio.c python/branches/py3k/Modules/_io/fileio.c python/branches/py3k/Modules/_io/textio.c Modified: python/branches/py3k/Lib/_pyio.py ============================================================================== --- python/branches/py3k/Lib/_pyio.py (original) +++ python/branches/py3k/Lib/_pyio.py Sat May 23 21:04:03 2009 @@ -736,6 +736,15 @@ def mode(self): return self.raw.mode + def __repr__(self): + clsname = self.__class__.__name__ + try: + name = self.name + except AttributeError: + return "<_pyio.{0}>".format(clsname) + else: + return "<_pyio.{0} name={1!r}>".format(clsname, name) + ### Lower-level APIs ### def fileno(self): @@ -1455,7 +1464,13 @@ # - "chars_..." for integer variables that count decoded characters def __repr__(self): - return "".format(self.encoding) + try: + name = self.name + except AttributeError: + return "<_pyio.TextIOWrapper encoding={0!r}>".format(self.encoding) + else: + return "<_pyio.TextIOWrapper name={0!r} encoding={1!r}>".format( + name, self.encoding) @property def encoding(self): Modified: python/branches/py3k/Lib/test/test_fileio.py ============================================================================== --- python/branches/py3k/Lib/test/test_fileio.py (original) +++ python/branches/py3k/Lib/test/test_fileio.py Sat May 23 21:04:03 2009 @@ -70,9 +70,13 @@ self.assertEquals(array('b', [1, 2]), a[:n]) def testRepr(self): - self.assertEquals(repr(self.f), - "io.FileIO(%d, %s)" % (self.f.fileno(), - repr(self.f.mode))) + self.assertEquals(repr(self.f), "<_io.FileIO name=%r mode=%r>" + % (self.f.name, self.f.mode)) + del self.f.name + self.assertEquals(repr(self.f), "<_io.FileIO fd=%r mode=%r>" + % (self.f.fileno(), self.f.mode)) + self.f.close() + self.assertEquals(repr(self.f), "<_io.FileIO [closed]>") def testErrors(self): f = self.f Modified: python/branches/py3k/Lib/test/test_io.py ============================================================================== --- python/branches/py3k/Lib/test/test_io.py (original) +++ python/branches/py3k/Lib/test/test_io.py Sat May 23 21:04:03 2009 @@ -618,6 +618,16 @@ self.assert_(s.startswith("Exception IOError: "), s) self.assert_(s.endswith(" ignored"), s) + def test_repr(self): + raw = self.MockRawIO() + b = self.tp(raw) + clsname = "%s.%s" % (self.tp.__module__, self.tp.__name__) + self.assertEqual(repr(b), "<%s>" % clsname) + raw.name = "dummy" + self.assertEqual(repr(b), "<%s name='dummy'>" % clsname) + raw.name = b"dummy" + self.assertEqual(repr(b), "<%s name=b'dummy'>" % clsname) + class BufferedReaderTest(unittest.TestCase, CommonBufferedTests): read_mode = "rb" @@ -1528,7 +1538,15 @@ raw = self.BytesIO("hello".encode("utf-8")) b = self.BufferedReader(raw) t = self.TextIOWrapper(b, encoding="utf-8") - self.assertEqual(repr(t), "") + modname = self.TextIOWrapper.__module__ + self.assertEqual(repr(t), + "<%s.TextIOWrapper encoding='utf-8'>" % modname) + raw.name = "dummy" + self.assertEqual(repr(t), + "<%s.TextIOWrapper name='dummy' encoding='utf-8'>" % modname) + raw.name = b"dummy" + self.assertEqual(repr(t), + "<%s.TextIOWrapper name=b'dummy' encoding='utf-8'>" % modname) def test_line_buffering(self): r = self.BytesIO() Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 23 21:04:03 2009 @@ -32,6 +32,9 @@ Library ------- +- Issue #5761: Add the name of the underlying file to the repr() of various + IO objects. + - Issue #5259: smtplib plain auth login no longer gives a traceback. Fix by Musashi Tamura, tests by Marcin Bachry. Modified: python/branches/py3k/Modules/_io/bufferedio.c ============================================================================== --- python/branches/py3k/Modules/_io/bufferedio.c (original) +++ python/branches/py3k/Modules/_io/bufferedio.c Sat May 23 21:04:03 2009 @@ -1123,6 +1123,27 @@ return line; } +static PyObject * +Buffered_repr(BufferedObject *self) +{ + PyObject *nameobj, *res; + + nameobj = PyObject_GetAttrString((PyObject *) self, "name"); + if (nameobj == NULL) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) + PyErr_Clear(); + else + return NULL; + res = PyUnicode_FromFormat("<%s>", Py_TYPE(self)->tp_name); + } + else { + res = PyUnicode_FromFormat("<%s name=%R>", + Py_TYPE(self)->tp_name, nameobj); + Py_DECREF(nameobj); + } + return res; +} + /* * class BufferedReader */ @@ -1472,7 +1493,7 @@ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare */ - 0, /*tp_repr*/ + (reprfunc)Buffered_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ @@ -1828,7 +1849,7 @@ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare */ - 0, /*tp_repr*/ + (reprfunc)Buffered_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ @@ -2219,7 +2240,7 @@ 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare */ - 0, /*tp_repr*/ + (reprfunc)Buffered_repr, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ Modified: python/branches/py3k/Modules/_io/fileio.c ============================================================================== --- python/branches/py3k/Modules/_io/fileio.c (original) +++ python/branches/py3k/Modules/_io/fileio.c Sat May 23 21:04:03 2009 @@ -846,11 +846,26 @@ static PyObject * fileio_repr(PyFileIOObject *self) { + PyObject *nameobj, *res; + if (self->fd < 0) - return PyUnicode_FromFormat("io.FileIO(-1)"); + return PyUnicode_FromFormat("<_io.FileIO [closed]>"); - return PyUnicode_FromFormat("io.FileIO(%d, '%s')", - self->fd, mode_string(self)); + nameobj = PyObject_GetAttrString((PyObject *) self, "name"); + if (nameobj == NULL) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) + PyErr_Clear(); + else + return NULL; + res = PyUnicode_FromFormat("<_io.FileIO fd=%d mode='%s'>", + self->fd, mode_string(self)); + } + else { + res = PyUnicode_FromFormat("<_io.FileIO name=%R mode='%s'>", + nameobj, mode_string(self)); + Py_DECREF(nameobj); + } + return res; } static PyObject * Modified: python/branches/py3k/Modules/_io/textio.c ============================================================================== --- python/branches/py3k/Modules/_io/textio.c (original) +++ python/branches/py3k/Modules/_io/textio.c Sat May 23 21:04:03 2009 @@ -2308,8 +2308,25 @@ static PyObject * TextIOWrapper_repr(PyTextIOWrapperObject *self) { - CHECK_INITIALIZED(self); - return PyUnicode_FromFormat("", self->encoding); + PyObject *nameobj, *res; + + CHECK_INITIALIZED(self); + + nameobj = PyObject_GetAttrString((PyObject *) self, "name"); + if (nameobj == NULL) { + if (PyErr_ExceptionMatches(PyExc_AttributeError)) + PyErr_Clear(); + else + return NULL; + res = PyUnicode_FromFormat("<_io.TextIOWrapper encoding=%R>", + self->encoding); + } + else { + res = PyUnicode_FromFormat("<_io.TextIOWrapper name=%R encoding=%R>", + nameobj, self->encoding); + Py_DECREF(nameobj); + } + return res; } From python-checkins at python.org Sat May 23 21:24:37 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 23 May 2009 21:24:37 +0200 (CEST) Subject: [Python-checkins] r72871 - in python/trunk: Makefile.pre.in Misc/ACKS Misc/NEWS Modules/getbuildinfo.c Python/sysmodule.c configure configure.in Message-ID: <20090523192437.711F9C3FD@mail.python.org> Author: benjamin.peterson Date: Sat May 23 21:24:37 2009 New Revision: 72871 Log: support building with subversion 1.7 #6094 Modified: python/trunk/Makefile.pre.in python/trunk/Misc/ACKS python/trunk/Misc/NEWS python/trunk/Modules/getbuildinfo.c python/trunk/Python/sysmodule.c python/trunk/configure python/trunk/configure.in Modified: python/trunk/Makefile.pre.in ============================================================================== --- python/trunk/Makefile.pre.in (original) +++ python/trunk/Makefile.pre.in Sat May 23 21:24:37 2009 @@ -505,7 +505,7 @@ $(SIGNAL_OBJS) \ $(MODOBJS) \ $(srcdir)/Modules/getbuildinfo.c - $(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LC_ALL=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c + $(CC) -c $(PY_CFLAGS) -DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" -o $@ $(srcdir)/Modules/getbuildinfo.c Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \ Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Sat May 23 21:24:37 2009 @@ -22,6 +22,7 @@ Erik Anders?n Oliver Andrich Ross Andrus +Arfrever Frehtes Taifersar Arahesis Jason Asbahr David Ascher Chris AtLee Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat May 23 21:24:37 2009 @@ -958,6 +958,8 @@ Build ----- +- Issue #6094: Build correctly with Subversion 1.7. + - Issue #5847: Remove -n switch on "Edit with IDLE" menu item. - Issue #5726: Make Modules/ld_so_aix return the actual exit code of the Modified: python/trunk/Modules/getbuildinfo.c ============================================================================== --- python/trunk/Modules/getbuildinfo.c (original) +++ python/trunk/Modules/getbuildinfo.c Sat May 23 21:24:37 2009 @@ -48,5 +48,5 @@ static const char svnversion[] = SVNVERSION; if (svnversion[0] != '$') return svnversion; /* it was interpolated, or passed on command line */ - return "exported"; + return "Unversioned directory"; } Modified: python/trunk/Python/sysmodule.c ============================================================================== --- python/trunk/Python/sysmodule.c (original) +++ python/trunk/Python/sysmodule.c Sat May 23 21:24:37 2009 @@ -1158,7 +1158,7 @@ svnversion = _Py_svnversion(); - if (strcmp(svnversion, "exported") != 0) + if (strcmp(svnversion, "Unversioned directory") != 0 && strcmp(svnversion, "exported") != 0) svn_revision = svnversion; else if (istag) { len = strlen(_patchlevel_revision); Modified: python/trunk/configure ============================================================================== --- python/trunk/configure (original) +++ python/trunk/configure Sat May 23 21:24:37 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 72497 . +# From configure.in Revision: 72799 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.7. # @@ -4385,7 +4385,7 @@ then SVNVERSION="svnversion \$(srcdir)" else - SVNVERSION="echo exported" + SVNVERSION="echo Unversioned directory" fi case $MACHDEP in Modified: python/trunk/configure.in ============================================================================== --- python/trunk/configure.in (original) +++ python/trunk/configure.in Sat May 23 21:24:37 2009 @@ -802,7 +802,7 @@ then SVNVERSION="svnversion \$(srcdir)" else - SVNVERSION="echo exported" + SVNVERSION="echo Unversioned directory" fi case $MACHDEP in From python-checkins at python.org Sat May 23 21:31:02 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 23 May 2009 21:31:02 +0200 (CEST) Subject: [Python-checkins] r72872 - python/trunk/Misc/ACKS Message-ID: <20090523193102.710FAD270@mail.python.org> Author: benjamin.peterson Date: Sat May 23 21:31:02 2009 New Revision: 72872 Log: reorder name Modified: python/trunk/Misc/ACKS Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Sat May 23 21:31:02 2009 @@ -22,7 +22,6 @@ Erik Anders?n Oliver Andrich Ross Andrus -Arfrever Frehtes Taifersar Arahesis Jason Asbahr David Ascher Chris AtLee @@ -704,6 +703,7 @@ Kalle Svensson Paul Swartz Thenault Sylvain +Arfrever Frehtes Taifersar Arahesis Geoff Talvola William Tanksley Christian Tanzer From python-checkins at python.org Sat May 23 21:35:34 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 23 May 2009 21:35:34 +0200 (CEST) Subject: [Python-checkins] r72873 - in python/branches/release26-maint: Makefile.pre.in Misc/ACKS Misc/NEWS Modules/getbuildinfo.c Python/sysmodule.c configure configure.in Message-ID: <20090523193534.38B67C428@mail.python.org> Author: benjamin.peterson Date: Sat May 23 21:35:33 2009 New Revision: 72873 Log: Merged revisions 72871-72872 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72871 | benjamin.peterson | 2009-05-23 14:24:37 -0500 (Sat, 23 May 2009) | 1 line support building with subversion 1.7 #6094 ........ r72872 | benjamin.peterson | 2009-05-23 14:31:02 -0500 (Sat, 23 May 2009) | 1 line reorder name ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Makefile.pre.in python/branches/release26-maint/Misc/ACKS python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/getbuildinfo.c python/branches/release26-maint/Python/sysmodule.c python/branches/release26-maint/configure python/branches/release26-maint/configure.in Modified: python/branches/release26-maint/Makefile.pre.in ============================================================================== --- python/branches/release26-maint/Makefile.pre.in (original) +++ python/branches/release26-maint/Makefile.pre.in Sat May 23 21:35:33 2009 @@ -501,7 +501,7 @@ $(SIGNAL_OBJS) \ $(MODOBJS) \ $(srcdir)/Modules/getbuildinfo.c - $(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LC_ALL=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c + $(CC) -c $(PY_CFLAGS) -DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" -o $@ $(srcdir)/Modules/getbuildinfo.c Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \ Modified: python/branches/release26-maint/Misc/ACKS ============================================================================== --- python/branches/release26-maint/Misc/ACKS (original) +++ python/branches/release26-maint/Misc/ACKS Sat May 23 21:35:33 2009 @@ -684,6 +684,7 @@ Kalle Svensson Paul Swartz Thenault Sylvain +Arfrever Frehtes Taifersar Arahesis Geoff Talvola William Tanksley Christian Tanzer Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sat May 23 21:35:33 2009 @@ -98,6 +98,8 @@ Build ----- +- Issue #6094: Build correctly with Subversion 1.7. + - Issue #5726: Make Modules/ld_so_aix return the actual exit code of the linker, rather than always exit successfully. Patch by Floris Bruynooghe. Modified: python/branches/release26-maint/Modules/getbuildinfo.c ============================================================================== --- python/branches/release26-maint/Modules/getbuildinfo.c (original) +++ python/branches/release26-maint/Modules/getbuildinfo.c Sat May 23 21:35:33 2009 @@ -48,5 +48,5 @@ static const char svnversion[] = SVNVERSION; if (svnversion[0] != '$') return svnversion; /* it was interpolated, or passed on command line */ - return "exported"; + return "Unversioned directory"; } Modified: python/branches/release26-maint/Python/sysmodule.c ============================================================================== --- python/branches/release26-maint/Python/sysmodule.c (original) +++ python/branches/release26-maint/Python/sysmodule.c Sat May 23 21:35:33 2009 @@ -1161,7 +1161,7 @@ svnversion = _Py_svnversion(); - if (strcmp(svnversion, "exported") != 0) + if (strcmp(svnversion, "Unversioned directory") != 0 && strcmp(svnversion, "exported") != 0) svn_revision = svnversion; else if (istag) { len = strlen(_patchlevel_revision); Modified: python/branches/release26-maint/configure ============================================================================== --- python/branches/release26-maint/configure (original) +++ python/branches/release26-maint/configure Sat May 23 21:35:33 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 70731 . +# From configure.in Revision: 72275 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.6. # @@ -4344,7 +4344,7 @@ then SVNVERSION="svnversion \$(srcdir)" else - SVNVERSION="echo exported" + SVNVERSION="echo Unversioned directory" fi case $MACHDEP in Modified: python/branches/release26-maint/configure.in ============================================================================== --- python/branches/release26-maint/configure.in (original) +++ python/branches/release26-maint/configure.in Sat May 23 21:35:33 2009 @@ -767,7 +767,7 @@ then SVNVERSION="svnversion \$(srcdir)" else - SVNVERSION="echo exported" + SVNVERSION="echo Unversioned directory" fi case $MACHDEP in From python-checkins at python.org Sat May 23 21:36:28 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 23 May 2009 21:36:28 +0200 (CEST) Subject: [Python-checkins] r72874 - in python/branches/py3k: Makefile.pre.in Misc/ACKS Misc/NEWS Modules/getbuildinfo.c Python/sysmodule.c configure configure.in Message-ID: <20090523193628.00723C43F@mail.python.org> Author: benjamin.peterson Date: Sat May 23 21:36:27 2009 New Revision: 72874 Log: Merged revisions 72871-72872 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72871 | benjamin.peterson | 2009-05-23 14:24:37 -0500 (Sat, 23 May 2009) | 1 line support building with subversion 1.7 #6094 ........ r72872 | benjamin.peterson | 2009-05-23 14:31:02 -0500 (Sat, 23 May 2009) | 1 line reorder name ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Makefile.pre.in python/branches/py3k/Misc/ACKS python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/getbuildinfo.c python/branches/py3k/Python/sysmodule.c python/branches/py3k/configure python/branches/py3k/configure.in Modified: python/branches/py3k/Makefile.pre.in ============================================================================== --- python/branches/py3k/Makefile.pre.in (original) +++ python/branches/py3k/Makefile.pre.in Sat May 23 21:36:27 2009 @@ -524,7 +524,7 @@ $(SIGNAL_OBJS) \ $(MODOBJS) \ $(srcdir)/Modules/getbuildinfo.c - $(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LC_ALL=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c + $(CC) -c $(PY_CFLAGS) -DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" -o $@ $(srcdir)/Modules/getbuildinfo.c Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \ Modified: python/branches/py3k/Misc/ACKS ============================================================================== --- python/branches/py3k/Misc/ACKS (original) +++ python/branches/py3k/Misc/ACKS Sat May 23 21:36:27 2009 @@ -709,6 +709,7 @@ Andrew Svetlov Paul Swartz Thenault Sylvain +Arfrever Frehtes Taifersar Arahesis Geoff Talvola Musashi Tamura William Tanksley Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 23 21:36:27 2009 @@ -1081,6 +1081,8 @@ Build ----- +- Issue #6094: Build correctly with Subversion 1.7. + - Issue #5847: Remove -n switch on "Edit with IDLE" menu item. - Issue #5726: Make Modules/ld_so_aix return the actual exit code of the Modified: python/branches/py3k/Modules/getbuildinfo.c ============================================================================== --- python/branches/py3k/Modules/getbuildinfo.c (original) +++ python/branches/py3k/Modules/getbuildinfo.c Sat May 23 21:36:27 2009 @@ -48,5 +48,5 @@ static const char svnversion[] = SVNVERSION; if (svnversion[0] != '$') return svnversion; /* it was interpolated, or passed on command line */ - return "exported"; + return "Unversioned directory"; } Modified: python/branches/py3k/Python/sysmodule.c ============================================================================== --- python/branches/py3k/Python/sysmodule.c (original) +++ python/branches/py3k/Python/sysmodule.c Sat May 23 21:36:27 2009 @@ -1115,7 +1115,7 @@ svnversion = _Py_svnversion(); - if (strcmp(svnversion, "exported") != 0) + if (strcmp(svnversion, "Unversioned directory") != 0 && strcmp(svnversion, "exported") != 0) svn_revision = svnversion; else if (istag) { len = strlen(_patchlevel_revision); Modified: python/branches/py3k/configure ============================================================================== --- python/branches/py3k/configure (original) +++ python/branches/py3k/configure Sat May 23 21:36:27 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 72800 . +# From configure.in Revision: 72865 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 3.1. # @@ -4333,7 +4333,7 @@ then SVNVERSION="svnversion \$(srcdir)" else - SVNVERSION="echo exported" + SVNVERSION="echo Unversioned directory" fi case $MACHDEP in @@ -13516,14 +13516,6 @@ Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";; # -u libsys_s pulls in all symbols in libsys Darwin/*) - # -u _PyMac_Error is needed to pull in the mac toolbox glue, - # which is - # not used by the core itself but which needs to be in the core so - # that dynamically loaded extension modules have access to it. - # -prebind is no longer used, because it actually seems to give a - # slowdown in stead of a speedup, maybe due to the large number of - # dynamic loads Python does. - LINKFORSHARED="$extra_undefs -framework CoreFoundation" if test "$enable_framework" then Modified: python/branches/py3k/configure.in ============================================================================== --- python/branches/py3k/configure.in (original) +++ python/branches/py3k/configure.in Sat May 23 21:36:27 2009 @@ -758,7 +758,7 @@ then SVNVERSION="svnversion \$(srcdir)" else - SVNVERSION="echo exported" + SVNVERSION="echo Unversioned directory" fi case $MACHDEP in From python-checkins at python.org Sat May 23 21:42:15 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 23 May 2009 21:42:15 +0200 (CEST) Subject: [Python-checkins] r72875 - in python/branches/release30-maint: Makefile.pre.in Misc/ACKS Misc/NEWS Modules/getbuildinfo.c Python/sysmodule.c configure configure.in Message-ID: <20090523194215.C0667D565@mail.python.org> Author: benjamin.peterson Date: Sat May 23 21:42:15 2009 New Revision: 72875 Log: Merged revisions 72874 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72874 | benjamin.peterson | 2009-05-23 14:36:27 -0500 (Sat, 23 May 2009) | 13 lines Merged revisions 72871-72872 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72871 | benjamin.peterson | 2009-05-23 14:24:37 -0500 (Sat, 23 May 2009) | 1 line support building with subversion 1.7 #6094 ........ r72872 | benjamin.peterson | 2009-05-23 14:31:02 -0500 (Sat, 23 May 2009) | 1 line reorder name ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Makefile.pre.in python/branches/release30-maint/Misc/ACKS python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/getbuildinfo.c python/branches/release30-maint/Python/sysmodule.c python/branches/release30-maint/configure python/branches/release30-maint/configure.in Modified: python/branches/release30-maint/Makefile.pre.in ============================================================================== --- python/branches/release30-maint/Makefile.pre.in (original) +++ python/branches/release30-maint/Makefile.pre.in Sat May 23 21:42:15 2009 @@ -499,7 +499,7 @@ $(SIGNAL_OBJS) \ $(MODOBJS) \ $(srcdir)/Modules/getbuildinfo.c - $(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LC_ALL=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c + $(CC) -c $(PY_CFLAGS) -DSVNVERSION="\"`LC_ALL=C $(SVNVERSION)`\"" -o $@ $(srcdir)/Modules/getbuildinfo.c Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile $(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \ Modified: python/branches/release30-maint/Misc/ACKS ============================================================================== --- python/branches/release30-maint/Misc/ACKS (original) +++ python/branches/release30-maint/Misc/ACKS Sat May 23 21:42:15 2009 @@ -684,6 +684,7 @@ Andrew Svetlov Paul Swartz Thenault Sylvain +Arfrever Frehtes Taifersar Arahesis Geoff Talvola William Tanksley Christian Tanzer Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat May 23 21:42:15 2009 @@ -171,6 +171,8 @@ Build ----- +- Issue #6094: Build correctly with Subversion 1.7. + - Link the shared python library with $(MODLIBS). - Issue #5359: Readd the Berkley-DB detection code to allow _dbm be built Modified: python/branches/release30-maint/Modules/getbuildinfo.c ============================================================================== --- python/branches/release30-maint/Modules/getbuildinfo.c (original) +++ python/branches/release30-maint/Modules/getbuildinfo.c Sat May 23 21:42:15 2009 @@ -48,5 +48,5 @@ static const char svnversion[] = SVNVERSION; if (svnversion[0] != '$') return svnversion; /* it was interpolated, or passed on command line */ - return "exported"; + return "Unversioned directory"; } Modified: python/branches/release30-maint/Python/sysmodule.c ============================================================================== --- python/branches/release30-maint/Python/sysmodule.c (original) +++ python/branches/release30-maint/Python/sysmodule.c Sat May 23 21:42:15 2009 @@ -1117,7 +1117,7 @@ svnversion = _Py_svnversion(); - if (strcmp(svnversion, "exported") != 0) + if (strcmp(svnversion, "Unversioned directory") != 0 && strcmp(svnversion, "exported") != 0) svn_revision = svnversion; else if (istag) { len = strlen(_patchlevel_revision); Modified: python/branches/release30-maint/configure ============================================================================== --- python/branches/release30-maint/configure (original) +++ python/branches/release30-maint/configure Sat May 23 21:42:15 2009 @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 68442 . +# From configure.in Revision: 72277 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 3.0. # @@ -4288,7 +4288,7 @@ then SVNVERSION="svnversion \$(srcdir)" else - SVNVERSION="echo exported" + SVNVERSION="echo Unversioned directory" fi case $MACHDEP in Modified: python/branches/release30-maint/configure.in ============================================================================== --- python/branches/release30-maint/configure.in (original) +++ python/branches/release30-maint/configure.in Sat May 23 21:42:15 2009 @@ -721,7 +721,7 @@ then SVNVERSION="svnversion \$(srcdir)" else - SVNVERSION="echo exported" + SVNVERSION="echo Unversioned directory" fi case $MACHDEP in From buildbot at python.org Sat May 23 21:57:58 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 19:57:58 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090523195758.47EBFD46F@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/730 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou,benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_posix test_smtplib ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Sat May 23 22:05:49 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 20:05:49 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090523200549.A06DDD4DE@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%202.6/builds/387 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-ubuntu-i386/build/Lib/test/test_signal.py", line 165, in test_main pickle.dump(None, done_w) File "/home/pybot/buildarea/2.6.klose-ubuntu-i386/build/Lib/contextlib.py", line 153, in __exit__ self.thing.close() IOError: [Errno 9] Bad file descriptor 1 test failed: test_signal make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Sat May 23 22:59:09 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 23 May 2009 22:59:09 +0200 (CEST) Subject: [Python-checkins] r72876 - python/trunk/Doc/library/ctypes.rst Message-ID: <20090523205909.71484D3E4@mail.python.org> Author: benjamin.peterson Date: Sat May 23 22:59:09 2009 New Revision: 72876 Log: remove mention of old ctypes version Modified: python/trunk/Doc/library/ctypes.rst Modified: python/trunk/Doc/library/ctypes.rst ============================================================================== --- python/trunk/Doc/library/ctypes.rst (original) +++ python/trunk/Doc/library/ctypes.rst Sat May 23 22:59:09 2009 @@ -1210,8 +1210,7 @@ Variable-sized data types ^^^^^^^^^^^^^^^^^^^^^^^^^ -``ctypes`` provides some support for variable-sized arrays and structures (this -was added in version 0.9.9.7). +``ctypes`` provides some support for variable-sized arrays and structures. The ``resize`` function can be used to resize the memory buffer of an existing ctypes object. The function takes the object as first argument, and the From python-checkins at python.org Sat May 23 23:05:12 2009 From: python-checkins at python.org (r.david.murray) Date: Sat, 23 May 2009 23:05:12 +0200 (CEST) Subject: [Python-checkins] r72877 - in python/branches/release30-maint: Lib/smtplib.py Lib/test/test_smtplib.py Misc/ACKS Misc/NEWS Message-ID: <20090523210512.370A3D40D@mail.python.org> Author: r.david.murray Date: Sat May 23 23:05:11 2009 New Revision: 72877 Log: Merged revisions 72868 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r72868 | r.david.murray | 2009-05-23 14:49:56 -0400 (Sat, 23 May 2009) | 5 lines Fix for issue 5259: ASCII encode the username and password before passing it to encode_base64, which requires bytes in py3k. Fix by Musashi Tamura, tests by Marcin Bachry. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/smtplib.py python/branches/release30-maint/Lib/test/test_smtplib.py python/branches/release30-maint/Misc/ACKS python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/smtplib.py ============================================================================== --- python/branches/release30-maint/Lib/smtplib.py (original) +++ python/branches/release30-maint/Lib/smtplib.py Sat May 23 23:05:11 2009 @@ -542,7 +542,8 @@ return encode_base64(response) def encode_plain(user, password): - return encode_base64("\0%s\0%s" % (user, password)) + s = "\0%s\0%s" % (user, password) + return encode_base64(s.encode('ascii'), eol='') AUTH_PLAIN = "PLAIN" Modified: python/branches/release30-maint/Lib/test/test_smtplib.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_smtplib.py (original) +++ python/branches/release30-maint/Lib/test/test_smtplib.py Sat May 23 23:05:11 2009 @@ -284,6 +284,9 @@ 'Mrs.C at somewhereesle.com':'Ruth C', } +sim_auth = ('Mr.A at somewhere.com', 'somepassword') +sim_auth_b64encoded = 'AE1yLkFAc29tZXdoZXJlLmNvbQBzb21lcGFzc3dvcmQ=' + sim_lists = {'list-1':['Mr.A at somewhere.com','Mrs.C at somewhereesle.com'], 'list-2':['Ms.B at somewhere.com',], } @@ -296,6 +299,7 @@ '250-SIZE 20000000\r\n' \ '250-STARTTLS\r\n' \ '250-DELIVERBY\r\n' \ + '250-AUTH PLAIN\r\n' \ '250 HELP' self.push(resp) @@ -324,6 +328,16 @@ else: self.push('550 No access for you!') + def smtp_AUTH(self, arg): + mech, auth = arg.split() + if mech.lower() == 'plain': + if auth == sim_auth_b64encoded: + self.push('235 ok, go ahead') + else: + self.push('550 No access for you!') + else: + self.push('504 auth type unimplemented') + class SimSMTPServer(smtpd.SMTPServer): def handle_accept(self): @@ -372,6 +386,7 @@ 'size': '20000000', 'starttls': '', 'deliverby': '', + 'auth': ' PLAIN', 'help': '', } @@ -412,6 +427,11 @@ self.assertEqual(smtp.expn(u), expected_unknown) smtp.quit() + def testAUTH(self): + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + + expected_auth_ok = (235, b'ok, go ahead') + self.assertEqual(smtp.login(sim_auth[0], sim_auth[1]), expected_auth_ok) def test_main(verbose=None): Modified: python/branches/release30-maint/Misc/ACKS ============================================================================== --- python/branches/release30-maint/Misc/ACKS (original) +++ python/branches/release30-maint/Misc/ACKS Sat May 23 23:05:11 2009 @@ -686,6 +686,7 @@ Thenault Sylvain Arfrever Frehtes Taifersar Arahesis Geoff Talvola +Musashi Tamura William Tanksley Christian Tanzer Steven Taschuk Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sat May 23 23:05:11 2009 @@ -65,6 +65,9 @@ Library ------- +- Issue #5259: smtplib plain auth login no longer gives a traceback. Fix + by Musashi Tamura, tests by Marcin Bachry. + - Issue #4066: smtplib.SMTP_SSL._get_socket now correctly returns the socket. Patch by Farhan Ahmad, test by Marcin Bachry. From buildbot at python.org Sat May 23 23:16:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 21:16:19 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 2.6 Message-ID: <20090523211619.53D95D4B0@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%202.6/builds/364 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: ======= Backtrace: ========= /lib/libc.so.6.1[0x200000000025ade0] /lib/libc.so.6.1(cfree-0x5f548b0)[0x200000000025f460] /usr/lib/libdb-4.7.so(__os_free-0x508fb80)[0x20000000011241a0] /usr/lib/libdb-4.7.so(__os_closehandle-0x508d640)[0x20000000011266f0] /usr/lib/libdb-4.7.so(__fop_file_setup-0x50ced50)[0x20000000010e4ff0] /usr/lib/libdb-4.7.so(__db_open-0x512b4f0)[0x2000000001088860] /usr/lib/libdb-4.7.so(__db_open_pp+0x50ad20)[0x20000000010791f0] /home/pybot/buildarea/2.6.klose-debian-ia64/build/build/lib.linux-ia64-2.6-pydebug/_bsddb.so[0x2000000000e466f0] ./python(PyCFunction_Call+0x20000000003ccdb0)[0x4000000000417740] ./python[0x400000000027c5d0] ./python(PyEval_EvalFrameEx+0x1ffffffffa0b8870)[0x400000000026c5d0] ./python(PyEval_EvalCodeEx+0x1ffffffffa0c03c0)[0x4000000000274130] ./python[0x400000000027d860] ./python[0x400000000027cbc0] ./python(PyEval_EvalFrameEx+0x1ffffffffa0b8870)[0x400000000026c5d0] ./python(PyEval_EvalCodeEx+0x1ffffffffa0c03c0)[0x4000000000274130] ./python[0x400000000027d860] ./python[0x400000000027cbc0] ./python(PyEval_EvalFrameEx+0x1ffffffffa0b8870)[0x400000000026c5d0] ./python(PyEval_EvalCodeEx+0x1ffffffffa0c03c0)[0x4000000000274130] ./python[0x400000000027d860] ./python[0x400000000027cbc0] ./python(PyEval_EvalFrameEx+0x1ffffffffa0b8870)[0x400000000026c5d0] ./python(PyEval_EvalCodeEx+0x1ffffffffa0c03c0)[0x4000000000274130] ./python[0x40000000004151c0] ./python(PyObject_Call+0x1ffffffff9e8f770)[0x40000000000434f0] ./python[0x4000000000066280] ./python(PyObject_Call+0x1ffffffff9e8f770)[0x40000000000434f0] ./python(PyEval_CallObjectWithKeywords+0x1ffffffffa0c6bf0)[0x400000000027a980] ./python(PyInstance_New+0x2000000000004400)[0x400000000004eb80] ./python(PyObject_Call+0x1ffffffff9e8f770)[0x40000000000434f0] ./python[0x400000000027eee0] ./python[0x400000000027cc20] ./python(PyEval_EvalFrameEx+0x1ffffffffa0b8870)[0x400000000026c5d0] ./python(PyEval_EvalCodeEx+0x1ffffffffa0c03c0)[0x4000000000274130] ./python[0x40000000004151c0] ./python(PyObject_Call+0x1ffffffff9e8f770)[0x40000000000434f0] ./python[0x400000000027fdc0] ./python(PyEval_EvalFrameEx+0x1ffffffffa0b9050)[0x400000000026cdb0] ./python[0x400000000027d4e0] ./python[0x400000000027cbc0] ./python(PyEval_EvalFrameEx+0x1ffffffffa0b8870)[0x400000000026c5d0] ./python(PyEval_EvalCodeEx+0x1ffffffffa0c03c0)[0x4000000000274130] ./python[0x400000000027d860] ./python[0x400000000027cbc0] ./python(PyEval_EvalFrameEx+0x1ffffffffa0b8870)[0x400000000026c5d0] ./python(PyEval_EvalCodeEx+0x1ffffffffa0c03c0)[0x4000000000274130] ./python[0x40000000004151c0] ./python(PyObject_Call+0x1ffffffff9e8f770)[0x40000000000434f0] ./python[0x400000000027fdc0] ./python(PyEval_EvalFrameEx+0x1ffffffffa0b9050)[0x400000000026cdb0] ./python(PyEval_EvalCodeEx+0x1ffffffffa0c03c0)[0x4000000000274130] ./python[0x40000000004151c0] ./python(PyObject_Call+0x1ffffffff9e8f770)[0x40000000000434f0] ./python[0x4000000000066280] ./python(PyObject_Call+0x1ffffffff9e8f770)[0x40000000000434f0] ./python[0x40000000001bd660] ./python(PyObject_Call+0x1ffffffff9e8f770)[0x40000000000434f0] ./python[0x400000000027eee0] ./python[0x400000000027cc20] ./python(PyEval_EvalFrameEx+0x1ffffffffa0b8870)[0x400000000026c5d0] ./python(PyEval_EvalCodeEx+0x1ffffffffa0c03c0)[0x4000000000274130] ./python[0x40000000004151c0] ======= Memory map: ======== 00000000-00004000 r--p 00000000 00:00 0 2000000000000000-200000000003c000 r-xp 00000000 03:05 2420685 /lib/ld-2.8.so 2000000000048000-2000000000050000 rw-p 00038000 03:05 2420685 /lib/ld-2.8.so 2000000000050000-2000000000078000 r-xp 00000000 03:05 2420667 /lib/libpthread-2.8.so 2000000000078000-2000000000084000 ---p 00028000 03:05 2420667 /lib/libpthread-2.8.so 2000000000084000-200000000008c000 rw-p 00024000 03:05 2420667 /lib/libpthread-2.8.so 200000000008c000-2000000000094000 rw-p 200000000008c000 00:00 0 2000000000094000-200000000009c000 r-xp 00000000 03:05 2420682 /lib/libdl-2.8.so 200000000009c000-20000000000a8000 ---p 00008000make: *** [buildbottest] Aborted sincerely, -The Buildbot From buildbot at python.org Sat May 23 23:45:59 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 21:45:59 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090523214559.A9009D43B@mail.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/606 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou,benjamin.peterson,r.david.murray BUILD FAILED: failed compile sincerely, -The Buildbot From python-checkins at python.org Sat May 23 23:48:06 2009 From: python-checkins at python.org (r.david.murray) Date: Sat, 23 May 2009 23:48:06 +0200 (CEST) Subject: [Python-checkins] r72878 - python/trunk/Lib/test/test_smtplib.py Message-ID: <20090523214806.D434BD489@mail.python.org> Author: r.david.murray Date: Sat May 23 23:48:06 2009 New Revision: 72878 Log: Add smtplib test from issue 5259. Modified: python/trunk/Lib/test/test_smtplib.py Modified: python/trunk/Lib/test/test_smtplib.py ============================================================================== --- python/trunk/Lib/test/test_smtplib.py (original) +++ python/trunk/Lib/test/test_smtplib.py Sat May 23 23:48:06 2009 @@ -276,6 +276,9 @@ 'Mrs.C at somewhereesle.com':'Ruth C', } +sim_auth = ('Mr.A at somewhere.com', 'somepassword') +sim_auth_b64encoded = 'AE1yLkFAc29tZXdoZXJlLmNvbQBzb21lcGFzc3dvcmQ=' + sim_lists = {'list-1':['Mr.A at somewhere.com','Mrs.C at somewhereesle.com'], 'list-2':['Ms.B at somewhere.com',], } @@ -288,6 +291,7 @@ '250-SIZE 20000000\r\n' \ '250-STARTTLS\r\n' \ '250-DELIVERBY\r\n' \ + '250-AUTH PLAIN\r\n' \ '250 HELP' self.push(resp) @@ -316,6 +320,16 @@ else: self.push('550 No access for you!') + def smtp_AUTH(self, arg): + mech, auth = arg.split() + if mech.lower() == 'plain': + if auth == sim_auth_b64encoded: + self.push('235 ok, go ahead') + else: + self.push('550 No access for you!') + else: + self.push('504 auth type unimplemented') + class SimSMTPServer(smtpd.SMTPServer): def handle_accept(self): @@ -364,6 +378,7 @@ 'size': '20000000', 'starttls': '', 'deliverby': '', + 'auth': ' PLAIN', 'help': '', } @@ -401,6 +416,11 @@ self.assertEqual(smtp.expn(u), expected_unknown) smtp.quit() + def testAUTH(self): + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + + expected_auth_ok = (235, b'ok, go ahead') + self.assertEqual(smtp.login(sim_auth[0], sim_auth[1]), expected_auth_ok) def test_main(verbose=None): From nnorwitz at gmail.com Sun May 24 00:26:27 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 23 May 2009 18:26:27 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (2) Message-ID: <20090523222627.GA31457@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 test_ssl leaked [0, 0, -403] references, sum=-403 Less important issues: ---------------------- test_asynchat leaked [126, -126, 0] references, sum=0 test_cmd_line leaked [25, 0, 0] references, sum=25 test_docxmlrpc leaked [174, -174, 0] references, sum=0 test_file leaked [0, 0, 84] references, sum=84 test_smtplib leaked [-90, 0, 0] references, sum=-90 test_socketserver leaked [0, 80, -80] references, sum=0 test_sys leaked [-21, -21, 0] references, sum=-42 test_threading leaked [48, 48, 48] references, sum=144 From buildbot at python.org Sun May 24 00:36:47 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 22:36:47 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090523223647.5D484D685@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1361 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson,r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Sun May 24 00:50:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 22:50:50 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090523225050.80B59D5C2@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/385 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 45, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/Include ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Sun May 24 01:23:02 2009 From: python-checkins at python.org (jeffrey.yasskin) Date: Sun, 24 May 2009 01:23:02 +0200 (CEST) Subject: [Python-checkins] r72879 - in python/trunk: Doc/library/sys.rst Include/code.h Objects/codeobject.c Objects/lnotab_notes.txt Python/ceval.c Python/compile.c Message-ID: <20090523232302.19926D3E7@mail.python.org> Author: jeffrey.yasskin Date: Sun May 24 01:23:01 2009 New Revision: 72879 Log: Issue #6042: lnotab-based tracing is very complicated and isn't documented very well. There were at least 3 comment blocks purporting to document co_lnotab, and none did a very good job. This patch unifies them into Objects/lnotab_notes.txt which tries to completely capture the current state of affairs. I also discovered that we've attached 2 layers of patches to the basic tracing scheme. The first layer avoids jumping to instructions that don't start a line, to avoid problems in if statements and while loops. The second layer discovered that jumps backward do need to trace at instructions that don't start a line, so it added extra lnotab entries for 'while' and 'for' loops, and added a special case for backward jumps within the same line. I replaced these patches by just treating forward and backward jumps differently. Added: python/trunk/Objects/lnotab_notes.txt Modified: python/trunk/Doc/library/sys.rst python/trunk/Include/code.h python/trunk/Objects/codeobject.c python/trunk/Python/ceval.c python/trunk/Python/compile.c Modified: python/trunk/Doc/library/sys.rst ============================================================================== --- python/trunk/Doc/library/sys.rst (original) +++ python/trunk/Doc/library/sys.rst Sun May 24 01:23:01 2009 @@ -798,9 +798,11 @@ specifies the local trace function. ``'line'`` - The interpreter is about to execute a new line of code (sometimes multiple - line events on one line exist). The local trace function is called; *arg* - is ``None``; the return value specifies the new local trace function. + The interpreter is about to execute a new line of code or re-execute the + condition of a loop. The local trace function is called; *arg* is + ``None``; the return value specifies the new local trace function. See + :file:`Objects/lnotab_notes.txt` for a detailed explanation of how this + works. ``'return'`` A function (or other code block) is about to return. The local trace Modified: python/trunk/Include/code.h ============================================================================== --- python/trunk/Include/code.h (original) +++ python/trunk/Include/code.h Sun May 24 01:23:01 2009 @@ -23,7 +23,8 @@ PyObject *co_filename; /* string (where it was loaded from) */ PyObject *co_name; /* string (name, for reference) */ int co_firstlineno; /* first source line number */ - PyObject *co_lnotab; /* string (encoding addr<->lineno mapping) */ + PyObject *co_lnotab; /* string (encoding addr<->lineno mapping) See + Objects/lnotab_notes.txt for details. */ void *co_zombieframe; /* for optimization only (see frameobject.c) */ } PyCodeObject; @@ -90,15 +91,11 @@ int ap_upper; } PyAddrPair; -/* Check whether lasti (an instruction offset) falls outside bounds - and whether it is a line number that should be traced. Returns - a line number if it should be traced or -1 if the line should not. - - If lasti is not within bounds, updates bounds. +/* Update *bounds to describe the first and one-past-the-last instructions in the + same line as lasti. Return the number of that line. */ - -PyAPI_FUNC(int) PyCode_CheckLineNumber(PyCodeObject* co, - int lasti, PyAddrPair *bounds); +PyAPI_FUNC(int) _PyCode_CheckLineNumber(PyCodeObject* co, + int lasti, PyAddrPair *bounds); PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts, PyObject *names, PyObject *lineno_obj); Modified: python/trunk/Objects/codeobject.c ============================================================================== --- python/trunk/Objects/codeobject.c (original) +++ python/trunk/Objects/codeobject.c Sun May 24 01:23:01 2009 @@ -507,48 +507,8 @@ code_new, /* tp_new */ }; -/* All about c_lnotab. - -c_lnotab is an array of unsigned bytes disguised as a Python string. In -O -mode, SET_LINENO opcodes aren't generated, and bytecode offsets are mapped -to source code line #s (when needed for tracebacks) via c_lnotab instead. -The array is conceptually a list of - (bytecode offset increment, line number increment) -pairs. The details are important and delicate, best illustrated by example: - - byte code offset source code line number - 0 1 - 6 2 - 50 7 - 350 307 - 361 308 - -The first trick is that these numbers aren't stored, only the increments -from one row to the next (this doesn't really work, but it's a start): - - 0, 1, 6, 1, 44, 5, 300, 300, 11, 1 - -The second trick is that an unsigned byte can't hold negative values, or -values larger than 255, so (a) there's a deep assumption that byte code -offsets and their corresponding line #s both increase monotonically, and (b) -if at least one column jumps by more than 255 from one row to the next, more -than one pair is written to the table. In case #b, there's no way to know -from looking at the table later how many were written. That's the delicate -part. A user of c_lnotab desiring to find the source line number -corresponding to a bytecode address A should do something like this - - lineno = addr = 0 - for addr_incr, line_incr in c_lnotab: - addr += addr_incr - if addr > A: - return lineno - lineno += line_incr - -In order for this to work, when the addr field increments by more than 255, -the line # increment in each pair generated must be 0 until the remaining addr -increment is < 256. So, in the example above, com_set_lineno should not (as -was actually done until 2.2) expand 300, 300 to 255, 255, 45, 45, but to -255, 0, 45, 255, 0, 45. +/* Use co_lnotab to compute the line number from a bytecode index, addrq. See + lnotab_notes.txt for the details of the lnotab representation. */ int @@ -567,85 +527,10 @@ return line; } -/* - Check whether the current instruction is at the start of a line. - - */ - - /* The theory of SET_LINENO-less tracing. - - In a nutshell, we use the co_lnotab field of the code object - to tell when execution has moved onto a different line. - - As mentioned above, the basic idea is so set things up so - that - - *instr_lb <= frame->f_lasti < *instr_ub - - is true so long as execution does not change lines. - - This is all fairly simple. Digging the information out of - co_lnotab takes some work, but is conceptually clear. - - Somewhat harder to explain is why we don't *always* call the - line trace function when the above test fails. - - Consider this code: - - 1: def f(a): - 2: if a: - 3: print 1 - 4: else: - 5: print 2 - - which compiles to this: - - 2 0 LOAD_FAST 0 (a) - 3 JUMP_IF_FALSE 9 (to 15) - 6 POP_TOP - - 3 7 LOAD_CONST 1 (1) - 10 PRINT_ITEM - 11 PRINT_NEWLINE - 12 JUMP_FORWARD 6 (to 21) - >> 15 POP_TOP - - 5 16 LOAD_CONST 2 (2) - 19 PRINT_ITEM - 20 PRINT_NEWLINE - >> 21 LOAD_CONST 0 (None) - 24 RETURN_VALUE - - If 'a' is false, execution will jump to instruction at offset - 15 and the co_lnotab will claim that execution has moved to - line 3. This is at best misleading. In this case we could - associate the POP_TOP with line 4, but that doesn't make - sense in all cases (I think). - - What we do is only call the line trace function if the co_lnotab - indicates we have jumped to the *start* of a line, i.e. if the - current instruction offset matches the offset given for the - start of a line by the co_lnotab. - - This also takes care of the situation where 'a' is true. - Execution will jump from instruction offset 12 to offset 21. - Then the co_lnotab would imply that execution has moved to line - 5, which is again misleading. - - Why do we set f_lineno when tracing? Well, consider the code - above when 'a' is true. If stepping through this with 'n' in - pdb, you would stop at line 1 with a "call" type event, then - line events on lines 2 and 3, then a "return" type event -- but - you would be shown line 5 during this event. This is a change - from the behaviour in 2.2 and before, and I've found it - confusing in practice. By setting and using f_lineno when - tracing, one can report a line number different from that - suggested by f_lasti on this one occasion where it's desirable. - */ - - -int -PyCode_CheckLineNumber(PyCodeObject* co, int lasti, PyAddrPair *bounds) +/* Update *bounds to describe the first and one-past-the-last instructions in + the same line as lasti. Return the number of that line. */ +int +_PyCode_CheckLineNumber(PyCodeObject* co, int lasti, PyAddrPair *bounds) { int size, addr, line; unsigned char* p; @@ -662,11 +547,9 @@ instr_lb -- if we stored the matching value of p somwhere we could skip the first while loop. */ - /* see comments in compile.c for the description of + /* See lnotab_notes.txt for the description of co_lnotab. A point to remember: increments to p - should come in pairs -- although we don't care about - the line increments here, treating them as byte - increments gets confusing, to say the least. */ + come in (addr, line) pairs. */ bounds->ap_lower = 0; while (size > 0) { @@ -679,13 +562,6 @@ --size; } - /* If lasti and addr don't match exactly, we don't want to - change the lineno slot on the frame or execute a trace - function. Return -1 instead. - */ - if (addr != lasti) - line = -1; - if (size > 0) { while (--size >= 0) { addr += *p++; Added: python/trunk/Objects/lnotab_notes.txt ============================================================================== --- (empty file) +++ python/trunk/Objects/lnotab_notes.txt Sun May 24 01:23:01 2009 @@ -0,0 +1,124 @@ +All about co_lnotab, the line number table. + +Code objects store a field named co_lnotab. This is an array of unsigned bytes +disguised as a Python string. It is used to map bytecode offsets to source code +line #s for tracebacks and to identify line number boundaries for line tracing. + +The array is conceptually a compressed list of + (bytecode offset increment, line number increment) +pairs. The details are important and delicate, best illustrated by example: + + byte code offset source code line number + 0 1 + 6 2 + 50 7 + 350 307 + 361 308 + +Instead of storing these numbers literally, we compress the list by storing only +the increments from one row to the next. Conceptually, the stored list might +look like: + + 0, 1, 6, 1, 44, 5, 300, 300, 11, 1 + +The above doesn't really work, but it's a start. Note that an unsigned byte +can't hold negative values, or values larger than 255, and the above example +contains two such values. So we make two tweaks: + + (a) there's a deep assumption that byte code offsets and their corresponding + line #s both increase monotonically, and + (b) if at least one column jumps by more than 255 from one row to the next, + more than one pair is written to the table. In case #b, there's no way to know + from looking at the table later how many were written. That's the delicate + part. A user of co_lnotab desiring to find the source line number + corresponding to a bytecode address A should do something like this + + lineno = addr = 0 + for addr_incr, line_incr in co_lnotab: + addr += addr_incr + if addr > A: + return lineno + lineno += line_incr + +(In C, this is implemented by PyCode_Addr2Line().) In order for this to work, +when the addr field increments by more than 255, the line # increment in each +pair generated must be 0 until the remaining addr increment is < 256. So, in +the example above, assemble_lnotab in compile.c should not (as was actually done +until 2.2) expand 300, 300 to + 255, 255, 45, 45, +but to + 255, 0, 45, 255, 0, 45. + +The above is sufficient to reconstruct line numbers for tracebacks, but not for +line tracing. Tracing is handled by PyCode_CheckLineNumber() in codeobject.c +and maybe_call_line_trace() in ceval.c. + +*** Tracing *** + +To a first approximation, we want to call the tracing function when the line +number of the current instruction changes. Re-computing the current line for +every instruction is a little slow, though, so each time we compute the line +number we save the bytecode indices where it's valid: + + *instr_lb <= frame->f_lasti < *instr_ub + +is true so long as execution does not change lines. That is, *instr_lb holds +the first bytecode index of the current line, and *instr_ub holds the first +bytecode index of the next line. As long as the above expression is true, +maybe_call_line_trace() does not need to call PyCode_CheckLineNumber(). Note +that the same line may appear multiple times in the lnotab, either because the +bytecode jumped more than 255 indices between line number changes or because +the compiler inserted the same line twice. Even in that case, *instr_ub holds +the first index of the next line. + +However, we don't *always* want to call the line trace function when the above +test fails. + +Consider this code: + +1: def f(a): +2: while a: +3: print 1, +4: break +5: else: +6: print 2, + +which compiles to this: + + 2 0 SETUP_LOOP 19 (to 22) + >> 3 LOAD_FAST 0 (a) + 6 POP_JUMP_IF_FALSE 17 + + 3 9 LOAD_CONST 1 (1) + 12 PRINT_ITEM + + 4 13 BREAK_LOOP + 14 JUMP_ABSOLUTE 3 + >> 17 POP_BLOCK + + 6 18 LOAD_CONST 2 (2) + 21 PRINT_ITEM + >> 22 LOAD_CONST 0 (None) + 25 RETURN_VALUE + +If 'a' is false, execution will jump to the POP_BLOCK instruction at offset 17 +and the co_lnotab will claim that execution has moved to line 4, which is wrong. +In this case, we could instead associate the POP_BLOCK with line 5, but that +would break jumps around loops without else clauses. + +We fix this by only calling the line trace function for a forward jump if the +co_lnotab indicates we have jumped to the *start* of a line, i.e. if the current +instruction offset matches the offset given for the start of a line by the +co_lnotab. For backward jumps, however, we always call the line trace function, +which lets a debugger stop on every evaluation of a loop guard (which usually +won't be the first opcode in a line). + +Why do we set f_lineno when tracing, and only just before calling the trace +function? Well, consider the code above when 'a' is true. If stepping through +this with 'n' in pdb, you would stop at line 1 with a "call" type event, then +line events on lines 2, 3, and 4, then a "return" type event -- but because the +code for the return actually falls in the range of the "line 6" opcodes, you +would be shown line 6 during this event. This is a change from the behaviour in +2.2 and before, and I've found it confusing in practice. By setting and using +f_lineno when tracing, one can report a line number different from that +suggested by f_lasti on this one occasion where it's desirable. Modified: python/trunk/Python/ceval.c ============================================================================== --- python/trunk/Python/ceval.c (original) +++ python/trunk/Python/ceval.c Sun May 24 01:23:01 2009 @@ -3591,33 +3591,30 @@ return result; } +/* See Objects/lnotab_notes.txt for a description of how tracing works. */ static int maybe_call_line_trace(Py_tracefunc func, PyObject *obj, PyFrameObject *frame, int *instr_lb, int *instr_ub, int *instr_prev) { int result = 0; + int line = frame->f_lineno; /* If the last instruction executed isn't in the current - instruction window, reset the window. If the last - instruction happens to fall at the start of a line or if it - represents a jump backwards, call the trace function. + instruction window, reset the window. */ - if ((frame->f_lasti < *instr_lb || frame->f_lasti >= *instr_ub)) { - int line; + if (frame->f_lasti < *instr_lb || frame->f_lasti >= *instr_ub) { PyAddrPair bounds; - - line = PyCode_CheckLineNumber(frame->f_code, frame->f_lasti, - &bounds); - if (line >= 0) { - frame->f_lineno = line; - result = call_trace(func, obj, frame, - PyTrace_LINE, Py_None); - } + line = _PyCode_CheckLineNumber(frame->f_code, frame->f_lasti, + &bounds); *instr_lb = bounds.ap_lower; *instr_ub = bounds.ap_upper; } - else if (frame->f_lasti <= *instr_prev) { + /* If the last instruction falls at the start of a line or if + it represents a jump backwards, update the frame's line + number and call the trace function. */ + if (frame->f_lasti == *instr_lb || frame->f_lasti < *instr_prev) { + frame->f_lineno = line; result = call_trace(func, obj, frame, PyTrace_LINE, Py_None); } *instr_prev = frame->f_lasti; Modified: python/trunk/Python/compile.c ============================================================================== --- python/trunk/Python/compile.c (original) +++ python/trunk/Python/compile.c Sun May 24 01:23:01 2009 @@ -1646,9 +1646,6 @@ VISIT(c, expr, s->v.For.iter); ADDOP(c, GET_ITER); compiler_use_next_block(c, start); - /* for expressions must be traced on each iteration, - so we need to set an extra line number. */ - c->u->u_lineno_set = false; ADDOP_JREL(c, FOR_ITER, cleanup); VISIT(c, expr, s->v.For.target); VISIT_SEQ(c, stmt, s->v.For.body); @@ -1694,9 +1691,6 @@ if (!compiler_push_fblock(c, LOOP, loop)) return 0; if (constant == -1) { - /* while expressions must be traced on each iteration, - so we need to set an extra line number. */ - c->u->u_lineno_set = false; VISIT(c, expr, s->v.While.test); ADDOP_JABS(c, POP_JUMP_IF_FALSE, anchor); } @@ -3493,51 +3487,9 @@ return size; } -/* All about a_lnotab. - -c_lnotab is an array of unsigned bytes disguised as a Python string. -It is used to map bytecode offsets to source code line #s (when needed -for tracebacks). - -The array is conceptually a list of - (bytecode offset increment, line number increment) -pairs. The details are important and delicate, best illustrated by example: - - byte code offset source code line number - 0 1 - 6 2 - 50 7 - 350 307 - 361 308 - -The first trick is that these numbers aren't stored, only the increments -from one row to the next (this doesn't really work, but it's a start): - - 0, 1, 6, 1, 44, 5, 300, 300, 11, 1 - -The second trick is that an unsigned byte can't hold negative values, or -values larger than 255, so (a) there's a deep assumption that byte code -offsets and their corresponding line #s both increase monotonically, and (b) -if at least one column jumps by more than 255 from one row to the next, more -than one pair is written to the table. In case #b, there's no way to know -from looking at the table later how many were written. That's the delicate -part. A user of c_lnotab desiring to find the source line number -corresponding to a bytecode address A should do something like this - - lineno = addr = 0 - for addr_incr, line_incr in c_lnotab: - addr += addr_incr - if addr > A: - return lineno - lineno += line_incr - -In order for this to work, when the addr field increments by more than 255, -the line # increment in each pair generated must be 0 until the remaining addr -increment is < 256. So, in the example above, assemble_lnotab (it used -to be called com_set_lineno) should not (as was actually done until 2.2) -expand 300, 300 to 255, 255, 45, 45, - but to 255, 0, 45, 255, 0, 45. -*/ +/* Appends a pair to the end of the line number table, a_lnotab, representing + the instruction's bytecode offset and line number. See + Objects/lnotab_notes.txt for the description of the line number table. */ static int assemble_lnotab(struct assembler *a, struct instr *i) From buildbot at python.org Sun May 24 01:48:41 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 23 May 2009 23:48:41 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090523234841.554C4D56B@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%20trunk/builds/58 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: jeffrey.yasskin BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From nnorwitz at gmail.com Sun May 24 02:00:58 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sat, 23 May 2009 17:00:58 -0700 Subject: [Python-checkins] r72879 - in python/trunk: Doc/library/sys.rst Include/code.h Objects/codeobject.c Objects/lnotab_notes.txt Python/ceval.c Python/compile.c In-Reply-To: <20090523232302.19926D3E7@mail.python.org> References: <20090523232302.19926D3E7@mail.python.org> Message-ID: On Sat, May 23, 2009 at 4:23 PM, jeffrey.yasskin wrote: > Author: jeffrey.yasskin > Date: Sun May 24 01:23:01 2009 > New Revision: 72879 > > Log: > Issue #6042: > lnotab-based tracing is very complicated and isn't documented very well. ?There > were at least 3 comment blocks purporting to document co_lnotab, and none did a > very good job. This patch unifies them into Objects/lnotab_notes.txt which > tries to completely capture the current state of affairs. > > I also discovered that we've attached 2 layers of patches to the basic tracing > scheme. The first layer avoids jumping to instructions that don't start a line, > to avoid problems in if statements and while loops. ?The second layer > discovered that jumps backward do need to trace at instructions that don't > start a line, so it added extra lnotab entries for 'while' and 'for' loops, and > added a special case for backward jumps within the same line. I replaced these > patches by just treating forward and backward jumps differently. > > > Added: > ? python/trunk/Objects/lnotab_notes.txt > Modified: > ? python/trunk/Doc/library/sys.rst > ? python/trunk/Include/code.h > ? python/trunk/Objects/codeobject.c > ? python/trunk/Python/ceval.c > ? python/trunk/Python/compile.c > > Modified: python/trunk/Include/code.h > ============================================================================== > --- python/trunk/Include/code.h (original) > +++ python/trunk/Include/code.h Sun May 24 01:23:01 2009 > @@ -23,7 +23,8 @@ > ? ? PyObject *co_filename; ? ? /* string (where it was loaded from) */ > ? ? PyObject *co_name; ? ? ? ? /* string (name, for reference) */ > ? ? int co_firstlineno; ? ? ? ? ? ? ? ?/* first source line number */ > - ? ?PyObject *co_lnotab; ? ? ? /* string (encoding addr<->lineno mapping) */ > + ? ?PyObject *co_lnotab; ? ? ? /* string (encoding addr<->lineno mapping) See > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Objects/lnotab_notes.txt for details. */ > ? ? void *co_zombieframe; ? ? /* for optimization only (see frameobject.c) */ > ?} PyCodeObject; > > @@ -90,15 +91,11 @@ > ? ? ? ? int ap_upper; > ?} PyAddrPair; > > -/* Check whether lasti (an instruction offset) falls outside bounds > - ? and whether it is a line number that should be traced. ?Returns > - ? a line number if it should be traced or -1 if the line should not. > - > - ? If lasti is not within bounds, updates bounds. > +/* Update *bounds to describe the first and one-past-the-last instructions in the > + ? same line as lasti. ?Return the number of that line. > ?*/ > - > -PyAPI_FUNC(int) PyCode_CheckLineNumber(PyCodeObject* co, > - ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? int lasti, PyAddrPair *bounds); > +PyAPI_FUNC(int) _PyCode_CheckLineNumber(PyCodeObject* co, > + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?int lasti, PyAddrPair *bounds); You should add an entry to Misc/NEWS about PyCode_CheckLineNumber becoming an internal API. n From python-checkins at python.org Sun May 24 11:14:50 2009 From: python-checkins at python.org (senthil.kumaran) Date: Sun, 24 May 2009 11:14:50 +0200 (CEST) Subject: [Python-checkins] r72880 - in python/trunk: Doc/library/httplib.rst Lib/httplib.py Lib/test/test_urllib2.py Lib/urllib2.py Misc/NEWS Message-ID: <20090524091450.F05F9C348@mail.python.org> Author: senthil.kumaran Date: Sun May 24 11:14:50 2009 New Revision: 72880 Log: Fixed Issue1424152, urllib2 fails with HTTPS over Proxy. Modified: python/trunk/Doc/library/httplib.rst python/trunk/Lib/httplib.py python/trunk/Lib/test/test_urllib2.py python/trunk/Lib/urllib2.py python/trunk/Misc/NEWS Modified: python/trunk/Doc/library/httplib.rst ============================================================================== --- python/trunk/Doc/library/httplib.rst (original) +++ python/trunk/Doc/library/httplib.rst Sun May 24 11:14:50 2009 @@ -428,6 +428,12 @@ debug level is ``0``, meaning no debugging output is printed. +.. method:: HTTPConnection.set_tunnel(host,port=None) + + Set the host and the port for HTTP Connect Tunnelling. Normally used when + it is required to do HTTPS Conection through a proxy server. + + .. method:: HTTPConnection.connect() Connect to the server specified when the object was created. Modified: python/trunk/Lib/httplib.py ============================================================================== --- python/trunk/Lib/httplib.py (original) +++ python/trunk/Lib/httplib.py Sun May 24 11:14:50 2009 @@ -662,11 +662,18 @@ self.__response = None self.__state = _CS_IDLE self._method = None + self._tunnel_host = None + self._tunnel_port = None self._set_hostport(host, port) if strict is not None: self.strict = strict + def set_tunnel(self, host, port=None): + """ Sets up the host and the port for the HTTP CONNECT Tunnelling.""" + self._tunnel_host = host + self._tunnel_port = port + def _set_hostport(self, host, port): if port is None: i = host.rfind(':') @@ -687,11 +694,30 @@ def set_debuglevel(self, level): self.debuglevel = level + def _tunnel(self): + self._set_hostport(self._tunnel_host, self._tunnel_port) + self.send("CONNECT %s:%d HTTP/1.0\r\n\r\n" % (self.host, self.port)) + response = self.response_class(self.sock, strict = self.strict, + method = self._method) + (version, code, message) = response._read_status() + + if code != 200: + self.close() + raise socket.error, "Tunnel connection failed: %d %s" % (code, + message.strip()) + while True: + line = response.fp.readline() + if line == '\r\n': break + + def connect(self): """Connect to the host and port specified in __init__.""" self.sock = socket.create_connection((self.host,self.port), self.timeout) + if self._tunnel_host: + self._tunnel() + def close(self): """Close the connection to the HTTP server.""" if self.sock: @@ -1101,6 +1127,9 @@ "Connect to a host on a given (SSL) port." sock = socket.create_connection((self.host, self.port), self.timeout) + if self._tunnel_host: + self.sock = sock + self._tunnel() self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file) __all__.append("HTTPSConnection") Modified: python/trunk/Lib/test/test_urllib2.py ============================================================================== --- python/trunk/Lib/test/test_urllib2.py (original) +++ python/trunk/Lib/test/test_urllib2.py Sun May 24 11:14:50 2009 @@ -939,6 +939,21 @@ self.assertEqual([(handlers[0], "http_open")], [tup[0:2] for tup in o.calls]) + def test_proxy_https(self): + o = OpenerDirector() + ph = urllib2.ProxyHandler(dict(https='proxy.example.com:3128')) + o.add_handler(ph) + meth_spec = [ + [("https_open","return response")] + ] + handlers = add_ordered_mock_handlers(o, meth_spec) + req = Request("https://www.example.com/") + self.assertEqual(req.get_host(), "www.example.com") + r = o.open(req) + self.assertEqual(req.get_host(), "proxy.example.com:3128") + self.assertEqual([(handlers[0], "https_open")], + [tup[0:2] for tup in o.calls]) + def test_basic_auth(self, quote_char='"'): opener = OpenerDirector() password_manager = MockPasswordManager() Modified: python/trunk/Lib/urllib2.py ============================================================================== --- python/trunk/Lib/urllib2.py (original) +++ python/trunk/Lib/urllib2.py Sun May 24 11:14:50 2009 @@ -192,6 +192,7 @@ # self.__r_type is what's left after doing the splittype self.host = None self.port = None + self._tunnel_host = None self.data = data self.headers = {} for key, value in headers.items(): @@ -252,8 +253,13 @@ return self.__r_host def set_proxy(self, host, type): - self.host, self.type = host, type - self.__r_host = self.__original + if self.type == 'https' and not self._tunnel_host: + self._tunnel_host = self.host + else: + self.type = type + self.__r_host = self.__original + + self.host = host def has_proxy(self): return self.__r_host == self.__original @@ -700,7 +706,7 @@ req.add_header('Proxy-authorization', 'Basic ' + creds) hostport = unquote(hostport) req.set_proxy(hostport, proxy_type) - if orig_type == proxy_type: + if orig_type == proxy_type or orig_type == 'https': # let other handlers take care of it return None else: @@ -1098,6 +1104,10 @@ headers["Connection"] = "close" headers = dict( (name.title(), val) for name, val in headers.items()) + + if req._tunnel_host: + h.set_tunnel(req._tunnel_host) + try: h.request(req.get_method(), req.get_selector(), req.data, headers) try: Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun May 24 11:14:50 2009 @@ -302,6 +302,9 @@ Library ------- +- Issue #1424152: Fix for httplib, urllib2 to support SSL while working through + proxy. Original patch by Christopher Li, changes made by Senthil Kumaran. + - Issue #1983: Fix functions taking or returning a process identifier to use the dedicated C type ``pid_t`` instead of a C ``int``. Some platforms have a process identifier type wider than the standard C integer type. From nnorwitz at gmail.com Sun May 24 11:32:59 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 24 May 2009 05:32:59 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090524093259.GA8070@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 Less important issues: ---------------------- test_file leaked [0, 0, 77] references, sum=77 test_filecmp leaked [0, -77, 0] references, sum=-77 test_smtplib leaked [120, -208, 0] references, sum=-88 test_socketserver leaked [69, -69, 0] references, sum=0 test_sys leaked [-21, 0, 42] references, sum=21 test_threading leaked [48, 48, 48] references, sum=144 test_urllib2_localnet leaked [0, 283, -283] references, sum=0 test_xmlrpc leaked [-50, -33, 0] references, sum=-83 From python-checkins at python.org Sun May 24 13:58:35 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 24 May 2009 13:58:35 +0200 (CEST) Subject: [Python-checkins] r72881 - python/branches/py3k/Modules/posixmodule.c Message-ID: <20090524115835.F026FD3DD@mail.python.org> Author: antoine.pitrou Date: Sun May 24 13:58:35 2009 New Revision: 72881 Log: Try to fix building under Windows (where SIZEOF_PID_T apparently doesn't exist) Modified: python/branches/py3k/Modules/posixmodule.c Modified: python/branches/py3k/Modules/posixmodule.c ============================================================================== --- python/branches/py3k/Modules/posixmodule.c (original) +++ python/branches/py3k/Modules/posixmodule.c Sun May 24 13:58:35 2009 @@ -304,8 +304,7 @@ #endif /* UNION_WAIT */ /* Issue #1983: pid_t can be longer than a C long on some systems */ -#ifdef SIZEOF_PID_T -#if SIZEOF_PID_T == SIZEOF_INT +#if !defined(SIZEOF_PID_T) || SIZEOF_PID_T == SIZEOF_INT #define PARSE_PID "i" #define PyLong_FromPid PyLong_FromLong #define PyLong_AsPid PyLong_AsLong @@ -319,7 +318,6 @@ #define PyLong_AsPid PyLong_AsLongLong #else #error "sizeof(pid_t) is neither sizeof(int), sizeof(long) or sizeof(long long)" -#endif #endif /* SIZEOF_PID_T */ /* Don't use the "_r" form if we don't need it (also, won't have a From nnorwitz at gmail.com Mon May 25 00:22:24 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Sun, 24 May 2009 18:22:24 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (2) Message-ID: <20090524222224.GA12229@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 test_ssl leaked [0, 322, 0] references, sum=322 Less important issues: ---------------------- test_asynchat leaked [0, 139, -139] references, sum=0 test_cmd_line leaked [0, 0, -25] references, sum=-25 test_popen2 leaked [0, 0, 29] references, sum=29 test_smtplib leaked [0, 84, 11] references, sum=95 test_socketserver leaked [0, 80, -80] references, sum=0 test_threading leaked [48, 53, 43] references, sum=144 test_xmlrpc leaked [-277, 2, 0] references, sum=-275 From nnorwitz at gmail.com Mon May 25 11:28:32 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Mon, 25 May 2009 05:28:32 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090525092832.GA31161@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 Less important issues: ---------------------- test_file leaked [78, -78, 70] references, sum=70 test_smtplib leaked [-111, 2, -92] references, sum=-201 test_sys leaked [-21, 42, -21] references, sum=0 test_threading leaked [48, 48, 48] references, sum=144 From python-checkins at python.org Sun May 24 14:15:05 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 24 May 2009 14:15:05 +0200 (CEST) Subject: [Python-checkins] r72882 - python/trunk/Modules/posixmodule.c Message-ID: <20090524121505.10E2BD538@mail.python.org> Author: antoine.pitrou Date: Sun May 24 14:15:04 2009 New Revision: 72882 Log: Fix build under Windows Modified: python/trunk/Modules/posixmodule.c Modified: python/trunk/Modules/posixmodule.c ============================================================================== --- python/trunk/Modules/posixmodule.c (original) +++ python/trunk/Modules/posixmodule.c Sun May 24 14:15:04 2009 @@ -312,8 +312,7 @@ #endif /* UNION_WAIT */ /* Issue #1983: pid_t can be longer than a C long on some systems */ -#ifdef SIZEOF_PID_T -#if SIZEOF_PID_T == SIZEOF_INT +#if !defined(SIZEOF_PID_T) || SIZEOF_PID_T == SIZEOF_INT #define PARSE_PID "i" #define PyLong_FromPid PyInt_FromLong #define PyLong_AsPid PyInt_AsLong @@ -327,7 +326,6 @@ #define PyLong_AsPid PyInt_AsLongLong #else #error "sizeof(pid_t) is neither sizeof(int), sizeof(long) or sizeof(long long)" -#endif #endif /* SIZEOF_PID_T */ /* Don't use the "_r" form if we don't need it (also, won't have a From python-checkins at python.org Sun May 24 14:17:07 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 24 May 2009 14:17:07 +0200 (CEST) Subject: [Python-checkins] r72883 - in python/branches/release26-maint: Modules/posixmodule.c Message-ID: <20090524121707.A9289D3E7@mail.python.org> Author: antoine.pitrou Date: Sun May 24 14:17:07 2009 New Revision: 72883 Log: Merged revisions 72882 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72882 | antoine.pitrou | 2009-05-24 14:15:04 +0200 (dim., 24 mai 2009) | 3 lines Fix build under Windows ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Modules/posixmodule.c Modified: python/branches/release26-maint/Modules/posixmodule.c ============================================================================== --- python/branches/release26-maint/Modules/posixmodule.c (original) +++ python/branches/release26-maint/Modules/posixmodule.c Sun May 24 14:17:07 2009 @@ -311,8 +311,7 @@ #endif /* UNION_WAIT */ /* Issue #1983: pid_t can be longer than a C long on some systems */ -#ifdef SIZEOF_PID_T -#if SIZEOF_PID_T == SIZEOF_INT +#if !defined(SIZEOF_PID_T) || SIZEOF_PID_T == SIZEOF_INT #define PARSE_PID "i" #define PyLong_FromPid PyInt_FromLong #define PyLong_AsPid PyInt_AsLong @@ -326,7 +325,6 @@ #define PyLong_AsPid PyInt_AsLongLong #else #error "sizeof(pid_t) is neither sizeof(int), sizeof(long) or sizeof(long long)" -#endif #endif /* SIZEOF_PID_T */ /* Don't use the "_r" form if we don't need it (also, won't have a From python-checkins at python.org Sun May 24 14:17:24 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 24 May 2009 14:17:24 +0200 (CEST) Subject: [Python-checkins] r72884 - python/branches/py3k Message-ID: <20090524121724.99E32C452@mail.python.org> Author: antoine.pitrou Date: Sun May 24 14:17:24 2009 New Revision: 72884 Log: Blocked revisions 72882 via svnmerge ........ r72882 | antoine.pitrou | 2009-05-24 14:15:04 +0200 (dim., 24 mai 2009) | 3 lines Fix build under Windows ........ Modified: python/branches/py3k/ (props changed) From buildbot at python.org Sun May 24 14:42:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 24 May 2009 12:42:14 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090524124214.E8D79D488@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/792 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun May 24 14:42:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 24 May 2009 12:42:19 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090524124219.47905D489@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1364 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_bsddb3 make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun May 24 14:48:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 24 May 2009 12:48:11 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090524124812.09FA0C43F@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/732 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sun May 24 16:45:53 2009 From: python-checkins at python.org (r.david.murray) Date: Sun, 24 May 2009 16:45:53 +0200 (CEST) Subject: [Python-checkins] r72885 - python/branches/py3k Message-ID: <20090524144553.3F1C6D5E5@mail.python.org> Author: r.david.murray Date: Sun May 24 16:45:53 2009 New Revision: 72885 Log: Recorded merge of revisions 72878 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72878 | r.david.murray | 2009-05-23 17:48:06 -0400 (Sat, 23 May 2009) | 2 lines Add smtplib test from issue 5259. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Sun May 24 16:48:53 2009 From: python-checkins at python.org (r.david.murray) Date: Sun, 24 May 2009 16:48:53 +0200 (CEST) Subject: [Python-checkins] r72886 - in python/branches/release26-maint: Lib/test/test_smtplib.py Message-ID: <20090524144853.3B3DFD4B9@mail.python.org> Author: r.david.murray Date: Sun May 24 16:48:53 2009 New Revision: 72886 Log: Merged revisions 72878 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72878 | r.david.murray | 2009-05-23 17:48:06 -0400 (Sat, 23 May 2009) | 2 lines Add smtplib test from issue 5259. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_smtplib.py Modified: python/branches/release26-maint/Lib/test/test_smtplib.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_smtplib.py (original) +++ python/branches/release26-maint/Lib/test/test_smtplib.py Sun May 24 16:48:53 2009 @@ -276,6 +276,9 @@ 'Mrs.C at somewhereesle.com':'Ruth C', } +sim_auth = ('Mr.A at somewhere.com', 'somepassword') +sim_auth_b64encoded = 'AE1yLkFAc29tZXdoZXJlLmNvbQBzb21lcGFzc3dvcmQ=' + sim_lists = {'list-1':['Mr.A at somewhere.com','Mrs.C at somewhereesle.com'], 'list-2':['Ms.B at somewhere.com',], } @@ -288,6 +291,7 @@ '250-SIZE 20000000\r\n' \ '250-STARTTLS\r\n' \ '250-DELIVERBY\r\n' \ + '250-AUTH PLAIN\r\n' \ '250 HELP' self.push(resp) @@ -316,6 +320,16 @@ else: self.push('550 No access for you!') + def smtp_AUTH(self, arg): + mech, auth = arg.split() + if mech.lower() == 'plain': + if auth == sim_auth_b64encoded: + self.push('235 ok, go ahead') + else: + self.push('550 No access for you!') + else: + self.push('504 auth type unimplemented') + class SimSMTPServer(smtpd.SMTPServer): def handle_accept(self): @@ -364,6 +378,7 @@ 'size': '20000000', 'starttls': '', 'deliverby': '', + 'auth': ' PLAIN', 'help': '', } @@ -401,6 +416,11 @@ self.assertEqual(smtp.expn(u), expected_unknown) smtp.quit() + def testAUTH(self): + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + + expected_auth_ok = (235, b'ok, go ahead') + self.assertEqual(smtp.login(sim_auth[0], sim_auth[1]), expected_auth_ok) def test_main(verbose=None): From python-checkins at python.org Sun May 24 17:40:09 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 24 May 2009 17:40:09 +0200 (CEST) Subject: [Python-checkins] r72887 - in python/trunk: Lib/test/test_fcntl.py Misc/NEWS Modules/fcntlmodule.c Message-ID: <20090524154009.D4EF5C3E6@mail.python.org> Author: antoine.pitrou Date: Sun May 24 17:40:09 2009 New Revision: 72887 Log: Issue #1309352: fcntl now converts its third arguments to a C `long` rather than an int, which makes some operations possible under 64-bit Linux (e.g. DN_MULTISHOT with F_NOTIFY). Modified: python/trunk/Lib/test/test_fcntl.py python/trunk/Misc/NEWS python/trunk/Modules/fcntlmodule.c Modified: python/trunk/Lib/test/test_fcntl.py ============================================================================== --- python/trunk/Lib/test/test_fcntl.py (original) +++ python/trunk/Lib/test/test_fcntl.py Sun May 24 17:40:09 2009 @@ -61,7 +61,7 @@ self.f = None def tearDown(self): - if not self.f.closed: + if self.f and not self.f.closed: self.f.close() unlink(TESTFN) @@ -85,6 +85,21 @@ rv = fcntl.fcntl(self.f, fcntl.F_SETLKW, lockdata) self.f.close() + def test_fcntl_64_bit(self): + # Issue #1309352: fcntl shouldn't fail when the third arg fits in a + # C 'long' but not in a C 'int'. + try: + cmd = fcntl.F_NOTIFY + # This flag is larger than 2**31 in 64-bit builds + flags = fcntl.DN_MULTISHOT + except AttributeError: + self.skipTest("F_NOTIFY or DN_MULTISHOT unavailable") + fd = os.open(os.path.dirname(os.path.abspath(TESTFN)), os.O_RDONLY) + try: + fcntl.fcntl(fd, cmd, flags) + finally: + os.close(fd) + def test_main(): run_unittest(TestFcntl) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun May 24 17:40:09 2009 @@ -302,6 +302,10 @@ Library ------- +- Issue #1309352: fcntl now converts its third arguments to a C `long` rather + than an int, which makes some operations possible under 64-bit Linux (e.g. + DN_MULTISHOT with F_NOTIFY). + - Issue #1424152: Fix for httplib, urllib2 to support SSL while working through proxy. Original patch by Christopher Li, changes made by Senthil Kumaran. Modified: python/trunk/Modules/fcntlmodule.c ============================================================================== --- python/trunk/Modules/fcntlmodule.c (original) +++ python/trunk/Modules/fcntlmodule.c Sun May 24 17:40:09 2009 @@ -34,7 +34,7 @@ { int fd; int code; - int arg; + long arg; int ret; char *str; Py_ssize_t len; @@ -61,7 +61,7 @@ PyErr_Clear(); arg = 0; if (!PyArg_ParseTuple(args, - "O&i|i;fcntl requires a file or file descriptor," + "O&i|l;fcntl requires a file or file descriptor," " an integer and optionally a third integer or a string", conv_descriptor, &fd, &code, &arg)) { return NULL; From python-checkins at python.org Sun May 24 17:41:43 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 24 May 2009 17:41:43 +0200 (CEST) Subject: [Python-checkins] r72888 - in python/branches/release26-maint: Lib/test/test_fcntl.py Misc/NEWS Modules/fcntlmodule.c Message-ID: <20090524154143.E58D6C3E6@mail.python.org> Author: antoine.pitrou Date: Sun May 24 17:41:43 2009 New Revision: 72888 Log: Merged revisions 72887 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72887 | antoine.pitrou | 2009-05-24 17:40:09 +0200 (dim., 24 mai 2009) | 6 lines Issue #1309352: fcntl now converts its third arguments to a C `long` rather than an int, which makes some operations possible under 64-bit Linux (e.g. DN_MULTISHOT with F_NOTIFY). ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_fcntl.py python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/fcntlmodule.c Modified: python/branches/release26-maint/Lib/test/test_fcntl.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_fcntl.py (original) +++ python/branches/release26-maint/Lib/test/test_fcntl.py Sun May 24 17:41:43 2009 @@ -57,7 +57,7 @@ self.f = None def tearDown(self): - if not self.f.closed: + if self.f and not self.f.closed: self.f.close() unlink(TESTFN) @@ -81,6 +81,21 @@ rv = fcntl.fcntl(self.f, fcntl.F_SETLKW, lockdata) self.f.close() + def test_fcntl_64_bit(self): + # Issue #1309352: fcntl shouldn't fail when the third arg fits in a + # C 'long' but not in a C 'int'. + try: + cmd = fcntl.F_NOTIFY + # This flag is larger than 2**31 in 64-bit builds + flags = fcntl.DN_MULTISHOT + except AttributeError: + self.skipTest("F_NOTIFY or DN_MULTISHOT unavailable") + fd = os.open(os.path.dirname(os.path.abspath(TESTFN)), os.O_RDONLY) + try: + fcntl.fcntl(fd, cmd, flags) + finally: + os.close(fd) + def test_main(): run_unittest(TestFcntl) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sun May 24 17:41:43 2009 @@ -50,6 +50,10 @@ Library ------- +- Issue #1309352: fcntl now converts its third arguments to a C `long` rather + than an int, which makes some operations possible under 64-bit Linux (e.g. + DN_MULTISHOT with F_NOTIFY). + - Issue #1983: Fix functions taking or returning a process identifier to use the dedicated C type ``pid_t`` instead of a C ``int``. Some platforms have a process identifier type wider than the standard C integer type. Modified: python/branches/release26-maint/Modules/fcntlmodule.c ============================================================================== --- python/branches/release26-maint/Modules/fcntlmodule.c (original) +++ python/branches/release26-maint/Modules/fcntlmodule.c Sun May 24 17:41:43 2009 @@ -34,7 +34,7 @@ { int fd; int code; - int arg; + long arg; int ret; char *str; Py_ssize_t len; @@ -61,7 +61,7 @@ PyErr_Clear(); arg = 0; if (!PyArg_ParseTuple(args, - "O&i|i;fcntl requires a file or file descriptor," + "O&i|l;fcntl requires a file or file descriptor," " an integer and optionally a third integer or a string", conv_descriptor, &fd, &code, &arg)) { return NULL; From python-checkins at python.org Sun May 24 17:46:13 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 24 May 2009 17:46:13 +0200 (CEST) Subject: [Python-checkins] r72889 - in python/branches/py3k: Lib/test/test_fcntl.py Misc/NEWS Modules/fcntlmodule.c Message-ID: <20090524154613.9AE0DC4A9@mail.python.org> Author: antoine.pitrou Date: Sun May 24 17:46:13 2009 New Revision: 72889 Log: Merged revisions 72887 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72887 | antoine.pitrou | 2009-05-24 17:40:09 +0200 (dim., 24 mai 2009) | 6 lines Issue #1309352: fcntl now converts its third arguments to a C `long` rather than an int, which makes some operations possible under 64-bit Linux (e.g. DN_MULTISHOT with F_NOTIFY). ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_fcntl.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/fcntlmodule.c Modified: python/branches/py3k/Lib/test/test_fcntl.py ============================================================================== --- python/branches/py3k/Lib/test/test_fcntl.py (original) +++ python/branches/py3k/Lib/test/test_fcntl.py Sun May 24 17:46:13 2009 @@ -59,7 +59,7 @@ self.f = None def tearDown(self): - if not self.f.closed: + if self.f and not self.f.closed: self.f.close() unlink(TESTFN) @@ -83,6 +83,21 @@ rv = fcntl.fcntl(self.f, fcntl.F_SETLKW, lockdata) self.f.close() + def test_fcntl_64_bit(self): + # Issue #1309352: fcntl shouldn't fail when the third arg fits in a + # C 'long' but not in a C 'int'. + try: + cmd = fcntl.F_NOTIFY + # This flag is larger than 2**31 in 64-bit builds + flags = fcntl.DN_MULTISHOT + except AttributeError: + self.skipTest("F_NOTIFY or DN_MULTISHOT unavailable") + fd = os.open(os.path.dirname(os.path.abspath(TESTFN)), os.O_RDONLY) + try: + fcntl.fcntl(fd, cmd, flags) + finally: + os.close(fd) + def test_main(): run_unittest(TestFcntl) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun May 24 17:46:13 2009 @@ -32,6 +32,10 @@ Library ------- +- Issue #1309352: fcntl now converts its third arguments to a C `long` rather + than an int, which makes some operations possible under 64-bit Linux (e.g. + DN_MULTISHOT with F_NOTIFY). + - Issue #5761: Add the name of the underlying file to the repr() of various IO objects. Modified: python/branches/py3k/Modules/fcntlmodule.c ============================================================================== --- python/branches/py3k/Modules/fcntlmodule.c (original) +++ python/branches/py3k/Modules/fcntlmodule.c Sun May 24 17:46:13 2009 @@ -34,7 +34,7 @@ { int fd; int code; - int arg; + long arg; int ret; char *str; Py_ssize_t len; @@ -61,7 +61,7 @@ PyErr_Clear(); arg = 0; if (!PyArg_ParseTuple(args, - "O&i|i;fcntl requires a file or file descriptor," + "O&i|l;fcntl requires a file or file descriptor," " an integer and optionally a third integer or a string", conv_descriptor, &fd, &code, &arg)) { return NULL; From buildbot at python.org Sun May 24 18:55:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 24 May 2009 16:55:13 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090524165513.A92E9C479@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/734 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sun May 24 20:00:13 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sun, 24 May 2009 20:00:13 +0200 (CEST) Subject: [Python-checkins] r72890 - python/trunk/Doc/library/httplib.rst Message-ID: <20090524180013.A13D9D358@mail.python.org> Author: gregory.p.smith Date: Sun May 24 20:00:13 2009 New Revision: 72890 Log: add a versionadded tag for set_tunnel Modified: python/trunk/Doc/library/httplib.rst Modified: python/trunk/Doc/library/httplib.rst ============================================================================== --- python/trunk/Doc/library/httplib.rst (original) +++ python/trunk/Doc/library/httplib.rst Sun May 24 20:00:13 2009 @@ -433,6 +433,8 @@ Set the host and the port for HTTP Connect Tunnelling. Normally used when it is required to do HTTPS Conection through a proxy server. + .. versionadded:: 2.7 + .. method:: HTTPConnection.connect() From python-checkins at python.org Sun May 24 21:10:52 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 24 May 2009 21:10:52 +0200 (CEST) Subject: [Python-checkins] r72891 - in python/trunk: Lib/distutils/command/bdist_msi.py Misc/NEWS Message-ID: <20090524191052.A07ECD29E@mail.python.org> Author: martin.v.loewis Date: Sun May 24 21:10:52 2009 New Revision: 72891 Log: Issue #6065: Do not try to build a version-independent installer if the package has extension modules. Also add NEWS entry for #5311. Modified: python/trunk/Lib/distutils/command/bdist_msi.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/command/bdist_msi.py ============================================================================== --- python/trunk/Lib/distutils/command/bdist_msi.py (original) +++ python/trunk/Lib/distutils/command/bdist_msi.py Sun May 24 21:10:52 2009 @@ -141,6 +141,8 @@ bdist_base = self.get_finalized_command('bdist').bdist_base self.bdist_dir = os.path.join(bdist_base, 'msi') short_version = get_python_version() + if (not self.target_version) and self.distribution.has_ext_modules(): + self.target_version = short_version if self.target_version: self.versions = [self.target_version] if not self.skip_build and self.distribution.has_ext_modules()\ Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun May 24 21:10:52 2009 @@ -302,6 +302,9 @@ Library ------- +- Issue #5311: bdist_msi can now build packages that do not depend on a + specific Python version. + - Issue #1309352: fcntl now converts its third arguments to a C `long` rather than an int, which makes some operations possible under 64-bit Linux (e.g. DN_MULTISHOT with F_NOTIFY). From python-checkins at python.org Sun May 24 21:19:17 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 24 May 2009 21:19:17 +0200 (CEST) Subject: [Python-checkins] r72892 - in python/branches/py3k: Lib/distutils/command/bdist_msi.py Misc/NEWS Message-ID: <20090524191917.B84A8D29E@mail.python.org> Author: martin.v.loewis Date: Sun May 24 21:19:17 2009 New Revision: 72892 Log: Merged revisions 72891 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72891 | martin.v.loewis | 2009-05-24 21:10:52 +0200 (So, 24 Mai 2009) | 5 lines Issue #6065: Do not try to build a version-independent installer if the package has extension modules. Also add NEWS entry for #5311. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/command/bdist_msi.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/distutils/command/bdist_msi.py ============================================================================== --- python/branches/py3k/Lib/distutils/command/bdist_msi.py (original) +++ python/branches/py3k/Lib/distutils/command/bdist_msi.py Sun May 24 21:19:17 2009 @@ -141,6 +141,8 @@ bdist_base = self.get_finalized_command('bdist').bdist_base self.bdist_dir = os.path.join(bdist_base, 'msi') short_version = get_python_version() + if (not self.target_version) and self.distribution.has_ext_modules(): + self.target_version = short_version if self.target_version: self.versions = [self.target_version] if not self.skip_build and self.distribution.has_ext_modules()\ Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun May 24 21:19:17 2009 @@ -230,6 +230,9 @@ Library ------- +- Issue #5311: bdist_msi can now build packages that do not depend on a + specific Python version. + - Issue #5940: distutils.command.build_clib.check_library_list was not doing the right type checkings anymore. From python-checkins at python.org Sun May 24 21:30:52 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 24 May 2009 21:30:52 +0200 (CEST) Subject: [Python-checkins] r72893 - in python/trunk: Lib/test/test_zipfile.py Lib/zipfile.py Misc/NEWS Message-ID: <20090524193052.7E419D2A4@mail.python.org> Author: martin.v.loewis Date: Sun May 24 21:30:52 2009 New Revision: 72893 Log: Issue #6050: Don't fail extracting a directory from a zipfile if the directory already exists. Modified: python/trunk/Lib/test/test_zipfile.py python/trunk/Lib/zipfile.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/test/test_zipfile.py ============================================================================== --- python/trunk/Lib/test/test_zipfile.py (original) +++ python/trunk/Lib/test/test_zipfile.py Sun May 24 21:30:52 2009 @@ -1023,6 +1023,11 @@ self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a", "b"))) self.assertTrue(os.path.exists(os.path.join(TESTFN2, "a", "b", "c"))) + def test_bug_6050(self): + # Extraction should succeed if directories already exist + os.mkdir(os.path.join(TESTFN2, "a")) + self.testExtractDir() + def testStoreDir(self): os.mkdir(os.path.join(TESTFN2, "x")) zipf = zipfile.ZipFile(TESTFN, "w") Modified: python/trunk/Lib/zipfile.py ============================================================================== --- python/trunk/Lib/zipfile.py (original) +++ python/trunk/Lib/zipfile.py Sun May 24 21:30:52 2009 @@ -971,7 +971,8 @@ os.makedirs(upperdirs) if member.filename[-1] == '/': - os.mkdir(targetpath) + if not os.path.isdir(targetpath): + os.mkdir(targetpath) return targetpath source = self.open(member, pwd=pwd) Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun May 24 21:30:52 2009 @@ -302,6 +302,9 @@ Library ------- +- Issue #6050: Don't fail extracting a directory from a zipfile if + the directory already exists. + - Issue #5311: bdist_msi can now build packages that do not depend on a specific Python version. From python-checkins at python.org Sun May 24 21:42:14 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 24 May 2009 21:42:14 +0200 (CEST) Subject: [Python-checkins] r72894 - in python/branches/release26-maint: Lib/test/test_zipfile.py Lib/zipfile.py Misc/NEWS Message-ID: <20090524194214.79B5AD2A4@mail.python.org> Author: martin.v.loewis Date: Sun May 24 21:42:14 2009 New Revision: 72894 Log: Merged revisions 72893 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72893 | martin.v.loewis | 2009-05-24 21:30:52 +0200 (So, 24 Mai 2009) | 3 lines Issue #6050: Don't fail extracting a directory from a zipfile if the directory already exists. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_zipfile.py python/branches/release26-maint/Lib/zipfile.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/test/test_zipfile.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_zipfile.py (original) +++ python/branches/release26-maint/Lib/test/test_zipfile.py Sun May 24 21:42:14 2009 @@ -994,6 +994,11 @@ self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a", "b"))) self.assertTrue(os.path.exists(os.path.join(TESTFN2, "a", "b", "c"))) + def test_bug_6050(self): + # Extraction should succeed if directories already exist + os.mkdir(os.path.join(TESTFN2, "a")) + self.testExtractDir() + def testStoreDir(self): os.mkdir(os.path.join(TESTFN2, "x")) zipf = zipfile.ZipFile(TESTFN, "w") Modified: python/branches/release26-maint/Lib/zipfile.py ============================================================================== --- python/branches/release26-maint/Lib/zipfile.py (original) +++ python/branches/release26-maint/Lib/zipfile.py Sun May 24 21:42:14 2009 @@ -959,7 +959,8 @@ os.makedirs(upperdirs) if member.filename[-1] == '/': - os.mkdir(targetpath) + if not os.path.isdir(targetpath): + os.mkdir(targetpath) return targetpath source = self.open(member, pwd=pwd) Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sun May 24 21:42:14 2009 @@ -50,6 +50,9 @@ Library ------- +- Issue #6050: Don't fail extracting a directory from a zipfile if + the directory already exists. + - Issue #1309352: fcntl now converts its third arguments to a C `long` rather than an int, which makes some operations possible under 64-bit Linux (e.g. DN_MULTISHOT with F_NOTIFY). From python-checkins at python.org Sun May 24 21:47:22 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 24 May 2009 21:47:22 +0200 (CEST) Subject: [Python-checkins] r72895 - in python/branches/py3k: Lib/test/test_zipfile.py Lib/zipfile.py Misc/NEWS Message-ID: <20090524194722.AA7A8D272@mail.python.org> Author: martin.v.loewis Date: Sun May 24 21:47:22 2009 New Revision: 72895 Log: Merged revisions 72893 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72893 | martin.v.loewis | 2009-05-24 21:30:52 +0200 (So, 24 Mai 2009) | 3 lines Issue #6050: Don't fail extracting a directory from a zipfile if the directory already exists. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_zipfile.py python/branches/py3k/Lib/zipfile.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/test/test_zipfile.py ============================================================================== --- python/branches/py3k/Lib/test/test_zipfile.py (original) +++ python/branches/py3k/Lib/test/test_zipfile.py Sun May 24 21:47:22 2009 @@ -1012,6 +1012,11 @@ self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a", "b"))) self.assertTrue(os.path.exists(os.path.join(TESTFN2, "a", "b", "c"))) + def test_bug_6050(self): + # Extraction should succeed if directories already exist + os.mkdir(os.path.join(TESTFN2, "a")) + self.testExtractDir() + def testStoreDir(self): os.mkdir(os.path.join(TESTFN2, "x")) zipf = zipfile.ZipFile(TESTFN, "w") Modified: python/branches/py3k/Lib/zipfile.py ============================================================================== --- python/branches/py3k/Lib/zipfile.py (original) +++ python/branches/py3k/Lib/zipfile.py Sun May 24 21:47:22 2009 @@ -978,7 +978,8 @@ os.makedirs(upperdirs) if member.filename[-1] == '/': - os.mkdir(targetpath) + if not os.path.isdir(targetpath): + os.mkdir(targetpath) return targetpath source = self.open(member, pwd=pwd) Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun May 24 21:47:22 2009 @@ -32,6 +32,9 @@ Library ------- +- Issue #6050: Don't fail extracting a directory from a zipfile if + the directory already exists. + - Issue #1309352: fcntl now converts its third arguments to a C `long` rather than an int, which makes some operations possible under 64-bit Linux (e.g. DN_MULTISHOT with F_NOTIFY). From python-checkins at python.org Sun May 24 21:53:34 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 24 May 2009 21:53:34 +0200 (CEST) Subject: [Python-checkins] r72896 - in python/branches/release30-maint: Lib/test/test_zipfile.py Lib/zipfile.py Misc/NEWS Message-ID: <20090524195334.1F3A8D345@mail.python.org> Author: martin.v.loewis Date: Sun May 24 21:53:33 2009 New Revision: 72896 Log: Merged revisions 72895 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72895 | martin.v.loewis | 2009-05-24 21:47:22 +0200 (So, 24 Mai 2009) | 10 lines Merged revisions 72893 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72893 | martin.v.loewis | 2009-05-24 21:30:52 +0200 (So, 24 Mai 2009) | 3 lines Issue #6050: Don't fail extracting a directory from a zipfile if the directory already exists. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_zipfile.py python/branches/release30-maint/Lib/zipfile.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/test/test_zipfile.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_zipfile.py (original) +++ python/branches/release30-maint/Lib/test/test_zipfile.py Sun May 24 21:53:33 2009 @@ -983,6 +983,11 @@ self.assertTrue(os.path.isdir(os.path.join(TESTFN2, "a", "b"))) self.assertTrue(os.path.exists(os.path.join(TESTFN2, "a", "b", "c"))) + def test_bug_6050(self): + # Extraction should succeed if directories already exist + os.mkdir(os.path.join(TESTFN2, "a")) + self.testExtractDir() + def testStoreDir(self): os.mkdir(os.path.join(TESTFN2, "x")) zipf = zipfile.ZipFile(TESTFN, "w") Modified: python/branches/release30-maint/Lib/zipfile.py ============================================================================== --- python/branches/release30-maint/Lib/zipfile.py (original) +++ python/branches/release30-maint/Lib/zipfile.py Sun May 24 21:53:33 2009 @@ -964,7 +964,8 @@ os.makedirs(upperdirs) if member.filename[-1] == '/': - os.mkdir(targetpath) + if not os.path.isdir(targetpath): + os.mkdir(targetpath) return targetpath source = self.open(member, pwd=pwd) Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Sun May 24 21:53:33 2009 @@ -65,6 +65,9 @@ Library ------- +- Issue #6050: Don't fail extracting a directory from a zipfile if + the directory already exists. + - Issue #5259: smtplib plain auth login no longer gives a traceback. Fix by Musashi Tamura, tests by Marcin Bachry. From buildbot at python.org Sun May 24 22:03:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 24 May 2009 20:03:48 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090524200349.04E8FD2A4@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1366 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: gregory.p.smith,martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Sun May 24 22:07:45 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 24 May 2009 22:07:45 +0200 (CEST) Subject: [Python-checkins] r72897 - python/branches/release26-maint/Lib/test/test_fcntl.py Message-ID: <20090524200745.8A89FD358@mail.python.org> Author: antoine.pitrou Date: Sun May 24 22:07:45 2009 New Revision: 72897 Log: The test-skipping API doesn't exist in 2.6 Modified: python/branches/release26-maint/Lib/test/test_fcntl.py Modified: python/branches/release26-maint/Lib/test/test_fcntl.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_fcntl.py (original) +++ python/branches/release26-maint/Lib/test/test_fcntl.py Sun May 24 22:07:45 2009 @@ -89,7 +89,8 @@ # This flag is larger than 2**31 in 64-bit builds flags = fcntl.DN_MULTISHOT except AttributeError: - self.skipTest("F_NOTIFY or DN_MULTISHOT unavailable") + # F_NOTIFY or DN_MULTISHOT unavailable, skipping + return fd = os.open(os.path.dirname(os.path.abspath(TESTFN)), os.O_RDONLY) try: fcntl.fcntl(fd, cmd, flags) From python-checkins at python.org Sun May 24 22:23:58 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 24 May 2009 22:23:58 +0200 (CEST) Subject: [Python-checkins] r72898 - in python/trunk: Makefile.pre.in Misc/ACKS Misc/NEWS Misc/python.pc.in configure configure.in pyconfig.h.in Message-ID: <20090524202358.30B58D259@mail.python.org> Author: antoine.pitrou Date: Sun May 24 22:23:57 2009 New Revision: 72898 Log: Issue #3585: Add pkg-config support. It creates a python-2.7.pc file and a python.pc symlink in the $(LIBDIR)/pkgconfig directory. Patch by Clinton Roy. Added: python/trunk/Misc/python.pc.in (contents, props changed) Modified: python/trunk/Makefile.pre.in python/trunk/Misc/ACKS python/trunk/Misc/NEWS python/trunk/configure python/trunk/configure.in python/trunk/pyconfig.h.in Modified: python/trunk/Makefile.pre.in ============================================================================== --- python/trunk/Makefile.pre.in (original) +++ python/trunk/Makefile.pre.in Sun May 24 22:23:57 2009 @@ -770,6 +770,8 @@ (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON)) -rm -f $(DESTDIR)$(BINDIR)/python-config (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python-config) + -rm -f $(DESTDIR)$(LIBPC)/python.pc + (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python.pc) # Install the interpreter with $(VERSION) affixed # This goes into $(exec_prefix) @@ -946,8 +948,12 @@ # Install the library and miscellaneous stuff needed for extending/embedding # This goes into $(exec_prefix) LIBPL= $(LIBP)/config + +# pkgconfig directory +LIBPC= $(LIBDIR)/pkgconfig + libainstall: all - @for i in $(LIBDIR) $(LIBP) $(LIBPL); \ + @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \ do \ if test ! -d $(DESTDIR)$$i; then \ echo "Creating directory $$i"; \ @@ -974,6 +980,7 @@ $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config + $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh # Substitution happens here, as the completely-expanded BINDIR Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Sun May 24 22:23:57 2009 @@ -618,6 +618,7 @@ Donald Wallace Rouse II Liam Routt Craig Rowland +Clinton Roy Paul Rubin Sam Ruby Audun S. Runde Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun May 24 22:23:57 2009 @@ -971,6 +971,10 @@ Build ----- +- Issue #3585: Add pkg-config support. It creates a python-2.7.pc file + and a python.pc symlink in the $(LIBDIR)/pkgconfig directory. Patch by + Clinton Roy. + - Issue #6094: Build correctly with Subversion 1.7. - Issue #5847: Remove -n switch on "Edit with IDLE" menu item. Added: python/trunk/Misc/python.pc.in ============================================================================== --- (empty file) +++ python/trunk/Misc/python.pc.in Sun May 24 22:23:57 2009 @@ -0,0 +1,13 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Python +Description: Python library +Requires: +Version: @VERSION@ +Libs.private: @LIBS@ +Libs: -L${libdir} -lpython at VERSION@ +Cflags: -I${includedir}/python at VERSION@ + Modified: python/trunk/configure ============================================================================== --- python/trunk/configure (original) +++ python/trunk/configure Sun May 24 22:23:57 2009 @@ -1,12 +1,12 @@ #! /bin/sh -# From configure.in Revision: 72799 . +# From configure.in Revision: 72871 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for python 2.7. +# Generated by GNU Autoconf 2.63 for python 2.7. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -18,7 +18,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -40,17 +40,45 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' else - PATH_SEPARATOR=: + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. @@ -66,8 +94,6 @@ # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -90,7 +116,7 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -103,17 +129,10 @@ PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -135,7 +154,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -161,7 +180,7 @@ as_have_required=no fi - if test $as_have_required = yes && (eval ": + if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } @@ -243,7 +262,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -264,7 +283,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -344,10 +363,10 @@ if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi @@ -416,9 +435,10 @@ test \$exitcode = 0") || { echo No shell found that supports shell functions. - echo Please tell autoconf at gnu.org about your system, - echo including any error possibly output before this - echo message + echo Please tell bug-autoconf at gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. } @@ -454,7 +474,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -482,7 +502,6 @@ *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -495,19 +514,22 @@ rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -532,10 +554,10 @@ as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -616,128 +638,160 @@ # include #endif" -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -VERSION -SOVERSION -CONFIG_ARGS -UNIVERSALSDK -ARCH_RUN_32BIT -PYTHONFRAMEWORK -PYTHONFRAMEWORKIDENTIFIER -PYTHONFRAMEWORKDIR -PYTHONFRAMEWORKPREFIX -PYTHONFRAMEWORKINSTALLDIR -FRAMEWORKINSTALLFIRST -FRAMEWORKINSTALLLAST -FRAMEWORKALTINSTALLFIRST -FRAMEWORKALTINSTALLLAST -FRAMEWORKUNIXTOOLSPREFIX -MACHDEP -SGI_ABI -EXTRAPLATDIR -EXTRAMACHDEPPATH -CONFIGURE_MACOSX_DEPLOYMENT_TARGET -EXPORT_MACOSX_DEPLOYMENT_TARGET -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -CXX -MAINCC -CPP -GREP -EGREP -BUILDEXEEXT -LIBRARY -LDLIBRARY -DLLLIBRARY -BLDLIBRARY -LDLIBRARYDIR -INSTSONAME -RUNSHARED -LINKCC -GNULD -RANLIB -AR -ARFLAGS -SVNVERSION -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -LN -OPT -BASECFLAGS -UNIVERSAL_ARCH_FLAGS -OTHER_LIBTOOL_OPT -LIBTOOL_CRUFT -SO -LDSHARED -BLDSHARED -CCSHARED -LINKFORSHARED -CFLAGSFORSHARED -SHLIBS -USE_SIGNAL_MODULE -SIGNAL_OBJS -USE_THREAD_MODULE -LDLAST -THREADOBJ -DLINCLDIR -DYNLOADFILE -MACHDEP_OBJS -TRUE -LIBOBJS -HAVE_GETHOSTBYNAME_R_6_ARG -HAVE_GETHOSTBYNAME_R_5_ARG -HAVE_GETHOSTBYNAME_R_3_ARG -HAVE_GETHOSTBYNAME_R -HAVE_GETHOSTBYNAME -LIBM -LIBC -UNICODE_OBJS -THREADHEADERS +ac_subst_vars='LTLIBOBJS SRCDIRS -LTLIBOBJS' +THREADHEADERS +UNICODE_OBJS +LIBC +LIBM +HAVE_GETHOSTBYNAME +HAVE_GETHOSTBYNAME_R +HAVE_GETHOSTBYNAME_R_3_ARG +HAVE_GETHOSTBYNAME_R_5_ARG +HAVE_GETHOSTBYNAME_R_6_ARG +LIBOBJS +TRUE +MACHDEP_OBJS +DYNLOADFILE +DLINCLDIR +THREADOBJ +LDLAST +USE_THREAD_MODULE +SIGNAL_OBJS +USE_SIGNAL_MODULE +SHLIBS +CFLAGSFORSHARED +LINKFORSHARED +CCSHARED +BLDSHARED +LDSHARED +SO +LIBTOOL_CRUFT +OTHER_LIBTOOL_OPT +UNIVERSAL_ARCH_FLAGS +BASECFLAGS +OPT +LN +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +SVNVERSION +ARFLAGS +AR +RANLIB +GNULD +LINKCC +RUNSHARED +INSTSONAME +LDLIBRARYDIR +BLDLIBRARY +DLLLIBRARY +LDLIBRARY +LIBRARY +BUILDEXEEXT +EGREP +GREP +CPP +MAINCC +CXX +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +EXPORT_MACOSX_DEPLOYMENT_TARGET +CONFIGURE_MACOSX_DEPLOYMENT_TARGET +EXTRAMACHDEPPATH +EXTRAPLATDIR +SGI_ABI +MACHDEP +FRAMEWORKUNIXTOOLSPREFIX +FRAMEWORKALTINSTALLLAST +FRAMEWORKALTINSTALLFIRST +FRAMEWORKINSTALLLAST +FRAMEWORKINSTALLFIRST +PYTHONFRAMEWORKINSTALLDIR +PYTHONFRAMEWORKPREFIX +PYTHONFRAMEWORKDIR +PYTHONFRAMEWORKIDENTIFIER +PYTHONFRAMEWORK +ARCH_RUN_32BIT +UNIVERSALSDK +CONFIG_ARGS +SOVERSION +VERSION +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_universalsdk +with_universal_archs +with_framework_name +enable_framework +with_gcc +with_cxx_main +with_suffix +enable_shared +enable_profiling +with_pydebug +enable_toolbox_glue +with_libs +with_system_ffi +with_dbmliborder +with_signal_module +with_dec_threads +with_threads +with_thread +with_pth +enable_ipv6 +with_doc_strings +with_tsc +with_pymalloc +with_wctype_functions +with_fpectl +with_libm +with_libc +enable_big_digits +enable_unicode +' ac_precious_vars='build_alias host_alias target_alias @@ -752,6 +806,8 @@ # Initialize some variables set by options. ac_init_help= ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -850,13 +906,21 @@ datarootdir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; @@ -869,13 +933,21 @@ dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -1066,22 +1138,38 @@ ac_init_version=: ;; -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. @@ -1101,7 +1189,7 @@ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { echo "$as_me: error: unrecognized option: $ac_option + -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -1110,16 +1198,16 @@ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -1128,22 +1216,38 @@ if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi -# Be sure to have absolute directory names. +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. 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 do eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done @@ -1158,7 +1262,7 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -1174,10 +1278,10 @@ ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 + { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } @@ -1185,12 +1289,12 @@ if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1217,12 +1321,12 @@ fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. @@ -1271,9 +1375,9 @@ Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -1283,25 +1387,25 @@ For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --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] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/python] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --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] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/python] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1315,6 +1419,7 @@ cat <<\_ACEOF Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-universalsdk[=SDKDIR] @@ -1388,15 +1493,17 @@ if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1432,7 +1539,7 @@ echo && $SHELL "$ac_srcdir/configure" --help=recursive else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1442,10 +1549,10 @@ if $ac_init_version; then cat <<\_ACEOF python configure 2.7 -generated by GNU Autoconf 2.61 +generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1456,7 +1563,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by python $as_me 2.7, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -1492,7 +1599,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" + $as_echo "PATH: $as_dir" done IFS=$as_save_IFS @@ -1527,7 +1634,7 @@ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; @@ -1579,11 +1686,12 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -1613,9 +1721,9 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo @@ -1630,9 +1738,9 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1648,8 +1756,8 @@ echo fi test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -1691,21 +1799,24 @@ # Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" + ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site fi -shift -for ac_site_file +for ac_site_file in "$ac_site_file1" "$ac_site_file2" do + test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi @@ -1715,16 +1826,16 @@ # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1738,29 +1849,38 @@ eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1770,10 +1890,12 @@ fi done if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi @@ -1915,20 +2037,20 @@ UNIVERSAL_ARCHS="32-bit" -{ echo "$as_me:$LINENO: checking for --with-universal-archs" >&5 -echo $ECHO_N "checking for --with-universal-archs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-universal-archs" >&5 +$as_echo_n "checking for --with-universal-archs... " >&6; } # Check whether --with-universal-archs was given. if test "${with_universal_archs+set}" = set; then withval=$with_universal_archs; - { echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } + { $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } UNIVERSAL_ARCHS="$withval" else - { echo "$as_me:$LINENO: result: 32-bit" >&5 -echo "${ECHO_T}32-bit" >&6; } + { $as_echo "$as_me:$LINENO: result: 32-bit" >&5 +$as_echo "32-bit" >&6; } fi @@ -2052,8 +2174,8 @@ ## # Set name for machine-dependent library files -{ echo "$as_me:$LINENO: checking MACHDEP" >&5 -echo $ECHO_N "checking MACHDEP... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking MACHDEP" >&5 +$as_echo_n "checking MACHDEP... " >&6; } if test -z "$MACHDEP" then ac_sys_system=`uname -s` @@ -2216,14 +2338,14 @@ LDFLAGS="$SGI_ABI $LDFLAGS" MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'` fi -{ echo "$as_me:$LINENO: result: $MACHDEP" >&5 -echo "${ECHO_T}$MACHDEP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $MACHDEP" >&5 +$as_echo "$MACHDEP" >&6; } # And add extra plat-mac for darwin -{ echo "$as_me:$LINENO: checking EXTRAPLATDIR" >&5 -echo $ECHO_N "checking EXTRAPLATDIR... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking EXTRAPLATDIR" >&5 +$as_echo_n "checking EXTRAPLATDIR... " >&6; } if test -z "$EXTRAPLATDIR" then case $MACHDEP in @@ -2237,8 +2359,8 @@ ;; esac fi -{ echo "$as_me:$LINENO: result: $EXTRAPLATDIR" >&5 -echo "${ECHO_T}$EXTRAPLATDIR" >&6; } +{ $as_echo "$as_me:$LINENO: result: $EXTRAPLATDIR" >&5 +$as_echo "$EXTRAPLATDIR" >&6; } # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET, # it may influence the way we can build extensions, so distutils @@ -2248,11 +2370,11 @@ CONFIGURE_MACOSX_DEPLOYMENT_TARGET= EXPORT_MACOSX_DEPLOYMENT_TARGET='#' -{ echo "$as_me:$LINENO: checking machine type as reported by uname -m" >&5 -echo $ECHO_N "checking machine type as reported by uname -m... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking machine type as reported by uname -m" >&5 +$as_echo_n "checking machine type as reported by uname -m... " >&6; } ac_sys_machine=`uname -m` -{ echo "$as_me:$LINENO: result: $ac_sys_machine" >&5 -echo "${ECHO_T}$ac_sys_machine" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_sys_machine" >&5 +$as_echo "$ac_sys_machine" >&6; } # checks for alternative programs @@ -2264,8 +2386,8 @@ # XXX shouldn't some/most/all of this code be merged with the stuff later # on that fiddles with OPT and BASECFLAGS? -{ echo "$as_me:$LINENO: checking for --without-gcc" >&5 -echo $ECHO_N "checking for --without-gcc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --without-gcc" >&5 +$as_echo_n "checking for --without-gcc... " >&6; } # Check whether --with-gcc was given. if test "${with_gcc+set}" = set; then @@ -2298,8 +2420,8 @@ OPT="$OPT -O" ;; *) - { { echo "$as_me:$LINENO: error: Unknown BeOS platform \"$BE_HOST_CPU\"" >&5 -echo "$as_me: error: Unknown BeOS platform \"$BE_HOST_CPU\"" >&2;} + { { $as_echo "$as_me:$LINENO: error: Unknown BeOS platform \"$BE_HOST_CPU\"" >&5 +$as_echo "$as_me: error: Unknown BeOS platform \"$BE_HOST_CPU\"" >&2;} { (exit 1); exit 1; }; } ;; esac @@ -2313,15 +2435,15 @@ esac fi -{ echo "$as_me:$LINENO: result: $without_gcc" >&5 -echo "${ECHO_T}$without_gcc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $without_gcc" >&5 +$as_echo "$without_gcc" >&6; } # If the user switches compilers, we can't believe the cache if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" then - { { echo "$as_me:$LINENO: error: cached CC is different -- throw away $cache_file + { { $as_echo "$as_me:$LINENO: error: cached CC is different -- throw away $cache_file (it is also a good idea to do 'make clean' before compiling)" >&5 -echo "$as_me: error: cached CC is different -- throw away $cache_file +$as_echo "$as_me: error: cached CC is different -- throw away $cache_file (it is also a good idea to do 'make clean' before compiling)" >&2;} { (exit 1); exit 1; }; } fi @@ -2334,10 +2456,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2350,7 +2472,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2361,11 +2483,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2374,10 +2496,10 @@ ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2390,7 +2512,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2401,11 +2523,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2413,12 +2535,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2431,10 +2549,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2447,7 +2565,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2458,11 +2576,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2471,10 +2589,10 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2492,7 +2610,7 @@ continue fi ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2515,11 +2633,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2530,10 +2648,10 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2546,7 +2664,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2557,11 +2675,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2574,10 +2692,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2590,7 +2708,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2601,11 +2719,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2617,12 +2735,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2632,44 +2746,50 @@ fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF @@ -2688,27 +2808,22 @@ } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + ac_rmfiles= for ac_file in $ac_files do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done @@ -2719,10 +2834,11 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' @@ -2733,7 +2849,7 @@ do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most @@ -2760,25 +2876,27 @@ ac_file='' fi -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables +$as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then @@ -2787,49 +2905,53 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. +$as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi fi fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } -rm -f a.out a.exe conftest$ac_cv_exeext b.out +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will @@ -2838,31 +2960,33 @@ for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2885,40 +3009,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile +$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2944,20 +3071,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -2967,15 +3095,19 @@ ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes @@ -3002,20 +3134,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" @@ -3040,20 +3173,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag @@ -3079,20 +3213,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3107,8 +3242,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3124,10 +3259,10 @@ CFLAGS= fi fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC @@ -3198,20 +3333,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3227,15 +3363,15 @@ # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac @@ -3248,8 +3384,8 @@ -{ echo "$as_me:$LINENO: checking for --with-cxx-main=" >&5 -echo $ECHO_N "checking for --with-cxx-main=... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-cxx-main=" >&5 +$as_echo_n "checking for --with-cxx-main=... " >&6; } # Check whether --with-cxx_main was given. if test "${with_cxx_main+set}" = set; then @@ -3274,8 +3410,8 @@ fi -{ echo "$as_me:$LINENO: result: $with_cxx_main" >&5 -echo "${ECHO_T}$with_cxx_main" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_cxx_main" >&5 +$as_echo "$with_cxx_main" >&6; } preset_cxx="$CXX" if test -z "$CXX" @@ -3283,10 +3419,10 @@ case "$CC" in gcc) # Extract the first word of "g++", so it can be a program name with args. set dummy g++; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CXX in [\\/]* | ?:[\\/]*) @@ -3301,7 +3437,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3314,20 +3450,20 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ;; cc) # Extract the first word of "c++", so it can be a program name with args. set dummy c++; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CXX in [\\/]* | ?:[\\/]*) @@ -3342,7 +3478,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3355,11 +3491,11 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ;; @@ -3375,10 +3511,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. @@ -3391,7 +3527,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3402,11 +3538,11 @@ fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -3421,12 +3557,12 @@ fi if test "$preset_cxx" != "$CXX" then - { echo "$as_me:$LINENO: WARNING: + { $as_echo "$as_me:$LINENO: WARNING: By default, distutils will build C++ extension modules with \"$CXX\". If this is not intended, then set CXX on the configure command line. " >&5 -echo "$as_me: WARNING: +$as_echo "$as_me: WARNING: By default, distutils will build C++ extension modules with \"$CXX\". If this is not intended, then set CXX on the configure command line. @@ -3441,15 +3577,15 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -3481,20 +3617,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3518,13 +3655,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3532,7 +3670,7 @@ # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3557,8 +3695,8 @@ else ac_cv_prog_CPP=$CPP fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3586,20 +3724,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3623,13 +3762,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3637,7 +3777,7 @@ # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3653,11 +3793,13 @@ if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi ac_ext=c @@ -3667,42 +3809,37 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else + if test -z "$GREP"; then ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3717,145 +3854,578 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac + $ac_path_GREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + if test "${ac_cv_header_minix_config_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 +$as_echo_n "checking for minix/config.h... " >&6; } +if test "${ac_cv_header_minix_config_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +$as_echo "$ac_cv_header_minix_config_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5 +$as_echo_n "checking minix/config.h usability... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - $ac_path_GREP_found && break 3 - done -done + ac_header_compiler=no +fi -done -IFS=$as_save_IFS +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5 +$as_echo_n "checking minix/config.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no fi -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## -------------------------------------- ## +## Report this to http://bugs.python.org/ ## +## -------------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 +$as_echo_n "checking for minix/config.h... " >&6; } +if test "${ac_cv_header_minix_config_h+set}" = set; then + $as_echo_n "(cached) " >&6 else - ac_cv_path_GREP=$GREP + ac_cv_header_minix_config_h=$ac_header_preproc fi - +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +$as_echo "$ac_cv_header_minix_config_h" >&6; } fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +if test "x$ac_cv_header_minix_config_h" = x""yes; then + MINIX=yes else - ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - + MINIX= +fi - $ac_path_EGREP_found && break 3 - done -done -done -IFS=$as_save_IFS + if test "$MINIX" = yes; then +cat >>confdefs.h <<\_ACEOF +#define _POSIX_SOURCE 1 +_ACEOF -fi -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi +cat >>confdefs.h <<\_ACEOF +#define _POSIX_1_SOURCE 2 +_ACEOF -else - ac_cv_path_EGREP=$EGREP -fi +cat >>confdefs.h <<\_ACEOF +#define _MINIX 1 +_ACEOF - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" + fi -{ echo "$as_me:$LINENO: checking for AIX" >&5 -echo $ECHO_N "checking for AIX... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF + { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test "${ac_cv_safe_to_define___extensions__+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#ifdef _AIX - yes -#endif +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -cat >>confdefs.h <<\_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_safe_to_define___extensions__=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_safe_to_define___extensions__=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + cat >>confdefs.h <<\_ACEOF +#define __EXTENSIONS__ 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF #define _ALL_SOURCE 1 _ACEOF -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -rm -f conftest* + cat >>confdefs.h <<\_ACEOF +#define _GNU_SOURCE 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _TANDEM_SOURCE 1 +_ACEOF @@ -3868,8 +4438,8 @@ esac -{ echo "$as_me:$LINENO: checking for --with-suffix" >&5 -echo $ECHO_N "checking for --with-suffix... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-suffix" >&5 +$as_echo_n "checking for --with-suffix... " >&6; } # Check whether --with-suffix was given. if test "${with_suffix+set}" = set; then @@ -3881,26 +4451,26 @@ esac fi -{ echo "$as_me:$LINENO: result: $EXEEXT" >&5 -echo "${ECHO_T}$EXEEXT" >&6; } +{ $as_echo "$as_me:$LINENO: result: $EXEEXT" >&5 +$as_echo "$EXEEXT" >&6; } # Test whether we're running on a non-case-sensitive system, in which # case we give a warning if no ext is given -{ echo "$as_me:$LINENO: checking for case-insensitive build directory" >&5 -echo $ECHO_N "checking for case-insensitive build directory... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for case-insensitive build directory" >&5 +$as_echo_n "checking for case-insensitive build directory... " >&6; } if test ! -d CaseSensitiveTestDir; then mkdir CaseSensitiveTestDir fi if test -d casesensitivetestdir then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } BUILDEXEEXT=.exe else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } BUILDEXEEXT=$EXEEXT fi rmdir CaseSensitiveTestDir @@ -3933,14 +4503,14 @@ -{ echo "$as_me:$LINENO: checking LIBRARY" >&5 -echo $ECHO_N "checking LIBRARY... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LIBRARY" >&5 +$as_echo_n "checking LIBRARY... " >&6; } if test -z "$LIBRARY" then LIBRARY='libpython$(VERSION).a' fi -{ echo "$as_me:$LINENO: result: $LIBRARY" >&5 -echo "${ECHO_T}$LIBRARY" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LIBRARY" >&5 +$as_echo "$LIBRARY" >&6; } # LDLIBRARY is the name of the library to link against (as opposed to the # name of the library into which to insert object files). BLDLIBRARY is also @@ -3975,8 +4545,8 @@ # This is altered for AIX in order to build the export list before # linking. -{ echo "$as_me:$LINENO: checking LINKCC" >&5 -echo $ECHO_N "checking LINKCC... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LINKCC" >&5 +$as_echo_n "checking LINKCC... " >&6; } if test -z "$LINKCC" then LINKCC='$(PURIFY) $(MAINCC)' @@ -3996,8 +4566,8 @@ LINKCC=qcc;; esac fi -{ echo "$as_me:$LINENO: result: $LINKCC" >&5 -echo "${ECHO_T}$LINKCC" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LINKCC" >&5 +$as_echo "$LINKCC" >&6; } # GNULD is set to "yes" if the GNU linker is used. If this goes wrong # make sure we default having it set to "no": this is used by @@ -4005,8 +4575,8 @@ # to linker command lines, and failing to detect GNU ld simply results # in the same bahaviour as before. -{ echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } ac_prog=ld if test "$GCC" = yes; then ac_prog=`$CC -print-prog-name=ld` @@ -4017,11 +4587,11 @@ *) GNULD=no;; esac -{ echo "$as_me:$LINENO: result: $GNULD" >&5 -echo "${ECHO_T}$GNULD" >&6; } +{ $as_echo "$as_me:$LINENO: result: $GNULD" >&5 +$as_echo "$GNULD" >&6; } -{ echo "$as_me:$LINENO: checking for --enable-shared" >&5 -echo $ECHO_N "checking for --enable-shared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --enable-shared" >&5 +$as_echo_n "checking for --enable-shared... " >&6; } # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then enableval=$enable_shared; @@ -4037,11 +4607,11 @@ enable_shared="no";; esac fi -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } +{ $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } -{ echo "$as_me:$LINENO: checking for --enable-profiling" >&5 -echo $ECHO_N "checking for --enable-profiling... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --enable-profiling" >&5 +$as_echo_n "checking for --enable-profiling... " >&6; } # Check whether --enable-profiling was given. if test "${enable_profiling+set}" = set; then enableval=$enable_profiling; ac_save_cc="$CC" @@ -4063,29 +4633,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_enable_profiling="yes" else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_enable_profiling="no" fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4093,8 +4666,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_enable_profiling" >&5 -echo "${ECHO_T}$ac_enable_profiling" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_enable_profiling" >&5 +$as_echo "$ac_enable_profiling" >&6; } case "$ac_enable_profiling" in "yes") @@ -4103,8 +4676,8 @@ ;; esac -{ echo "$as_me:$LINENO: checking LDLIBRARY" >&5 -echo $ECHO_N "checking LDLIBRARY... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LDLIBRARY" >&5 +$as_echo_n "checking LDLIBRARY... " >&6; } # MacOSX framework builds need more magic. LDLIBRARY is the dynamic # library that we build, but we do not want to link against it (we @@ -4191,16 +4764,16 @@ esac fi -{ echo "$as_me:$LINENO: result: $LDLIBRARY" >&5 -echo "${ECHO_T}$LDLIBRARY" >&6; } +{ $as_echo "$as_me:$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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -4213,7 +4786,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4224,11 +4797,11 @@ fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } + { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4237,10 +4810,10 @@ 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $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. @@ -4253,7 +4826,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4264,11 +4837,11 @@ fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -4276,12 +4849,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$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 @@ -4295,10 +4864,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. @@ -4311,7 +4880,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4322,11 +4891,11 @@ fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6; } + { $as_echo "$as_me:$LINENO: result: $AR" >&5 +$as_echo "$AR" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4345,10 +4914,10 @@ # Extract the first word of "svnversion", so it can be a program name with args. set dummy svnversion; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_SVNVERSION+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$SVNVERSION"; then ac_cv_prog_SVNVERSION="$SVNVERSION" # Let the user override the test. @@ -4361,7 +4930,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_SVNVERSION="found" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4373,11 +4942,11 @@ fi SVNVERSION=$ac_cv_prog_SVNVERSION if test -n "$SVNVERSION"; then - { echo "$as_me:$LINENO: result: $SVNVERSION" >&5 -echo "${ECHO_T}$SVNVERSION" >&6; } + { $as_echo "$as_me:$LINENO: result: $SVNVERSION" >&5 +$as_echo "$SVNVERSION" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4413,8 +4982,8 @@ fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi @@ -4440,11 +5009,12 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -4473,17 +5043,29 @@ # program-specific install script used by HP pwplus--don't use. : else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi fi fi done done ;; esac + done IFS=$as_save_IFS +rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then @@ -4496,8 +5078,8 @@ INSTALL=$ac_install_sh fi fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } +{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -4520,8 +5102,8 @@ fi # Check for --with-pydebug -{ echo "$as_me:$LINENO: checking for --with-pydebug" >&5 -echo $ECHO_N "checking for --with-pydebug... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-pydebug" >&5 +$as_echo_n "checking for --with-pydebug... " >&6; } # Check whether --with-pydebug was given. if test "${with_pydebug+set}" = set; then @@ -4533,15 +5115,15 @@ #define Py_DEBUG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; }; + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; }; Py_DEBUG='true' -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; }; Py_DEBUG='false' +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; }; Py_DEBUG='false' fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4619,8 +5201,8 @@ # Python violates C99 rules, by casting between incompatible # pointer types. GCC may generate bad code as a result of that, # so use -fno-strict-aliasing if supported. - { echo "$as_me:$LINENO: checking whether $CC accepts -fno-strict-aliasing" >&5 -echo $ECHO_N "checking whether $CC accepts -fno-strict-aliasing... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether $CC accepts -fno-strict-aliasing" >&5 +$as_echo_n "checking whether $CC accepts -fno-strict-aliasing... " >&6; } ac_save_cc="$CC" CC="$CC -fno-strict-aliasing" if test "$cross_compiling" = yes; then @@ -4640,36 +5222,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_no_strict_aliasing_ok=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_no_strict_aliasing_ok=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CC="$ac_save_cc" - { echo "$as_me:$LINENO: result: $ac_cv_no_strict_aliasing_ok" >&5 -echo "${ECHO_T}$ac_cv_no_strict_aliasing_ok" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_no_strict_aliasing_ok" >&5 +$as_echo "$ac_cv_no_strict_aliasing_ok" >&6; } if test $ac_cv_no_strict_aliasing_ok = yes then BASECFLAGS="$BASECFLAGS -fno-strict-aliasing" @@ -4708,8 +5293,8 @@ ARCH_RUN_32BIT="arch -i386 -ppc" else - { { echo "$as_me:$LINENO: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&5 -echo "$as_me: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&2;} + { { $as_echo "$as_me:$LINENO: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&5 +$as_echo "$as_me: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&2;} { (exit 1); exit 1; }; } fi @@ -4783,10 +5368,10 @@ ac_cv_opt_olimit_ok=no fi -{ echo "$as_me:$LINENO: checking whether $CC accepts -OPT:Olimit=0" >&5 -echo $ECHO_N "checking whether $CC accepts -OPT:Olimit=0... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -OPT:Olimit=0" >&5 +$as_echo_n "checking whether $CC accepts -OPT:Olimit=0... " >&6; } if test "${ac_cv_opt_olimit_ok+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -OPT:Olimit=0" @@ -4807,29 +5392,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_opt_olimit_ok=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_opt_olimit_ok=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4837,8 +5425,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_opt_olimit_ok" >&5 -echo "${ECHO_T}$ac_cv_opt_olimit_ok" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_opt_olimit_ok" >&5 +$as_echo "$ac_cv_opt_olimit_ok" >&6; } if test $ac_cv_opt_olimit_ok = yes; then case $ac_sys_system in # XXX is this branch needed? On MacOSX 10.2.2 the result of the @@ -4851,10 +5439,10 @@ ;; esac else - { echo "$as_me:$LINENO: checking whether $CC accepts -Olimit 1500" >&5 -echo $ECHO_N "checking whether $CC accepts -Olimit 1500... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether $CC accepts -Olimit 1500" >&5 +$as_echo_n "checking whether $CC accepts -Olimit 1500... " >&6; } if test "${ac_cv_olimit_ok+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -Olimit 1500" @@ -4875,29 +5463,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_olimit_ok=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_olimit_ok=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4905,8 +5496,8 @@ CC="$ac_save_cc" fi - { echo "$as_me:$LINENO: result: $ac_cv_olimit_ok" >&5 -echo "${ECHO_T}$ac_cv_olimit_ok" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_olimit_ok" >&5 +$as_echo "$ac_cv_olimit_ok" >&6; } if test $ac_cv_olimit_ok = yes; then BASECFLAGS="$BASECFLAGS -Olimit 1500" fi @@ -4915,8 +5506,8 @@ # Check whether GCC supports PyArg_ParseTuple format if test "$GCC" = "yes" then - { echo "$as_me:$LINENO: checking whether gcc supports ParseTuple __format__" >&5 -echo $ECHO_N "checking whether gcc supports ParseTuple __format__... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether gcc supports ParseTuple __format__" >&5 +$as_echo_n "checking whether gcc supports ParseTuple __format__... " >&6; } save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Werror" cat >conftest.$ac_ext <<_ACEOF @@ -4942,13 +5533,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -4958,14 +5550,14 @@ #define HAVE_ATTRIBUTE_FORMAT_PARSETUPLE 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4978,10 +5570,10 @@ # complain if unaccepted options are passed (e.g. gcc on Mac OS X). # So we have to see first whether pthreads are available without # options before we can check whether -Kpthread improves anything. -{ echo "$as_me:$LINENO: checking whether pthreads are available without options" >&5 -echo $ECHO_N "checking whether pthreads are available without options... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether pthreads are available without options" >&5 +$as_echo_n "checking whether pthreads are available without options... " >&6; } if test "${ac_cv_pthread_is_default+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_pthread_is_default=no @@ -5012,19 +5604,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_pthread_is_default=yes @@ -5032,13 +5626,14 @@ ac_cv_pthread=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_pthread_is_default=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5046,8 +5641,8 @@ fi -{ echo "$as_me:$LINENO: result: $ac_cv_pthread_is_default" >&5 -echo "${ECHO_T}$ac_cv_pthread_is_default" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_pthread_is_default" >&5 +$as_echo "$ac_cv_pthread_is_default" >&6; } if test $ac_cv_pthread_is_default = yes @@ -5059,10 +5654,10 @@ # Some compilers won't report that they do not support -Kpthread, # so we need to run a program to see whether it really made the # function available. -{ echo "$as_me:$LINENO: checking whether $CC accepts -Kpthread" >&5 -echo $ECHO_N "checking whether $CC accepts -Kpthread... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -Kpthread" >&5 +$as_echo_n "checking whether $CC accepts -Kpthread... " >&6; } if test "${ac_cv_kpthread+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -Kpthread" @@ -5095,29 +5690,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_kpthread=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_kpthread=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5125,8 +5723,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_kpthread" >&5 -echo "${ECHO_T}$ac_cv_kpthread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_kpthread" >&5 +$as_echo "$ac_cv_kpthread" >&6; } fi if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no @@ -5136,10 +5734,10 @@ # Some compilers won't report that they do not support -Kthread, # so we need to run a program to see whether it really made the # function available. -{ echo "$as_me:$LINENO: checking whether $CC accepts -Kthread" >&5 -echo $ECHO_N "checking whether $CC accepts -Kthread... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -Kthread" >&5 +$as_echo_n "checking whether $CC accepts -Kthread... " >&6; } if test "${ac_cv_kthread+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -Kthread" @@ -5172,29 +5770,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_kthread=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_kthread=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5202,8 +5803,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_kthread" >&5 -echo "${ECHO_T}$ac_cv_kthread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_kthread" >&5 +$as_echo "$ac_cv_kthread" >&6; } fi if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no @@ -5213,10 +5814,10 @@ # Some compilers won't report that they do not support -pthread, # so we need to run a program to see whether it really made the # function available. -{ echo "$as_me:$LINENO: checking whether $CC accepts -pthread" >&5 -echo $ECHO_N "checking whether $CC accepts -pthread... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -pthread" >&5 +$as_echo_n "checking whether $CC accepts -pthread... " >&6; } if test "${ac_cv_thread+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -pthread" @@ -5249,29 +5850,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_pthread=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_pthread=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5279,8 +5883,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_pthread" >&5 -echo "${ECHO_T}$ac_cv_pthread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_pthread" >&5 +$as_echo "$ac_cv_pthread" >&6; } fi # If we have set a CC compiler flag for thread support then @@ -5288,8 +5892,8 @@ ac_cv_cxx_thread=no if test ! -z "$CXX" then -{ echo "$as_me:$LINENO: checking whether $CXX also accepts flags for thread support" >&5 -echo $ECHO_N "checking whether $CXX also accepts flags for thread support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CXX also accepts flags for thread support" >&5 +$as_echo_n "checking whether $CXX also accepts flags for thread support... " >&6; } ac_save_cxx="$CXX" if test "$ac_cv_kpthread" = "yes" @@ -5319,17 +5923,17 @@ fi rm -fr conftest* fi -{ echo "$as_me:$LINENO: result: $ac_cv_cxx_thread" >&5 -echo "${ECHO_T}$ac_cv_cxx_thread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_thread" >&5 +$as_echo "$ac_cv_cxx_thread" >&6; } fi CXX="$ac_save_cxx" # checks for header files -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5356,20 +5960,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no @@ -5438,136 +6043,70 @@ #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif -#include <$ac_header> +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_Header=no" +( exit $ac_status ) +ac_cv_header_stdc=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then -done +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF +fi @@ -5636,20 +6175,21 @@ sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ bluetooth/bluetooth.h linux/tipc.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5665,32 +6205,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5704,51 +6245,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -5757,21 +6299,24 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -5785,11 +6330,11 @@ ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5815,20 +6360,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -5836,12 +6382,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break @@ -5850,10 +6399,10 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -5891,26 +6440,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_opendir=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then @@ -5925,8 +6478,8 @@ rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -5934,10 +6487,10 @@ fi else - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -5975,26 +6528,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_opendir=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then @@ -6009,8 +6566,8 @@ rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -6019,10 +6576,10 @@ fi -{ echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5 -echo $ECHO_N "checking whether sys/types.h defines makedev... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5 +$as_echo_n "checking whether sys/types.h defines makedev... " >&6; } if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6045,46 +6602,50 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_header_sys_types_h_makedev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_types_h_makedev=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 -echo "${ECHO_T}$ac_cv_header_sys_types_h_makedev" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 +$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; } if test $ac_cv_header_sys_types_h_makedev = no; then if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - { echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 -echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 +$as_echo_n "checking for sys/mkdev.h... " >&6; } if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 +$as_echo "$ac_cv_header_sys_mkdev_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 -echo $ECHO_N "checking sys/mkdev.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 +$as_echo_n "checking sys/mkdev.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6100,32 +6661,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5 -echo $ECHO_N "checking sys/mkdev.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5 +$as_echo_n "checking sys/mkdev.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6139,51 +6701,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -6192,18 +6755,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 -echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 +$as_echo_n "checking for sys/mkdev.h... " >&6; } if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_sys_mkdev_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 +$as_echo "$ac_cv_header_sys_mkdev_h" >&6; } fi -if test $ac_cv_header_sys_mkdev_h = yes; then +if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define MAJOR_IN_MKDEV 1 @@ -6215,17 +6778,17 @@ if test $ac_cv_header_sys_mkdev_h = no; then if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - { echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 -echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 +$as_echo_n "checking for sys/sysmacros.h... " >&6; } if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 +$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 -echo $ECHO_N "checking sys/sysmacros.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 +$as_echo_n "checking sys/sysmacros.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6241,32 +6804,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5 -echo $ECHO_N "checking sys/sysmacros.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5 +$as_echo_n "checking sys/sysmacros.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6280,51 +6844,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -6333,18 +6898,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 -echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 +$as_echo_n "checking for sys/sysmacros.h... " >&6; } if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_sys_sysmacros_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 +$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; } fi -if test $ac_cv_header_sys_sysmacros_h = yes; then +if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define MAJOR_IN_SYSMACROS 1 @@ -6361,11 +6926,11 @@ for ac_header in term.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6387,20 +6952,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -6408,12 +6974,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -6425,11 +6994,11 @@ for ac_header in linux/netlink.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6454,20 +7023,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -6475,12 +7045,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -6490,8 +7063,8 @@ # checks for typedefs was_it_defined=no -{ echo "$as_me:$LINENO: checking for clock_t in time.h" >&5 -echo $ECHO_N "checking for clock_t in time.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for clock_t in time.h" >&5 +$as_echo_n "checking for clock_t in time.h... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6515,12 +7088,12 @@ fi rm -f conftest* -{ echo "$as_me:$LINENO: result: $was_it_defined" >&5 -echo "${ECHO_T}$was_it_defined" >&6; } +{ $as_echo "$as_me:$LINENO: result: $was_it_defined" >&5 +$as_echo "$was_it_defined" >&6; } # Check whether using makedev requires defining _OSF_SOURCE -{ echo "$as_me:$LINENO: checking for makedev" >&5 -echo $ECHO_N "checking for makedev... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for makedev" >&5 +$as_echo_n "checking for makedev... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6542,26 +7115,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_has_makedev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_has_makedev=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_has_makedev" = "no"; then @@ -6590,26 +7167,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_has_makedev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_has_makedev=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_has_makedev" = "yes"; then @@ -6620,8 +7201,8 @@ fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_has_makedev" >&5 -echo "${ECHO_T}$ac_cv_has_makedev" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_has_makedev" >&5 +$as_echo "$ac_cv_has_makedev" >&6; } if test "$ac_cv_has_makedev" = "yes"; then cat >>confdefs.h <<\_ACEOF @@ -6638,8 +7219,8 @@ # work-around, disable LFS on such configurations use_lfs=yes -{ echo "$as_me:$LINENO: checking Solaris LFS bug" >&5 -echo $ECHO_N "checking Solaris LFS bug... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking Solaris LFS bug" >&5 +$as_echo_n "checking Solaris LFS bug... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6665,28 +7246,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then sol_lfs_bug=no else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 sol_lfs_bug=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $sol_lfs_bug" >&5 -echo "${ECHO_T}$sol_lfs_bug" >&6; } +{ $as_echo "$as_me:$LINENO: result: $sol_lfs_bug" >&5 +$as_echo "$sol_lfs_bug" >&6; } if test "$sol_lfs_bug" = "yes"; then use_lfs=no fi @@ -6714,26 +7296,58 @@ EOF # Type availability checks -{ echo "$as_me:$LINENO: checking for mode_t" >&5 -echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for mode_t" >&5 +$as_echo_n "checking for mode_t... " >&6; } if test "${ac_cv_type_mode_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_mode_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef mode_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (mode_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((mode_t))) + return 0; ; return 0; } @@ -6744,30 +7358,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_mode_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_mode_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_mode_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 -echo "${ECHO_T}$ac_cv_type_mode_t" >&6; } -if test $ac_cv_type_mode_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 +$as_echo "$ac_cv_type_mode_t" >&6; } +if test "x$ac_cv_type_mode_t" = x""yes; then : else @@ -6777,26 +7400,58 @@ fi -{ echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for off_t" >&5 +$as_echo_n "checking for off_t... " >&6; } if test "${ac_cv_type_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_off_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef off_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (off_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((off_t))) + return 0; ; return 0; } @@ -6807,30 +7462,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_off_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_off_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_off_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6; } -if test $ac_cv_type_off_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +$as_echo "$ac_cv_type_off_t" >&6; } +if test "x$ac_cv_type_off_t" = x""yes; then : else @@ -6840,26 +7504,58 @@ fi -{ echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5 +$as_echo_n "checking for pid_t... " >&6; } if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_pid_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef pid_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (pid_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((pid_t))) + return 0; ; return 0; } @@ -6870,30 +7566,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_pid_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_pid_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_pid_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } -if test $ac_cv_type_pid_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +$as_echo "$ac_cv_type_pid_t" >&6; } +if test "x$ac_cv_type_pid_t" = x""yes; then : else @@ -6903,10 +7608,10 @@ fi -{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5 -echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } if test "${ac_cv_type_signal+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6931,20 +7636,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_signal=int else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=void @@ -6952,34 +7658,66 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 -echo "${ECHO_T}$ac_cv_type_signal" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF -{ echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for size_t" >&5 +$as_echo_n "checking for size_t... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_size_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef size_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (size_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((size_t))) + return 0; ; return 0; } @@ -6990,30 +7728,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_size_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_size_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_size_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6; } -if test $ac_cv_type_size_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +$as_echo "$ac_cv_type_size_t" >&6; } +if test "x$ac_cv_type_size_t" = x""yes; then : else @@ -7023,10 +7770,10 @@ fi -{ echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 -echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } if test "${ac_cv_type_uid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7046,8 +7793,8 @@ rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 -echo "${ECHO_T}$ac_cv_type_uid_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF @@ -7062,10 +7809,10 @@ fi - { echo "$as_me:$LINENO: checking for uint32_t" >&5 -echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for uint32_t" >&5 +$as_echo_n "checking for uint32_t... " >&6; } if test "${ac_cv_c_uint32_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_c_uint32_t=no for ac_type in 'uint32_t' 'unsigned int' 'unsigned long int' \ @@ -7093,13 +7840,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7110,7 +7858,7 @@ esac else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -7120,8 +7868,8 @@ test "$ac_cv_c_uint32_t" != no && break done fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_uint32_t" >&5 -echo "${ECHO_T}$ac_cv_c_uint32_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint32_t" >&5 +$as_echo "$ac_cv_c_uint32_t" >&6; } case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) @@ -7138,10 +7886,10 @@ esac - { echo "$as_me:$LINENO: checking for uint64_t" >&5 -echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for uint64_t" >&5 +$as_echo_n "checking for uint64_t... " >&6; } if test "${ac_cv_c_uint64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_c_uint64_t=no for ac_type in 'uint64_t' 'unsigned int' 'unsigned long int' \ @@ -7169,13 +7917,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7186,7 +7935,7 @@ esac else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -7196,8 +7945,8 @@ test "$ac_cv_c_uint64_t" != no && break done fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_uint64_t" >&5 -echo "${ECHO_T}$ac_cv_c_uint64_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint64_t" >&5 +$as_echo "$ac_cv_c_uint64_t" >&6; } case $ac_cv_c_uint64_t in #( no|yes) ;; #( *) @@ -7214,10 +7963,10 @@ esac - { echo "$as_me:$LINENO: checking for int32_t" >&5 -echo $ECHO_N "checking for int32_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for int32_t" >&5 +$as_echo_n "checking for int32_t... " >&6; } if test "${ac_cv_c_int32_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_c_int32_t=no for ac_type in 'int32_t' 'int' 'long int' \ @@ -7245,13 +7994,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7267,7 +8017,7 @@ main () { static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 1) - < ($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 2))]; + < ($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 2))]; test_array [0] = 0 ; @@ -7280,20 +8030,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 case $ac_type in @@ -7305,7 +8056,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -7315,8 +8066,8 @@ test "$ac_cv_c_int32_t" != no && break done fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_int32_t" >&5 -echo "${ECHO_T}$ac_cv_c_int32_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int32_t" >&5 +$as_echo "$ac_cv_c_int32_t" >&6; } case $ac_cv_c_int32_t in #( no|yes) ;; #( *) @@ -7328,10 +8079,10 @@ esac - { echo "$as_me:$LINENO: checking for int64_t" >&5 -echo $ECHO_N "checking for int64_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for int64_t" >&5 +$as_echo_n "checking for int64_t... " >&6; } if test "${ac_cv_c_int64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_c_int64_t=no for ac_type in 'int64_t' 'int' 'long int' \ @@ -7359,13 +8110,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7381,7 +8133,7 @@ main () { static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 1) - < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 2))]; + < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 2))]; test_array [0] = 0 ; @@ -7394,20 +8146,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 case $ac_type in @@ -7419,7 +8172,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -7429,8 +8182,8 @@ test "$ac_cv_c_int64_t" != no && break done fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_int64_t" >&5 -echo "${ECHO_T}$ac_cv_c_int64_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int64_t" >&5 +$as_echo "$ac_cv_c_int64_t" >&6; } case $ac_cv_c_int64_t in #( no|yes) ;; #( *) @@ -7441,26 +8194,24 @@ ;; esac -{ echo "$as_me:$LINENO: checking for ssize_t" >&5 -echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ssize_t" >&5 +$as_echo_n "checking for ssize_t... " >&6; } if test "${ac_cv_type_ssize_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_ssize_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef ssize_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof (ssize_t)) + return 0; ; return 0; } @@ -7471,45 +8222,18 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_ssize_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_ssize_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 -echo "${ECHO_T}$ac_cv_type_ssize_t" >&6; } -if test $ac_cv_type_ssize_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_SSIZE_T 1 -_ACEOF - -fi - - -# Sizes of various common basic types -# ANSI C requires sizeof(char) == 1, so no need to check it -{ echo "$as_me:$LINENO: checking for int" >&5 -echo $ECHO_N "checking for int... $ECHO_C" >&6; } -if test "${ac_cv_type_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7517,14 +8241,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef int ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof ((ssize_t))) + return 0; ; return 0; } @@ -7535,38 +8256,57 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_int=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_ssize_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_int=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 -echo "${ECHO_T}$ac_cv_type_int" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 +$as_echo "$ac_cv_type_ssize_t" >&6; } +if test "x$ac_cv_type_ssize_t" = x""yes; then +cat >>confdefs.h <<\_ACEOF +#define HAVE_SSIZE_T 1 +_ACEOF + +fi + + +# Sizes of various common basic types +# ANSI C requires sizeof(char) == 1, so no need to check it # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of int" >&5 -echo $ECHO_N "checking size of int... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } if test "${ac_cv_sizeof_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -7577,11 +8317,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= 0)]; test_array [0] = 0 ; @@ -7594,13 +8333,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7614,11 +8354,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7631,20 +8370,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -7658,7 +8398,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -7668,11 +8408,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) < 0)]; test_array [0] = 0 ; @@ -7685,13 +8424,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7705,11 +8445,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= $ac_mid)]; test_array [0] = 0 ; @@ -7722,20 +8461,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -7749,7 +8489,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -7769,11 +8509,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7786,20 +8525,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -7810,11 +8550,13 @@ case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; '') if test "$ac_cv_type_int" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int) +$as_echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_int=0 fi ;; @@ -7827,9 +8569,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (int)); } +static unsigned long int ulongval () { return (long int) (sizeof (int)); } #include #include int @@ -7839,20 +8580,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (int))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (int)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (int)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -7865,43 +8608,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_int" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int) +$as_echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_int=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } @@ -7910,68 +8658,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6; } -if test "${ac_cv_type_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } if test "${ac_cv_sizeof_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -7982,11 +8676,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)]; test_array [0] = 0 ; @@ -7999,13 +8692,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8019,11 +8713,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8036,20 +8729,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -8063,7 +8757,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -8073,11 +8767,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)]; test_array [0] = 0 ; @@ -8090,13 +8783,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8110,11 +8804,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)]; test_array [0] = 0 ; @@ -8127,20 +8820,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -8154,7 +8848,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -8174,11 +8868,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8191,20 +8884,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -8215,11 +8909,13 @@ case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) +$as_echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long=0 fi ;; @@ -8232,9 +8928,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (long)); } +static unsigned long int ulongval () { return (long int) (sizeof (long)); } #include #include int @@ -8244,20 +8939,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (long))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -8270,43 +8967,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) +$as_echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } @@ -8315,68 +9017,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for void *" >&5 -echo $ECHO_N "checking for void *... $ECHO_C" >&6; } -if test "${ac_cv_type_void_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef void * ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_void_p=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_void_p=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 -echo "${ECHO_T}$ac_cv_type_void_p" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of void *" >&5 -echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -8387,11 +9035,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= 0)]; test_array [0] = 0 ; @@ -8404,13 +9051,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8424,11 +9072,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8441,20 +9088,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -8468,7 +9116,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -8478,11 +9126,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) < 0)]; test_array [0] = 0 ; @@ -8495,13 +9142,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8515,11 +9163,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= $ac_mid)]; test_array [0] = 0 ; @@ -8532,20 +9179,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -8559,7 +9207,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -8579,11 +9227,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8596,20 +9243,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -8620,11 +9268,13 @@ case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; '') if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) +$as_echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_void_p=0 fi ;; @@ -8637,9 +9287,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (void *)); } +static unsigned long int ulongval () { return (long int) (sizeof (void *)); } #include #include int @@ -8649,20 +9298,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (void *))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (void *)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (void *)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -8675,43 +9326,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_void_p=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) +$as_echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_void_p=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } @@ -8720,68 +9376,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for short" >&5 -echo $ECHO_N "checking for short... $ECHO_C" >&6; } -if test "${ac_cv_type_short+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef short ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_short=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_short=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 -echo "${ECHO_T}$ac_cv_type_short" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of short" >&5 -echo $ECHO_N "checking size of short... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } if test "${ac_cv_sizeof_short+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -8792,11 +9394,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= 0)]; test_array [0] = 0 ; @@ -8809,13 +9410,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8829,11 +9431,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8846,20 +9447,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -8873,7 +9475,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -8883,11 +9485,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) < 0)]; test_array [0] = 0 ; @@ -8900,13 +9501,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8920,11 +9522,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= $ac_mid)]; test_array [0] = 0 ; @@ -8937,20 +9538,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -8964,7 +9566,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -8984,11 +9586,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9001,20 +9602,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -9025,11 +9627,13 @@ case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; '') if test "$ac_cv_type_short" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short) +$as_echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_short=0 fi ;; @@ -9042,9 +9646,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (short)); } +static unsigned long int ulongval () { return (long int) (sizeof (short)); } #include #include int @@ -9054,20 +9657,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (short))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (short)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (short)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9080,43 +9685,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_short=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_short" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short) +$as_echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_short=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 -echo "${ECHO_T}$ac_cv_sizeof_short" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } @@ -9125,68 +9735,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for float" >&5 -echo $ECHO_N "checking for float... $ECHO_C" >&6; } -if test "${ac_cv_type_float+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef float ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_float=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_float=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_float" >&5 -echo "${ECHO_T}$ac_cv_type_float" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of float" >&5 -echo $ECHO_N "checking size of float... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of float" >&5 +$as_echo_n "checking size of float... " >&6; } if test "${ac_cv_sizeof_float+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -9197,11 +9753,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) >= 0)]; test_array [0] = 0 ; @@ -9214,13 +9769,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9234,11 +9790,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9251,20 +9806,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -9278,7 +9834,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -9288,11 +9844,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) < 0)]; test_array [0] = 0 ; @@ -9305,13 +9860,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9325,11 +9881,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) >= $ac_mid)]; test_array [0] = 0 ; @@ -9342,20 +9897,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -9369,7 +9925,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -9389,11 +9945,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9406,20 +9961,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -9430,11 +9986,13 @@ case $ac_lo in ?*) ac_cv_sizeof_float=$ac_lo;; '') if test "$ac_cv_type_float" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (float) +$as_echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_float=0 fi ;; @@ -9447,9 +10005,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (float)); } +static unsigned long int ulongval () { return (long int) (sizeof (float)); } #include #include int @@ -9459,20 +10016,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (float))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (float)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (float)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9485,43 +10044,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_float=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_float" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (float) +$as_echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_float=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 -echo "${ECHO_T}$ac_cv_sizeof_float" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 +$as_echo "$ac_cv_sizeof_float" >&6; } @@ -9530,68 +10094,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for double" >&5 -echo $ECHO_N "checking for double... $ECHO_C" >&6; } -if test "${ac_cv_type_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef double ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_double=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_double=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5 -echo "${ECHO_T}$ac_cv_type_double" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of double" >&5 -echo $ECHO_N "checking size of double... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of double" >&5 +$as_echo_n "checking size of double... " >&6; } if test "${ac_cv_sizeof_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -9602,11 +10112,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= 0)]; test_array [0] = 0 ; @@ -9619,13 +10128,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9639,11 +10149,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9656,20 +10165,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -9683,7 +10193,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -9693,11 +10203,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) < 0)]; test_array [0] = 0 ; @@ -9710,13 +10219,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9730,11 +10240,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= $ac_mid)]; test_array [0] = 0 ; @@ -9747,20 +10256,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -9774,7 +10284,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -9794,11 +10304,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9811,20 +10320,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -9835,11 +10345,13 @@ case $ac_lo in ?*) ac_cv_sizeof_double=$ac_lo;; '') if test "$ac_cv_type_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (double) +$as_echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_double=0 fi ;; @@ -9852,9 +10364,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (double)); } +static unsigned long int ulongval () { return (long int) (sizeof (double)); } #include #include int @@ -9864,20 +10375,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (double))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (double)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (double)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9889,114 +10402,65 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_double=`cat conftest.val` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -if test "$ac_cv_type_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (double) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_double=0 - fi -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 -echo "${ECHO_T}$ac_cv_sizeof_double" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_DOUBLE $ac_cv_sizeof_double -_ACEOF - - -{ echo "$as_me:$LINENO: checking for fpos_t" >&5 -echo $ECHO_N "checking for fpos_t... $ECHO_C" >&6; } -if test "${ac_cv_type_fpos_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef fpos_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_fpos_t=yes + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_double=`cat conftest.val` else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_fpos_t=no +( exit $ac_status ) +if test "$ac_cv_type_double" = yes; then + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double) +See \`config.log' for more details." >&5 +$as_echo "$as_me: error: cannot compute sizeof (double) +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; }; } + else + ac_cv_sizeof_double=0 + fi fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_fpos_t" >&5 -echo "${ECHO_T}$ac_cv_type_fpos_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 +$as_echo "$ac_cv_sizeof_double" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_DOUBLE $ac_cv_sizeof_double +_ACEOF + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of fpos_t" >&5 -echo $ECHO_N "checking size of fpos_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of fpos_t" >&5 +$as_echo_n "checking size of fpos_t... " >&6; } if test "${ac_cv_sizeof_fpos_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -10007,11 +10471,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) >= 0)]; test_array [0] = 0 ; @@ -10024,13 +10487,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10044,11 +10508,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10061,20 +10524,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -10088,7 +10552,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -10098,11 +10562,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) < 0)]; test_array [0] = 0 ; @@ -10115,13 +10578,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10135,11 +10599,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -10152,20 +10615,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -10179,7 +10643,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -10199,11 +10663,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10216,20 +10679,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -10240,11 +10704,13 @@ case $ac_lo in ?*) ac_cv_sizeof_fpos_t=$ac_lo;; '') if test "$ac_cv_type_fpos_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (fpos_t) +$as_echo "$as_me: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_fpos_t=0 fi ;; @@ -10257,9 +10723,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (fpos_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (fpos_t)); } #include #include int @@ -10269,20 +10734,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (fpos_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (fpos_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (fpos_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -10295,43 +10762,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_fpos_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_fpos_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (fpos_t) +$as_echo "$as_me: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_fpos_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_fpos_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_fpos_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_fpos_t" >&5 +$as_echo "$ac_cv_sizeof_fpos_t" >&6; } @@ -10340,68 +10812,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } -if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef size_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_size_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_size_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of size_t" >&5 -echo $ECHO_N "checking size of size_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of size_t" >&5 +$as_echo_n "checking size of size_t... " >&6; } if test "${ac_cv_sizeof_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -10412,11 +10830,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= 0)]; test_array [0] = 0 ; @@ -10429,13 +10846,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10449,11 +10867,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10466,20 +10883,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -10493,7 +10911,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -10503,11 +10921,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) < 0)]; test_array [0] = 0 ; @@ -10520,13 +10937,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10540,11 +10958,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -10557,20 +10974,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -10584,7 +11002,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -10604,11 +11022,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10621,20 +11038,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -10645,11 +11063,13 @@ case $ac_lo in ?*) ac_cv_sizeof_size_t=$ac_lo;; '') if test "$ac_cv_type_size_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (size_t) +$as_echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_size_t=0 fi ;; @@ -10662,9 +11082,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (size_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (size_t)); } #include #include int @@ -10674,20 +11093,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (size_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (size_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (size_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -10700,43 +11121,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_size_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_size_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (size_t) +$as_echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_size_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 +$as_echo "$ac_cv_sizeof_size_t" >&6; } @@ -10745,68 +11171,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } -if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef pid_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_pid_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_pid_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of pid_t" >&5 -echo $ECHO_N "checking size of pid_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of pid_t" >&5 +$as_echo_n "checking size of pid_t... " >&6; } if test "${ac_cv_sizeof_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -10817,11 +11189,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) >= 0)]; test_array [0] = 0 ; @@ -10834,13 +11205,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10854,11 +11226,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10871,20 +11242,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -10898,7 +11270,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -10908,11 +11280,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) < 0)]; test_array [0] = 0 ; @@ -10925,13 +11296,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10945,11 +11317,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -10962,20 +11333,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -10989,7 +11361,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -11009,11 +11381,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11026,20 +11397,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -11050,11 +11422,13 @@ case $ac_lo in ?*) ac_cv_sizeof_pid_t=$ac_lo;; '') if test "$ac_cv_type_pid_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (pid_t) +$as_echo "$as_me: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_pid_t=0 fi ;; @@ -11067,9 +11441,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (pid_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (pid_t)); } #include #include int @@ -11079,20 +11452,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (pid_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (pid_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (pid_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -11105,43 +11480,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_pid_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_pid_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (pid_t) +$as_echo "$as_me: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_pid_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_pid_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_pid_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_pid_t" >&5 +$as_echo "$ac_cv_sizeof_pid_t" >&6; } @@ -11151,8 +11531,8 @@ -{ echo "$as_me:$LINENO: checking for long long support" >&5 -echo $ECHO_N "checking for long long support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for long long support" >&5 +$as_echo_n "checking for long long support... " >&6; } have_long_long=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -11175,13 +11555,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11195,78 +11576,24 @@ have_long_long=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_long_long" >&5 -echo "${ECHO_T}$have_long_long" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_long_long" >&5 +$as_echo "$have_long_long" >&6; } if test "$have_long_long" = yes ; then -{ echo "$as_me:$LINENO: checking for long long" >&5 -echo $ECHO_N "checking for long long... $ECHO_C" >&6; } -if test "${ac_cv_type_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long long ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long_long=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_long_long" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long long" >&5 -echo $ECHO_N "checking size of long long... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } if test "${ac_cv_sizeof_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -11277,11 +11604,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= 0)]; test_array [0] = 0 ; @@ -11294,13 +11620,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11314,11 +11641,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11331,20 +11657,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -11358,7 +11685,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -11368,11 +11695,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) < 0)]; test_array [0] = 0 ; @@ -11385,13 +11711,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11405,11 +11732,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= $ac_mid)]; test_array [0] = 0 ; @@ -11422,20 +11748,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -11449,7 +11776,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -11469,11 +11796,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11486,20 +11812,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -11510,11 +11837,13 @@ case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; '') if test "$ac_cv_type_long_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long) +$as_echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_long=0 fi ;; @@ -11527,9 +11856,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (long long)); } +static unsigned long int ulongval () { return (long int) (sizeof (long long)); } #include #include int @@ -11539,20 +11867,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (long long))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long long)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long long)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -11565,43 +11895,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_long=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long) +$as_echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_long=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } @@ -11612,8 +11947,8 @@ fi -{ echo "$as_me:$LINENO: checking for long double support" >&5 -echo $ECHO_N "checking for long double support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for long double support" >&5 +$as_echo_n "checking for long double support... " >&6; } have_long_double=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -11636,13 +11971,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11656,78 +11992,24 @@ have_long_double=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_long_double" >&5 -echo "${ECHO_T}$have_long_double" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_long_double" >&5 +$as_echo "$have_long_double" >&6; } if test "$have_long_double" = yes ; then -{ echo "$as_me:$LINENO: checking for long double" >&5 -echo $ECHO_N "checking for long double... $ECHO_C" >&6; } -if test "${ac_cv_type_long_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long double ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long_double=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long_double=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long_double" >&5 -echo "${ECHO_T}$ac_cv_type_long_double" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long double" >&5 -echo $ECHO_N "checking size of long double... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of long double" >&5 +$as_echo_n "checking size of long double... " >&6; } if test "${ac_cv_sizeof_long_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -11738,11 +12020,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) >= 0)]; test_array [0] = 0 ; @@ -11755,13 +12036,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11775,11 +12057,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11792,20 +12073,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -11819,7 +12101,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -11829,11 +12111,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) < 0)]; test_array [0] = 0 ; @@ -11846,13 +12127,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11866,11 +12148,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) >= $ac_mid)]; test_array [0] = 0 ; @@ -11883,20 +12164,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -11910,7 +12192,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -11930,11 +12212,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11947,20 +12228,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -11971,11 +12253,13 @@ case $ac_lo in ?*) ac_cv_sizeof_long_double=$ac_lo;; '') if test "$ac_cv_type_long_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long double) +$as_echo "$as_me: error: cannot compute sizeof (long double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_double=0 fi ;; @@ -11988,9 +12272,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (long double)); } +static unsigned long int ulongval () { return (long int) (sizeof (long double)); } #include #include int @@ -12000,20 +12283,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (long double))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long double)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long double)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -12026,43 +12311,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_double=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long double) +$as_echo "$as_me: error: cannot compute sizeof (long double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_double=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long_double" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5 +$as_echo "$ac_cv_sizeof_long_double" >&6; } @@ -12073,8 +12363,8 @@ fi -{ echo "$as_me:$LINENO: checking for _Bool support" >&5 -echo $ECHO_N "checking for _Bool support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for _Bool support" >&5 +$as_echo_n "checking for _Bool support... " >&6; } have_c99_bool=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -12097,13 +12387,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12117,78 +12408,24 @@ have_c99_bool=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_c99_bool" >&5 -echo "${ECHO_T}$have_c99_bool" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_c99_bool" >&5 +$as_echo "$have_c99_bool" >&6; } if test "$have_c99_bool" = yes ; then -{ echo "$as_me:$LINENO: checking for _Bool" >&5 -echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } -if test "${ac_cv_type__Bool+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef _Bool ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type__Bool=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type__Bool=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 -echo "${ECHO_T}$ac_cv_type__Bool" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of _Bool" >&5 -echo $ECHO_N "checking size of _Bool... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of _Bool" >&5 +$as_echo_n "checking size of _Bool... " >&6; } if test "${ac_cv_sizeof__Bool+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -12199,11 +12436,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) >= 0)]; test_array [0] = 0 ; @@ -12216,13 +12452,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12236,11 +12473,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12253,20 +12489,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -12280,7 +12517,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -12290,11 +12527,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) < 0)]; test_array [0] = 0 ; @@ -12307,13 +12543,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12327,11 +12564,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) >= $ac_mid)]; test_array [0] = 0 ; @@ -12344,20 +12580,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -12371,7 +12608,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -12391,11 +12628,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12408,20 +12644,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -12432,11 +12669,13 @@ case $ac_lo in ?*) ac_cv_sizeof__Bool=$ac_lo;; '') if test "$ac_cv_type__Bool" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (_Bool) +$as_echo "$as_me: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof__Bool=0 fi ;; @@ -12449,9 +12688,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (_Bool)); } +static unsigned long int ulongval () { return (long int) (sizeof (_Bool)); } #include #include int @@ -12461,20 +12699,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (_Bool))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (_Bool)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (_Bool)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -12487,43 +12727,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof__Bool=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type__Bool" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (_Bool) +$as_echo "$as_me: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof__Bool=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof__Bool" >&5 -echo "${ECHO_T}$ac_cv_sizeof__Bool" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof__Bool" >&5 +$as_echo "$ac_cv_sizeof__Bool" >&6; } @@ -12534,12 +12779,13 @@ fi -{ echo "$as_me:$LINENO: checking for uintptr_t" >&5 -echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for uintptr_t" >&5 +$as_echo_n "checking for uintptr_t... " >&6; } if test "${ac_cv_type_uintptr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_uintptr_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -12549,14 +12795,11 @@ #include #endif -typedef uintptr_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof (uintptr_t)) + return 0; ; return 0; } @@ -12567,55 +12810,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_uintptr_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_uintptr_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; } -if test $ac_cv_type_uintptr_t = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_UINTPTR_T 1 -_ACEOF - -{ echo "$as_me:$LINENO: checking for uintptr_t" >&5 -echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; } -if test "${ac_cv_type_uintptr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else + } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -typedef uintptr_t ac__type_new_; +#ifdef HAVE_STDINT_H + #include + #endif + int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof ((uintptr_t))) + return 0; ; return 0; } @@ -12626,38 +12847,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_uintptr_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_uintptr_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_uintptr_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +$as_echo "$ac_cv_type_uintptr_t" >&6; } +if test "x$ac_cv_type_uintptr_t" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_UINTPTR_T 1 +_ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of uintptr_t" >&5 -echo $ECHO_N "checking size of uintptr_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of uintptr_t" >&5 +$as_echo_n "checking size of uintptr_t... " >&6; } if test "${ac_cv_sizeof_uintptr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -12668,11 +12903,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) >= 0)]; test_array [0] = 0 ; @@ -12685,13 +12919,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12705,11 +12940,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12722,20 +12956,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -12749,7 +12984,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -12759,11 +12994,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) < 0)]; test_array [0] = 0 ; @@ -12776,13 +13010,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12796,11 +13031,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -12813,20 +13047,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -12840,7 +13075,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -12860,11 +13095,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12877,20 +13111,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -12901,11 +13136,13 @@ case $ac_lo in ?*) ac_cv_sizeof_uintptr_t=$ac_lo;; '') if test "$ac_cv_type_uintptr_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (uintptr_t) +$as_echo "$as_me: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_uintptr_t=0 fi ;; @@ -12918,9 +13155,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (uintptr_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (uintptr_t)); } #include #include int @@ -12930,20 +13166,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (uintptr_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (uintptr_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (uintptr_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -12956,43 +13194,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_uintptr_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_uintptr_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (uintptr_t) +$as_echo "$as_me: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_uintptr_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_uintptr_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_uintptr_t" >&5 +$as_echo "$ac_cv_sizeof_uintptr_t" >&6; } @@ -13006,10 +13249,10 @@ # Hmph. AC_CHECK_SIZEOF() doesn't include . -{ echo "$as_me:$LINENO: checking size of off_t" >&5 -echo $ECHO_N "checking size of off_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of off_t" >&5 +$as_echo_n "checking size of off_t... " >&6; } if test "${ac_cv_sizeof_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_sizeof_off_t=4 @@ -13036,29 +13279,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_off_t=`cat conftestval` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_sizeof_off_t=0 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -13066,16 +13312,16 @@ fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 +$as_echo "$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF -{ echo "$as_me:$LINENO: checking whether to enable large file support" >&5 -echo $ECHO_N "checking whether to enable large file support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether to enable large file support" >&5 +$as_echo_n "checking whether to enable large file support... " >&6; } if test "$have_long_long" = yes -a \ "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then @@ -13084,18 +13330,18 @@ #define HAVE_LARGEFILE_SUPPORT 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # AC_CHECK_SIZEOF() doesn't include . -{ echo "$as_me:$LINENO: checking size of time_t" >&5 -echo $ECHO_N "checking size of time_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of time_t" >&5 +$as_echo_n "checking size of time_t... " >&6; } if test "${ac_cv_sizeof_time_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_sizeof_time_t=4 @@ -13122,29 +13368,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_time_t=`cat conftestval` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_sizeof_time_t=0 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -13152,8 +13401,8 @@ fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_time_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5 +$as_echo "$ac_cv_sizeof_time_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_TIME_T $ac_cv_sizeof_time_t @@ -13170,8 +13419,8 @@ elif test "$ac_cv_pthread" = "yes" then CC="$CC -pthread" fi -{ echo "$as_me:$LINENO: checking for pthread_t" >&5 -echo $ECHO_N "checking for pthread_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for pthread_t" >&5 +$as_echo_n "checking for pthread_t... " >&6; } have_pthread_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -13194,34 +13443,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then have_pthread_t=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_pthread_t" >&5 -echo "${ECHO_T}$have_pthread_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_pthread_t" >&5 +$as_echo "$have_pthread_t" >&6; } if test "$have_pthread_t" = yes ; then # AC_CHECK_SIZEOF() doesn't include . - { echo "$as_me:$LINENO: checking size of pthread_t" >&5 -echo $ECHO_N "checking size of pthread_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking size of pthread_t" >&5 +$as_echo_n "checking size of pthread_t... " >&6; } if test "${ac_cv_sizeof_pthread_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_sizeof_pthread_t=4 @@ -13248,29 +13498,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_pthread_t=`cat conftestval` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_sizeof_pthread_t=0 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -13278,8 +13531,8 @@ fi - { echo "$as_me:$LINENO: result: $ac_cv_sizeof_pthread_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_pthread_t" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_pthread_t" >&5 +$as_echo "$ac_cv_sizeof_pthread_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t @@ -13288,8 +13541,8 @@ fi CC="$ac_save_cc" -{ echo "$as_me:$LINENO: checking for --enable-toolbox-glue" >&5 -echo $ECHO_N "checking for --enable-toolbox-glue... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --enable-toolbox-glue" >&5 +$as_echo_n "checking for --enable-toolbox-glue... " >&6; } # Check whether --enable-toolbox-glue was given. if test "${enable_toolbox_glue+set}" = set; then enableval=$enable_toolbox_glue; @@ -13320,8 +13573,8 @@ extra_undefs="" ;; esac -{ echo "$as_me:$LINENO: result: $enable_toolbox_glue" >&5 -echo "${ECHO_T}$enable_toolbox_glue" >&6; } +{ $as_echo "$as_me:$LINENO: result: $enable_toolbox_glue" >&5 +$as_echo "$enable_toolbox_glue" >&6; } @@ -13358,8 +13611,8 @@ LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; esac -{ echo "$as_me:$LINENO: checking for --enable-framework" >&5 -echo $ECHO_N "checking for --enable-framework... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --enable-framework" >&5 +$as_echo_n "checking for --enable-framework... " >&6; } if test "$enable_framework" then BASECFLAGS="$BASECFLAGS -fno-common -dynamic" @@ -13370,15 +13623,15 @@ #define WITH_NEXT_FRAMEWORK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -{ echo "$as_me:$LINENO: checking for dyld" >&5 -echo $ECHO_N "checking for dyld... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for dyld" >&5 +$as_echo_n "checking for dyld... " >&6; } case $ac_sys_system/$ac_sys_release in Darwin/*) @@ -13386,12 +13639,12 @@ #define WITH_DYLD 1 _ACEOF - { echo "$as_me:$LINENO: result: always on for Darwin" >&5 -echo "${ECHO_T}always on for Darwin" >&6; } + { $as_echo "$as_me:$LINENO: result: always on for Darwin" >&5 +$as_echo "always on for Darwin" >&6; } ;; *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ;; esac @@ -13403,8 +13656,8 @@ # SO is the extension of shared libraries `(including the dot!) # -- usually .so, .sl on HP-UX, .dll on Cygwin -{ echo "$as_me:$LINENO: checking SO" >&5 -echo $ECHO_N "checking SO... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking SO" >&5 +$as_echo_n "checking SO... " >&6; } if test -z "$SO" then case $ac_sys_system in @@ -13429,8 +13682,8 @@ echo '=====================================================================' sleep 10 fi -{ echo "$as_me:$LINENO: result: $SO" >&5 -echo "${ECHO_T}$SO" >&6; } +{ $as_echo "$as_me:$LINENO: result: $SO" >&5 +$as_echo "$SO" >&6; } cat >>confdefs.h <<_ACEOF @@ -13441,8 +13694,8 @@ # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 # (Shared libraries in this instance are shared modules to be loaded into # Python, as opposed to building Python itself as a shared library.) -{ echo "$as_me:$LINENO: checking LDSHARED" >&5 -echo $ECHO_N "checking LDSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LDSHARED" >&5 +$as_echo_n "checking LDSHARED... " >&6; } if test -z "$LDSHARED" then case $ac_sys_system/$ac_sys_release in @@ -13548,13 +13801,13 @@ *) LDSHARED="ld";; esac fi -{ echo "$as_me:$LINENO: result: $LDSHARED" >&5 -echo "${ECHO_T}$LDSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LDSHARED" >&5 +$as_echo "$LDSHARED" >&6; } BLDSHARED=${BLDSHARED-$LDSHARED} # CCSHARED are the C *flags* used to create objects to go into a shared # library (module) -- this is only needed for a few systems -{ echo "$as_me:$LINENO: checking CCSHARED" >&5 -echo $ECHO_N "checking CCSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking CCSHARED" >&5 +$as_echo_n "checking CCSHARED... " >&6; } if test -z "$CCSHARED" then case $ac_sys_system/$ac_sys_release in @@ -13589,12 +13842,12 @@ atheos*) CCSHARED="-fPIC";; esac fi -{ echo "$as_me:$LINENO: result: $CCSHARED" >&5 -echo "${ECHO_T}$CCSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CCSHARED" >&5 +$as_echo "$CCSHARED" >&6; } # LINKFORSHARED are the flags passed to the $(CC) command that links # the python executable -- this is only needed for a few systems -{ echo "$as_me:$LINENO: checking LINKFORSHARED" >&5 -echo $ECHO_N "checking LINKFORSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LINKFORSHARED" >&5 +$as_echo_n "checking LINKFORSHARED... " >&6; } if test -z "$LINKFORSHARED" then case $ac_sys_system/$ac_sys_release in @@ -13649,13 +13902,13 @@ LINKFORSHARED='-Wl,-E -N 2048K';; esac fi -{ echo "$as_me:$LINENO: result: $LINKFORSHARED" >&5 -echo "${ECHO_T}$LINKFORSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LINKFORSHARED" >&5 +$as_echo "$LINKFORSHARED" >&6; } -{ echo "$as_me:$LINENO: checking CFLAGSFORSHARED" >&5 -echo $ECHO_N "checking CFLAGSFORSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking CFLAGSFORSHARED" >&5 +$as_echo_n "checking CFLAGSFORSHARED... " >&6; } if test ! "$LIBRARY" = "$LDLIBRARY" then case $ac_sys_system in @@ -13667,8 +13920,8 @@ CFLAGSFORSHARED='$(CCSHARED)' esac fi -{ echo "$as_me:$LINENO: result: $CFLAGSFORSHARED" >&5 -echo "${ECHO_T}$CFLAGSFORSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CFLAGSFORSHARED" >&5 +$as_echo "$CFLAGSFORSHARED" >&6; } # SHLIBS are libraries (except -lc and -lm) to link to the python shared # library (with --enable-shared). @@ -13679,22 +13932,22 @@ # don't need to link LIBS explicitly. The default should be only changed # on systems where this approach causes problems. -{ echo "$as_me:$LINENO: checking SHLIBS" >&5 -echo $ECHO_N "checking SHLIBS... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking SHLIBS" >&5 +$as_echo_n "checking SHLIBS... " >&6; } case "$ac_sys_system" in *) SHLIBS='$(LIBS)';; esac -{ echo "$as_me:$LINENO: result: $SHLIBS" >&5 -echo "${ECHO_T}$SHLIBS" >&6; } +{ $as_echo "$as_me:$LINENO: result: $SHLIBS" >&5 +$as_echo "$SHLIBS" >&6; } # checks for libraries -{ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -13726,33 +13979,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF @@ -13762,10 +14019,10 @@ fi # Dynamic linking for SunOS/Solaris and SYSV -{ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" @@ -13797,33 +14054,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dld_shl_load=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } -if test $ac_cv_lib_dld_shl_load = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDLD 1 _ACEOF @@ -13835,10 +14096,10 @@ # only check for sem_init if thread support is requested if test "$with_threads" = "yes" -o -z "$with_threads"; then - { echo "$as_me:$LINENO: checking for library containing sem_init" >&5 -echo $ECHO_N "checking for library containing sem_init... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing sem_init" >&5 +$as_echo_n "checking for library containing sem_init... " >&6; } if test "${ac_cv_search_sem_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -13876,26 +14137,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_sem_init=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_sem_init+set}" = set; then @@ -13910,8 +14175,8 @@ rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_sem_init" >&5 -echo "${ECHO_T}$ac_cv_search_sem_init" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_sem_init" >&5 +$as_echo "$ac_cv_search_sem_init" >&6; } ac_res=$ac_cv_search_sem_init if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -13923,10 +14188,10 @@ fi # check if we need libintl for locale functions -{ echo "$as_me:$LINENO: checking for textdomain in -lintl" >&5 -echo $ECHO_N "checking for textdomain in -lintl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for textdomain in -lintl" >&5 +$as_echo_n "checking for textdomain in -lintl... " >&6; } if test "${ac_cv_lib_intl_textdomain+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" @@ -13958,33 +14223,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_intl_textdomain=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_textdomain=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_textdomain" >&5 -echo "${ECHO_T}$ac_cv_lib_intl_textdomain" >&6; } -if test $ac_cv_lib_intl_textdomain = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_textdomain" >&5 +$as_echo "$ac_cv_lib_intl_textdomain" >&6; } +if test "x$ac_cv_lib_intl_textdomain" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_LIBINTL 1 @@ -13995,8 +14264,8 @@ # checks for system dependent C++ extensions support case "$ac_sys_system" in - AIX*) { echo "$as_me:$LINENO: checking for genuine AIX C++ extensions support" >&5 -echo $ECHO_N "checking for genuine AIX C++ extensions support... $ECHO_C" >&6; } + AIX*) { $as_echo "$as_me:$LINENO: checking for genuine AIX C++ extensions support" >&5 +$as_echo_n "checking for genuine AIX C++ extensions support... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14018,33 +14287,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define AIX_GENUINE_CPLUSPLUS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext;; *) ;; @@ -14052,10 +14325,10 @@ # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. # BeOS' sockets are stashed in libnet. -{ echo "$as_me:$LINENO: checking for t_open in -lnsl" >&5 -echo $ECHO_N "checking for t_open in -lnsl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for t_open in -lnsl" >&5 +$as_echo_n "checking for t_open in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_t_open+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" @@ -14087,40 +14360,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_nsl_t_open=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_t_open=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_t_open" >&5 -echo "${ECHO_T}$ac_cv_lib_nsl_t_open" >&6; } -if test $ac_cv_lib_nsl_t_open = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_t_open" >&5 +$as_echo "$ac_cv_lib_nsl_t_open" >&6; } +if test "x$ac_cv_lib_nsl_t_open" = x""yes; then LIBS="-lnsl $LIBS" fi # SVR4 -{ echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 -echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 +$as_echo_n "checking for socket in -lsocket... " >&6; } if test "${ac_cv_lib_socket_socket+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS $LIBS" @@ -14152,43 +14429,47 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_socket_socket=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_socket=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6; } -if test $ac_cv_lib_socket_socket = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 +$as_echo "$ac_cv_lib_socket_socket" >&6; } +if test "x$ac_cv_lib_socket_socket" = x""yes; then LIBS="-lsocket $LIBS" fi # SVR4 sockets case "$ac_sys_system" in BeOS*) -{ echo "$as_me:$LINENO: checking for socket in -lnet" >&5 -echo $ECHO_N "checking for socket in -lnet... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for socket in -lnet" >&5 +$as_echo_n "checking for socket in -lnet... " >&6; } if test "${ac_cv_lib_net_socket+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnet $LIBS $LIBS" @@ -14220,58 +14501,62 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_net_socket=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_net_socket=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_net_socket" >&5 -echo "${ECHO_T}$ac_cv_lib_net_socket" >&6; } -if test $ac_cv_lib_net_socket = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_net_socket" >&5 +$as_echo "$ac_cv_lib_net_socket" >&6; } +if test "x$ac_cv_lib_net_socket" = x""yes; then LIBS="-lnet $LIBS" fi # BeOS ;; esac -{ echo "$as_me:$LINENO: checking for --with-libs" >&5 -echo $ECHO_N "checking for --with-libs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-libs" >&5 +$as_echo_n "checking for --with-libs... " >&6; } # Check whether --with-libs was given. if test "${with_libs+set}" = set; then withval=$with_libs; -{ echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } +{ $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } LIBS="$withval $LIBS" else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Check for use of the system libffi library -{ echo "$as_me:$LINENO: checking for --with-system-ffi" >&5 -echo $ECHO_N "checking for --with-system-ffi... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-system-ffi" >&5 +$as_echo_n "checking for --with-system-ffi... " >&6; } # Check whether --with-system_ffi was given. if test "${with_system_ffi+set}" = set; then @@ -14279,41 +14564,41 @@ fi -{ echo "$as_me:$LINENO: result: $with_system_ffi" >&5 -echo "${ECHO_T}$with_system_ffi" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_system_ffi" >&5 +$as_echo "$with_system_ffi" >&6; } # Check for --with-dbmliborder -{ echo "$as_me:$LINENO: checking for --with-dbmliborder" >&5 -echo $ECHO_N "checking for --with-dbmliborder... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-dbmliborder" >&5 +$as_echo_n "checking for --with-dbmliborder... " >&6; } # Check whether --with-dbmliborder was given. if test "${with_dbmliborder+set}" = set; then withval=$with_dbmliborder; if test x$with_dbmliborder = xyes then -{ { echo "$as_me:$LINENO: error: proper usage is --with-dbmliborder=db1:db2:..." >&5 -echo "$as_me: error: proper usage is --with-dbmliborder=db1:db2:..." >&2;} +{ { $as_echo "$as_me:$LINENO: error: proper usage is --with-dbmliborder=db1:db2:..." >&5 +$as_echo "$as_me: error: proper usage is --with-dbmliborder=db1:db2:..." >&2;} { (exit 1); exit 1; }; } else for db in `echo $with_dbmliborder | sed 's/:/ /g'`; do if test x$db != xndbm && test x$db != xgdbm && test x$db != xbdb then - { { echo "$as_me:$LINENO: error: proper usage is --with-dbmliborder=db1:db2:..." >&5 -echo "$as_me: error: proper usage is --with-dbmliborder=db1:db2:..." >&2;} + { { $as_echo "$as_me:$LINENO: error: proper usage is --with-dbmliborder=db1:db2:..." >&5 +$as_echo "$as_me: error: proper usage is --with-dbmliborder=db1:db2:..." >&2;} { (exit 1); exit 1; }; } fi done fi fi -{ echo "$as_me:$LINENO: result: $with_dbmliborder" >&5 -echo "${ECHO_T}$with_dbmliborder" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_dbmliborder" >&5 +$as_echo "$with_dbmliborder" >&6; } # Determine if signalmodule should be used. -{ echo "$as_me:$LINENO: checking for --with-signal-module" >&5 -echo $ECHO_N "checking for --with-signal-module... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-signal-module" >&5 +$as_echo_n "checking for --with-signal-module... " >&6; } # Check whether --with-signal-module was given. if test "${with_signal_module+set}" = set; then @@ -14324,8 +14609,8 @@ if test -z "$with_signal_module" then with_signal_module="yes" fi -{ echo "$as_me:$LINENO: result: $with_signal_module" >&5 -echo "${ECHO_T}$with_signal_module" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_signal_module" >&5 +$as_echo "$with_signal_module" >&6; } if test "${with_signal_module}" = "yes"; then USE_SIGNAL_MODULE="" @@ -14339,22 +14624,22 @@ USE_THREAD_MODULE="" -{ echo "$as_me:$LINENO: checking for --with-dec-threads" >&5 -echo $ECHO_N "checking for --with-dec-threads... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-dec-threads" >&5 +$as_echo_n "checking for --with-dec-threads... " >&6; } # Check whether --with-dec-threads was given. if test "${with_dec_threads+set}" = set; then withval=$with_dec_threads; -{ echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } +{ $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } LDLAST=-threads if test "${with_thread+set}" != set; then with_thread="$withval"; fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -14367,8 +14652,8 @@ -{ echo "$as_me:$LINENO: checking for --with-threads" >&5 -echo $ECHO_N "checking for --with-threads... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-threads" >&5 +$as_echo_n "checking for --with-threads... " >&6; } # Check whether --with-threads was given. if test "${with_threads+set}" = set; then @@ -14387,8 +14672,8 @@ if test -z "$with_threads" then with_threads="yes" fi -{ echo "$as_me:$LINENO: result: $with_threads" >&5 -echo "${ECHO_T}$with_threads" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_threads" >&5 +$as_echo "$with_threads" >&6; } if test "$with_threads" = "no" @@ -14454,8 +14739,8 @@ # According to the POSIX spec, a pthreads implementation must # define _POSIX_THREADS in unistd.h. Some apparently don't # (e.g. gnu pth with pthread emulation) - { echo "$as_me:$LINENO: checking for _POSIX_THREADS in unistd.h" >&5 -echo $ECHO_N "checking for _POSIX_THREADS in unistd.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for _POSIX_THREADS in unistd.h" >&5 +$as_echo_n "checking for _POSIX_THREADS in unistd.h... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14477,25 +14762,25 @@ fi rm -f conftest* - { echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5 -echo "${ECHO_T}$unistd_defines_pthreads" >&6; } + { $as_echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5 +$as_echo "$unistd_defines_pthreads" >&6; } cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF if test "${ac_cv_header_cthreads_h+set}" = set; then - { echo "$as_me:$LINENO: checking for cthreads.h" >&5 -echo $ECHO_N "checking for cthreads.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for cthreads.h" >&5 +$as_echo_n "checking for cthreads.h... " >&6; } if test "${ac_cv_header_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 +$as_echo "$ac_cv_header_cthreads_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking cthreads.h usability" >&5 -echo $ECHO_N "checking cthreads.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking cthreads.h usability" >&5 +$as_echo_n "checking cthreads.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14511,32 +14796,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking cthreads.h presence" >&5 -echo $ECHO_N "checking cthreads.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking cthreads.h presence" >&5 +$as_echo_n "checking cthreads.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14550,51 +14836,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: cthreads.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: cthreads.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: cthreads.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: cthreads.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: cthreads.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: cthreads.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: cthreads.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: cthreads.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: cthreads.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: cthreads.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: cthreads.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: cthreads.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: cthreads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -14603,18 +14890,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for cthreads.h" >&5 -echo $ECHO_N "checking for cthreads.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for cthreads.h" >&5 +$as_echo_n "checking for cthreads.h... " >&6; } if test "${ac_cv_header_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_cthreads_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 +$as_echo "$ac_cv_header_cthreads_h" >&6; } fi -if test $ac_cv_header_cthreads_h = yes; then +if test "x$ac_cv_header_cthreads_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14633,17 +14920,17 @@ else if test "${ac_cv_header_mach_cthreads_h+set}" = set; then - { echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 -echo $ECHO_N "checking for mach/cthreads.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 +$as_echo_n "checking for mach/cthreads.h... " >&6; } if test "${ac_cv_header_mach_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_mach_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 +$as_echo "$ac_cv_header_mach_cthreads_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking mach/cthreads.h usability" >&5 -echo $ECHO_N "checking mach/cthreads.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking mach/cthreads.h usability" >&5 +$as_echo_n "checking mach/cthreads.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14659,32 +14946,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking mach/cthreads.h presence" >&5 -echo $ECHO_N "checking mach/cthreads.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking mach/cthreads.h presence" >&5 +$as_echo_n "checking mach/cthreads.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14698,51 +14986,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: mach/cthreads.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: mach/cthreads.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -14751,18 +15040,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 -echo $ECHO_N "checking for mach/cthreads.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 +$as_echo_n "checking for mach/cthreads.h... " >&6; } if test "${ac_cv_header_mach_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_mach_cthreads_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_mach_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 +$as_echo "$ac_cv_header_mach_cthreads_h" >&6; } fi -if test $ac_cv_header_mach_cthreads_h = yes; then +if test "x$ac_cv_header_mach_cthreads_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14779,13 +15068,13 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for --with-pth" >&5 -echo $ECHO_N "checking for --with-pth... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for --with-pth" >&5 +$as_echo_n "checking for --with-pth... " >&6; } # Check whether --with-pth was given. if test "${with_pth+set}" = set; then - withval=$with_pth; { echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } + withval=$with_pth; { $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14798,16 +15087,16 @@ LIBS="-lpth $LIBS" THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } # Just looking for pthread_create in libpthread is not enough: # on HP/UX, pthread.h renames pthread_create to a different symbol name. # So we really have to include pthread.h, and then link. _libs=$LIBS LIBS="$LIBS -lpthread" - { echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 -echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 +$as_echo_n "checking for pthread_create in -lpthread... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14832,21 +15121,24 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14854,15 +15146,15 @@ posix_threads=yes THREADOBJ="Python/thread.o" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$_libs - { echo "$as_me:$LINENO: checking for pthread_detach" >&5 -echo $ECHO_N "checking for pthread_detach... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_detach" >&5 +$as_echo_n "checking for pthread_detach... " >&6; } if test "${ac_cv_func_pthread_detach+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -14915,32 +15207,36 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_pthread_detach=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_pthread_detach=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_pthread_detach" >&5 -echo "${ECHO_T}$ac_cv_func_pthread_detach" >&6; } -if test $ac_cv_func_pthread_detach = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_pthread_detach" >&5 +$as_echo "$ac_cv_func_pthread_detach" >&6; } +if test "x$ac_cv_func_pthread_detach" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14950,17 +15246,17 @@ else if test "${ac_cv_header_atheos_threads_h+set}" = set; then - { echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 -echo $ECHO_N "checking for atheos/threads.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 +$as_echo_n "checking for atheos/threads.h... " >&6; } if test "${ac_cv_header_atheos_threads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 -echo "${ECHO_T}$ac_cv_header_atheos_threads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 +$as_echo "$ac_cv_header_atheos_threads_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking atheos/threads.h usability" >&5 -echo $ECHO_N "checking atheos/threads.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking atheos/threads.h usability" >&5 +$as_echo_n "checking atheos/threads.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14976,32 +15272,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking atheos/threads.h presence" >&5 -echo $ECHO_N "checking atheos/threads.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking atheos/threads.h presence" >&5 +$as_echo_n "checking atheos/threads.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15015,51 +15312,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: atheos/threads.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: atheos/threads.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: atheos/threads.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -15068,18 +15366,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 -echo $ECHO_N "checking for atheos/threads.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 +$as_echo_n "checking for atheos/threads.h... " >&6; } if test "${ac_cv_header_atheos_threads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_atheos_threads_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 -echo "${ECHO_T}$ac_cv_header_atheos_threads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 +$as_echo "$ac_cv_header_atheos_threads_h" >&6; } fi -if test $ac_cv_header_atheos_threads_h = yes; then +if test "x$ac_cv_header_atheos_threads_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15093,17 +15391,17 @@ else if test "${ac_cv_header_kernel_OS_h+set}" = set; then - { echo "$as_me:$LINENO: checking for kernel/OS.h" >&5 -echo $ECHO_N "checking for kernel/OS.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for kernel/OS.h" >&5 +$as_echo_n "checking for kernel/OS.h... " >&6; } if test "${ac_cv_header_kernel_OS_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_kernel_OS_h" >&5 -echo "${ECHO_T}$ac_cv_header_kernel_OS_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_kernel_OS_h" >&5 +$as_echo "$ac_cv_header_kernel_OS_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking kernel/OS.h usability" >&5 -echo $ECHO_N "checking kernel/OS.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking kernel/OS.h usability" >&5 +$as_echo_n "checking kernel/OS.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15119,32 +15417,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking kernel/OS.h presence" >&5 -echo $ECHO_N "checking kernel/OS.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking kernel/OS.h presence" >&5 +$as_echo_n "checking kernel/OS.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15158,51 +15457,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: kernel/OS.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: kernel/OS.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: kernel/OS.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: kernel/OS.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: kernel/OS.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: kernel/OS.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: kernel/OS.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: kernel/OS.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: kernel/OS.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: kernel/OS.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: kernel/OS.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: kernel/OS.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: kernel/OS.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: kernel/OS.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: kernel/OS.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: kernel/OS.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: kernel/OS.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: kernel/OS.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: kernel/OS.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: kernel/OS.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: kernel/OS.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: kernel/OS.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: kernel/OS.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: kernel/OS.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: kernel/OS.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: kernel/OS.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: kernel/OS.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: kernel/OS.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: kernel/OS.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: kernel/OS.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: kernel/OS.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: kernel/OS.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -15211,18 +15511,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for kernel/OS.h" >&5 -echo $ECHO_N "checking for kernel/OS.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for kernel/OS.h" >&5 +$as_echo_n "checking for kernel/OS.h... " >&6; } if test "${ac_cv_header_kernel_OS_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_kernel_OS_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_kernel_OS_h" >&5 -echo "${ECHO_T}$ac_cv_header_kernel_OS_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_kernel_OS_h" >&5 +$as_echo "$ac_cv_header_kernel_OS_h" >&6; } fi -if test $ac_cv_header_kernel_OS_h = yes; then +if test "x$ac_cv_header_kernel_OS_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15235,10 +15535,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for pthread_create in -lpthreads" >&5 -echo $ECHO_N "checking for pthread_create in -lpthreads... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthreads" >&5 +$as_echo_n "checking for pthread_create in -lpthreads... " >&6; } if test "${ac_cv_lib_pthreads_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" @@ -15270,33 +15570,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_pthreads_pthread_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthreads_pthread_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_create" >&6; } -if test $ac_cv_lib_pthreads_pthread_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_create" >&5 +$as_echo "$ac_cv_lib_pthreads_pthread_create" >&6; } +if test "x$ac_cv_lib_pthreads_pthread_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15306,10 +15610,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5 -echo $ECHO_N "checking for pthread_create in -lc_r... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5 +$as_echo_n "checking for pthread_create in -lc_r... " >&6; } if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" @@ -15341,33 +15645,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_c_r_pthread_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_c_r_pthread_create" >&6; } -if test $ac_cv_lib_c_r_pthread_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5 +$as_echo "$ac_cv_lib_c_r_pthread_create" >&6; } +if test "x$ac_cv_lib_c_r_pthread_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15377,10 +15685,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for __pthread_create_system in -lpthread" >&5 -echo $ECHO_N "checking for __pthread_create_system in -lpthread... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for __pthread_create_system in -lpthread" >&5 +$as_echo_n "checking for __pthread_create_system in -lpthread... " >&6; } if test "${ac_cv_lib_pthread___pthread_create_system+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" @@ -15412,33 +15720,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_pthread___pthread_create_system=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread___pthread_create_system=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_create_system" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread___pthread_create_system" >&6; } -if test $ac_cv_lib_pthread___pthread_create_system = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_create_system" >&5 +$as_echo "$ac_cv_lib_pthread___pthread_create_system" >&6; } +if test "x$ac_cv_lib_pthread___pthread_create_system" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15448,10 +15760,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for pthread_create in -lcma" >&5 -echo $ECHO_N "checking for pthread_create in -lcma... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lcma" >&5 +$as_echo_n "checking for pthread_create in -lcma... " >&6; } if test "${ac_cv_lib_cma_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcma $LIBS" @@ -15483,33 +15795,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_cma_pthread_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_cma_pthread_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_cma_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_cma_pthread_create" >&6; } -if test $ac_cv_lib_cma_pthread_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cma_pthread_create" >&5 +$as_echo "$ac_cv_lib_cma_pthread_create" >&6; } +if test "x$ac_cv_lib_cma_pthread_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15539,6 +15855,7 @@ fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi @@ -15550,10 +15867,10 @@ - { echo "$as_me:$LINENO: checking for usconfig in -lmpc" >&5 -echo $ECHO_N "checking for usconfig in -lmpc... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for usconfig in -lmpc" >&5 +$as_echo_n "checking for usconfig in -lmpc... " >&6; } if test "${ac_cv_lib_mpc_usconfig+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmpc $LIBS" @@ -15585,33 +15902,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_mpc_usconfig=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_mpc_usconfig=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_mpc_usconfig" >&5 -echo "${ECHO_T}$ac_cv_lib_mpc_usconfig" >&6; } -if test $ac_cv_lib_mpc_usconfig = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mpc_usconfig" >&5 +$as_echo "$ac_cv_lib_mpc_usconfig" >&6; } +if test "x$ac_cv_lib_mpc_usconfig" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15623,10 +15944,10 @@ if test "$posix_threads" != "yes"; then - { echo "$as_me:$LINENO: checking for thr_create in -lthread" >&5 -echo $ECHO_N "checking for thr_create in -lthread... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for thr_create in -lthread" >&5 +$as_echo_n "checking for thr_create in -lthread... " >&6; } if test "${ac_cv_lib_thread_thr_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lthread $LIBS" @@ -15658,33 +15979,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_thread_thr_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_thread_thr_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_thread_thr_create" >&5 -echo "${ECHO_T}$ac_cv_lib_thread_thr_create" >&6; } -if test $ac_cv_lib_thread_thr_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_thread_thr_create" >&5 +$as_echo "$ac_cv_lib_thread_thr_create" >&6; } +if test "x$ac_cv_lib_thread_thr_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15737,10 +16062,10 @@ ;; esac - { echo "$as_me:$LINENO: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5 -echo $ECHO_N "checking if PTHREAD_SCOPE_SYSTEM is supported... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5 +$as_echo_n "checking if PTHREAD_SCOPE_SYSTEM is supported... " >&6; } if test "${ac_cv_pthread_system_supported+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_pthread_system_supported=no @@ -15770,29 +16095,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_pthread_system_supported=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_pthread_system_supported=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -15800,8 +16128,8 @@ fi - { echo "$as_me:$LINENO: result: $ac_cv_pthread_system_supported" >&5 -echo "${ECHO_T}$ac_cv_pthread_system_supported" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_pthread_system_supported" >&5 +$as_echo "$ac_cv_pthread_system_supported" >&6; } if test "$ac_cv_pthread_system_supported" = "yes"; then cat >>confdefs.h <<\_ACEOF @@ -15812,11 +16140,11 @@ for ac_func in pthread_sigmask do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -15869,35 +16197,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF case $ac_sys_system in CYGWIN*) @@ -15917,18 +16252,18 @@ # Check for enable-ipv6 -{ echo "$as_me:$LINENO: checking if --enable-ipv6 is specified" >&5 -echo $ECHO_N "checking if --enable-ipv6 is specified... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if --enable-ipv6 is specified" >&5 +$as_echo_n "checking if --enable-ipv6 is specified... " >&6; } # Check whether --enable-ipv6 was given. if test "${enable_ipv6+set}" = set; then enableval=$enable_ipv6; case "$enableval" in no) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no ;; - *) { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + *) { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define ENABLE_IPV6 1 _ACEOF @@ -15939,8 +16274,8 @@ else if test "$cross_compiling" = yes; then - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no else @@ -15968,41 +16303,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } ipv6=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test "$ipv6" = "yes"; then - { echo "$as_me:$LINENO: checking if RFC2553 API is available" >&5 -echo $ECHO_N "checking if RFC2553 API is available... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if RFC2553 API is available" >&5 +$as_echo_n "checking if RFC2553 API is available... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16026,26 +16364,27 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } ipv6=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no fi @@ -16067,8 +16406,8 @@ ipv6trylibc=no if test "$ipv6" = "yes"; then - { echo "$as_me:$LINENO: checking ipv6 stack type" >&5 -echo $ECHO_N "checking ipv6 stack type... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking ipv6 stack type" >&5 +$as_echo_n "checking ipv6 stack type... " >&6; } for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta; do case $i in @@ -16224,8 +16563,8 @@ break fi done - { echo "$as_me:$LINENO: result: $ipv6type" >&5 -echo "${ECHO_T}$ipv6type" >&6; } + { $as_echo "$as_me:$LINENO: result: $ipv6type" >&5 +$as_echo "$ipv6type" >&6; } fi if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then @@ -16244,8 +16583,8 @@ fi fi -{ echo "$as_me:$LINENO: checking for OSX 10.5 SDK or later" >&5 -echo $ECHO_N "checking for OSX 10.5 SDK or later... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for OSX 10.5 SDK or later" >&5 +$as_echo_n "checking for OSX 10.5 SDK or later... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16267,13 +16606,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16283,22 +16623,22 @@ #define HAVE_OSX105_SDK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Check for --with-doc-strings -{ echo "$as_me:$LINENO: checking for --with-doc-strings" >&5 -echo $ECHO_N "checking for --with-doc-strings... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-doc-strings" >&5 +$as_echo_n "checking for --with-doc-strings... " >&6; } # Check whether --with-doc-strings was given. if test "${with_doc_strings+set}" = set; then @@ -16317,12 +16657,12 @@ _ACEOF fi -{ echo "$as_me:$LINENO: result: $with_doc_strings" >&5 -echo "${ECHO_T}$with_doc_strings" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_doc_strings" >&5 +$as_echo "$with_doc_strings" >&6; } # Check for Python-specific malloc support -{ echo "$as_me:$LINENO: checking for --with-tsc" >&5 -echo $ECHO_N "checking for --with-tsc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-tsc" >&5 +$as_echo_n "checking for --with-tsc... " >&6; } # Check whether --with-tsc was given. if test "${with_tsc+set}" = set; then @@ -16334,20 +16674,20 @@ #define WITH_TSC 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Check for Python-specific malloc support -{ echo "$as_me:$LINENO: checking for --with-pymalloc" >&5 -echo $ECHO_N "checking for --with-pymalloc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-pymalloc" >&5 +$as_echo_n "checking for --with-pymalloc... " >&6; } # Check whether --with-pymalloc was given. if test "${with_pymalloc+set}" = set; then @@ -16366,12 +16706,12 @@ _ACEOF fi -{ echo "$as_me:$LINENO: result: $with_pymalloc" >&5 -echo "${ECHO_T}$with_pymalloc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_pymalloc" >&5 +$as_echo "$with_pymalloc" >&6; } # Check for --with-wctype-functions -{ echo "$as_me:$LINENO: checking for --with-wctype-functions" >&5 -echo $ECHO_N "checking for --with-wctype-functions... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-wctype-functions" >&5 +$as_echo_n "checking for --with-wctype-functions... " >&6; } # Check whether --with-wctype-functions was given. if test "${with_wctype_functions+set}" = set; then @@ -16383,14 +16723,14 @@ #define WANT_WCTYPE_FUNCTIONS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -16403,11 +16743,11 @@ for ac_func in dlopen do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -16460,35 +16800,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -16498,8 +16845,8 @@ # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic # loading of modules. -{ echo "$as_me:$LINENO: checking DYNLOADFILE" >&5 -echo $ECHO_N "checking DYNLOADFILE... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking DYNLOADFILE" >&5 +$as_echo_n "checking DYNLOADFILE... " >&6; } if test -z "$DYNLOADFILE" then case $ac_sys_system/$ac_sys_release in @@ -16524,8 +16871,8 @@ ;; esac fi -{ echo "$as_me:$LINENO: result: $DYNLOADFILE" >&5 -echo "${ECHO_T}$DYNLOADFILE" >&6; } +{ $as_echo "$as_me:$LINENO: result: $DYNLOADFILE" >&5 +$as_echo "$DYNLOADFILE" >&6; } if test "$DYNLOADFILE" != "dynload_stub.o" then @@ -16538,16 +16885,16 @@ # MACHDEP_OBJS can be set to platform-specific object files needed by Python -{ echo "$as_me:$LINENO: checking MACHDEP_OBJS" >&5 -echo $ECHO_N "checking MACHDEP_OBJS... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking MACHDEP_OBJS" >&5 +$as_echo_n "checking MACHDEP_OBJS... " >&6; } if test -z "$MACHDEP_OBJS" then MACHDEP_OBJS=$extra_machdep_objs else MACHDEP_OBJS="$MACHDEP_OBJS $extra_machdep_objs" fi -{ echo "$as_me:$LINENO: result: MACHDEP_OBJS" >&5 -echo "${ECHO_T}MACHDEP_OBJS" >&6; } +{ $as_echo "$as_me:$LINENO: result: MACHDEP_OBJS" >&5 +$as_echo "MACHDEP_OBJS" >&6; } # checks for library functions @@ -16649,11 +16996,11 @@ sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ truncate uname unsetenv utimes waitpid wait3 wait4 wcscoll _getpty do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -16706,35 +17053,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -16743,8 +17097,8 @@ # For some functions, having a definition is not sufficient, since # we want to take their address. -{ echo "$as_me:$LINENO: checking for chroot" >&5 -echo $ECHO_N "checking for chroot... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for chroot" >&5 +$as_echo_n "checking for chroot... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16766,13 +17120,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16782,20 +17137,20 @@ #define HAVE_CHROOT 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for link" >&5 -echo $ECHO_N "checking for link... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for link" >&5 +$as_echo_n "checking for link... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16817,13 +17172,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16833,20 +17189,20 @@ #define HAVE_LINK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for symlink" >&5 -echo $ECHO_N "checking for symlink... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for symlink" >&5 +$as_echo_n "checking for symlink... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16868,13 +17224,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16884,20 +17241,20 @@ #define HAVE_SYMLINK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for fchdir" >&5 -echo $ECHO_N "checking for fchdir... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fchdir" >&5 +$as_echo_n "checking for fchdir... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16919,13 +17276,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16935,20 +17293,20 @@ #define HAVE_FCHDIR 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for fsync" >&5 -echo $ECHO_N "checking for fsync... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fsync" >&5 +$as_echo_n "checking for fsync... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16970,13 +17328,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16986,20 +17345,20 @@ #define HAVE_FSYNC 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for fdatasync" >&5 -echo $ECHO_N "checking for fdatasync... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fdatasync" >&5 +$as_echo_n "checking for fdatasync... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17021,13 +17380,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17037,20 +17397,20 @@ #define HAVE_FDATASYNC 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for epoll" >&5 -echo $ECHO_N "checking for epoll... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for epoll" >&5 +$as_echo_n "checking for epoll... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17072,13 +17432,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17088,20 +17449,20 @@ #define HAVE_EPOLL 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for kqueue" >&5 -echo $ECHO_N "checking for kqueue... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for kqueue" >&5 +$as_echo_n "checking for kqueue... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17126,13 +17487,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17142,14 +17504,14 @@ #define HAVE_KQUEUE 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -17160,8 +17522,8 @@ # address to avoid compiler warnings and potential miscompilations # because of the missing prototypes. -{ echo "$as_me:$LINENO: checking for ctermid_r" >&5 -echo $ECHO_N "checking for ctermid_r... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ctermid_r" >&5 +$as_echo_n "checking for ctermid_r... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17186,13 +17548,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17202,21 +17565,21 @@ #define HAVE_CTERMID_R 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for flock" >&5 -echo $ECHO_N "checking for flock... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for flock" >&5 +$as_echo_n "checking for flock... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17241,13 +17604,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17257,21 +17621,21 @@ #define HAVE_FLOCK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for getpagesize" >&5 -echo $ECHO_N "checking for getpagesize... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getpagesize" >&5 +$as_echo_n "checking for getpagesize... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17296,13 +17660,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17312,14 +17677,14 @@ #define HAVE_GETPAGESIZE 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -17329,10 +17694,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_TRUE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$TRUE"; then ac_cv_prog_TRUE="$TRUE" # Let the user override the test. @@ -17345,7 +17710,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_TRUE="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -17356,11 +17721,11 @@ fi TRUE=$ac_cv_prog_TRUE if test -n "$TRUE"; then - { echo "$as_me:$LINENO: result: $TRUE" >&5 -echo "${ECHO_T}$TRUE" >&6; } + { $as_echo "$as_me:$LINENO: result: $TRUE" >&5 +$as_echo "$TRUE" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -17369,10 +17734,10 @@ test -n "$TRUE" || TRUE="/bin/true" -{ echo "$as_me:$LINENO: checking for inet_aton in -lc" >&5 -echo $ECHO_N "checking for inet_aton in -lc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_aton in -lc" >&5 +$as_echo_n "checking for inet_aton in -lc... " >&6; } if test "${ac_cv_lib_c_inet_aton+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" @@ -17404,40 +17769,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_c_inet_aton=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_inet_aton=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_inet_aton" >&5 -echo "${ECHO_T}$ac_cv_lib_c_inet_aton" >&6; } -if test $ac_cv_lib_c_inet_aton = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_inet_aton" >&5 +$as_echo "$ac_cv_lib_c_inet_aton" >&6; } +if test "x$ac_cv_lib_c_inet_aton" = x""yes; then $ac_cv_prog_TRUE else -{ echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5 -echo $ECHO_N "checking for inet_aton in -lresolv... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5 +$as_echo_n "checking for inet_aton in -lresolv... " >&6; } if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" @@ -17469,33 +17838,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_resolv_inet_aton=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_resolv_inet_aton=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5 -echo "${ECHO_T}$ac_cv_lib_resolv_inet_aton" >&6; } -if test $ac_cv_lib_resolv_inet_aton = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5 +$as_echo "$ac_cv_lib_resolv_inet_aton" >&6; } +if test "x$ac_cv_lib_resolv_inet_aton" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF @@ -17510,14 +17883,16 @@ # On Tru64, chflags seems to be present, but calling it will # exit Python -{ echo "$as_me:$LINENO: checking for chflags" >&5 -echo $ECHO_N "checking for chflags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for chflags" >&5 +$as_echo_n "checking for chflags... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17542,50 +17917,55 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_CHFLAGS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: checking for lchflags" >&5 -echo $ECHO_N "checking for lchflags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for lchflags" >&5 +$as_echo_n "checking for lchflags... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17610,37 +17990,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_LCHFLAGS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -17655,10 +18038,10 @@ ;; esac -{ echo "$as_me:$LINENO: checking for inflateCopy in -lz" >&5 -echo $ECHO_N "checking for inflateCopy in -lz... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inflateCopy in -lz" >&5 +$as_echo_n "checking for inflateCopy in -lz... " >&6; } if test "${ac_cv_lib_z_inflateCopy+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" @@ -17690,33 +18073,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_z_inflateCopy=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_inflateCopy=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateCopy" >&5 -echo "${ECHO_T}$ac_cv_lib_z_inflateCopy" >&6; } -if test $ac_cv_lib_z_inflateCopy = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateCopy" >&5 +$as_echo "$ac_cv_lib_z_inflateCopy" >&6; } +if test "x$ac_cv_lib_z_inflateCopy" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ZLIB_COPY 1 @@ -17732,8 +18119,8 @@ ;; esac -{ echo "$as_me:$LINENO: checking for hstrerror" >&5 -echo $ECHO_N "checking for hstrerror... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for hstrerror" >&5 +$as_echo_n "checking for hstrerror... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17758,39 +18145,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define HAVE_HSTRERROR 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for inet_aton" >&5 -echo $ECHO_N "checking for inet_aton... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_aton" >&5 +$as_echo_n "checking for inet_aton... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17818,39 +18209,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define HAVE_INET_ATON 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for inet_pton" >&5 -echo $ECHO_N "checking for inet_pton... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_pton" >&5 +$as_echo_n "checking for inet_pton... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17878,13 +18273,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17894,22 +18290,22 @@ #define HAVE_INET_PTON 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # On some systems, setgroups is in unistd.h, on others, in grp.h -{ echo "$as_me:$LINENO: checking for setgroups" >&5 -echo $ECHO_N "checking for setgroups... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for setgroups" >&5 +$as_echo_n "checking for setgroups... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17937,13 +18333,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17953,14 +18350,14 @@ #define HAVE_SETGROUPS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -17971,11 +18368,11 @@ for ac_func in openpty do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18028,42 +18425,49 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else - { echo "$as_me:$LINENO: checking for openpty in -lutil" >&5 -echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for openpty in -lutil" >&5 +$as_echo_n "checking for openpty in -lutil... " >&6; } if test "${ac_cv_lib_util_openpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" @@ -18095,42 +18499,46 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_util_openpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_util_openpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_util_openpty" >&5 -echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6; } -if test $ac_cv_lib_util_openpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_util_openpty" >&5 +$as_echo "$ac_cv_lib_util_openpty" >&6; } +if test "x$ac_cv_lib_util_openpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_OPENPTY 1 _ACEOF LIBS="$LIBS -lutil" else - { echo "$as_me:$LINENO: checking for openpty in -lbsd" >&5 -echo $ECHO_N "checking for openpty in -lbsd... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for openpty in -lbsd" >&5 +$as_echo_n "checking for openpty in -lbsd... " >&6; } if test "${ac_cv_lib_bsd_openpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" @@ -18162,33 +18570,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_bsd_openpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_openpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_openpty" >&5 -echo "${ECHO_T}$ac_cv_lib_bsd_openpty" >&6; } -if test $ac_cv_lib_bsd_openpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_openpty" >&5 +$as_echo "$ac_cv_lib_bsd_openpty" >&6; } +if test "x$ac_cv_lib_bsd_openpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_OPENPTY 1 _ACEOF @@ -18205,11 +18617,11 @@ for ac_func in forkpty do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18262,42 +18674,49 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else - { echo "$as_me:$LINENO: checking for forkpty in -lutil" >&5 -echo $ECHO_N "checking for forkpty in -lutil... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for forkpty in -lutil" >&5 +$as_echo_n "checking for forkpty in -lutil... " >&6; } if test "${ac_cv_lib_util_forkpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" @@ -18329,42 +18748,46 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_util_forkpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_util_forkpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_util_forkpty" >&5 -echo "${ECHO_T}$ac_cv_lib_util_forkpty" >&6; } -if test $ac_cv_lib_util_forkpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_util_forkpty" >&5 +$as_echo "$ac_cv_lib_util_forkpty" >&6; } +if test "x$ac_cv_lib_util_forkpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FORKPTY 1 _ACEOF LIBS="$LIBS -lutil" else - { echo "$as_me:$LINENO: checking for forkpty in -lbsd" >&5 -echo $ECHO_N "checking for forkpty in -lbsd... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for forkpty in -lbsd" >&5 +$as_echo_n "checking for forkpty in -lbsd... " >&6; } if test "${ac_cv_lib_bsd_forkpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" @@ -18396,33 +18819,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_bsd_forkpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_forkpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_forkpty" >&5 -echo "${ECHO_T}$ac_cv_lib_bsd_forkpty" >&6; } -if test $ac_cv_lib_bsd_forkpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_forkpty" >&5 +$as_echo "$ac_cv_lib_bsd_forkpty" >&6; } +if test "x$ac_cv_lib_bsd_forkpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FORKPTY 1 _ACEOF @@ -18441,11 +18868,11 @@ for ac_func in memmove do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18498,35 +18925,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -18542,11 +18976,11 @@ for ac_func in fseek64 fseeko fstatvfs ftell64 ftello statvfs do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18599,35 +19033,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -18639,11 +19080,11 @@ for ac_func in dup2 getcwd strdup do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18696,35 +19137,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else @@ -18741,11 +19189,11 @@ for ac_func in getpgrp do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18798,35 +19246,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18849,13 +19304,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -18867,7 +19323,7 @@ else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18881,11 +19337,11 @@ for ac_func in setpgrp do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18938,35 +19394,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18989,13 +19452,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -19007,7 +19471,7 @@ else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -19021,11 +19485,11 @@ for ac_func in gettimeofday do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19078,35 +19542,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19129,20 +19600,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -19159,8 +19631,8 @@ done -{ echo "$as_me:$LINENO: checking for major" >&5 -echo $ECHO_N "checking for major... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for major" >&5 +$as_echo_n "checking for major... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -19192,44 +19664,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define HAVE_DEVICE_MACROS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext # On OSF/1 V5.1, getaddrinfo is available, but a define # for [no]getaddrinfo in netdb.h. -{ echo "$as_me:$LINENO: checking for getaddrinfo" >&5 -echo $ECHO_N "checking for getaddrinfo... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getaddrinfo" >&5 +$as_echo_n "checking for getaddrinfo... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -19258,26 +19734,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -{ echo "$as_me:$LINENO: checking getaddrinfo bug" >&5 -echo $ECHO_N "checking getaddrinfo bug... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +{ $as_echo "$as_me:$LINENO: checking getaddrinfo bug" >&5 +$as_echo_n "checking getaddrinfo bug... " >&6; } if test "$cross_compiling" = yes; then - { echo "$as_me:$LINENO: result: buggy" >&5 -echo "${ECHO_T}buggy" >&6; } + { $as_echo "$as_me:$LINENO: result: buggy" >&5 +$as_echo "buggy" >&6; } buggygetaddrinfo=yes else cat >conftest.$ac_ext <<_ACEOF @@ -19380,48 +19859,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: good" >&5 -echo "${ECHO_T}good" >&6; } + { $as_echo "$as_me:$LINENO: result: good" >&5 +$as_echo "good" >&6; } buggygetaddrinfo=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: buggy" >&5 -echo "${ECHO_T}buggy" >&6; } +{ $as_echo "$as_me:$LINENO: result: buggy" >&5 +$as_echo "buggy" >&6; } buggygetaddrinfo=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } buggygetaddrinfo=yes fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext @@ -19441,11 +19924,11 @@ for ac_func in getnameinfo do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19498,35 +19981,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -19534,10 +20024,10 @@ # checks for structures -{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if test "${ac_cv_header_time+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19564,20 +20054,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no @@ -19585,8 +20076,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF @@ -19595,10 +20086,10 @@ fi -{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if test "${ac_cv_struct_tm+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19614,7 +20105,7 @@ { struct tm tm; int *p = &tm.tm_sec; - return !p; + return !p; ; return 0; } @@ -19625,20 +20116,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_tm=time.h else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h @@ -19646,8 +20138,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -echo "${ECHO_T}$ac_cv_struct_tm" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF @@ -19656,10 +20148,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 -echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 +$as_echo_n "checking for struct tm.tm_zone... " >&6; } if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19687,20 +20179,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19729,20 +20222,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_zone=no @@ -19753,9 +20247,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 -echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6; } -if test $ac_cv_member_struct_tm_tm_zone = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 +$as_echo "$ac_cv_member_struct_tm_tm_zone" >&6; } +if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 @@ -19771,10 +20265,10 @@ _ACEOF else - { echo "$as_me:$LINENO: checking whether tzname is declared" >&5 -echo $ECHO_N "checking whether tzname is declared... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether tzname is declared" >&5 +$as_echo_n "checking whether tzname is declared... " >&6; } if test "${ac_cv_have_decl_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19801,20 +20295,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_tzname=no @@ -19822,9 +20317,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 -echo "${ECHO_T}$ac_cv_have_decl_tzname" >&6; } -if test $ac_cv_have_decl_tzname = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 +$as_echo "$ac_cv_have_decl_tzname" >&6; } +if test "x$ac_cv_have_decl_tzname" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_TZNAME 1 @@ -19840,10 +20335,10 @@ fi - { echo "$as_me:$LINENO: checking for tzname" >&5 -echo $ECHO_N "checking for tzname... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for tzname" >&5 +$as_echo_n "checking for tzname... " >&6; } if test "${ac_cv_var_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19870,31 +20365,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_var_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_var_tzname=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 -echo "${ECHO_T}$ac_cv_var_tzname" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 +$as_echo "$ac_cv_var_tzname" >&6; } if test $ac_cv_var_tzname = yes; then cat >>confdefs.h <<\_ACEOF @@ -19904,10 +20403,10 @@ fi fi -{ echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 -echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 +$as_echo_n "checking for struct stat.st_rdev... " >&6; } if test "${ac_cv_member_struct_stat_st_rdev+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19932,20 +20431,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19971,20 +20471,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_rdev=no @@ -19995,9 +20496,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6; } -if test $ac_cv_member_struct_stat_st_rdev = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 +$as_echo "$ac_cv_member_struct_stat_st_rdev" >&6; } +if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_RDEV 1 @@ -20006,10 +20507,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 -echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 +$as_echo_n "checking for struct stat.st_blksize... " >&6; } if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20034,20 +20535,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blksize=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -20073,20 +20575,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blksize=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_blksize=no @@ -20097,9 +20600,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6; } -if test $ac_cv_member_struct_stat_st_blksize = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 +$as_echo "$ac_cv_member_struct_stat_st_blksize" >&6; } +if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLKSIZE 1 @@ -20108,10 +20611,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_flags" >&5 -echo $ECHO_N "checking for struct stat.st_flags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_flags" >&5 +$as_echo_n "checking for struct stat.st_flags... " >&6; } if test "${ac_cv_member_struct_stat_st_flags+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20136,20 +20639,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_flags=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -20175,20 +20679,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_flags=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_flags=no @@ -20199,9 +20704,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_flags" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_flags" >&6; } -if test $ac_cv_member_struct_stat_st_flags = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_flags" >&5 +$as_echo "$ac_cv_member_struct_stat_st_flags" >&6; } +if test "x$ac_cv_member_struct_stat_st_flags" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_FLAGS 1 @@ -20210,10 +20715,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_gen" >&5 -echo $ECHO_N "checking for struct stat.st_gen... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_gen" >&5 +$as_echo_n "checking for struct stat.st_gen... " >&6; } if test "${ac_cv_member_struct_stat_st_gen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20238,20 +20743,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_gen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -20277,20 +20783,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_gen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_gen=no @@ -20301,9 +20808,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_gen" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_gen" >&6; } -if test $ac_cv_member_struct_stat_st_gen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_gen" >&5 +$as_echo "$ac_cv_member_struct_stat_st_gen" >&6; } +if test "x$ac_cv_member_struct_stat_st_gen" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_GEN 1 @@ -20312,10 +20819,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_birthtime" >&5 -echo $ECHO_N "checking for struct stat.st_birthtime... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_birthtime" >&5 +$as_echo_n "checking for struct stat.st_birthtime... " >&6; } if test "${ac_cv_member_struct_stat_st_birthtime+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20340,20 +20847,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_birthtime=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -20379,20 +20887,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_birthtime=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_birthtime=no @@ -20403,9 +20912,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_birthtime" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_birthtime" >&6; } -if test $ac_cv_member_struct_stat_st_birthtime = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_birthtime" >&5 +$as_echo "$ac_cv_member_struct_stat_st_birthtime" >&6; } +if test "x$ac_cv_member_struct_stat_st_birthtime" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BIRTHTIME 1 @@ -20414,10 +20923,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5 -echo $ECHO_N "checking for struct stat.st_blocks... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5 +$as_echo_n "checking for struct stat.st_blocks... " >&6; } if test "${ac_cv_member_struct_stat_st_blocks+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20442,20 +20951,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blocks=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -20481,20 +20991,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blocks=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_blocks=no @@ -20505,9 +21016,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_blocks" >&6; } -if test $ac_cv_member_struct_stat_st_blocks = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5 +$as_echo "$ac_cv_member_struct_stat_st_blocks" >&6; } +if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLOCKS 1 @@ -20529,10 +21040,10 @@ -{ echo "$as_me:$LINENO: checking for time.h that defines altzone" >&5 -echo $ECHO_N "checking for time.h that defines altzone... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for time.h that defines altzone" >&5 +$as_echo_n "checking for time.h that defines altzone... " >&6; } if test "${ac_cv_header_time_altzone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20555,20 +21066,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time_altzone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time_altzone=no @@ -20577,8 +21089,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_time_altzone" >&5 -echo "${ECHO_T}$ac_cv_header_time_altzone" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time_altzone" >&5 +$as_echo "$ac_cv_header_time_altzone" >&6; } if test $ac_cv_header_time_altzone = yes; then cat >>confdefs.h <<\_ACEOF @@ -20588,8 +21100,8 @@ fi was_it_defined=no -{ echo "$as_me:$LINENO: checking whether sys/select.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether sys/select.h and sys/time.h may both be included... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether sys/select.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether sys/select.h and sys/time.h may both be included... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20615,13 +21127,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20635,20 +21148,20 @@ was_it_defined=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $was_it_defined" >&5 -echo "${ECHO_T}$was_it_defined" >&6; } +{ $as_echo "$as_me:$LINENO: result: $was_it_defined" >&5 +$as_echo "$was_it_defined" >&6; } -{ echo "$as_me:$LINENO: checking for addrinfo" >&5 -echo $ECHO_N "checking for addrinfo... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for addrinfo" >&5 +$as_echo_n "checking for addrinfo... " >&6; } if test "${ac_cv_struct_addrinfo+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20672,20 +21185,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_addrinfo=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_addrinfo=no @@ -20694,8 +21208,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_addrinfo" >&5 -echo "${ECHO_T}$ac_cv_struct_addrinfo" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_addrinfo" >&5 +$as_echo "$ac_cv_struct_addrinfo" >&6; } if test $ac_cv_struct_addrinfo = yes; then cat >>confdefs.h <<\_ACEOF @@ -20704,10 +21218,10 @@ fi -{ echo "$as_me:$LINENO: checking for sockaddr_storage" >&5 -echo $ECHO_N "checking for sockaddr_storage... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for sockaddr_storage" >&5 +$as_echo_n "checking for sockaddr_storage... " >&6; } if test "${ac_cv_struct_sockaddr_storage+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20732,20 +21246,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_sockaddr_storage=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_sockaddr_storage=no @@ -20754,8 +21269,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_sockaddr_storage" >&5 -echo "${ECHO_T}$ac_cv_struct_sockaddr_storage" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_sockaddr_storage" >&5 +$as_echo "$ac_cv_struct_sockaddr_storage" >&6; } if test $ac_cv_struct_sockaddr_storage = yes; then cat >>confdefs.h <<\_ACEOF @@ -20767,10 +21282,10 @@ # checks for compiler characteristics -{ echo "$as_me:$LINENO: checking whether char is unsigned" >&5 -echo $ECHO_N "checking whether char is unsigned... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether char is unsigned" >&5 +$as_echo_n "checking whether char is unsigned... " >&6; } if test "${ac_cv_c_char_unsigned+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20795,20 +21310,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_char_unsigned=no else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_char_unsigned=yes @@ -20816,8 +21332,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5 -echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5 +$as_echo "$ac_cv_c_char_unsigned" >&6; } if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then cat >>confdefs.h <<\_ACEOF #define __CHAR_UNSIGNED__ 1 @@ -20825,10 +21341,10 @@ fi -{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20900,20 +21416,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no @@ -20921,20 +21438,20 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF -#define const +#define const /**/ _ACEOF fi works=no -{ echo "$as_me:$LINENO: checking for working volatile" >&5 -echo $ECHO_N "checking for working volatile... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for working volatile" >&5 +$as_echo_n "checking for working volatile... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20956,37 +21473,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then works=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >>confdefs.h <<\_ACEOF -#define volatile +#define volatile /**/ _ACEOF fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $works" >&5 -echo "${ECHO_T}$works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $works" >&5 +$as_echo "$works" >&6; } works=no -{ echo "$as_me:$LINENO: checking for working signed char" >&5 -echo $ECHO_N "checking for working signed char... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for working signed char" >&5 +$as_echo_n "checking for working signed char... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21008,37 +21526,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then works=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >>confdefs.h <<\_ACEOF -#define signed +#define signed /**/ _ACEOF fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $works" >&5 -echo "${ECHO_T}$works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $works" >&5 +$as_echo "$works" >&6; } have_prototypes=no -{ echo "$as_me:$LINENO: checking for prototypes" >&5 -echo $ECHO_N "checking for prototypes... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for prototypes" >&5 +$as_echo_n "checking for prototypes... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21060,13 +21579,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21080,19 +21600,19 @@ have_prototypes=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_prototypes" >&5 -echo "${ECHO_T}$have_prototypes" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_prototypes" >&5 +$as_echo "$have_prototypes" >&6; } works=no -{ echo "$as_me:$LINENO: checking for variable length prototypes and stdarg.h" >&5 -echo $ECHO_N "checking for variable length prototypes and stdarg.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for variable length prototypes and stdarg.h" >&5 +$as_echo_n "checking for variable length prototypes and stdarg.h... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21124,13 +21644,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21144,19 +21665,19 @@ works=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $works" >&5 -echo "${ECHO_T}$works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $works" >&5 +$as_echo "$works" >&6; } # check for socketpair -{ echo "$as_me:$LINENO: checking for socketpair" >&5 -echo $ECHO_N "checking for socketpair... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for socketpair" >&5 +$as_echo_n "checking for socketpair... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21181,13 +21702,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21197,22 +21719,22 @@ #define HAVE_SOCKETPAIR 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # check if sockaddr has sa_len member -{ echo "$as_me:$LINENO: checking if sockaddr has sa_len member" >&5 -echo $ECHO_N "checking if sockaddr has sa_len member... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if sockaddr has sa_len member" >&5 +$as_echo_n "checking if sockaddr has sa_len member... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21236,37 +21758,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKADDR_SA_LEN 1 _ACEOF else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext va_list_is_array=no -{ echo "$as_me:$LINENO: checking whether va_list is an array" >&5 -echo $ECHO_N "checking whether va_list is an array... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether va_list is an array" >&5 +$as_echo_n "checking whether va_list is an array... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21294,20 +21817,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -21321,17 +21845,17 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $va_list_is_array" >&5 -echo "${ECHO_T}$va_list_is_array" >&6; } +{ $as_echo "$as_me:$LINENO: result: $va_list_is_array" >&5 +$as_echo "$va_list_is_array" >&6; } # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-( -{ echo "$as_me:$LINENO: checking for gethostbyname_r" >&5 -echo $ECHO_N "checking for gethostbyname_r... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for gethostbyname_r" >&5 +$as_echo_n "checking for gethostbyname_r... " >&6; } if test "${ac_cv_func_gethostbyname_r+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21384,39 +21908,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_gethostbyname_r=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname_r=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5 -echo "${ECHO_T}$ac_cv_func_gethostbyname_r" >&6; } -if test $ac_cv_func_gethostbyname_r = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5 +$as_echo "$ac_cv_func_gethostbyname_r" >&6; } +if test "x$ac_cv_func_gethostbyname_r" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_GETHOSTBYNAME_R 1 _ACEOF - { echo "$as_me:$LINENO: checking gethostbyname_r with 6 args" >&5 -echo $ECHO_N "checking gethostbyname_r with 6 args... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 6 args" >&5 +$as_echo_n "checking gethostbyname_r with 6 args... " >&6; } OLD_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS" cat >conftest.$ac_ext <<_ACEOF @@ -21450,13 +21978,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21471,18 +22000,18 @@ #define HAVE_GETHOSTBYNAME_R_6_ARG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - { echo "$as_me:$LINENO: checking gethostbyname_r with 5 args" >&5 -echo $ECHO_N "checking gethostbyname_r with 5 args... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 5 args" >&5 +$as_echo_n "checking gethostbyname_r with 5 args... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21514,13 +22043,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21535,18 +22065,18 @@ #define HAVE_GETHOSTBYNAME_R_5_ARG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - { echo "$as_me:$LINENO: checking gethostbyname_r with 3 args" >&5 -echo $ECHO_N "checking gethostbyname_r with 3 args... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 3 args" >&5 +$as_echo_n "checking gethostbyname_r with 3 args... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21576,13 +22106,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21597,16 +22128,16 @@ #define HAVE_GETHOSTBYNAME_R_3_ARG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -21626,11 +22157,11 @@ for ac_func in gethostbyname do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21683,35 +22214,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -21730,10 +22268,10 @@ # (none yet) # Linux requires this for correct f.p. operations -{ echo "$as_me:$LINENO: checking for __fpu_control" >&5 -echo $ECHO_N "checking for __fpu_control... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for __fpu_control" >&5 +$as_echo_n "checking for __fpu_control... " >&6; } if test "${ac_cv_func___fpu_control+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21786,39 +22324,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func___fpu_control=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func___fpu_control=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func___fpu_control" >&5 -echo "${ECHO_T}$ac_cv_func___fpu_control" >&6; } -if test $ac_cv_func___fpu_control = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func___fpu_control" >&5 +$as_echo "$ac_cv_func___fpu_control" >&6; } +if test "x$ac_cv_func___fpu_control" = x""yes; then : else -{ echo "$as_me:$LINENO: checking for __fpu_control in -lieee" >&5 -echo $ECHO_N "checking for __fpu_control in -lieee... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for __fpu_control in -lieee" >&5 +$as_echo_n "checking for __fpu_control in -lieee... " >&6; } if test "${ac_cv_lib_ieee___fpu_control+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" @@ -21850,33 +22392,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_ieee___fpu_control=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ieee___fpu_control=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_ieee___fpu_control" >&5 -echo "${ECHO_T}$ac_cv_lib_ieee___fpu_control" >&6; } -if test $ac_cv_lib_ieee___fpu_control = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ieee___fpu_control" >&5 +$as_echo "$ac_cv_lib_ieee___fpu_control" >&6; } +if test "x$ac_cv_lib_ieee___fpu_control" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBIEEE 1 _ACEOF @@ -21890,8 +22436,8 @@ # Check for --with-fpectl -{ echo "$as_me:$LINENO: checking for --with-fpectl" >&5 -echo $ECHO_N "checking for --with-fpectl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-fpectl" >&5 +$as_echo_n "checking for --with-fpectl... " >&6; } # Check whether --with-fpectl was given. if test "${with_fpectl+set}" = set; then @@ -21903,14 +22449,14 @@ #define WANT_SIGFPE_HANDLER 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -21921,53 +22467,53 @@ BeOS) ;; *) LIBM=-lm esac -{ echo "$as_me:$LINENO: checking for --with-libm=STRING" >&5 -echo $ECHO_N "checking for --with-libm=STRING... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-libm=STRING" >&5 +$as_echo_n "checking for --with-libm=STRING... " >&6; } # Check whether --with-libm was given. if test "${with_libm+set}" = set; then withval=$with_libm; if test "$withval" = no then LIBM= - { echo "$as_me:$LINENO: result: force LIBM empty" >&5 -echo "${ECHO_T}force LIBM empty" >&6; } + { $as_echo "$as_me:$LINENO: result: force LIBM empty" >&5 +$as_echo "force LIBM empty" >&6; } elif test "$withval" != yes then LIBM=$withval - { echo "$as_me:$LINENO: result: set LIBM=\"$withval\"" >&5 -echo "${ECHO_T}set LIBM=\"$withval\"" >&6; } -else { { echo "$as_me:$LINENO: error: proper usage is --with-libm=STRING" >&5 -echo "$as_me: error: proper usage is --with-libm=STRING" >&2;} + { $as_echo "$as_me:$LINENO: result: set LIBM=\"$withval\"" >&5 +$as_echo "set LIBM=\"$withval\"" >&6; } +else { { $as_echo "$as_me:$LINENO: error: proper usage is --with-libm=STRING" >&5 +$as_echo "$as_me: error: proper usage is --with-libm=STRING" >&2;} { (exit 1); exit 1; }; } fi else - { echo "$as_me:$LINENO: result: default LIBM=\"$LIBM\"" >&5 -echo "${ECHO_T}default LIBM=\"$LIBM\"" >&6; } + { $as_echo "$as_me:$LINENO: result: default LIBM=\"$LIBM\"" >&5 +$as_echo "default LIBM=\"$LIBM\"" >&6; } fi # check for --with-libc=... -{ echo "$as_me:$LINENO: checking for --with-libc=STRING" >&5 -echo $ECHO_N "checking for --with-libc=STRING... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-libc=STRING" >&5 +$as_echo_n "checking for --with-libc=STRING... " >&6; } # Check whether --with-libc was given. if test "${with_libc+set}" = set; then withval=$with_libc; if test "$withval" = no then LIBC= - { echo "$as_me:$LINENO: result: force LIBC empty" >&5 -echo "${ECHO_T}force LIBC empty" >&6; } + { $as_echo "$as_me:$LINENO: result: force LIBC empty" >&5 +$as_echo "force LIBC empty" >&6; } elif test "$withval" != yes then LIBC=$withval - { echo "$as_me:$LINENO: result: set LIBC=\"$withval\"" >&5 -echo "${ECHO_T}set LIBC=\"$withval\"" >&6; } -else { { echo "$as_me:$LINENO: error: proper usage is --with-libc=STRING" >&5 -echo "$as_me: error: proper usage is --with-libc=STRING" >&2;} + { $as_echo "$as_me:$LINENO: result: set LIBC=\"$withval\"" >&5 +$as_echo "set LIBC=\"$withval\"" >&6; } +else { { $as_echo "$as_me:$LINENO: error: proper usage is --with-libc=STRING" >&5 +$as_echo "$as_me: error: proper usage is --with-libc=STRING" >&2;} { (exit 1); exit 1; }; } fi else - { echo "$as_me:$LINENO: result: default LIBC=\"$LIBC\"" >&5 -echo "${ECHO_T}default LIBC=\"$LIBC\"" >&6; } + { $as_echo "$as_me:$LINENO: result: default LIBC=\"$LIBC\"" >&5 +$as_echo "default LIBC=\"$LIBC\"" >&6; } fi @@ -21983,10 +22529,10 @@ # IEEE 754 platforms. On IEEE 754, test should return 1 if rounding # mode is round-to-nearest and double rounding issues are present, and # 0 otherwise. See http://bugs.python.org/issue2937 for more info. -{ echo "$as_me:$LINENO: checking for x87-style double rounding" >&5 -echo $ECHO_N "checking for x87-style double rounding... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for x87-style double rounding" >&5 +$as_echo_n "checking for x87-style double rounding... " >&6; } if test "${ac_cv_x87_double_rounding+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -22025,37 +22571,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_x87_double_rounding=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_x87_double_rounding=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_x87_double_rounding" >&5 -echo "${ECHO_T}$ac_cv_x87_double_rounding" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_x87_double_rounding" >&5 +$as_echo "$ac_cv_x87_double_rounding" >&6; } if test "$ac_cv_x87_double_rounding" = yes then @@ -22066,14 +22615,16 @@ fi # Multiprocessing check for broken sem_getvalue -{ echo "$as_me:$LINENO: checking for broken sem_getvalue" >&5 -echo $ECHO_N "checking for broken sem_getvalue... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for broken sem_getvalue" >&5 +$as_echo_n "checking for broken sem_getvalue... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22110,30 +22661,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_BROKEN_SEM_GETVALUE 1 @@ -22141,6 +22694,7 @@ fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -22148,10 +22702,10 @@ # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of # -0. on some architectures. -{ echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5 -echo $ECHO_N "checking whether tanh preserves the sign of zero... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5 +$as_echo_n "checking whether tanh preserves the sign of zero... " >&6; } if test "${ac_cv_tanh_preserves_zero_sign+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -22182,37 +22736,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_tanh_preserves_zero_sign=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_tanh_preserves_zero_sign=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_tanh_preserves_zero_sign" >&5 -echo "${ECHO_T}$ac_cv_tanh_preserves_zero_sign" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_tanh_preserves_zero_sign" >&5 +$as_echo "$ac_cv_tanh_preserves_zero_sign" >&6; } if test "$ac_cv_tanh_preserves_zero_sign" = yes then @@ -22233,11 +22790,11 @@ for ac_func in acosh asinh atanh copysign expm1 finite hypot log1p round do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22290,44 +22847,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done -{ echo "$as_me:$LINENO: checking whether isinf is declared" >&5 -echo $ECHO_N "checking whether isinf is declared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether isinf is declared" >&5 +$as_echo_n "checking whether isinf is declared... " >&6; } if test "${ac_cv_have_decl_isinf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22354,20 +22918,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_isinf=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_isinf=no @@ -22375,9 +22940,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5 -echo "${ECHO_T}$ac_cv_have_decl_isinf" >&6; } -if test $ac_cv_have_decl_isinf = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5 +$as_echo "$ac_cv_have_decl_isinf" >&6; } +if test "x$ac_cv_have_decl_isinf" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ISINF 1 @@ -22391,10 +22956,10 @@ fi -{ echo "$as_me:$LINENO: checking whether isnan is declared" >&5 -echo $ECHO_N "checking whether isnan is declared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether isnan is declared" >&5 +$as_echo_n "checking whether isnan is declared... " >&6; } if test "${ac_cv_have_decl_isnan+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22421,20 +22986,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_isnan=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_isnan=no @@ -22442,9 +23008,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5 -echo "${ECHO_T}$ac_cv_have_decl_isnan" >&6; } -if test $ac_cv_have_decl_isnan = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5 +$as_echo "$ac_cv_have_decl_isnan" >&6; } +if test "x$ac_cv_have_decl_isnan" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ISNAN 1 @@ -22458,10 +23024,10 @@ fi -{ echo "$as_me:$LINENO: checking whether isfinite is declared" >&5 -echo $ECHO_N "checking whether isfinite is declared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether isfinite is declared" >&5 +$as_echo_n "checking whether isfinite is declared... " >&6; } if test "${ac_cv_have_decl_isfinite+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22488,20 +23054,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_isfinite=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_isfinite=no @@ -22509,9 +23076,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5 -echo "${ECHO_T}$ac_cv_have_decl_isfinite" >&6; } -if test $ac_cv_have_decl_isfinite = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5 +$as_echo "$ac_cv_have_decl_isfinite" >&6; } +if test "x$ac_cv_have_decl_isfinite" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ISFINITE 1 @@ -22531,8 +23098,8 @@ LIBS=$LIBS_SAVE # determine what size digit to use for Python's longs -{ echo "$as_me:$LINENO: checking digit size for Python's longs" >&5 -echo $ECHO_N "checking digit size for Python's longs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking digit size for Python's longs" >&5 +$as_echo_n "checking digit size for Python's longs... " >&6; } # Check whether --enable-big-digits was given. if test "${enable_big_digits+set}" = set; then enableval=$enable_big_digits; case $enable_big_digits in @@ -22543,12 +23110,12 @@ 15|30) ;; *) - { { echo "$as_me:$LINENO: error: bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30" >&5 -echo "$as_me: error: bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30" >&2;} + { { $as_echo "$as_me:$LINENO: error: bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30" >&5 +$as_echo "$as_me: error: bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30" >&2;} { (exit 1); exit 1; }; } ;; esac -{ echo "$as_me:$LINENO: result: $enable_big_digits" >&5 -echo "${ECHO_T}$enable_big_digits" >&6; } +{ $as_echo "$as_me:$LINENO: result: $enable_big_digits" >&5 +$as_echo "$enable_big_digits" >&6; } cat >>confdefs.h <<_ACEOF #define PYLONG_BITS_IN_DIGIT $enable_big_digits @@ -22556,24 +23123,24 @@ else - { echo "$as_me:$LINENO: result: no value specified" >&5 -echo "${ECHO_T}no value specified" >&6; } + { $as_echo "$as_me:$LINENO: result: no value specified" >&5 +$as_echo "no value specified" >&6; } fi # check for wchar.h if test "${ac_cv_header_wchar_h+set}" = set; then - { echo "$as_me:$LINENO: checking for wchar.h" >&5 -echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for wchar.h" >&5 +$as_echo_n "checking for wchar.h... " >&6; } if test "${ac_cv_header_wchar_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 -echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 +$as_echo "$ac_cv_header_wchar_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking wchar.h usability" >&5 -echo $ECHO_N "checking wchar.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking wchar.h usability" >&5 +$as_echo_n "checking wchar.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -22589,32 +23156,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking wchar.h presence" >&5 -echo $ECHO_N "checking wchar.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking wchar.h presence" >&5 +$as_echo_n "checking wchar.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -22628,51 +23196,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: wchar.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: wchar.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: wchar.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: wchar.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: wchar.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: wchar.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: wchar.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: wchar.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: wchar.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: wchar.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: wchar.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -22681,18 +23250,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for wchar.h" >&5 -echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for wchar.h" >&5 +$as_echo_n "checking for wchar.h... " >&6; } if test "${ac_cv_header_wchar_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_wchar_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 -echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 +$as_echo "$ac_cv_header_wchar_h" >&6; } fi -if test $ac_cv_header_wchar_h = yes; then +if test "x$ac_cv_header_wchar_h" = x""yes; then cat >>confdefs.h <<\_ACEOF @@ -22711,69 +23280,14 @@ # determine wchar_t size if test "$wchar_h" = yes then - { echo "$as_me:$LINENO: checking for wchar_t" >&5 -echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6; } -if test "${ac_cv_type_wchar_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -typedef wchar_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_wchar_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_wchar_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_wchar_t" >&5 -echo "${ECHO_T}$ac_cv_type_wchar_t" >&6; } - -# The cast to long int works around a bug in the HP C Compiler + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of wchar_t" >&5 -echo $ECHO_N "checking size of wchar_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of wchar_t" >&5 +$as_echo_n "checking size of wchar_t... " >&6; } if test "${ac_cv_sizeof_wchar_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -22785,11 +23299,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) >= 0)]; test_array [0] = 0 ; @@ -22802,13 +23315,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -22823,11 +23337,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -22840,20 +23353,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -22867,7 +23381,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -22878,11 +23392,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) < 0)]; test_array [0] = 0 ; @@ -22895,13 +23408,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -22916,11 +23430,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -22933,20 +23446,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -22960,7 +23474,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -22981,11 +23495,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -22998,20 +23511,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -23022,11 +23536,13 @@ case $ac_lo in ?*) ac_cv_sizeof_wchar_t=$ac_lo;; '') if test "$ac_cv_type_wchar_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (wchar_t) +$as_echo "$as_me: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_wchar_t=0 fi ;; @@ -23040,9 +23556,8 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (wchar_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (wchar_t)); } #include #include int @@ -23052,20 +23567,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (wchar_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (wchar_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (wchar_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -23078,43 +23595,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_wchar_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_wchar_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (wchar_t) +$as_echo "$as_me: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_wchar_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_wchar_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5 +$as_echo "$ac_cv_sizeof_wchar_t" >&6; } @@ -23125,8 +23647,8 @@ fi -{ echo "$as_me:$LINENO: checking for UCS-4 tcl" >&5 -echo $ECHO_N "checking for UCS-4 tcl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for UCS-4 tcl" >&5 +$as_echo_n "checking for UCS-4 tcl... " >&6; } have_ucs4_tcl=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23153,13 +23675,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -23173,24 +23696,24 @@ have_ucs4_tcl=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_ucs4_tcl" >&5 -echo "${ECHO_T}$have_ucs4_tcl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_ucs4_tcl" >&5 +$as_echo "$have_ucs4_tcl" >&6; } # check whether wchar_t is signed or not if test "$wchar_h" = yes then # check whether wchar_t is signed or not - { echo "$as_me:$LINENO: checking whether wchar_t is signed" >&5 -echo $ECHO_N "checking whether wchar_t is signed... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether wchar_t is signed" >&5 +$as_echo_n "checking whether wchar_t is signed... " >&6; } if test "${ac_cv_wchar_t_signed+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -23217,41 +23740,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_wchar_t_signed=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_wchar_t_signed=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi - { echo "$as_me:$LINENO: result: $ac_cv_wchar_t_signed" >&5 -echo "${ECHO_T}$ac_cv_wchar_t_signed" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_wchar_t_signed" >&5 +$as_echo "$ac_cv_wchar_t_signed" >&6; } fi -{ echo "$as_me:$LINENO: checking what type to use for unicode" >&5 -echo $ECHO_N "checking what type to use for unicode... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking what type to use for unicode" >&5 +$as_echo_n "checking what type to use for unicode... " >&6; } # Check whether --enable-unicode was given. if test "${enable_unicode+set}" = set; then enableval=$enable_unicode; @@ -23295,74 +23821,220 @@ if test "$enable_unicode" = "no" then UNICODE_OBJS="" - { echo "$as_me:$LINENO: result: not used" >&5 -echo "${ECHO_T}not used" >&6; } + { $as_echo "$as_me:$LINENO: result: not used" >&5 +$as_echo "not used" >&6; } +else + UNICODE_OBJS="Objects/unicodeobject.o Objects/unicodectype.o" + +cat >>confdefs.h <<\_ACEOF +#define Py_USING_UNICODE 1 +_ACEOF + + + # wchar_t is only usable if it maps to an unsigned type + if test "$unicode_size" = "$ac_cv_sizeof_wchar_t" \ + -a "$ac_cv_wchar_t_signed" = "no" + then + PY_UNICODE_TYPE="wchar_t" + +cat >>confdefs.h <<\_ACEOF +#define HAVE_USABLE_WCHAR_T 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define PY_UNICODE_TYPE wchar_t +_ACEOF + + elif test "$ac_cv_sizeof_short" = "$unicode_size" + then + PY_UNICODE_TYPE="unsigned short" + cat >>confdefs.h <<\_ACEOF +#define PY_UNICODE_TYPE unsigned short +_ACEOF + + elif test "$ac_cv_sizeof_long" = "$unicode_size" + then + PY_UNICODE_TYPE="unsigned long" + cat >>confdefs.h <<\_ACEOF +#define PY_UNICODE_TYPE unsigned long +_ACEOF + + else + PY_UNICODE_TYPE="no type found" + fi + { $as_echo "$as_me:$LINENO: result: $PY_UNICODE_TYPE" >&5 +$as_echo "$PY_UNICODE_TYPE" >&6; } +fi + +# check for endianness + + { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + + # Check for potential -arch flags. It is not universal unless + # there are some -arch flags. Note that *ppc* also matches + # ppc64. This check is also rather less than ideal. + case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( + *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; + esac +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + # It does; now see whether it defined to BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_bigendian=yes else - UNICODE_OBJS="Objects/unicodeobject.o Objects/unicodectype.o" - -cat >>confdefs.h <<\_ACEOF -#define Py_USING_UNICODE 1 -_ACEOF - - - # wchar_t is only usable if it maps to an unsigned type - if test "$unicode_size" = "$ac_cv_sizeof_wchar_t" \ - -a "$ac_cv_wchar_t_signed" = "no" - then - PY_UNICODE_TYPE="wchar_t" - -cat >>confdefs.h <<\_ACEOF -#define HAVE_USABLE_WCHAR_T 1 -_ACEOF + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - cat >>confdefs.h <<\_ACEOF -#define PY_UNICODE_TYPE wchar_t -_ACEOF + ac_cv_c_bigendian=no +fi - elif test "$ac_cv_sizeof_short" = "$unicode_size" - then - PY_UNICODE_TYPE="unsigned short" - cat >>confdefs.h <<\_ACEOF -#define PY_UNICODE_TYPE unsigned short -_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - elif test "$ac_cv_sizeof_long" = "$unicode_size" - then - PY_UNICODE_TYPE="unsigned long" - cat >>confdefs.h <<\_ACEOF -#define PY_UNICODE_TYPE unsigned long -_ACEOF - else - PY_UNICODE_TYPE="no type found" - fi - { echo "$as_me:$LINENO: result: $PY_UNICODE_TYPE" >&5 -echo "${ECHO_T}$PY_UNICODE_TYPE" >&6; } fi -# check for endianness -{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include +#include int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ - && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) - bogus endian macros -#endif +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif ; return 0; @@ -23374,33 +24046,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include +#include int main () { -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif +#ifndef _BIG_ENDIAN + not big endian + #endif ; return 0; @@ -23412,20 +24084,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no @@ -23433,29 +24106,44 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - # It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then + # Try to guess by grepping values from an object file. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + int main () { - _ascii (); _ebcdic (); +return use_ascii (foo) == use_ebcdic (foo); ; return 0; } @@ -23466,30 +24154,31 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -23508,14 +24197,14 @@ main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; ; return 0; @@ -23527,63 +24216,70 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + fi fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } -case $ac_cv_c_bigendian in - yes) +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF +;; #( + no) + ;; #( + universal) cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 +#define AC_APPLE_UNIVERSAL_BUILD 1 _ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + + ;; #( + *) + { { $as_echo "$as_me:$LINENO: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +$as_echo "$as_me: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; -esac + esac # Check whether right shifting a negative integer extends the sign bit # or fills with zeros (like the Cray J90, according to Tim Peters). -{ echo "$as_me:$LINENO: checking whether right shift extends the sign bit" >&5 -echo $ECHO_N "checking whether right shift extends the sign bit... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether right shift extends the sign bit" >&5 +$as_echo_n "checking whether right shift extends the sign bit... " >&6; } if test "${ac_cv_rshift_extends_sign+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -23608,37 +24304,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_rshift_extends_sign=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_rshift_extends_sign=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_rshift_extends_sign" >&5 -echo "${ECHO_T}$ac_cv_rshift_extends_sign" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_rshift_extends_sign" >&5 +$as_echo "$ac_cv_rshift_extends_sign" >&6; } if test "$ac_cv_rshift_extends_sign" = no then @@ -23649,10 +24348,10 @@ fi # check for getc_unlocked and related locking functions -{ echo "$as_me:$LINENO: checking for getc_unlocked() and friends" >&5 -echo $ECHO_N "checking for getc_unlocked() and friends... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getc_unlocked() and friends" >&5 +$as_echo_n "checking for getc_unlocked() and friends... " >&6; } if test "${ac_cv_have_getc_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -23681,32 +24380,36 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_have_getc_unlocked=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_getc_unlocked=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_getc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_getc_unlocked" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_getc_unlocked" >&5 +$as_echo "$ac_cv_have_getc_unlocked" >&6; } if test "$ac_cv_have_getc_unlocked" = yes then @@ -23724,8 +24427,8 @@ # library. NOTE: Keep the precedence of listed libraries synchronised # with setup.py. py_cv_lib_readline=no -{ echo "$as_me:$LINENO: checking how to link readline libs" >&5 -echo $ECHO_N "checking how to link readline libs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to link readline libs" >&5 +$as_echo_n "checking how to link readline libs... " >&6; } for py_libtermcap in "" ncursesw ncurses curses termcap; do if test -z "$py_libtermcap"; then READLINE_LIBS="-lreadline" @@ -23761,26 +24464,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then py_cv_lib_readline=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test $py_cv_lib_readline = yes; then @@ -23790,11 +24497,11 @@ # Uncomment this line if you want to use READINE_LIBS in Makefile or scripts #AC_SUBST([READLINE_LIBS]) if test $py_cv_lib_readline = no; then - { echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6; } + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } else - { echo "$as_me:$LINENO: result: $READLINE_LIBS" >&5 -echo "${ECHO_T}$READLINE_LIBS" >&6; } + { $as_echo "$as_me:$LINENO: result: $READLINE_LIBS" >&5 +$as_echo "$READLINE_LIBS" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_LIBREADLINE 1 @@ -23803,10 +24510,10 @@ fi # check for readline 2.1 -{ echo "$as_me:$LINENO: checking for rl_callback_handler_install in -lreadline" >&5 -echo $ECHO_N "checking for rl_callback_handler_install in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_callback_handler_install in -lreadline" >&5 +$as_echo_n "checking for rl_callback_handler_install in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_callback_handler_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -23838,33 +24545,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_callback_handler_install=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_callback_handler_install=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_callback_handler_install" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_callback_handler_install" >&6; } -if test $ac_cv_lib_readline_rl_callback_handler_install = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_callback_handler_install" >&5 +$as_echo "$ac_cv_lib_readline_rl_callback_handler_install" >&6; } +if test "x$ac_cv_lib_readline_rl_callback_handler_install" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_CALLBACK 1 @@ -23887,20 +24598,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then have_readline=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 have_readline=no @@ -23931,10 +24643,10 @@ fi # check for readline 4.0 -{ echo "$as_me:$LINENO: checking for rl_pre_input_hook in -lreadline" >&5 -echo $ECHO_N "checking for rl_pre_input_hook in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_pre_input_hook in -lreadline" >&5 +$as_echo_n "checking for rl_pre_input_hook in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_pre_input_hook+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -23966,33 +24678,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_pre_input_hook=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_pre_input_hook=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_pre_input_hook" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_pre_input_hook" >&6; } -if test $ac_cv_lib_readline_rl_pre_input_hook = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_pre_input_hook" >&5 +$as_echo "$ac_cv_lib_readline_rl_pre_input_hook" >&6; } +if test "x$ac_cv_lib_readline_rl_pre_input_hook" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_PRE_INPUT_HOOK 1 @@ -24002,10 +24718,10 @@ # also in 4.0 -{ echo "$as_me:$LINENO: checking for rl_completion_display_matches_hook in -lreadline" >&5 -echo $ECHO_N "checking for rl_completion_display_matches_hook in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_completion_display_matches_hook in -lreadline" >&5 +$as_echo_n "checking for rl_completion_display_matches_hook in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_completion_display_matches_hook+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -24037,33 +24753,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_completion_display_matches_hook=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_completion_display_matches_hook=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_display_matches_hook" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6; } -if test $ac_cv_lib_readline_rl_completion_display_matches_hook = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_display_matches_hook" >&5 +$as_echo "$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6; } +if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1 @@ -24073,10 +24793,10 @@ # check for readline 4.2 -{ echo "$as_me:$LINENO: checking for rl_completion_matches in -lreadline" >&5 -echo $ECHO_N "checking for rl_completion_matches in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_completion_matches in -lreadline" >&5 +$as_echo_n "checking for rl_completion_matches in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_completion_matches+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -24108,33 +24828,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_completion_matches=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_completion_matches=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_matches" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_completion_matches" >&6; } -if test $ac_cv_lib_readline_rl_completion_matches = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_matches" >&5 +$as_echo "$ac_cv_lib_readline_rl_completion_matches" >&6; } +if test "x$ac_cv_lib_readline_rl_completion_matches" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_COMPLETION_MATCHES 1 @@ -24157,20 +24881,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then have_readline=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 have_readline=no @@ -24203,10 +24928,10 @@ # End of readline checks: restore LIBS LIBS=$LIBS_no_readline -{ echo "$as_me:$LINENO: checking for broken nice()" >&5 -echo $ECHO_N "checking for broken nice()... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for broken nice()" >&5 +$as_echo_n "checking for broken nice()... " >&6; } if test "${ac_cv_broken_nice+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -24234,37 +24959,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_broken_nice=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_broken_nice=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_broken_nice" >&5 -echo "${ECHO_T}$ac_cv_broken_nice" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_nice" >&5 +$as_echo "$ac_cv_broken_nice" >&6; } if test "$ac_cv_broken_nice" = yes then @@ -24274,8 +25002,8 @@ fi -{ echo "$as_me:$LINENO: checking for broken poll()" >&5 -echo $ECHO_N "checking for broken poll()... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for broken poll()" >&5 +$as_echo_n "checking for broken poll()... " >&6; } if test "$cross_compiling" = yes; then ac_cv_broken_poll=no else @@ -24317,35 +25045,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_broken_poll=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_broken_poll=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_broken_poll" >&5 -echo "${ECHO_T}$ac_cv_broken_poll" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_poll" >&5 +$as_echo "$ac_cv_broken_poll" >&6; } if test "$ac_cv_broken_poll" = yes then @@ -24358,10 +25089,10 @@ # Before we can test tzset, we need to check if struct tm has a tm_zone # (which is not required by ISO C or UNIX spec) and/or if we support # tzname[] -{ echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 -echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 +$as_echo_n "checking for struct tm.tm_zone... " >&6; } if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24389,20 +25120,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -24431,20 +25163,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_zone=no @@ -24455,9 +25188,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 -echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6; } -if test $ac_cv_member_struct_tm_tm_zone = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 +$as_echo "$ac_cv_member_struct_tm_tm_zone" >&6; } +if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 @@ -24473,10 +25206,10 @@ _ACEOF else - { echo "$as_me:$LINENO: checking whether tzname is declared" >&5 -echo $ECHO_N "checking whether tzname is declared... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether tzname is declared" >&5 +$as_echo_n "checking whether tzname is declared... " >&6; } if test "${ac_cv_have_decl_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24503,20 +25236,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_tzname=no @@ -24524,9 +25258,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 -echo "${ECHO_T}$ac_cv_have_decl_tzname" >&6; } -if test $ac_cv_have_decl_tzname = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 +$as_echo "$ac_cv_have_decl_tzname" >&6; } +if test "x$ac_cv_have_decl_tzname" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_TZNAME 1 @@ -24542,10 +25276,10 @@ fi - { echo "$as_me:$LINENO: checking for tzname" >&5 -echo $ECHO_N "checking for tzname... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for tzname" >&5 +$as_echo_n "checking for tzname... " >&6; } if test "${ac_cv_var_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24572,31 +25306,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_var_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_var_tzname=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 -echo "${ECHO_T}$ac_cv_var_tzname" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 +$as_echo "$ac_cv_var_tzname" >&6; } if test $ac_cv_var_tzname = yes; then cat >>confdefs.h <<\_ACEOF @@ -24608,10 +25346,10 @@ # check tzset(3) exists and works like we expect it to -{ echo "$as_me:$LINENO: checking for working tzset()" >&5 -echo $ECHO_N "checking for working tzset()... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for working tzset()" >&5 +$as_echo_n "checking for working tzset()... " >&6; } if test "${ac_cv_working_tzset+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -24694,37 +25432,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_working_tzset=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_working_tzset=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_working_tzset" >&5 -echo "${ECHO_T}$ac_cv_working_tzset" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_working_tzset" >&5 +$as_echo "$ac_cv_working_tzset" >&6; } if test "$ac_cv_working_tzset" = yes then @@ -24735,10 +25476,10 @@ fi # Look for subsecond timestamps in struct stat -{ echo "$as_me:$LINENO: checking for tv_nsec in struct stat" >&5 -echo $ECHO_N "checking for tv_nsec in struct stat... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for tv_nsec in struct stat" >&5 +$as_echo_n "checking for tv_nsec in struct stat... " >&6; } if test "${ac_cv_stat_tv_nsec+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24764,20 +25505,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_stat_tv_nsec=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_stat_tv_nsec=no @@ -24786,8 +25528,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec" >&5 -echo "${ECHO_T}$ac_cv_stat_tv_nsec" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec" >&5 +$as_echo "$ac_cv_stat_tv_nsec" >&6; } if test "$ac_cv_stat_tv_nsec" = yes then @@ -24798,10 +25540,10 @@ fi # Look for BSD style subsecond timestamps in struct stat -{ echo "$as_me:$LINENO: checking for tv_nsec2 in struct stat" >&5 -echo $ECHO_N "checking for tv_nsec2 in struct stat... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for tv_nsec2 in struct stat" >&5 +$as_echo_n "checking for tv_nsec2 in struct stat... " >&6; } if test "${ac_cv_stat_tv_nsec2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24827,20 +25569,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_stat_tv_nsec2=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_stat_tv_nsec2=no @@ -24849,8 +25592,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec2" >&5 -echo "${ECHO_T}$ac_cv_stat_tv_nsec2" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec2" >&5 +$as_echo "$ac_cv_stat_tv_nsec2" >&6; } if test "$ac_cv_stat_tv_nsec2" = yes then @@ -24861,10 +25604,10 @@ fi # On HP/UX 11.0, mvwdelch is a block with a return statement -{ echo "$as_me:$LINENO: checking whether mvwdelch is an expression" >&5 -echo $ECHO_N "checking whether mvwdelch is an expression... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether mvwdelch is an expression" >&5 +$as_echo_n "checking whether mvwdelch is an expression... " >&6; } if test "${ac_cv_mvwdelch_is_expression+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24890,20 +25633,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_mvwdelch_is_expression=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_mvwdelch_is_expression=no @@ -24912,8 +25656,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_mvwdelch_is_expression" >&5 -echo "${ECHO_T}$ac_cv_mvwdelch_is_expression" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_mvwdelch_is_expression" >&5 +$as_echo "$ac_cv_mvwdelch_is_expression" >&6; } if test "$ac_cv_mvwdelch_is_expression" = yes then @@ -24924,10 +25668,10 @@ fi -{ echo "$as_me:$LINENO: checking whether WINDOW has _flags" >&5 -echo $ECHO_N "checking whether WINDOW has _flags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether WINDOW has _flags" >&5 +$as_echo_n "checking whether WINDOW has _flags... " >&6; } if test "${ac_cv_window_has_flags+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24953,20 +25697,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_window_has_flags=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_window_has_flags=no @@ -24975,8 +25720,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_window_has_flags" >&5 -echo "${ECHO_T}$ac_cv_window_has_flags" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_window_has_flags" >&5 +$as_echo "$ac_cv_window_has_flags" >&6; } if test "$ac_cv_window_has_flags" = yes @@ -24988,8 +25733,8 @@ fi -{ echo "$as_me:$LINENO: checking for is_term_resized" >&5 -echo $ECHO_N "checking for is_term_resized... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for is_term_resized" >&5 +$as_echo_n "checking for is_term_resized... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -25011,13 +25756,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -25027,21 +25773,21 @@ #define HAVE_CURSES_IS_TERM_RESIZED 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for resize_term" >&5 -echo $ECHO_N "checking for resize_term... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for resize_term" >&5 +$as_echo_n "checking for resize_term... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -25063,13 +25809,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -25079,21 +25826,21 @@ #define HAVE_CURSES_RESIZE_TERM 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for resizeterm" >&5 -echo $ECHO_N "checking for resizeterm... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for resizeterm" >&5 +$as_echo_n "checking for resizeterm... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -25115,13 +25862,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -25131,61 +25879,63 @@ #define HAVE_CURSES_RESIZETERM 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for /dev/ptmx" >&5 -echo $ECHO_N "checking for /dev/ptmx... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for /dev/ptmx" >&5 +$as_echo_n "checking for /dev/ptmx... " >&6; } if test -r /dev/ptmx then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_DEV_PTMX 1 _ACEOF else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -{ echo "$as_me:$LINENO: checking for /dev/ptc" >&5 -echo $ECHO_N "checking for /dev/ptc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for /dev/ptc" >&5 +$as_echo_n "checking for /dev/ptc... " >&6; } if test -r /dev/ptc then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_DEV_PTC 1 _ACEOF else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -{ echo "$as_me:$LINENO: checking for %zd printf() format support" >&5 -echo $ECHO_N "checking for %zd printf() format support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for %zd printf() format support" >&5 +$as_echo_n "checking for %zd printf() format support... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -25234,47 +25984,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define PY_FORMAT_SIZE_T "z" _ACEOF else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: checking for socklen_t" >&5 -echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for socklen_t" >&5 +$as_echo_n "checking for socklen_t... " >&6; } if test "${ac_cv_type_socklen_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_socklen_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -25289,14 +26043,53 @@ #endif -typedef socklen_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (socklen_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + + +int +main () +{ +if (sizeof ((socklen_t))) + return 0; ; return 0; } @@ -25307,30 +26100,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_socklen_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_socklen_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_socklen_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 -echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; } -if test $ac_cv_type_socklen_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 +$as_echo "$ac_cv_type_socklen_t" >&6; } +if test "x$ac_cv_type_socklen_t" = x""yes; then : else @@ -25350,18 +26152,18 @@ SRCDIRS="Parser Grammar Objects Python Modules Mac" -{ echo "$as_me:$LINENO: checking for build directories" >&5 -echo $ECHO_N "checking for build directories... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for build directories" >&5 +$as_echo_n "checking for build directories... " >&6; } for dir in $SRCDIRS; do if test ! -d $dir; then mkdir $dir fi done -{ echo "$as_me:$LINENO: result: done" >&5 -echo "${ECHO_T}done" >&6; } +{ $as_echo "$as_me:$LINENO: result: done" >&5 +$as_echo "done" >&6; } # generate output files -ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config" +ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config Misc/python.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -25390,11 +26192,12 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -25427,12 +26230,12 @@ if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -25448,7 +26251,7 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -25460,12 +26263,14 @@ + : ${CONFIG_STATUS=./config.status} +ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -25478,7 +26283,7 @@ SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -25488,7 +26293,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -25510,17 +26315,45 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' else - PATH_SEPARATOR=: + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. @@ -25536,8 +26369,6 @@ # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -25560,7 +26391,7 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -25573,17 +26404,10 @@ PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -25605,7 +26429,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -25656,7 +26480,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -25684,7 +26508,6 @@ *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -25697,19 +26520,22 @@ rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -25734,10 +26560,10 @@ as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -25760,7 +26586,7 @@ # values after options handling. ac_log=" This file was extended by python $as_me 2.7, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -25773,29 +26599,39 @@ _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" +config_files="`echo $ac_config_files`" +config_headers="`echo $ac_config_headers`" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. -Usage: $0 [OPTIONS] [FILE]... +Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages + -q, --quiet, --silent + do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -25806,24 +26642,24 @@ Report bugs to ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ python config.status 2.7 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2006 Free Software Foundation, Inc. +Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do @@ -25845,30 +26681,36 @@ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; + $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 + { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 + -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -25887,30 +26729,32 @@ fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + exec "\$@" fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - echo "$ac_log" + $as_echo "$ac_log" } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets @@ -25924,9 +26768,10 @@ "Mac/Resources/app/Info.plist") CONFIG_FILES="$CONFIG_FILES Mac/Resources/app/Info.plist" ;; "Makefile.pre") CONFIG_FILES="$CONFIG_FILES Makefile.pre" ;; "Modules/Setup.config") CONFIG_FILES="$CONFIG_FILES Modules/Setup.config" ;; + "Misc/python.pc") CONFIG_FILES="$CONFIG_FILES Misc/python.pc" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done @@ -25966,227 +26811,145 @@ (umask 077 && mkdir "$tmp") } || { - echo "$me: cannot create a temporary directory in ." >&2 + $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then -_ACEOF +ac_cr=' +' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -VERSION!$VERSION$ac_delim -SOVERSION!$SOVERSION$ac_delim -CONFIG_ARGS!$CONFIG_ARGS$ac_delim -UNIVERSALSDK!$UNIVERSALSDK$ac_delim -ARCH_RUN_32BIT!$ARCH_RUN_32BIT$ac_delim -PYTHONFRAMEWORK!$PYTHONFRAMEWORK$ac_delim -PYTHONFRAMEWORKIDENTIFIER!$PYTHONFRAMEWORKIDENTIFIER$ac_delim -PYTHONFRAMEWORKDIR!$PYTHONFRAMEWORKDIR$ac_delim -PYTHONFRAMEWORKPREFIX!$PYTHONFRAMEWORKPREFIX$ac_delim -PYTHONFRAMEWORKINSTALLDIR!$PYTHONFRAMEWORKINSTALLDIR$ac_delim -FRAMEWORKINSTALLFIRST!$FRAMEWORKINSTALLFIRST$ac_delim -FRAMEWORKINSTALLLAST!$FRAMEWORKINSTALLLAST$ac_delim -FRAMEWORKALTINSTALLFIRST!$FRAMEWORKALTINSTALLFIRST$ac_delim -FRAMEWORKALTINSTALLLAST!$FRAMEWORKALTINSTALLLAST$ac_delim -FRAMEWORKUNIXTOOLSPREFIX!$FRAMEWORKUNIXTOOLSPREFIX$ac_delim -MACHDEP!$MACHDEP$ac_delim -SGI_ABI!$SGI_ABI$ac_delim -EXTRAPLATDIR!$EXTRAPLATDIR$ac_delim -EXTRAMACHDEPPATH!$EXTRAMACHDEPPATH$ac_delim -CONFIGURE_MACOSX_DEPLOYMENT_TARGET!$CONFIGURE_MACOSX_DEPLOYMENT_TARGET$ac_delim -EXPORT_MACOSX_DEPLOYMENT_TARGET!$EXPORT_MACOSX_DEPLOYMENT_TARGET$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -CXX!$CXX$ac_delim -MAINCC!$MAINCC$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -BUILDEXEEXT!$BUILDEXEEXT$ac_delim -LIBRARY!$LIBRARY$ac_delim -LDLIBRARY!$LDLIBRARY$ac_delim -DLLLIBRARY!$DLLLIBRARY$ac_delim -BLDLIBRARY!$BLDLIBRARY$ac_delim -LDLIBRARYDIR!$LDLIBRARYDIR$ac_delim -INSTSONAME!$INSTSONAME$ac_delim -RUNSHARED!$RUNSHARED$ac_delim -LINKCC!$LINKCC$ac_delim -GNULD!$GNULD$ac_delim -RANLIB!$RANLIB$ac_delim -AR!$AR$ac_delim -ARFLAGS!$ARFLAGS$ac_delim -SVNVERSION!$SVNVERSION$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -LN!$LN$ac_delim -OPT!$OPT$ac_delim -BASECFLAGS!$BASECFLAGS$ac_delim -UNIVERSAL_ARCH_FLAGS!$UNIVERSAL_ARCH_FLAGS$ac_delim -OTHER_LIBTOOL_OPT!$OTHER_LIBTOOL_OPT$ac_delim -LIBTOOL_CRUFT!$LIBTOOL_CRUFT$ac_delim -SO!$SO$ac_delim -LDSHARED!$LDSHARED$ac_delim -BLDSHARED!$BLDSHARED$ac_delim -CCSHARED!$CCSHARED$ac_delim -_ACEOF + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done +rm -f conf$$subs.sh -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + print line +} -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -LINKFORSHARED!$LINKFORSHARED$ac_delim -CFLAGSFORSHARED!$CFLAGSFORSHARED$ac_delim -SHLIBS!$SHLIBS$ac_delim -USE_SIGNAL_MODULE!$USE_SIGNAL_MODULE$ac_delim -SIGNAL_OBJS!$SIGNAL_OBJS$ac_delim -USE_THREAD_MODULE!$USE_THREAD_MODULE$ac_delim -LDLAST!$LDLAST$ac_delim -THREADOBJ!$THREADOBJ$ac_delim -DLINCLDIR!$DLINCLDIR$ac_delim -DYNLOADFILE!$DYNLOADFILE$ac_delim -MACHDEP_OBJS!$MACHDEP_OBJS$ac_delim -TRUE!$TRUE$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -HAVE_GETHOSTBYNAME_R_6_ARG!$HAVE_GETHOSTBYNAME_R_6_ARG$ac_delim -HAVE_GETHOSTBYNAME_R_5_ARG!$HAVE_GETHOSTBYNAME_R_5_ARG$ac_delim -HAVE_GETHOSTBYNAME_R_3_ARG!$HAVE_GETHOSTBYNAME_R_3_ARG$ac_delim -HAVE_GETHOSTBYNAME_R!$HAVE_GETHOSTBYNAME_R$ac_delim -HAVE_GETHOSTBYNAME!$HAVE_GETHOSTBYNAME$ac_delim -LIBM!$LIBM$ac_delim -LIBC!$LIBC$ac_delim -UNICODE_OBJS!$UNICODE_OBJS$ac_delim -THREADHEADERS!$THREADHEADERS$ac_delim -SRCDIRS!$SRCDIRS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACAWK _ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 24; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof _ACEOF - # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty @@ -26202,19 +26965,133 @@ }' fi -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 +$as_echo "$as_me: error: could not setup config headers machinery" >&2;} + { (exit 1); exit 1; }; } +fi # test -n "$CONFIG_HEADERS" + -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " +shift +for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; @@ -26243,26 +27120,38 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac - ac_file_inputs="$ac_file_inputs $ac_f" + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; esac ;; esac @@ -26272,7 +27161,7 @@ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | +$as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -26298,7 +27187,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -26307,7 +27196,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -26328,17 +27217,17 @@ test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -26378,12 +27267,13 @@ esac _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= -case `sed -n '/datarootdir/ { +ac_sed_dataroot=' +/datarootdir/ { p q } @@ -26392,13 +27282,14 @@ /@infodir@/p /@localedir@/p /@mandir@/p -' $ac_file_inputs` in +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g @@ -26412,15 +27303,16 @@ # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t +s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t @@ -26430,119 +27322,58 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} else - rm -f $ac_file - mv "$tmp/config.h" $ac_file + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } fi else - echo "/* $configure_input */" - cat "$ac_result" + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 +$as_echo "$as_me: error: could not create -" >&2;} + { (exit 1); exit 1; }; } fi - rm -f "$tmp/out12" ;; @@ -26556,6 +27387,11 @@ chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -26577,6 +27413,10 @@ # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi echo "creating Modules/Setup" @@ -26598,12 +27438,12 @@ case $ac_sys_system in BeOS) - { echo "$as_me:$LINENO: WARNING: + { $as_echo "$as_me:$LINENO: WARNING: Support for BeOS is deprecated as of Python 2.6. See PEP 11 for the gory details. " >&5 -echo "$as_me: WARNING: +$as_echo "$as_me: WARNING: Support for BeOS is deprecated as of Python 2.6. See PEP 11 for the gory details. Modified: python/trunk/configure.in ============================================================================== --- python/trunk/configure.in (original) +++ python/trunk/configure.in Sun May 24 22:23:57 2009 @@ -3867,7 +3867,7 @@ AC_MSG_RESULT(done) # generate output files -AC_CONFIG_FILES(Makefile.pre Modules/Setup.config) +AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc) AC_OUTPUT echo "creating Modules/Setup" Modified: python/trunk/pyconfig.h.in ============================================================================== --- python/trunk/pyconfig.h.in (original) +++ python/trunk/pyconfig.h.in Sun May 24 22:23:57 2009 @@ -5,6 +5,9 @@ #define Py_PYCONFIG_H +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + /* Define for AIX if your compiler is a genuine IBM xlC/xlC_r and you want support for AIX C++ shared extension modules. */ #undef AIX_GENUINE_CPLUSPLUS @@ -966,6 +969,28 @@ /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + /* Define if you want to use MacPython modules on MacOSX in unix-Python. */ #undef USE_TOOLBOX_OBJECT_GLUE @@ -1006,20 +1031,21 @@ /* Define to profile with the Pentium timestamp counter */ #undef WITH_TSC -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif /* Define if arithmetic is subject to x87-style double rounding issue */ #undef X87_DOUBLE_ROUNDING -/* Define to 1 if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif - /* Define on OpenBSD to activate all library features */ #undef _BSD_SOURCE @@ -1038,15 +1064,25 @@ /* This must be defined on some systems to enable large file support. */ #undef _LARGEFILE_SOURCE +/* Define to 1 if on MINIX. */ +#undef _MINIX + /* Define on NetBSD to activate all library features */ #undef _NETBSD_SOURCE /* Define _OSF_SOURCE to get the makedev macro. */ #undef _OSF_SOURCE +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + /* Define to activate features from IEEE Stds 1003.1-2001 */ #undef _POSIX_C_SOURCE +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE + /* Define if you have POSIX threads, and your system does not define that. */ #undef _POSIX_THREADS @@ -1054,12 +1090,12 @@ #undef _REENTRANT /* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or is not used. If the typedef was allowed, the + , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT32_T /* Define for Solaris 2.5.1 so the uint64_t typedef from , - , or is not used. If the typedef was allowed, the + , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT64_T From python-checkins at python.org Sun May 24 22:39:13 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 24 May 2009 22:39:13 +0200 (CEST) Subject: [Python-checkins] r72899 - in python/branches/py3k: Makefile.pre.in Misc/ACKS Misc/NEWS Misc/python.pc.in configure configure.in pyconfig.h.in Message-ID: <20090524203913.1C006D29D@mail.python.org> Author: antoine.pitrou Date: Sun May 24 22:39:11 2009 New Revision: 72899 Log: Merged revisions 72898 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72898 | antoine.pitrou | 2009-05-24 22:23:57 +0200 (dim., 24 mai 2009) | 6 lines Issue #3585: Add pkg-config support. It creates a python-2.7.pc file and a python.pc symlink in the $(LIBDIR)/pkgconfig directory. Patch by Clinton Roy. ........ Added: python/branches/py3k/Misc/python.pc.in - copied unchanged from r72898, /python/trunk/Misc/python.pc.in Modified: python/branches/py3k/ (props changed) python/branches/py3k/Makefile.pre.in python/branches/py3k/Misc/ACKS python/branches/py3k/Misc/NEWS python/branches/py3k/configure python/branches/py3k/configure.in python/branches/py3k/pyconfig.h.in Modified: python/branches/py3k/Makefile.pre.in ============================================================================== --- python/branches/py3k/Makefile.pre.in (original) +++ python/branches/py3k/Makefile.pre.in Sun May 24 22:39:11 2009 @@ -812,6 +812,8 @@ (cd $(DESTDIR)$(BINDIR); $(LN) python$(VERSION)$(EXE) $(PYTHON)3$(EXE)) -rm -f $(DESTDIR)$(BINDIR)/python3-config (cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python3-config) + -rm -f $(DESTDIR)$(LIBPC)/python3.pc + (cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc) # Install the manual page maninstall: @@ -956,8 +958,12 @@ # Install the library and miscellaneous stuff needed for extending/embedding # This goes into $(exec_prefix) LIBPL= $(LIBP)/config + +# pkgconfig directory +LIBPC= $(LIBDIR)/pkgconfig + libainstall: all - @for i in $(LIBDIR) $(LIBP) $(LIBPL); \ + @for i in $(LIBDIR) $(LIBP) $(LIBPL) $(LIBPC); \ do \ if test ! -d $(DESTDIR)$$i; then \ echo "Creating directory $$i"; \ @@ -984,6 +990,7 @@ $(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup $(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local $(INSTALL_DATA) Modules/Setup.config $(DESTDIR)$(LIBPL)/Setup.config + $(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc $(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup $(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh # Substitution happens here, as the completely-expanded BINDIR Modified: python/branches/py3k/Misc/ACKS ============================================================================== --- python/branches/py3k/Misc/ACKS (original) +++ python/branches/py3k/Misc/ACKS Sun May 24 22:39:11 2009 @@ -622,6 +622,7 @@ Donald Wallace Rouse II Liam Routt Craig Rowland +Clinton Roy Paul Rubin Sam Ruby Audun S. Runde Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sun May 24 22:39:11 2009 @@ -87,6 +87,13 @@ - The _functools and _locale modules are now built into the libpython shared library instead of as extension modules. +Build +----- + +- Issue #3585: Add pkg-config support. It creates a python-2.7.pc file + and a python3.pc symlink in the $(LIBDIR)/pkgconfig directory. Patch by + Clinton Roy. + Tests ----- Modified: python/branches/py3k/configure ============================================================================== --- python/branches/py3k/configure (original) +++ python/branches/py3k/configure Sun May 24 22:39:11 2009 @@ -1,12 +1,12 @@ #! /bin/sh -# From configure.in Revision: 72865 . +# From configure.in Revision: 72874 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for python 3.1. +# Generated by GNU Autoconf 2.63 for python 3.1. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -18,7 +18,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -40,17 +40,45 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' else - PATH_SEPARATOR=: + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. @@ -66,8 +94,6 @@ # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -90,7 +116,7 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -103,17 +129,10 @@ PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -135,7 +154,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -161,7 +180,7 @@ as_have_required=no fi - if test $as_have_required = yes && (eval ": + if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } @@ -243,7 +262,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -264,7 +283,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -344,10 +363,10 @@ if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi @@ -416,9 +435,10 @@ test \$exitcode = 0") || { echo No shell found that supports shell functions. - echo Please tell autoconf at gnu.org about your system, - echo including any error possibly output before this - echo message + echo Please tell bug-autoconf at gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. } @@ -454,7 +474,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -482,7 +502,6 @@ *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -495,19 +514,22 @@ rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -532,10 +554,10 @@ as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -616,125 +638,157 @@ # include #endif" -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -VERSION -SOVERSION -CONFIG_ARGS -UNIVERSALSDK -ARCH_RUN_32BIT -PYTHONFRAMEWORK -PYTHONFRAMEWORKIDENTIFIER -PYTHONFRAMEWORKDIR -PYTHONFRAMEWORKPREFIX -PYTHONFRAMEWORKINSTALLDIR -FRAMEWORKINSTALLFIRST -FRAMEWORKINSTALLLAST -FRAMEWORKALTINSTALLFIRST -FRAMEWORKALTINSTALLLAST -FRAMEWORKUNIXTOOLSPREFIX -MACHDEP -SGI_ABI -CONFIGURE_MACOSX_DEPLOYMENT_TARGET -EXPORT_MACOSX_DEPLOYMENT_TARGET -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -CXX -MAINCC -CPP -GREP -EGREP -BUILDEXEEXT -LIBRARY -LDLIBRARY -DLLLIBRARY -BLDLIBRARY -LDLIBRARYDIR -INSTSONAME -RUNSHARED -LINKCC -GNULD -RANLIB -AR -ARFLAGS -SVNVERSION -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -LN -OPT -BASECFLAGS -UNIVERSAL_ARCH_FLAGS -OTHER_LIBTOOL_OPT -LIBTOOL_CRUFT -SO -LDSHARED -BLDSHARED -CCSHARED -LINKFORSHARED -CFLAGSFORSHARED -SHLIBS -USE_SIGNAL_MODULE -SIGNAL_OBJS -USE_THREAD_MODULE -LDLAST -THREADOBJ -DLINCLDIR -DYNLOADFILE -MACHDEP_OBJS -TRUE -LIBOBJS -HAVE_GETHOSTBYNAME_R_6_ARG -HAVE_GETHOSTBYNAME_R_5_ARG -HAVE_GETHOSTBYNAME_R_3_ARG -HAVE_GETHOSTBYNAME_R -HAVE_GETHOSTBYNAME -LIBM -LIBC -THREADHEADERS +ac_subst_vars='LTLIBOBJS SRCDIRS -LTLIBOBJS' +THREADHEADERS +LIBC +LIBM +HAVE_GETHOSTBYNAME +HAVE_GETHOSTBYNAME_R +HAVE_GETHOSTBYNAME_R_3_ARG +HAVE_GETHOSTBYNAME_R_5_ARG +HAVE_GETHOSTBYNAME_R_6_ARG +LIBOBJS +TRUE +MACHDEP_OBJS +DYNLOADFILE +DLINCLDIR +THREADOBJ +LDLAST +USE_THREAD_MODULE +SIGNAL_OBJS +USE_SIGNAL_MODULE +SHLIBS +CFLAGSFORSHARED +LINKFORSHARED +CCSHARED +BLDSHARED +LDSHARED +SO +LIBTOOL_CRUFT +OTHER_LIBTOOL_OPT +UNIVERSAL_ARCH_FLAGS +BASECFLAGS +OPT +LN +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +SVNVERSION +ARFLAGS +AR +RANLIB +GNULD +LINKCC +RUNSHARED +INSTSONAME +LDLIBRARYDIR +BLDLIBRARY +DLLLIBRARY +LDLIBRARY +LIBRARY +BUILDEXEEXT +EGREP +GREP +CPP +MAINCC +CXX +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +EXPORT_MACOSX_DEPLOYMENT_TARGET +CONFIGURE_MACOSX_DEPLOYMENT_TARGET +SGI_ABI +MACHDEP +FRAMEWORKUNIXTOOLSPREFIX +FRAMEWORKALTINSTALLLAST +FRAMEWORKALTINSTALLFIRST +FRAMEWORKINSTALLLAST +FRAMEWORKINSTALLFIRST +PYTHONFRAMEWORKINSTALLDIR +PYTHONFRAMEWORKPREFIX +PYTHONFRAMEWORKDIR +PYTHONFRAMEWORKIDENTIFIER +PYTHONFRAMEWORK +ARCH_RUN_32BIT +UNIVERSALSDK +CONFIG_ARGS +SOVERSION +VERSION +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_universalsdk +with_universal_archs +with_framework_name +enable_framework +with_gcc +with_cxx_main +with_suffix +enable_shared +enable_profiling +with_pydebug +with_libs +with_system_ffi +with_dbmliborder +with_signal_module +with_dec_threads +with_threads +with_thread +with_pth +enable_ipv6 +with_doc_strings +with_tsc +with_pymalloc +with_wctype_functions +with_fpectl +with_libm +with_libc +enable_big_digits +with_wide_unicode +with_computed_gotos +' ac_precious_vars='build_alias host_alias target_alias @@ -749,6 +803,8 @@ # Initialize some variables set by options. ac_init_help= ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -847,13 +903,21 @@ datarootdir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; @@ -866,13 +930,21 @@ dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -1063,22 +1135,38 @@ ac_init_version=: ;; -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. @@ -1098,7 +1186,7 @@ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { echo "$as_me: error: unrecognized option: $ac_option + -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -1107,16 +1195,16 @@ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -1125,22 +1213,38 @@ if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi -# Be sure to have absolute directory names. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +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 do eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done @@ -1155,7 +1259,7 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -1171,10 +1275,10 @@ ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 + { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } @@ -1182,12 +1286,12 @@ if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1214,12 +1318,12 @@ fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. @@ -1268,9 +1372,9 @@ Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -1280,25 +1384,25 @@ For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --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] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/python] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --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] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/python] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1312,6 +1416,7 @@ cat <<\_ACEOF Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-universalsdk[=SDKDIR] @@ -1385,15 +1490,17 @@ if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1429,7 +1536,7 @@ echo && $SHELL "$ac_srcdir/configure" --help=recursive else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1439,10 +1546,10 @@ if $ac_init_version; then cat <<\_ACEOF python configure 3.1 -generated by GNU Autoconf 2.61 +generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1453,7 +1560,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by python $as_me 3.1, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -1489,7 +1596,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" + $as_echo "PATH: $as_dir" done IFS=$as_save_IFS @@ -1524,7 +1631,7 @@ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; @@ -1576,11 +1683,12 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -1610,9 +1718,9 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo @@ -1627,9 +1735,9 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1645,8 +1753,8 @@ echo fi test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -1688,21 +1796,24 @@ # Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" + ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site fi -shift -for ac_site_file +for ac_site_file in "$ac_site_file1" "$ac_site_file2" do + test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi @@ -1712,16 +1823,16 @@ # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1735,29 +1846,38 @@ eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1767,10 +1887,12 @@ fi done if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi @@ -1912,20 +2034,20 @@ UNIVERSAL_ARCHS="32-bit" -{ echo "$as_me:$LINENO: checking for --with-universal-archs" >&5 -echo $ECHO_N "checking for --with-universal-archs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-universal-archs" >&5 +$as_echo_n "checking for --with-universal-archs... " >&6; } # Check whether --with-universal-archs was given. if test "${with_universal_archs+set}" = set; then withval=$with_universal_archs; - { echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } + { $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } UNIVERSAL_ARCHS="$withval" else - { echo "$as_me:$LINENO: result: 32-bit" >&5 -echo "${ECHO_T}32-bit" >&6; } + { $as_echo "$as_me:$LINENO: result: 32-bit" >&5 +$as_echo "32-bit" >&6; } fi @@ -2047,8 +2169,8 @@ ## # Set name for machine-dependent library files -{ echo "$as_me:$LINENO: checking MACHDEP" >&5 -echo $ECHO_N "checking MACHDEP... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking MACHDEP" >&5 +$as_echo_n "checking MACHDEP... " >&6; } if test -z "$MACHDEP" then ac_sys_system=`uname -s` @@ -2211,8 +2333,8 @@ LDFLAGS="$SGI_ABI $LDFLAGS" MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'` fi -{ echo "$as_me:$LINENO: result: $MACHDEP" >&5 -echo "${ECHO_T}$MACHDEP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $MACHDEP" >&5 +$as_echo "$MACHDEP" >&6; } # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET, # it may influence the way we can build extensions, so distutils @@ -2222,11 +2344,11 @@ CONFIGURE_MACOSX_DEPLOYMENT_TARGET= EXPORT_MACOSX_DEPLOYMENT_TARGET='#' -{ echo "$as_me:$LINENO: checking machine type as reported by uname -m" >&5 -echo $ECHO_N "checking machine type as reported by uname -m... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking machine type as reported by uname -m" >&5 +$as_echo_n "checking machine type as reported by uname -m... " >&6; } ac_sys_machine=`uname -m` -{ echo "$as_me:$LINENO: result: $ac_sys_machine" >&5 -echo "${ECHO_T}$ac_sys_machine" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_sys_machine" >&5 +$as_echo "$ac_sys_machine" >&6; } # checks for alternative programs @@ -2238,8 +2360,8 @@ # XXX shouldn't some/most/all of this code be merged with the stuff later # on that fiddles with OPT and BASECFLAGS? -{ echo "$as_me:$LINENO: checking for --without-gcc" >&5 -echo $ECHO_N "checking for --without-gcc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --without-gcc" >&5 +$as_echo_n "checking for --without-gcc... " >&6; } # Check whether --with-gcc was given. if test "${with_gcc+set}" = set; then @@ -2264,15 +2386,15 @@ esac fi -{ echo "$as_me:$LINENO: result: $without_gcc" >&5 -echo "${ECHO_T}$without_gcc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $without_gcc" >&5 +$as_echo "$without_gcc" >&6; } # If the user switches compilers, we can't believe the cache if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" then - { { echo "$as_me:$LINENO: error: cached CC is different -- throw away $cache_file + { { $as_echo "$as_me:$LINENO: error: cached CC is different -- throw away $cache_file (it is also a good idea to do 'make clean' before compiling)" >&5 -echo "$as_me: error: cached CC is different -- throw away $cache_file +$as_echo "$as_me: error: cached CC is different -- throw away $cache_file (it is also a good idea to do 'make clean' before compiling)" >&2;} { (exit 1); exit 1; }; } fi @@ -2285,10 +2407,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2301,7 +2423,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2312,11 +2434,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2325,10 +2447,10 @@ ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2341,7 +2463,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2352,11 +2474,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2364,12 +2486,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2382,10 +2500,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2398,7 +2516,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2409,11 +2527,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2422,10 +2540,10 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2443,7 +2561,7 @@ continue fi ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2466,11 +2584,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2481,10 +2599,10 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2497,7 +2615,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2508,11 +2626,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2525,10 +2643,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2541,7 +2659,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2552,11 +2670,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2568,12 +2686,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2583,44 +2697,50 @@ fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF @@ -2639,27 +2759,22 @@ } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + ac_rmfiles= for ac_file in $ac_files do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done @@ -2670,10 +2785,11 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' @@ -2684,7 +2800,7 @@ do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most @@ -2711,25 +2827,27 @@ ac_file='' fi -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables +$as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then @@ -2738,49 +2856,53 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. +$as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi fi fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } -rm -f a.out a.exe conftest$ac_cv_exeext b.out +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will @@ -2789,31 +2911,33 @@ for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2836,40 +2960,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile +$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2895,20 +3022,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -2918,15 +3046,19 @@ ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes @@ -2953,20 +3085,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" @@ -2991,20 +3124,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag @@ -3030,20 +3164,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3058,8 +3193,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3075,10 +3210,10 @@ CFLAGS= fi fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC @@ -3149,20 +3284,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3178,15 +3314,15 @@ # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac @@ -3199,8 +3335,8 @@ -{ echo "$as_me:$LINENO: checking for --with-cxx-main=" >&5 -echo $ECHO_N "checking for --with-cxx-main=... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-cxx-main=" >&5 +$as_echo_n "checking for --with-cxx-main=... " >&6; } # Check whether --with-cxx_main was given. if test "${with_cxx_main+set}" = set; then @@ -3225,8 +3361,8 @@ fi -{ echo "$as_me:$LINENO: result: $with_cxx_main" >&5 -echo "${ECHO_T}$with_cxx_main" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_cxx_main" >&5 +$as_echo "$with_cxx_main" >&6; } preset_cxx="$CXX" if test -z "$CXX" @@ -3234,10 +3370,10 @@ case "$CC" in gcc) # Extract the first word of "g++", so it can be a program name with args. set dummy g++; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CXX in [\\/]* | ?:[\\/]*) @@ -3252,7 +3388,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3265,20 +3401,20 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ;; cc) # Extract the first word of "c++", so it can be a program name with args. set dummy c++; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CXX in [\\/]* | ?:[\\/]*) @@ -3293,7 +3429,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3306,11 +3442,11 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ;; @@ -3326,10 +3462,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. @@ -3342,7 +3478,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3353,11 +3489,11 @@ fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -3372,12 +3508,12 @@ fi if test "$preset_cxx" != "$CXX" then - { echo "$as_me:$LINENO: WARNING: + { $as_echo "$as_me:$LINENO: WARNING: By default, distutils will build C++ extension modules with \"$CXX\". If this is not intended, then set CXX on the configure command line. " >&5 -echo "$as_me: WARNING: +$as_echo "$as_me: WARNING: By default, distutils will build C++ extension modules with \"$CXX\". If this is not intended, then set CXX on the configure command line. @@ -3392,15 +3528,15 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -3432,20 +3568,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3469,13 +3606,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3483,7 +3621,7 @@ # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3508,8 +3646,8 @@ else ac_cv_prog_CPP=$CPP fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3537,20 +3675,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3574,13 +3713,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3588,7 +3728,7 @@ # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3604,11 +3744,13 @@ if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi ac_ext=c @@ -3618,42 +3760,37 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else + if test -z "$GREP"; then ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3668,74 +3805,60 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_GREP_found && break 3 + $ac_path_GREP_found && break 3 + done done done - -done IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } -fi - + fi else ac_cv_path_GREP=$GREP fi - fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else + if test -z "$EGREP"; then ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3750,63 +3873,510 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_EGREP_found && break 3 + $ac_path_EGREP_found && break 3 + done done done - -done IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no fi +rm -f conftest* -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } fi +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : else - ac_cv_path_EGREP=$EGREP + ac_cv_header_stdc=no fi +rm -f conftest* +fi - fi +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + -{ echo "$as_me:$LINENO: checking for AIX" >&5 -echo $ECHO_N "checking for AIX... $ECHO_C" >&6; } +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + if test "${ac_cv_header_minix_config_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 +$as_echo_n "checking for minix/config.h... " >&6; } +if test "${ac_cv_header_minix_config_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +$as_echo "$ac_cv_header_minix_config_h" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5 +$as_echo_n "checking minix/config.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#ifdef _AIX - yes -#endif +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5 +$as_echo_n "checking minix/config.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## -------------------------------------- ## +## Report this to http://bugs.python.org/ ## +## -------------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 +$as_echo_n "checking for minix/config.h... " >&6; } +if test "${ac_cv_header_minix_config_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_minix_config_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +$as_echo "$ac_cv_header_minix_config_h" >&6; } + +fi +if test "x$ac_cv_header_minix_config_h" = x""yes; then + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_SOURCE 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_1_SOURCE 2 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _MINIX 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test "${ac_cv_safe_to_define___extensions__+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + ; + return 0; +} _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -cat >>confdefs.h <<\_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_safe_to_define___extensions__=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_safe_to_define___extensions__=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + cat >>confdefs.h <<\_ACEOF +#define __EXTENSIONS__ 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF #define _ALL_SOURCE 1 _ACEOF -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -rm -f conftest* + cat >>confdefs.h <<\_ACEOF +#define _GNU_SOURCE 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _TANDEM_SOURCE 1 +_ACEOF @@ -3819,8 +4389,8 @@ esac -{ echo "$as_me:$LINENO: checking for --with-suffix" >&5 -echo $ECHO_N "checking for --with-suffix... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-suffix" >&5 +$as_echo_n "checking for --with-suffix... " >&6; } # Check whether --with-suffix was given. if test "${with_suffix+set}" = set; then @@ -3832,26 +4402,26 @@ esac fi -{ echo "$as_me:$LINENO: result: $EXEEXT" >&5 -echo "${ECHO_T}$EXEEXT" >&6; } +{ $as_echo "$as_me:$LINENO: result: $EXEEXT" >&5 +$as_echo "$EXEEXT" >&6; } # Test whether we're running on a non-case-sensitive system, in which # case we give a warning if no ext is given -{ echo "$as_me:$LINENO: checking for case-insensitive build directory" >&5 -echo $ECHO_N "checking for case-insensitive build directory... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for case-insensitive build directory" >&5 +$as_echo_n "checking for case-insensitive build directory... " >&6; } if test ! -d CaseSensitiveTestDir; then mkdir CaseSensitiveTestDir fi if test -d casesensitivetestdir then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } BUILDEXEEXT=.exe else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } BUILDEXEEXT=$EXEEXT fi rmdir CaseSensitiveTestDir @@ -3884,14 +4454,14 @@ -{ echo "$as_me:$LINENO: checking LIBRARY" >&5 -echo $ECHO_N "checking LIBRARY... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LIBRARY" >&5 +$as_echo_n "checking LIBRARY... " >&6; } if test -z "$LIBRARY" then LIBRARY='libpython$(VERSION).a' fi -{ echo "$as_me:$LINENO: result: $LIBRARY" >&5 -echo "${ECHO_T}$LIBRARY" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LIBRARY" >&5 +$as_echo "$LIBRARY" >&6; } # LDLIBRARY is the name of the library to link against (as opposed to the # name of the library into which to insert object files). BLDLIBRARY is also @@ -3926,8 +4496,8 @@ # This is altered for AIX in order to build the export list before # linking. -{ echo "$as_me:$LINENO: checking LINKCC" >&5 -echo $ECHO_N "checking LINKCC... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LINKCC" >&5 +$as_echo_n "checking LINKCC... " >&6; } if test -z "$LINKCC" then LINKCC='$(PURIFY) $(MAINCC)' @@ -3947,8 +4517,8 @@ LINKCC=qcc;; esac fi -{ echo "$as_me:$LINENO: result: $LINKCC" >&5 -echo "${ECHO_T}$LINKCC" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LINKCC" >&5 +$as_echo "$LINKCC" >&6; } # GNULD is set to "yes" if the GNU linker is used. If this goes wrong # make sure we default having it set to "no": this is used by @@ -3956,8 +4526,8 @@ # to linker command lines, and failing to detect GNU ld simply results # in the same bahaviour as before. -{ echo "$as_me:$LINENO: checking for GNU ld" >&5 -echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } ac_prog=ld if test "$GCC" = yes; then ac_prog=`$CC -print-prog-name=ld` @@ -3968,11 +4538,11 @@ *) GNULD=no;; esac -{ echo "$as_me:$LINENO: result: $GNULD" >&5 -echo "${ECHO_T}$GNULD" >&6; } +{ $as_echo "$as_me:$LINENO: result: $GNULD" >&5 +$as_echo "$GNULD" >&6; } -{ echo "$as_me:$LINENO: checking for --enable-shared" >&5 -echo $ECHO_N "checking for --enable-shared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --enable-shared" >&5 +$as_echo_n "checking for --enable-shared... " >&6; } # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then enableval=$enable_shared; @@ -3988,11 +4558,11 @@ enable_shared="no";; esac fi -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } +{ $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } -{ echo "$as_me:$LINENO: checking for --enable-profiling" >&5 -echo $ECHO_N "checking for --enable-profiling... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --enable-profiling" >&5 +$as_echo_n "checking for --enable-profiling... " >&6; } # Check whether --enable-profiling was given. if test "${enable_profiling+set}" = set; then enableval=$enable_profiling; ac_save_cc="$CC" @@ -4014,29 +4584,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_enable_profiling="yes" else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_enable_profiling="no" fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4044,8 +4617,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_enable_profiling" >&5 -echo "${ECHO_T}$ac_enable_profiling" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_enable_profiling" >&5 +$as_echo "$ac_enable_profiling" >&6; } case "$ac_enable_profiling" in "yes") @@ -4054,8 +4627,8 @@ ;; esac -{ echo "$as_me:$LINENO: checking LDLIBRARY" >&5 -echo $ECHO_N "checking LDLIBRARY... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LDLIBRARY" >&5 +$as_echo_n "checking LDLIBRARY... " >&6; } # MacOSX framework builds need more magic. LDLIBRARY is the dynamic # library that we build, but we do not want to link against it (we @@ -4139,16 +4712,16 @@ esac fi -{ echo "$as_me:$LINENO: result: $LDLIBRARY" >&5 -echo "${ECHO_T}$LDLIBRARY" >&6; } +{ $as_echo "$as_me:$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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -4161,7 +4734,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4172,11 +4745,11 @@ fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } + { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4185,10 +4758,10 @@ 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 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $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. @@ -4201,7 +4774,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4212,11 +4785,11 @@ fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -echo "${ECHO_T}$ac_ct_RANLIB" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -4224,12 +4797,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf at gnu.org." >&2;} +{ $as_echo "$as_me:$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 @@ -4243,10 +4812,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. @@ -4259,7 +4828,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4270,11 +4839,11 @@ fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { echo "$as_me:$LINENO: result: $AR" >&5 -echo "${ECHO_T}$AR" >&6; } + { $as_echo "$as_me:$LINENO: result: $AR" >&5 +$as_echo "$AR" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4293,10 +4862,10 @@ # Extract the first word of "svnversion", so it can be a program name with args. set dummy svnversion; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_SVNVERSION+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$SVNVERSION"; then ac_cv_prog_SVNVERSION="$SVNVERSION" # Let the user override the test. @@ -4309,7 +4878,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_SVNVERSION="found" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4321,11 +4890,11 @@ fi SVNVERSION=$ac_cv_prog_SVNVERSION if test -n "$SVNVERSION"; then - { echo "$as_me:$LINENO: result: $SVNVERSION" >&5 -echo "${ECHO_T}$SVNVERSION" >&6; } + { $as_echo "$as_me:$LINENO: result: $SVNVERSION" >&5 +$as_echo "$SVNVERSION" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4361,8 +4930,8 @@ fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi @@ -4388,11 +4957,12 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -4421,17 +4991,29 @@ # program-specific install script used by HP pwplus--don't use. : else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi fi fi done done ;; esac + done IFS=$as_save_IFS +rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then @@ -4444,8 +5026,8 @@ INSTALL=$ac_install_sh fi fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } +{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -4467,8 +5049,8 @@ fi # Check for --with-pydebug -{ echo "$as_me:$LINENO: checking for --with-pydebug" >&5 -echo $ECHO_N "checking for --with-pydebug... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-pydebug" >&5 +$as_echo_n "checking for --with-pydebug... " >&6; } # Check whether --with-pydebug was given. if test "${with_pydebug+set}" = set; then @@ -4480,15 +5062,15 @@ #define Py_DEBUG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; }; + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; }; Py_DEBUG='true' -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; }; Py_DEBUG='false' +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; }; Py_DEBUG='false' fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4566,8 +5148,8 @@ # Python violates C99 rules, by casting between incompatible # pointer types. GCC may generate bad code as a result of that, # so use -fno-strict-aliasing if supported. - { echo "$as_me:$LINENO: checking whether $CC accepts -fno-strict-aliasing" >&5 -echo $ECHO_N "checking whether $CC accepts -fno-strict-aliasing... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether $CC accepts -fno-strict-aliasing" >&5 +$as_echo_n "checking whether $CC accepts -fno-strict-aliasing... " >&6; } ac_save_cc="$CC" CC="$CC -fno-strict-aliasing" if test "$cross_compiling" = yes; then @@ -4587,36 +5169,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_no_strict_aliasing_ok=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_no_strict_aliasing_ok=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CC="$ac_save_cc" - { echo "$as_me:$LINENO: result: $ac_cv_no_strict_aliasing_ok" >&5 -echo "${ECHO_T}$ac_cv_no_strict_aliasing_ok" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_no_strict_aliasing_ok" >&5 +$as_echo "$ac_cv_no_strict_aliasing_ok" >&6; } if test $ac_cv_no_strict_aliasing_ok = yes then BASECFLAGS="$BASECFLAGS -fno-strict-aliasing" @@ -4655,8 +5240,8 @@ ARCH_RUN_32BIT="arch -i386 -ppc" else - { { echo "$as_me:$LINENO: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&5 -echo "$as_me: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&2;} + { { $as_echo "$as_me:$LINENO: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&5 +$as_echo "$as_me: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&2;} { (exit 1); exit 1; }; } fi @@ -4730,10 +5315,10 @@ ac_cv_opt_olimit_ok=no fi -{ echo "$as_me:$LINENO: checking whether $CC accepts -OPT:Olimit=0" >&5 -echo $ECHO_N "checking whether $CC accepts -OPT:Olimit=0... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -OPT:Olimit=0" >&5 +$as_echo_n "checking whether $CC accepts -OPT:Olimit=0... " >&6; } if test "${ac_cv_opt_olimit_ok+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -OPT:Olimit=0" @@ -4754,29 +5339,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_opt_olimit_ok=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_opt_olimit_ok=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4784,8 +5372,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_opt_olimit_ok" >&5 -echo "${ECHO_T}$ac_cv_opt_olimit_ok" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_opt_olimit_ok" >&5 +$as_echo "$ac_cv_opt_olimit_ok" >&6; } if test $ac_cv_opt_olimit_ok = yes; then case $ac_sys_system in # XXX is this branch needed? On MacOSX 10.2.2 the result of the @@ -4798,10 +5386,10 @@ ;; esac else - { echo "$as_me:$LINENO: checking whether $CC accepts -Olimit 1500" >&5 -echo $ECHO_N "checking whether $CC accepts -Olimit 1500... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether $CC accepts -Olimit 1500" >&5 +$as_echo_n "checking whether $CC accepts -Olimit 1500... " >&6; } if test "${ac_cv_olimit_ok+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -Olimit 1500" @@ -4822,29 +5410,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_olimit_ok=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_olimit_ok=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4852,8 +5443,8 @@ CC="$ac_save_cc" fi - { echo "$as_me:$LINENO: result: $ac_cv_olimit_ok" >&5 -echo "${ECHO_T}$ac_cv_olimit_ok" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_olimit_ok" >&5 +$as_echo "$ac_cv_olimit_ok" >&6; } if test $ac_cv_olimit_ok = yes; then BASECFLAGS="$BASECFLAGS -Olimit 1500" fi @@ -4862,8 +5453,8 @@ # Check whether GCC supports PyArg_ParseTuple format if test "$GCC" = "yes" then - { echo "$as_me:$LINENO: checking whether gcc supports ParseTuple __format__" >&5 -echo $ECHO_N "checking whether gcc supports ParseTuple __format__... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether gcc supports ParseTuple __format__" >&5 +$as_echo_n "checking whether gcc supports ParseTuple __format__... " >&6; } save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Werror" cat >conftest.$ac_ext <<_ACEOF @@ -4889,13 +5480,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -4905,14 +5497,14 @@ #define HAVE_ATTRIBUTE_FORMAT_PARSETUPLE 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -4925,10 +5517,10 @@ # complain if unaccepted options are passed (e.g. gcc on Mac OS X). # So we have to see first whether pthreads are available without # options before we can check whether -Kpthread improves anything. -{ echo "$as_me:$LINENO: checking whether pthreads are available without options" >&5 -echo $ECHO_N "checking whether pthreads are available without options... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether pthreads are available without options" >&5 +$as_echo_n "checking whether pthreads are available without options... " >&6; } if test "${ac_cv_pthread_is_default+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_pthread_is_default=no @@ -4959,19 +5551,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_pthread_is_default=yes @@ -4979,13 +5573,14 @@ ac_cv_pthread=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_pthread_is_default=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4993,8 +5588,8 @@ fi -{ echo "$as_me:$LINENO: result: $ac_cv_pthread_is_default" >&5 -echo "${ECHO_T}$ac_cv_pthread_is_default" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_pthread_is_default" >&5 +$as_echo "$ac_cv_pthread_is_default" >&6; } if test $ac_cv_pthread_is_default = yes @@ -5006,10 +5601,10 @@ # Some compilers won't report that they do not support -Kpthread, # so we need to run a program to see whether it really made the # function available. -{ echo "$as_me:$LINENO: checking whether $CC accepts -Kpthread" >&5 -echo $ECHO_N "checking whether $CC accepts -Kpthread... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -Kpthread" >&5 +$as_echo_n "checking whether $CC accepts -Kpthread... " >&6; } if test "${ac_cv_kpthread+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -Kpthread" @@ -5042,29 +5637,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_kpthread=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_kpthread=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5072,8 +5670,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_kpthread" >&5 -echo "${ECHO_T}$ac_cv_kpthread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_kpthread" >&5 +$as_echo "$ac_cv_kpthread" >&6; } fi if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no @@ -5083,10 +5681,10 @@ # Some compilers won't report that they do not support -Kthread, # so we need to run a program to see whether it really made the # function available. -{ echo "$as_me:$LINENO: checking whether $CC accepts -Kthread" >&5 -echo $ECHO_N "checking whether $CC accepts -Kthread... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -Kthread" >&5 +$as_echo_n "checking whether $CC accepts -Kthread... " >&6; } if test "${ac_cv_kthread+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -Kthread" @@ -5119,29 +5717,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_kthread=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_kthread=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5149,8 +5750,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_kthread" >&5 -echo "${ECHO_T}$ac_cv_kthread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_kthread" >&5 +$as_echo "$ac_cv_kthread" >&6; } fi if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no @@ -5160,10 +5761,10 @@ # Some compilers won't report that they do not support -pthread, # so we need to run a program to see whether it really made the # function available. -{ echo "$as_me:$LINENO: checking whether $CC accepts -pthread" >&5 -echo $ECHO_N "checking whether $CC accepts -pthread... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -pthread" >&5 +$as_echo_n "checking whether $CC accepts -pthread... " >&6; } if test "${ac_cv_thread+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_cc="$CC" CC="$CC -pthread" @@ -5196,29 +5797,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_pthread=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_pthread=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5226,8 +5830,8 @@ CC="$ac_save_cc" fi -{ echo "$as_me:$LINENO: result: $ac_cv_pthread" >&5 -echo "${ECHO_T}$ac_cv_pthread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_pthread" >&5 +$as_echo "$ac_cv_pthread" >&6; } fi # If we have set a CC compiler flag for thread support then @@ -5235,8 +5839,8 @@ ac_cv_cxx_thread=no if test ! -z "$CXX" then -{ echo "$as_me:$LINENO: checking whether $CXX also accepts flags for thread support" >&5 -echo $ECHO_N "checking whether $CXX also accepts flags for thread support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CXX also accepts flags for thread support" >&5 +$as_echo_n "checking whether $CXX also accepts flags for thread support... " >&6; } ac_save_cxx="$CXX" if test "$ac_cv_kpthread" = "yes" @@ -5266,17 +5870,17 @@ fi rm -fr conftest* fi -{ echo "$as_me:$LINENO: result: $ac_cv_cxx_thread" >&5 -echo "${ECHO_T}$ac_cv_cxx_thread" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_thread" >&5 +$as_echo "$ac_cv_cxx_thread" >&6; } fi CXX="$ac_save_cxx" # checks for header files -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5303,20 +5907,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no @@ -5408,37 +6013,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -5447,75 +6055,6 @@ fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - @@ -5583,20 +6122,21 @@ sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ bluetooth/bluetooth.h linux/tipc.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5612,32 +6152,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5651,51 +6192,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -5704,21 +6246,24 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -5732,11 +6277,11 @@ ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } + as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5762,20 +6307,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -5783,12 +6329,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break @@ -5797,10 +6346,10 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -5838,26 +6387,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_opendir=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then @@ -5872,8 +6425,8 @@ rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -5881,10 +6434,10 @@ fi else - { echo "$as_me:$LINENO: checking for library containing opendir" >&5 -echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 +$as_echo_n "checking for library containing opendir... " >&6; } if test "${ac_cv_search_opendir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -5922,26 +6475,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_opendir=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then @@ -5956,8 +6513,8 @@ rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -echo "${ECHO_T}$ac_cv_search_opendir" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +$as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -5966,10 +6523,10 @@ fi -{ echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5 -echo $ECHO_N "checking whether sys/types.h defines makedev... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5 +$as_echo_n "checking whether sys/types.h defines makedev... " >&6; } if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5992,46 +6549,50 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_header_sys_types_h_makedev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_types_h_makedev=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 -echo "${ECHO_T}$ac_cv_header_sys_types_h_makedev" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 +$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; } if test $ac_cv_header_sys_types_h_makedev = no; then if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - { echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 -echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 +$as_echo_n "checking for sys/mkdev.h... " >&6; } if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 +$as_echo "$ac_cv_header_sys_mkdev_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 -echo $ECHO_N "checking sys/mkdev.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 +$as_echo_n "checking sys/mkdev.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6047,32 +6608,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5 -echo $ECHO_N "checking sys/mkdev.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5 +$as_echo_n "checking sys/mkdev.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6086,51 +6648,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -6139,18 +6702,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 -echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 +$as_echo_n "checking for sys/mkdev.h... " >&6; } if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_sys_mkdev_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 +$as_echo "$ac_cv_header_sys_mkdev_h" >&6; } fi -if test $ac_cv_header_sys_mkdev_h = yes; then +if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define MAJOR_IN_MKDEV 1 @@ -6162,17 +6725,17 @@ if test $ac_cv_header_sys_mkdev_h = no; then if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - { echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 -echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 +$as_echo_n "checking for sys/sysmacros.h... " >&6; } if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 +$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 -echo $ECHO_N "checking sys/sysmacros.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 +$as_echo_n "checking sys/sysmacros.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6188,32 +6751,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5 -echo $ECHO_N "checking sys/sysmacros.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5 +$as_echo_n "checking sys/sysmacros.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6227,51 +6791,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -6280,18 +6845,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 -echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 +$as_echo_n "checking for sys/sysmacros.h... " >&6; } if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_sys_sysmacros_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 -echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 +$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; } fi -if test $ac_cv_header_sys_sysmacros_h = yes; then +if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define MAJOR_IN_SYSMACROS 1 @@ -6308,11 +6873,11 @@ for ac_header in term.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6334,20 +6899,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -6355,12 +6921,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -6372,11 +6941,11 @@ for ac_header in linux/netlink.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6401,20 +6970,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -6422,12 +6992,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -6437,8 +7010,8 @@ # checks for typedefs was_it_defined=no -{ echo "$as_me:$LINENO: checking for clock_t in time.h" >&5 -echo $ECHO_N "checking for clock_t in time.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for clock_t in time.h" >&5 +$as_echo_n "checking for clock_t in time.h... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6462,12 +7035,12 @@ fi rm -f conftest* -{ echo "$as_me:$LINENO: result: $was_it_defined" >&5 -echo "${ECHO_T}$was_it_defined" >&6; } +{ $as_echo "$as_me:$LINENO: result: $was_it_defined" >&5 +$as_echo "$was_it_defined" >&6; } # Check whether using makedev requires defining _OSF_SOURCE -{ echo "$as_me:$LINENO: checking for makedev" >&5 -echo $ECHO_N "checking for makedev... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for makedev" >&5 +$as_echo_n "checking for makedev... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6489,26 +7062,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_has_makedev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_has_makedev=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_has_makedev" = "no"; then @@ -6537,26 +7114,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_has_makedev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_has_makedev=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_has_makedev" = "yes"; then @@ -6567,8 +7148,8 @@ fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_has_makedev" >&5 -echo "${ECHO_T}$ac_cv_has_makedev" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_has_makedev" >&5 +$as_echo "$ac_cv_has_makedev" >&6; } if test "$ac_cv_has_makedev" = "yes"; then cat >>confdefs.h <<\_ACEOF @@ -6585,8 +7166,8 @@ # work-around, disable LFS on such configurations use_lfs=yes -{ echo "$as_me:$LINENO: checking Solaris LFS bug" >&5 -echo $ECHO_N "checking Solaris LFS bug... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking Solaris LFS bug" >&5 +$as_echo_n "checking Solaris LFS bug... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6612,28 +7193,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then sol_lfs_bug=no else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 sol_lfs_bug=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $sol_lfs_bug" >&5 -echo "${ECHO_T}$sol_lfs_bug" >&6; } +{ $as_echo "$as_me:$LINENO: result: $sol_lfs_bug" >&5 +$as_echo "$sol_lfs_bug" >&6; } if test "$sol_lfs_bug" = "yes"; then use_lfs=no fi @@ -6661,26 +7243,58 @@ EOF # Type availability checks -{ echo "$as_me:$LINENO: checking for mode_t" >&5 -echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for mode_t" >&5 +$as_echo_n "checking for mode_t... " >&6; } if test "${ac_cv_type_mode_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_mode_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef mode_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (mode_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((mode_t))) + return 0; ; return 0; } @@ -6691,30 +7305,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_mode_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_mode_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_mode_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 -echo "${ECHO_T}$ac_cv_type_mode_t" >&6; } -if test $ac_cv_type_mode_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 +$as_echo "$ac_cv_type_mode_t" >&6; } +if test "x$ac_cv_type_mode_t" = x""yes; then : else @@ -6724,26 +7347,58 @@ fi -{ echo "$as_me:$LINENO: checking for off_t" >&5 -echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for off_t" >&5 +$as_echo_n "checking for off_t... " >&6; } if test "${ac_cv_type_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_off_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef off_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (off_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((off_t))) + return 0; ; return 0; } @@ -6754,30 +7409,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_off_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_off_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_off_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -echo "${ECHO_T}$ac_cv_type_off_t" >&6; } -if test $ac_cv_type_off_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +$as_echo "$ac_cv_type_off_t" >&6; } +if test "x$ac_cv_type_off_t" = x""yes; then : else @@ -6787,26 +7451,58 @@ fi -{ echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5 +$as_echo_n "checking for pid_t... " >&6; } if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_pid_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef pid_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (pid_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof ((pid_t))) + return 0; ; return 0; } @@ -6817,30 +7513,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_pid_t=yes + : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_pid_t=no + ac_cv_type_pid_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } -if test $ac_cv_type_pid_t = yes; then + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +$as_echo "$ac_cv_type_pid_t" >&6; } +if test "x$ac_cv_type_pid_t" = x""yes; then : else @@ -6850,10 +7555,10 @@ fi -{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5 -echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +$as_echo_n "checking return type of signal handlers... " >&6; } if test "${ac_cv_type_signal+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6878,20 +7583,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_signal=int else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=void @@ -6899,19 +7605,54 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 -echo "${ECHO_T}$ac_cv_type_signal" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +$as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF -{ echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for size_t" >&5 +$as_echo_n "checking for size_t... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else + ac_cv_type_size_t=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6919,14 +7660,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef size_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof ((size_t))) + return 0; ; return 0; } @@ -6937,30 +7675,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_size_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_size_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_size_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6; } -if test $ac_cv_type_size_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +$as_echo "$ac_cv_type_size_t" >&6; } +if test "x$ac_cv_type_size_t" = x""yes; then : else @@ -6970,10 +7717,10 @@ fi -{ echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 -echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 +$as_echo_n "checking for uid_t in sys/types.h... " >&6; } if test "${ac_cv_type_uid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6993,8 +7740,8 @@ rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 -echo "${ECHO_T}$ac_cv_type_uid_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 +$as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF @@ -7009,10 +7756,10 @@ fi - { echo "$as_me:$LINENO: checking for uint32_t" >&5 -echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for uint32_t" >&5 +$as_echo_n "checking for uint32_t... " >&6; } if test "${ac_cv_c_uint32_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_c_uint32_t=no for ac_type in 'uint32_t' 'unsigned int' 'unsigned long int' \ @@ -7040,13 +7787,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7057,7 +7805,7 @@ esac else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -7067,8 +7815,8 @@ test "$ac_cv_c_uint32_t" != no && break done fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_uint32_t" >&5 -echo "${ECHO_T}$ac_cv_c_uint32_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint32_t" >&5 +$as_echo "$ac_cv_c_uint32_t" >&6; } case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) @@ -7085,10 +7833,10 @@ esac - { echo "$as_me:$LINENO: checking for uint64_t" >&5 -echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for uint64_t" >&5 +$as_echo_n "checking for uint64_t... " >&6; } if test "${ac_cv_c_uint64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_c_uint64_t=no for ac_type in 'uint64_t' 'unsigned int' 'unsigned long int' \ @@ -7116,13 +7864,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7133,7 +7882,7 @@ esac else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -7143,8 +7892,8 @@ test "$ac_cv_c_uint64_t" != no && break done fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_uint64_t" >&5 -echo "${ECHO_T}$ac_cv_c_uint64_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint64_t" >&5 +$as_echo "$ac_cv_c_uint64_t" >&6; } case $ac_cv_c_uint64_t in #( no|yes) ;; #( *) @@ -7161,10 +7910,10 @@ esac - { echo "$as_me:$LINENO: checking for int32_t" >&5 -echo $ECHO_N "checking for int32_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for int32_t" >&5 +$as_echo_n "checking for int32_t... " >&6; } if test "${ac_cv_c_int32_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_c_int32_t=no for ac_type in 'int32_t' 'int' 'long int' \ @@ -7192,13 +7941,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7214,7 +7964,7 @@ main () { static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 1) - < ($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 2))]; + < ($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 2))]; test_array [0] = 0 ; @@ -7227,20 +7977,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 case $ac_type in @@ -7252,7 +8003,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -7262,8 +8013,8 @@ test "$ac_cv_c_int32_t" != no && break done fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_int32_t" >&5 -echo "${ECHO_T}$ac_cv_c_int32_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int32_t" >&5 +$as_echo "$ac_cv_c_int32_t" >&6; } case $ac_cv_c_int32_t in #( no|yes) ;; #( *) @@ -7275,10 +8026,10 @@ esac - { echo "$as_me:$LINENO: checking for int64_t" >&5 -echo $ECHO_N "checking for int64_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for int64_t" >&5 +$as_echo_n "checking for int64_t... " >&6; } if test "${ac_cv_c_int64_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_c_int64_t=no for ac_type in 'int64_t' 'int' 'long int' \ @@ -7306,13 +8057,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7328,7 +8080,7 @@ main () { static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 1) - < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 2))]; + < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 2))]; test_array [0] = 0 ; @@ -7341,20 +8093,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 case $ac_type in @@ -7366,7 +8119,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -7376,8 +8129,8 @@ test "$ac_cv_c_int64_t" != no && break done fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_int64_t" >&5 -echo "${ECHO_T}$ac_cv_c_int64_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int64_t" >&5 +$as_echo "$ac_cv_c_int64_t" >&6; } case $ac_cv_c_int64_t in #( no|yes) ;; #( *) @@ -7388,26 +8141,24 @@ ;; esac -{ echo "$as_me:$LINENO: checking for ssize_t" >&5 -echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ssize_t" >&5 +$as_echo_n "checking for ssize_t... " >&6; } if test "${ac_cv_type_ssize_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_ssize_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef ssize_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof (ssize_t)) + return 0; ; return 0; } @@ -7418,45 +8169,18 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_ssize_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_ssize_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 -echo "${ECHO_T}$ac_cv_type_ssize_t" >&6; } -if test $ac_cv_type_ssize_t = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_SSIZE_T 1 -_ACEOF - -fi - - -# Sizes of various common basic types -# ANSI C requires sizeof(char) == 1, so no need to check it -{ echo "$as_me:$LINENO: checking for int" >&5 -echo $ECHO_N "checking for int... $ECHO_C" >&6; } -if test "${ac_cv_type_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7464,14 +8188,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef int ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof ((ssize_t))) + return 0; ; return 0; } @@ -7482,38 +8203,57 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_int=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_ssize_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_int=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 -echo "${ECHO_T}$ac_cv_type_int" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 +$as_echo "$ac_cv_type_ssize_t" >&6; } +if test "x$ac_cv_type_ssize_t" = x""yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SSIZE_T 1 +_ACEOF + +fi + +# Sizes of various common basic types +# ANSI C requires sizeof(char) == 1, so no need to check it # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of int" >&5 -echo $ECHO_N "checking size of int... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of int" >&5 +$as_echo_n "checking size of int... " >&6; } if test "${ac_cv_sizeof_int+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -7524,11 +8264,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= 0)]; test_array [0] = 0 ; @@ -7541,13 +8280,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7561,11 +8301,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7578,20 +8317,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -7605,7 +8345,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -7615,11 +8355,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) < 0)]; test_array [0] = 0 ; @@ -7632,13 +8371,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7652,11 +8392,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= $ac_mid)]; test_array [0] = 0 ; @@ -7669,20 +8408,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -7696,7 +8436,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -7716,11 +8456,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7733,20 +8472,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -7757,11 +8497,13 @@ case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; '') if test "$ac_cv_type_int" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int) +$as_echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_int=0 fi ;; @@ -7774,9 +8516,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef int ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (int)); } +static unsigned long int ulongval () { return (long int) (sizeof (int)); } #include #include int @@ -7786,20 +8527,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (int))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (int)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (int)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -7812,43 +8555,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_int" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (int) +$as_echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_int=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 -echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +$as_echo "$ac_cv_sizeof_int" >&6; } @@ -7857,68 +8605,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6; } -if test "${ac_cv_type_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } if test "${ac_cv_sizeof_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -7929,11 +8623,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)]; test_array [0] = 0 ; @@ -7946,13 +8639,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7966,11 +8660,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7983,20 +8676,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -8010,7 +8704,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -8020,11 +8714,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)]; test_array [0] = 0 ; @@ -8037,13 +8730,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8057,11 +8751,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)]; test_array [0] = 0 ; @@ -8074,20 +8767,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -8101,7 +8795,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -8121,11 +8815,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8138,20 +8831,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -8162,11 +8856,13 @@ case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) +$as_echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long=0 fi ;; @@ -8179,9 +8875,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (long)); } +static unsigned long int ulongval () { return (long int) (sizeof (long)); } #include #include int @@ -8191,20 +8886,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (long))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -8217,43 +8914,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) +$as_echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } @@ -8262,68 +8964,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for void *" >&5 -echo $ECHO_N "checking for void *... $ECHO_C" >&6; } -if test "${ac_cv_type_void_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef void * ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_void_p=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_void_p=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 -echo "${ECHO_T}$ac_cv_type_void_p" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of void *" >&5 -echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -8334,11 +8982,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= 0)]; test_array [0] = 0 ; @@ -8351,13 +8998,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8371,11 +9019,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8388,20 +9035,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -8415,7 +9063,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -8425,11 +9073,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) < 0)]; test_array [0] = 0 ; @@ -8442,13 +9089,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8462,11 +9110,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= $ac_mid)]; test_array [0] = 0 ; @@ -8479,20 +9126,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -8506,7 +9154,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -8526,11 +9174,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8543,20 +9190,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -8567,11 +9215,13 @@ case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; '') if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) +$as_echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_void_p=0 fi ;; @@ -8584,9 +9234,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (void *)); } +static unsigned long int ulongval () { return (long int) (sizeof (void *)); } #include #include int @@ -8596,20 +9245,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (void *))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (void *)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (void *)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -8622,43 +9273,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_void_p=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) +$as_echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_void_p=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } @@ -8667,68 +9323,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for short" >&5 -echo $ECHO_N "checking for short... $ECHO_C" >&6; } -if test "${ac_cv_type_short+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef short ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_short=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_short=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 -echo "${ECHO_T}$ac_cv_type_short" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of short" >&5 -echo $ECHO_N "checking size of short... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of short" >&5 +$as_echo_n "checking size of short... " >&6; } if test "${ac_cv_sizeof_short+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -8739,11 +9341,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= 0)]; test_array [0] = 0 ; @@ -8756,13 +9357,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8776,11 +9378,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8793,20 +9394,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -8820,7 +9422,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -8830,11 +9432,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) < 0)]; test_array [0] = 0 ; @@ -8847,13 +9448,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8867,11 +9469,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= $ac_mid)]; test_array [0] = 0 ; @@ -8884,20 +9485,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -8911,7 +9513,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -8931,11 +9533,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8948,20 +9549,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -8972,11 +9574,13 @@ case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; '') if test "$ac_cv_type_short" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short) +$as_echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_short=0 fi ;; @@ -8989,9 +9593,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef short ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (short)); } +static unsigned long int ulongval () { return (long int) (sizeof (short)); } #include #include int @@ -9001,20 +9604,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (short))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (short)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (short)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9027,43 +9632,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_short=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_short" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (short) +$as_echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_short=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 -echo "${ECHO_T}$ac_cv_sizeof_short" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 +$as_echo "$ac_cv_sizeof_short" >&6; } @@ -9072,68 +9682,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for float" >&5 -echo $ECHO_N "checking for float... $ECHO_C" >&6; } -if test "${ac_cv_type_float+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef float ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_float=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_float=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_float" >&5 -echo "${ECHO_T}$ac_cv_type_float" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of float" >&5 -echo $ECHO_N "checking size of float... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of float" >&5 +$as_echo_n "checking size of float... " >&6; } if test "${ac_cv_sizeof_float+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -9144,11 +9700,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) >= 0)]; test_array [0] = 0 ; @@ -9161,13 +9716,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9181,11 +9737,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9198,20 +9753,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -9225,7 +9781,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -9235,11 +9791,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) < 0)]; test_array [0] = 0 ; @@ -9252,13 +9807,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9272,11 +9828,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) >= $ac_mid)]; test_array [0] = 0 ; @@ -9289,20 +9844,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -9316,7 +9872,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -9336,11 +9892,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (float))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9353,20 +9908,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -9377,11 +9933,13 @@ case $ac_lo in ?*) ac_cv_sizeof_float=$ac_lo;; '') if test "$ac_cv_type_float" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (float) +$as_echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_float=0 fi ;; @@ -9394,9 +9952,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef float ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (float)); } +static unsigned long int ulongval () { return (long int) (sizeof (float)); } #include #include int @@ -9406,20 +9963,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (float))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (float)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (float)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9432,113 +9991,64 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_float=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_float" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (float) +$as_echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_float=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 -echo "${ECHO_T}$ac_cv_sizeof_float" >&6; } - +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 +$as_echo "$ac_cv_sizeof_float" >&6; } -cat >>confdefs.h <<_ACEOF -#define SIZEOF_FLOAT $ac_cv_sizeof_float -_ACEOF - - -{ echo "$as_me:$LINENO: checking for double" >&5 -echo $ECHO_N "checking for double... $ECHO_C" >&6; } -if test "${ac_cv_type_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef double ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_double=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_double=no -fi +cat >>confdefs.h <<_ACEOF +#define SIZEOF_FLOAT $ac_cv_sizeof_float +_ACEOF -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5 -echo "${ECHO_T}$ac_cv_type_double" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of double" >&5 -echo $ECHO_N "checking size of double... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of double" >&5 +$as_echo_n "checking size of double... " >&6; } if test "${ac_cv_sizeof_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -9549,11 +10059,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= 0)]; test_array [0] = 0 ; @@ -9566,13 +10075,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9586,11 +10096,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9603,20 +10112,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -9630,7 +10140,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -9640,11 +10150,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) < 0)]; test_array [0] = 0 ; @@ -9657,13 +10166,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9677,11 +10187,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= $ac_mid)]; test_array [0] = 0 ; @@ -9694,20 +10203,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -9721,7 +10231,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -9741,11 +10251,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9758,20 +10267,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -9782,11 +10292,13 @@ case $ac_lo in ?*) ac_cv_sizeof_double=$ac_lo;; '') if test "$ac_cv_type_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (double) +$as_echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_double=0 fi ;; @@ -9799,9 +10311,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef double ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (double)); } +static unsigned long int ulongval () { return (long int) (sizeof (double)); } #include #include int @@ -9811,20 +10322,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (double))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (double)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (double)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9837,43 +10350,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_double=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (double) +$as_echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_double=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 -echo "${ECHO_T}$ac_cv_sizeof_double" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 +$as_echo "$ac_cv_sizeof_double" >&6; } @@ -9882,68 +10400,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for fpos_t" >&5 -echo $ECHO_N "checking for fpos_t... $ECHO_C" >&6; } -if test "${ac_cv_type_fpos_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef fpos_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_fpos_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_fpos_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_fpos_t" >&5 -echo "${ECHO_T}$ac_cv_type_fpos_t" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of fpos_t" >&5 -echo $ECHO_N "checking size of fpos_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of fpos_t" >&5 +$as_echo_n "checking size of fpos_t... " >&6; } if test "${ac_cv_sizeof_fpos_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -9954,11 +10418,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) >= 0)]; test_array [0] = 0 ; @@ -9971,13 +10434,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9991,11 +10455,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10008,20 +10471,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -10035,7 +10499,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -10045,11 +10509,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) < 0)]; test_array [0] = 0 ; @@ -10062,13 +10525,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10082,11 +10546,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -10099,20 +10562,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -10126,7 +10590,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -10146,11 +10610,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10163,20 +10626,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -10187,11 +10651,13 @@ case $ac_lo in ?*) ac_cv_sizeof_fpos_t=$ac_lo;; '') if test "$ac_cv_type_fpos_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (fpos_t) +$as_echo "$as_me: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_fpos_t=0 fi ;; @@ -10204,9 +10670,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef fpos_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (fpos_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (fpos_t)); } #include #include int @@ -10216,20 +10681,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (fpos_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (fpos_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (fpos_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -10242,43 +10709,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_fpos_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_fpos_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (fpos_t) +$as_echo "$as_me: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_fpos_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_fpos_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_fpos_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_fpos_t" >&5 +$as_echo "$ac_cv_sizeof_fpos_t" >&6; } @@ -10287,68 +10759,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for size_t" >&5 -echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } -if test "${ac_cv_type_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef size_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_size_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_size_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -echo "${ECHO_T}$ac_cv_type_size_t" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of size_t" >&5 -echo $ECHO_N "checking size of size_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of size_t" >&5 +$as_echo_n "checking size of size_t... " >&6; } if test "${ac_cv_sizeof_size_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -10359,11 +10777,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= 0)]; test_array [0] = 0 ; @@ -10376,13 +10793,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10396,11 +10814,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10413,20 +10830,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -10440,7 +10858,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -10450,11 +10868,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) < 0)]; test_array [0] = 0 ; @@ -10467,13 +10884,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10487,11 +10905,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -10504,20 +10921,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -10531,7 +10949,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -10551,11 +10969,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10568,20 +10985,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -10592,11 +11010,13 @@ case $ac_lo in ?*) ac_cv_sizeof_size_t=$ac_lo;; '') if test "$ac_cv_type_size_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (size_t) +$as_echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_size_t=0 fi ;; @@ -10609,9 +11029,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef size_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (size_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (size_t)); } #include #include int @@ -10621,20 +11040,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (size_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (size_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (size_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -10647,43 +11068,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_size_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_size_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (size_t) +$as_echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_size_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 +$as_echo "$ac_cv_sizeof_size_t" >&6; } @@ -10692,68 +11118,14 @@ _ACEOF -{ echo "$as_me:$LINENO: checking for pid_t" >&5 -echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } -if test "${ac_cv_type_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef pid_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_pid_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_pid_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of pid_t" >&5 -echo $ECHO_N "checking size of pid_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of pid_t" >&5 +$as_echo_n "checking size of pid_t... " >&6; } if test "${ac_cv_sizeof_pid_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -10764,11 +11136,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) >= 0)]; test_array [0] = 0 ; @@ -10781,13 +11152,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10801,11 +11173,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10818,20 +11189,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -10845,7 +11217,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -10855,11 +11227,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) < 0)]; test_array [0] = 0 ; @@ -10872,13 +11243,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10892,11 +11264,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -10909,20 +11280,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -10936,7 +11308,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -10956,11 +11328,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10973,20 +11344,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -10997,11 +11369,13 @@ case $ac_lo in ?*) ac_cv_sizeof_pid_t=$ac_lo;; '') if test "$ac_cv_type_pid_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (pid_t) +$as_echo "$as_me: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_pid_t=0 fi ;; @@ -11014,9 +11388,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef pid_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (pid_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (pid_t)); } #include #include int @@ -11026,20 +11399,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (pid_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (pid_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (pid_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -11052,43 +11427,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_pid_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_pid_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (pid_t) +$as_echo "$as_me: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_pid_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_pid_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_pid_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_pid_t" >&5 +$as_echo "$ac_cv_sizeof_pid_t" >&6; } @@ -11098,8 +11478,8 @@ -{ echo "$as_me:$LINENO: checking for long long support" >&5 -echo $ECHO_N "checking for long long support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for long long support" >&5 +$as_echo_n "checking for long long support... " >&6; } have_long_long=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -11122,13 +11502,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11142,78 +11523,24 @@ have_long_long=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_long_long" >&5 -echo "${ECHO_T}$have_long_long" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_long_long" >&5 +$as_echo "$have_long_long" >&6; } if test "$have_long_long" = yes ; then -{ echo "$as_me:$LINENO: checking for long long" >&5 -echo $ECHO_N "checking for long long... $ECHO_C" >&6; } -if test "${ac_cv_type_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long long ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long_long=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 -echo "${ECHO_T}$ac_cv_type_long_long" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long long" >&5 -echo $ECHO_N "checking size of long long... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } if test "${ac_cv_sizeof_long_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -11224,11 +11551,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= 0)]; test_array [0] = 0 ; @@ -11241,13 +11567,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11261,11 +11588,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11278,20 +11604,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -11305,7 +11632,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -11315,11 +11642,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) < 0)]; test_array [0] = 0 ; @@ -11332,13 +11658,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11352,11 +11679,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= $ac_mid)]; test_array [0] = 0 ; @@ -11369,20 +11695,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -11396,7 +11723,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -11416,11 +11743,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11433,20 +11759,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -11457,11 +11784,13 @@ case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; '') if test "$ac_cv_type_long_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long) +$as_echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_long=0 fi ;; @@ -11474,9 +11803,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long long ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (long long)); } +static unsigned long int ulongval () { return (long int) (sizeof (long long)); } #include #include int @@ -11486,20 +11814,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (long long))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long long)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long long)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -11512,43 +11842,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_long=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long long) +$as_echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_long=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } @@ -11559,8 +11894,8 @@ fi -{ echo "$as_me:$LINENO: checking for long double support" >&5 -echo $ECHO_N "checking for long double support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for long double support" >&5 +$as_echo_n "checking for long double support... " >&6; } have_long_double=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -11583,13 +11918,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11603,78 +11939,24 @@ have_long_double=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_long_double" >&5 -echo "${ECHO_T}$have_long_double" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_long_double" >&5 +$as_echo "$have_long_double" >&6; } if test "$have_long_double" = yes ; then -{ echo "$as_me:$LINENO: checking for long double" >&5 -echo $ECHO_N "checking for long double... $ECHO_C" >&6; } -if test "${ac_cv_type_long_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long double ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long_double=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long_double=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long_double" >&5 -echo "${ECHO_T}$ac_cv_type_long_double" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long double" >&5 -echo $ECHO_N "checking size of long double... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of long double" >&5 +$as_echo_n "checking size of long double... " >&6; } if test "${ac_cv_sizeof_long_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -11685,11 +11967,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) >= 0)]; test_array [0] = 0 ; @@ -11702,13 +11983,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11722,11 +12004,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11739,20 +12020,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -11766,7 +12048,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -11776,11 +12058,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) < 0)]; test_array [0] = 0 ; @@ -11793,13 +12074,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11813,11 +12095,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) >= $ac_mid)]; test_array [0] = 0 ; @@ -11830,20 +12111,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -11857,7 +12139,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -11877,11 +12159,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long double))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11894,20 +12175,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -11918,11 +12200,13 @@ case $ac_lo in ?*) ac_cv_sizeof_long_double=$ac_lo;; '') if test "$ac_cv_type_long_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long double) +$as_echo "$as_me: error: cannot compute sizeof (long double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_double=0 fi ;; @@ -11935,9 +12219,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long double ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (long double)); } +static unsigned long int ulongval () { return (long int) (sizeof (long double)); } #include #include int @@ -11947,20 +12230,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (long double))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long double)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long double)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -11973,128 +12258,73 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_double=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long_double" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long double) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long double) +$as_echo "$as_me: error: cannot compute sizeof (long double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long_double=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long_double" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double -_ACEOF - - -fi - - -{ echo "$as_me:$LINENO: checking for _Bool support" >&5 -echo $ECHO_N "checking for _Bool support... $ECHO_C" >&6; } -have_c99_bool=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -_Bool x; x = (_Bool)0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5 +$as_echo "$ac_cv_sizeof_long_double" >&6; } -cat >>confdefs.h <<\_ACEOF -#define HAVE_C99_BOOL 1 -_ACEOF - have_c99_bool=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_DOUBLE $ac_cv_sizeof_long_double +_ACEOF fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_c99_bool" >&5 -echo "${ECHO_T}$have_c99_bool" >&6; } -if test "$have_c99_bool" = yes ; then -{ echo "$as_me:$LINENO: checking for _Bool" >&5 -echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } -if test "${ac_cv_type__Bool+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF + +{ $as_echo "$as_me:$LINENO: checking for _Bool support" >&5 +$as_echo_n "checking for _Bool support... " >&6; } +have_c99_bool=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -typedef _Bool ac__type_new_; + int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +_Bool x; x = (_Bool)0; ; return 0; } @@ -12105,38 +12335,45 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type__Bool=yes + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_C99_BOOL 1 +_ACEOF + + have_c99_bool=yes + else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type__Bool=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 -echo "${ECHO_T}$ac_cv_type__Bool" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $have_c99_bool" >&5 +$as_echo "$have_c99_bool" >&6; } +if test "$have_c99_bool" = yes ; then # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of _Bool" >&5 -echo $ECHO_N "checking size of _Bool... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of _Bool" >&5 +$as_echo_n "checking size of _Bool... " >&6; } if test "${ac_cv_sizeof__Bool+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -12147,11 +12384,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) >= 0)]; test_array [0] = 0 ; @@ -12164,13 +12400,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12184,11 +12421,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12201,20 +12437,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -12228,7 +12465,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -12238,11 +12475,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) < 0)]; test_array [0] = 0 ; @@ -12255,13 +12491,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12275,11 +12512,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) >= $ac_mid)]; test_array [0] = 0 ; @@ -12292,20 +12528,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -12319,7 +12556,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -12339,11 +12576,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12356,20 +12592,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -12380,11 +12617,13 @@ case $ac_lo in ?*) ac_cv_sizeof__Bool=$ac_lo;; '') if test "$ac_cv_type__Bool" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (_Bool) +$as_echo "$as_me: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof__Bool=0 fi ;; @@ -12397,9 +12636,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef _Bool ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (_Bool)); } +static unsigned long int ulongval () { return (long int) (sizeof (_Bool)); } #include #include int @@ -12409,20 +12647,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (_Bool))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (_Bool)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (_Bool)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -12435,43 +12675,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof__Bool=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type__Bool" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (_Bool) +$as_echo "$as_me: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof__Bool=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof__Bool" >&5 -echo "${ECHO_T}$ac_cv_sizeof__Bool" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof__Bool" >&5 +$as_echo "$ac_cv_sizeof__Bool" >&6; } @@ -12482,12 +12727,13 @@ fi -{ echo "$as_me:$LINENO: checking for uintptr_t" >&5 -echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for uintptr_t" >&5 +$as_echo_n "checking for uintptr_t... " >&6; } if test "${ac_cv_type_uintptr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_uintptr_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -12497,14 +12743,11 @@ #include #endif -typedef uintptr_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof (uintptr_t)) + return 0; ; return 0; } @@ -12515,55 +12758,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_uintptr_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_uintptr_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; } -if test $ac_cv_type_uintptr_t = yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_UINTPTR_T 1 -_ACEOF - -{ echo "$as_me:$LINENO: checking for uintptr_t" >&5 -echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; } -if test "${ac_cv_type_uintptr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -typedef uintptr_t ac__type_new_; +#ifdef HAVE_STDINT_H + #include + #endif + int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; +if (sizeof ((uintptr_t))) + return 0; ; return 0; } @@ -12574,38 +12795,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_uintptr_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_uintptr_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_uintptr_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +$as_echo "$ac_cv_type_uintptr_t" >&6; } +if test "x$ac_cv_type_uintptr_t" = x""yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_UINTPTR_T 1 +_ACEOF # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of uintptr_t" >&5 -echo $ECHO_N "checking size of uintptr_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of uintptr_t" >&5 +$as_echo_n "checking size of uintptr_t... " >&6; } if test "${ac_cv_sizeof_uintptr_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -12616,11 +12851,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) >= 0)]; test_array [0] = 0 ; @@ -12633,13 +12867,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12653,11 +12888,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12670,20 +12904,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -12697,7 +12932,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -12707,11 +12942,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) < 0)]; test_array [0] = 0 ; @@ -12724,13 +12958,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12744,11 +12979,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -12761,20 +12995,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -12788,7 +13023,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -12808,11 +13043,10 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12825,20 +13059,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -12849,11 +13084,13 @@ case $ac_lo in ?*) ac_cv_sizeof_uintptr_t=$ac_lo;; '') if test "$ac_cv_type_uintptr_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (uintptr_t) +$as_echo "$as_me: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_uintptr_t=0 fi ;; @@ -12866,9 +13103,8 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef uintptr_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (uintptr_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (uintptr_t)); } #include #include int @@ -12878,20 +13114,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (uintptr_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (uintptr_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (uintptr_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -12904,43 +13142,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_uintptr_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_uintptr_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (uintptr_t) +$as_echo "$as_me: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_uintptr_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_uintptr_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_uintptr_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_uintptr_t" >&5 +$as_echo "$ac_cv_sizeof_uintptr_t" >&6; } @@ -12954,10 +13197,10 @@ # Hmph. AC_CHECK_SIZEOF() doesn't include . -{ echo "$as_me:$LINENO: checking size of off_t" >&5 -echo $ECHO_N "checking size of off_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of off_t" >&5 +$as_echo_n "checking size of off_t... " >&6; } if test "${ac_cv_sizeof_off_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_sizeof_off_t=4 @@ -12984,29 +13227,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_off_t=`cat conftestval` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_sizeof_off_t=0 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -13014,16 +13260,16 @@ fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 +$as_echo "$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF -{ echo "$as_me:$LINENO: checking whether to enable large file support" >&5 -echo $ECHO_N "checking whether to enable large file support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether to enable large file support" >&5 +$as_echo_n "checking whether to enable large file support... " >&6; } if test "$have_long_long" = yes -a \ "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then @@ -13032,18 +13278,18 @@ #define HAVE_LARGEFILE_SUPPORT 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # AC_CHECK_SIZEOF() doesn't include . -{ echo "$as_me:$LINENO: checking size of time_t" >&5 -echo $ECHO_N "checking size of time_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of time_t" >&5 +$as_echo_n "checking size of time_t... " >&6; } if test "${ac_cv_sizeof_time_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_sizeof_time_t=4 @@ -13070,29 +13316,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_time_t=`cat conftestval` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_sizeof_time_t=0 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -13100,8 +13349,8 @@ fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_time_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5 +$as_echo "$ac_cv_sizeof_time_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_TIME_T $ac_cv_sizeof_time_t @@ -13118,8 +13367,8 @@ elif test "$ac_cv_pthread" = "yes" then CC="$CC -pthread" fi -{ echo "$as_me:$LINENO: checking for pthread_t" >&5 -echo $ECHO_N "checking for pthread_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for pthread_t" >&5 +$as_echo_n "checking for pthread_t... " >&6; } have_pthread_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -13142,34 +13391,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then have_pthread_t=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_pthread_t" >&5 -echo "${ECHO_T}$have_pthread_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_pthread_t" >&5 +$as_echo "$have_pthread_t" >&6; } if test "$have_pthread_t" = yes ; then # AC_CHECK_SIZEOF() doesn't include . - { echo "$as_me:$LINENO: checking size of pthread_t" >&5 -echo $ECHO_N "checking size of pthread_t... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking size of pthread_t" >&5 +$as_echo_n "checking size of pthread_t... " >&6; } if test "${ac_cv_sizeof_pthread_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_sizeof_pthread_t=4 @@ -13196,29 +13446,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_pthread_t=`cat conftestval` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_sizeof_pthread_t=0 fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -13226,8 +13479,8 @@ fi - { echo "$as_me:$LINENO: result: $ac_cv_sizeof_pthread_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_pthread_t" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_pthread_t" >&5 +$as_echo "$ac_cv_sizeof_pthread_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t @@ -13272,8 +13525,8 @@ LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; esac -{ echo "$as_me:$LINENO: checking for --enable-framework" >&5 -echo $ECHO_N "checking for --enable-framework... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --enable-framework" >&5 +$as_echo_n "checking for --enable-framework... " >&6; } if test "$enable_framework" then BASECFLAGS="$BASECFLAGS -fno-common -dynamic" @@ -13284,15 +13537,15 @@ #define WITH_NEXT_FRAMEWORK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -{ echo "$as_me:$LINENO: checking for dyld" >&5 -echo $ECHO_N "checking for dyld... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for dyld" >&5 +$as_echo_n "checking for dyld... " >&6; } case $ac_sys_system/$ac_sys_release in Darwin/*) @@ -13300,12 +13553,12 @@ #define WITH_DYLD 1 _ACEOF - { echo "$as_me:$LINENO: result: always on for Darwin" >&5 -echo "${ECHO_T}always on for Darwin" >&6; } + { $as_echo "$as_me:$LINENO: result: always on for Darwin" >&5 +$as_echo "always on for Darwin" >&6; } ;; *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ;; esac @@ -13317,8 +13570,8 @@ # SO is the extension of shared libraries `(including the dot!) # -- usually .so, .sl on HP-UX, .dll on Cygwin -{ echo "$as_me:$LINENO: checking SO" >&5 -echo $ECHO_N "checking SO... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking SO" >&5 +$as_echo_n "checking SO... " >&6; } if test -z "$SO" then case $ac_sys_system in @@ -13343,8 +13596,8 @@ echo '=====================================================================' sleep 10 fi -{ echo "$as_me:$LINENO: result: $SO" >&5 -echo "${ECHO_T}$SO" >&6; } +{ $as_echo "$as_me:$LINENO: result: $SO" >&5 +$as_echo "$SO" >&6; } cat >>confdefs.h <<_ACEOF @@ -13355,8 +13608,8 @@ # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 # (Shared libraries in this instance are shared modules to be loaded into # Python, as opposed to building Python itself as a shared library.) -{ echo "$as_me:$LINENO: checking LDSHARED" >&5 -echo $ECHO_N "checking LDSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LDSHARED" >&5 +$as_echo_n "checking LDSHARED... " >&6; } if test -z "$LDSHARED" then case $ac_sys_system/$ac_sys_release in @@ -13458,13 +13711,13 @@ *) LDSHARED="ld";; esac fi -{ echo "$as_me:$LINENO: result: $LDSHARED" >&5 -echo "${ECHO_T}$LDSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LDSHARED" >&5 +$as_echo "$LDSHARED" >&6; } BLDSHARED=${BLDSHARED-$LDSHARED} # CCSHARED are the C *flags* used to create objects to go into a shared # library (module) -- this is only needed for a few systems -{ echo "$as_me:$LINENO: checking CCSHARED" >&5 -echo $ECHO_N "checking CCSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking CCSHARED" >&5 +$as_echo_n "checking CCSHARED... " >&6; } if test -z "$CCSHARED" then case $ac_sys_system/$ac_sys_release in @@ -13499,12 +13752,12 @@ atheos*) CCSHARED="-fPIC";; esac fi -{ echo "$as_me:$LINENO: result: $CCSHARED" >&5 -echo "${ECHO_T}$CCSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CCSHARED" >&5 +$as_echo "$CCSHARED" >&6; } # LINKFORSHARED are the flags passed to the $(CC) command that links # the python executable -- this is only needed for a few systems -{ echo "$as_me:$LINENO: checking LINKFORSHARED" >&5 -echo $ECHO_N "checking LINKFORSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking LINKFORSHARED" >&5 +$as_echo_n "checking LINKFORSHARED... " >&6; } if test -z "$LINKFORSHARED" then case $ac_sys_system/$ac_sys_release in @@ -13551,13 +13804,13 @@ LINKFORSHARED='-Wl,-E -N 2048K';; esac fi -{ echo "$as_me:$LINENO: result: $LINKFORSHARED" >&5 -echo "${ECHO_T}$LINKFORSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $LINKFORSHARED" >&5 +$as_echo "$LINKFORSHARED" >&6; } -{ echo "$as_me:$LINENO: checking CFLAGSFORSHARED" >&5 -echo $ECHO_N "checking CFLAGSFORSHARED... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking CFLAGSFORSHARED" >&5 +$as_echo_n "checking CFLAGSFORSHARED... " >&6; } if test ! "$LIBRARY" = "$LDLIBRARY" then case $ac_sys_system in @@ -13569,8 +13822,8 @@ CFLAGSFORSHARED='$(CCSHARED)' esac fi -{ echo "$as_me:$LINENO: result: $CFLAGSFORSHARED" >&5 -echo "${ECHO_T}$CFLAGSFORSHARED" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CFLAGSFORSHARED" >&5 +$as_echo "$CFLAGSFORSHARED" >&6; } # SHLIBS are libraries (except -lc and -lm) to link to the python shared # library (with --enable-shared). @@ -13581,22 +13834,22 @@ # don't need to link LIBS explicitly. The default should be only changed # on systems where this approach causes problems. -{ echo "$as_me:$LINENO: checking SHLIBS" >&5 -echo $ECHO_N "checking SHLIBS... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking SHLIBS" >&5 +$as_echo_n "checking SHLIBS... " >&6; } case "$ac_sys_system" in *) SHLIBS='$(LIBS)';; esac -{ echo "$as_me:$LINENO: result: $SHLIBS" >&5 -echo "${ECHO_T}$SHLIBS" >&6; } +{ $as_echo "$as_me:$LINENO: result: $SHLIBS" >&5 +$as_echo "$SHLIBS" >&6; } # checks for libraries -{ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -13628,33 +13881,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dl_dlopen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF @@ -13664,10 +13921,10 @@ fi # Dynamic linking for SunOS/Solaris and SYSV -{ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" @@ -13699,33 +13956,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dld_shl_load=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } -if test $ac_cv_lib_dld_shl_load = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDLD 1 _ACEOF @@ -13737,10 +13998,10 @@ # only check for sem_init if thread support is requested if test "$with_threads" = "yes" -o -z "$with_threads"; then - { echo "$as_me:$LINENO: checking for library containing sem_init" >&5 -echo $ECHO_N "checking for library containing sem_init... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for library containing sem_init" >&5 +$as_echo_n "checking for library containing sem_init... " >&6; } if test "${ac_cv_search_sem_init+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -13778,26 +14039,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_search_sem_init=$ac_res else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_sem_init+set}" = set; then @@ -13812,8 +14077,8 @@ rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_search_sem_init" >&5 -echo "${ECHO_T}$ac_cv_search_sem_init" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_sem_init" >&5 +$as_echo "$ac_cv_search_sem_init" >&6; } ac_res=$ac_cv_search_sem_init if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -13825,10 +14090,10 @@ fi # check if we need libintl for locale functions -{ echo "$as_me:$LINENO: checking for textdomain in -lintl" >&5 -echo $ECHO_N "checking for textdomain in -lintl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for textdomain in -lintl" >&5 +$as_echo_n "checking for textdomain in -lintl... " >&6; } if test "${ac_cv_lib_intl_textdomain+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" @@ -13860,33 +14125,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_intl_textdomain=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_textdomain=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_textdomain" >&5 -echo "${ECHO_T}$ac_cv_lib_intl_textdomain" >&6; } -if test $ac_cv_lib_intl_textdomain = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_textdomain" >&5 +$as_echo "$ac_cv_lib_intl_textdomain" >&6; } +if test "x$ac_cv_lib_intl_textdomain" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_LIBINTL 1 @@ -13897,8 +14166,8 @@ # checks for system dependent C++ extensions support case "$ac_sys_system" in - AIX*) { echo "$as_me:$LINENO: checking for genuine AIX C++ extensions support" >&5 -echo $ECHO_N "checking for genuine AIX C++ extensions support... $ECHO_C" >&6; } + AIX*) { $as_echo "$as_me:$LINENO: checking for genuine AIX C++ extensions support" >&5 +$as_echo_n "checking for genuine AIX C++ extensions support... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -13920,43 +14189,47 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define AIX_GENUINE_CPLUSPLUS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext;; *) ;; esac # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. -{ echo "$as_me:$LINENO: checking for t_open in -lnsl" >&5 -echo $ECHO_N "checking for t_open in -lnsl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for t_open in -lnsl" >&5 +$as_echo_n "checking for t_open in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_t_open+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" @@ -13988,40 +14261,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_nsl_t_open=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_t_open=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_t_open" >&5 -echo "${ECHO_T}$ac_cv_lib_nsl_t_open" >&6; } -if test $ac_cv_lib_nsl_t_open = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_t_open" >&5 +$as_echo "$ac_cv_lib_nsl_t_open" >&6; } +if test "x$ac_cv_lib_nsl_t_open" = x""yes; then LIBS="-lnsl $LIBS" fi # SVR4 -{ echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 -echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 +$as_echo_n "checking for socket in -lsocket... " >&6; } if test "${ac_cv_lib_socket_socket+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS $LIBS" @@ -14053,56 +14330,60 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_socket_socket=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_socket=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6; } -if test $ac_cv_lib_socket_socket = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 +$as_echo "$ac_cv_lib_socket_socket" >&6; } +if test "x$ac_cv_lib_socket_socket" = x""yes; then LIBS="-lsocket $LIBS" fi # SVR4 sockets -{ echo "$as_me:$LINENO: checking for --with-libs" >&5 -echo $ECHO_N "checking for --with-libs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-libs" >&5 +$as_echo_n "checking for --with-libs... " >&6; } # Check whether --with-libs was given. if test "${with_libs+set}" = set; then withval=$with_libs; -{ echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } +{ $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } LIBS="$withval $LIBS" else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Check for use of the system libffi library -{ echo "$as_me:$LINENO: checking for --with-system-ffi" >&5 -echo $ECHO_N "checking for --with-system-ffi... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-system-ffi" >&5 +$as_echo_n "checking for --with-system-ffi... " >&6; } # Check whether --with-system_ffi was given. if test "${with_system_ffi+set}" = set; then @@ -14110,41 +14391,41 @@ fi -{ echo "$as_me:$LINENO: result: $with_system_ffi" >&5 -echo "${ECHO_T}$with_system_ffi" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_system_ffi" >&5 +$as_echo "$with_system_ffi" >&6; } # Check for --with-dbmliborder -{ echo "$as_me:$LINENO: checking for --with-dbmliborder" >&5 -echo $ECHO_N "checking for --with-dbmliborder... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-dbmliborder" >&5 +$as_echo_n "checking for --with-dbmliborder... " >&6; } # Check whether --with-dbmliborder was given. if test "${with_dbmliborder+set}" = set; then withval=$with_dbmliborder; if test x$with_dbmliborder = xyes then -{ { echo "$as_me:$LINENO: error: proper usage is --with-dbmliborder=db1:db2:..." >&5 -echo "$as_me: error: proper usage is --with-dbmliborder=db1:db2:..." >&2;} +{ { $as_echo "$as_me:$LINENO: error: proper usage is --with-dbmliborder=db1:db2:..." >&5 +$as_echo "$as_me: error: proper usage is --with-dbmliborder=db1:db2:..." >&2;} { (exit 1); exit 1; }; } else for db in `echo $with_dbmliborder | sed 's/:/ /g'`; do if test x$db != xndbm && test x$db != xgdbm && test x$db != xbdb then - { { echo "$as_me:$LINENO: error: proper usage is --with-dbmliborder=db1:db2:..." >&5 -echo "$as_me: error: proper usage is --with-dbmliborder=db1:db2:..." >&2;} + { { $as_echo "$as_me:$LINENO: error: proper usage is --with-dbmliborder=db1:db2:..." >&5 +$as_echo "$as_me: error: proper usage is --with-dbmliborder=db1:db2:..." >&2;} { (exit 1); exit 1; }; } fi done fi fi -{ echo "$as_me:$LINENO: result: $with_dbmliborder" >&5 -echo "${ECHO_T}$with_dbmliborder" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_dbmliborder" >&5 +$as_echo "$with_dbmliborder" >&6; } # Determine if signalmodule should be used. -{ echo "$as_me:$LINENO: checking for --with-signal-module" >&5 -echo $ECHO_N "checking for --with-signal-module... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-signal-module" >&5 +$as_echo_n "checking for --with-signal-module... " >&6; } # Check whether --with-signal-module was given. if test "${with_signal_module+set}" = set; then @@ -14155,8 +14436,8 @@ if test -z "$with_signal_module" then with_signal_module="yes" fi -{ echo "$as_me:$LINENO: result: $with_signal_module" >&5 -echo "${ECHO_T}$with_signal_module" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_signal_module" >&5 +$as_echo "$with_signal_module" >&6; } if test "${with_signal_module}" = "yes"; then USE_SIGNAL_MODULE="" @@ -14170,22 +14451,22 @@ USE_THREAD_MODULE="" -{ echo "$as_me:$LINENO: checking for --with-dec-threads" >&5 -echo $ECHO_N "checking for --with-dec-threads... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-dec-threads" >&5 +$as_echo_n "checking for --with-dec-threads... " >&6; } # Check whether --with-dec-threads was given. if test "${with_dec_threads+set}" = set; then withval=$with_dec_threads; -{ echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } +{ $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } LDLAST=-threads if test "${with_thread+set}" != set; then with_thread="$withval"; fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -14198,8 +14479,8 @@ -{ echo "$as_me:$LINENO: checking for --with-threads" >&5 -echo $ECHO_N "checking for --with-threads... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-threads" >&5 +$as_echo_n "checking for --with-threads... " >&6; } # Check whether --with-threads was given. if test "${with_threads+set}" = set; then @@ -14218,8 +14499,8 @@ if test -z "$with_threads" then with_threads="yes" fi -{ echo "$as_me:$LINENO: result: $with_threads" >&5 -echo "${ECHO_T}$with_threads" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_threads" >&5 +$as_echo "$with_threads" >&6; } if test "$with_threads" = "no" @@ -14285,8 +14566,8 @@ # According to the POSIX spec, a pthreads implementation must # define _POSIX_THREADS in unistd.h. Some apparently don't # (e.g. gnu pth with pthread emulation) - { echo "$as_me:$LINENO: checking for _POSIX_THREADS in unistd.h" >&5 -echo $ECHO_N "checking for _POSIX_THREADS in unistd.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for _POSIX_THREADS in unistd.h" >&5 +$as_echo_n "checking for _POSIX_THREADS in unistd.h... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14308,25 +14589,25 @@ fi rm -f conftest* - { echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5 -echo "${ECHO_T}$unistd_defines_pthreads" >&6; } + { $as_echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5 +$as_echo "$unistd_defines_pthreads" >&6; } cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF if test "${ac_cv_header_cthreads_h+set}" = set; then - { echo "$as_me:$LINENO: checking for cthreads.h" >&5 -echo $ECHO_N "checking for cthreads.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for cthreads.h" >&5 +$as_echo_n "checking for cthreads.h... " >&6; } if test "${ac_cv_header_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 +$as_echo "$ac_cv_header_cthreads_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking cthreads.h usability" >&5 -echo $ECHO_N "checking cthreads.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking cthreads.h usability" >&5 +$as_echo_n "checking cthreads.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14342,32 +14623,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking cthreads.h presence" >&5 -echo $ECHO_N "checking cthreads.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking cthreads.h presence" >&5 +$as_echo_n "checking cthreads.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14381,51 +14663,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: cthreads.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: cthreads.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: cthreads.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: cthreads.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: cthreads.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: cthreads.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: cthreads.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: cthreads.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: cthreads.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: cthreads.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: cthreads.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: cthreads.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: cthreads.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: cthreads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -14434,18 +14717,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for cthreads.h" >&5 -echo $ECHO_N "checking for cthreads.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for cthreads.h" >&5 +$as_echo_n "checking for cthreads.h... " >&6; } if test "${ac_cv_header_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_cthreads_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 +$as_echo "$ac_cv_header_cthreads_h" >&6; } fi -if test $ac_cv_header_cthreads_h = yes; then +if test "x$ac_cv_header_cthreads_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14464,17 +14747,17 @@ else if test "${ac_cv_header_mach_cthreads_h+set}" = set; then - { echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 -echo $ECHO_N "checking for mach/cthreads.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 +$as_echo_n "checking for mach/cthreads.h... " >&6; } if test "${ac_cv_header_mach_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_mach_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 +$as_echo "$ac_cv_header_mach_cthreads_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking mach/cthreads.h usability" >&5 -echo $ECHO_N "checking mach/cthreads.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking mach/cthreads.h usability" >&5 +$as_echo_n "checking mach/cthreads.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14490,32 +14773,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking mach/cthreads.h presence" >&5 -echo $ECHO_N "checking mach/cthreads.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking mach/cthreads.h presence" >&5 +$as_echo_n "checking mach/cthreads.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14529,51 +14813,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: mach/cthreads.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: mach/cthreads.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -14582,18 +14867,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 -echo $ECHO_N "checking for mach/cthreads.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 +$as_echo_n "checking for mach/cthreads.h... " >&6; } if test "${ac_cv_header_mach_cthreads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_mach_cthreads_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 -echo "${ECHO_T}$ac_cv_header_mach_cthreads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 +$as_echo "$ac_cv_header_mach_cthreads_h" >&6; } fi -if test $ac_cv_header_mach_cthreads_h = yes; then +if test "x$ac_cv_header_mach_cthreads_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14610,13 +14895,13 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for --with-pth" >&5 -echo $ECHO_N "checking for --with-pth... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for --with-pth" >&5 +$as_echo_n "checking for --with-pth... " >&6; } # Check whether --with-pth was given. if test "${with_pth+set}" = set; then - withval=$with_pth; { echo "$as_me:$LINENO: result: $withval" >&5 -echo "${ECHO_T}$withval" >&6; } + withval=$with_pth; { $as_echo "$as_me:$LINENO: result: $withval" >&5 +$as_echo "$withval" >&6; } cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14629,16 +14914,16 @@ LIBS="-lpth $LIBS" THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } # Just looking for pthread_create in libpthread is not enough: # on HP/UX, pthread.h renames pthread_create to a different symbol name. # So we really have to include pthread.h, and then link. _libs=$LIBS LIBS="$LIBS -lpthread" - { echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 -echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 +$as_echo_n "checking for pthread_create in -lpthread... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14663,21 +14948,24 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14685,15 +14973,15 @@ posix_threads=yes THREADOBJ="Python/thread.o" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$_libs - { echo "$as_me:$LINENO: checking for pthread_detach" >&5 -echo $ECHO_N "checking for pthread_detach... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_detach" >&5 +$as_echo_n "checking for pthread_detach... " >&6; } if test "${ac_cv_func_pthread_detach+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -14746,32 +15034,36 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_pthread_detach=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_pthread_detach=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_pthread_detach" >&5 -echo "${ECHO_T}$ac_cv_func_pthread_detach" >&6; } -if test $ac_cv_func_pthread_detach = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_pthread_detach" >&5 +$as_echo "$ac_cv_func_pthread_detach" >&6; } +if test "x$ac_cv_func_pthread_detach" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14781,17 +15073,17 @@ else if test "${ac_cv_header_atheos_threads_h+set}" = set; then - { echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 -echo $ECHO_N "checking for atheos/threads.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 +$as_echo_n "checking for atheos/threads.h... " >&6; } if test "${ac_cv_header_atheos_threads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 -echo "${ECHO_T}$ac_cv_header_atheos_threads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 +$as_echo "$ac_cv_header_atheos_threads_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking atheos/threads.h usability" >&5 -echo $ECHO_N "checking atheos/threads.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking atheos/threads.h usability" >&5 +$as_echo_n "checking atheos/threads.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14807,32 +15099,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking atheos/threads.h presence" >&5 -echo $ECHO_N "checking atheos/threads.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking atheos/threads.h presence" >&5 +$as_echo_n "checking atheos/threads.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14846,51 +15139,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: atheos/threads.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: atheos/threads.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: atheos/threads.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -14899,18 +15193,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 -echo $ECHO_N "checking for atheos/threads.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 +$as_echo_n "checking for atheos/threads.h... " >&6; } if test "${ac_cv_header_atheos_threads_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_atheos_threads_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 -echo "${ECHO_T}$ac_cv_header_atheos_threads_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 +$as_echo "$ac_cv_header_atheos_threads_h" >&6; } fi -if test $ac_cv_header_atheos_threads_h = yes; then +if test "x$ac_cv_header_atheos_threads_h" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14923,10 +15217,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for pthread_create in -lpthreads" >&5 -echo $ECHO_N "checking for pthread_create in -lpthreads... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthreads" >&5 +$as_echo_n "checking for pthread_create in -lpthreads... " >&6; } if test "${ac_cv_lib_pthreads_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" @@ -14958,33 +15252,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_pthreads_pthread_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthreads_pthread_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_create" >&6; } -if test $ac_cv_lib_pthreads_pthread_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_create" >&5 +$as_echo "$ac_cv_lib_pthreads_pthread_create" >&6; } +if test "x$ac_cv_lib_pthreads_pthread_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14994,10 +15292,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5 -echo $ECHO_N "checking for pthread_create in -lc_r... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5 +$as_echo_n "checking for pthread_create in -lc_r... " >&6; } if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" @@ -15029,33 +15327,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_c_r_pthread_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_c_r_pthread_create" >&6; } -if test $ac_cv_lib_c_r_pthread_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5 +$as_echo "$ac_cv_lib_c_r_pthread_create" >&6; } +if test "x$ac_cv_lib_c_r_pthread_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15065,10 +15367,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for __pthread_create_system in -lpthread" >&5 -echo $ECHO_N "checking for __pthread_create_system in -lpthread... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for __pthread_create_system in -lpthread" >&5 +$as_echo_n "checking for __pthread_create_system in -lpthread... " >&6; } if test "${ac_cv_lib_pthread___pthread_create_system+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" @@ -15100,33 +15402,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_pthread___pthread_create_system=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread___pthread_create_system=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_create_system" >&5 -echo "${ECHO_T}$ac_cv_lib_pthread___pthread_create_system" >&6; } -if test $ac_cv_lib_pthread___pthread_create_system = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_create_system" >&5 +$as_echo "$ac_cv_lib_pthread___pthread_create_system" >&6; } +if test "x$ac_cv_lib_pthread___pthread_create_system" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15136,10 +15442,10 @@ THREADOBJ="Python/thread.o" else - { echo "$as_me:$LINENO: checking for pthread_create in -lcma" >&5 -echo $ECHO_N "checking for pthread_create in -lcma... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for pthread_create in -lcma" >&5 +$as_echo_n "checking for pthread_create in -lcma... " >&6; } if test "${ac_cv_lib_cma_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcma $LIBS" @@ -15171,33 +15477,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_cma_pthread_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_cma_pthread_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_cma_pthread_create" >&5 -echo "${ECHO_T}$ac_cv_lib_cma_pthread_create" >&6; } -if test $ac_cv_lib_cma_pthread_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cma_pthread_create" >&5 +$as_echo "$ac_cv_lib_cma_pthread_create" >&6; } +if test "x$ac_cv_lib_cma_pthread_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15224,6 +15534,7 @@ fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi @@ -15235,10 +15546,10 @@ - { echo "$as_me:$LINENO: checking for usconfig in -lmpc" >&5 -echo $ECHO_N "checking for usconfig in -lmpc... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for usconfig in -lmpc" >&5 +$as_echo_n "checking for usconfig in -lmpc... " >&6; } if test "${ac_cv_lib_mpc_usconfig+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmpc $LIBS" @@ -15270,33 +15581,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_mpc_usconfig=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_mpc_usconfig=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_mpc_usconfig" >&5 -echo "${ECHO_T}$ac_cv_lib_mpc_usconfig" >&6; } -if test $ac_cv_lib_mpc_usconfig = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mpc_usconfig" >&5 +$as_echo "$ac_cv_lib_mpc_usconfig" >&6; } +if test "x$ac_cv_lib_mpc_usconfig" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15308,10 +15623,10 @@ if test "$posix_threads" != "yes"; then - { echo "$as_me:$LINENO: checking for thr_create in -lthread" >&5 -echo $ECHO_N "checking for thr_create in -lthread... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for thr_create in -lthread" >&5 +$as_echo_n "checking for thr_create in -lthread... " >&6; } if test "${ac_cv_lib_thread_thr_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lthread $LIBS" @@ -15343,33 +15658,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_thread_thr_create=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_thread_thr_create=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_thread_thr_create" >&5 -echo "${ECHO_T}$ac_cv_lib_thread_thr_create" >&6; } -if test $ac_cv_lib_thread_thr_create = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_thread_thr_create" >&5 +$as_echo "$ac_cv_lib_thread_thr_create" >&6; } +if test "x$ac_cv_lib_thread_thr_create" = x""yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15422,10 +15741,10 @@ ;; esac - { echo "$as_me:$LINENO: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5 -echo $ECHO_N "checking if PTHREAD_SCOPE_SYSTEM is supported... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5 +$as_echo_n "checking if PTHREAD_SCOPE_SYSTEM is supported... " >&6; } if test "${ac_cv_pthread_system_supported+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_pthread_system_supported=no @@ -15455,29 +15774,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_pthread_system_supported=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_pthread_system_supported=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -15485,8 +15807,8 @@ fi - { echo "$as_me:$LINENO: result: $ac_cv_pthread_system_supported" >&5 -echo "${ECHO_T}$ac_cv_pthread_system_supported" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_pthread_system_supported" >&5 +$as_echo "$ac_cv_pthread_system_supported" >&6; } if test "$ac_cv_pthread_system_supported" = "yes"; then cat >>confdefs.h <<\_ACEOF @@ -15497,11 +15819,11 @@ for ac_func in pthread_sigmask do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -15554,35 +15876,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF case $ac_sys_system in CYGWIN*) @@ -15602,18 +15931,18 @@ # Check for enable-ipv6 -{ echo "$as_me:$LINENO: checking if --enable-ipv6 is specified" >&5 -echo $ECHO_N "checking if --enable-ipv6 is specified... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if --enable-ipv6 is specified" >&5 +$as_echo_n "checking if --enable-ipv6 is specified... " >&6; } # Check whether --enable-ipv6 was given. if test "${enable_ipv6+set}" = set; then enableval=$enable_ipv6; case "$enableval" in no) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no ;; - *) { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + *) { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define ENABLE_IPV6 1 _ACEOF @@ -15624,8 +15953,8 @@ else if test "$cross_compiling" = yes; then - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no else @@ -15653,41 +15982,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } ipv6=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test "$ipv6" = "yes"; then - { echo "$as_me:$LINENO: checking if RFC2553 API is available" >&5 -echo $ECHO_N "checking if RFC2553 API is available... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking if RFC2553 API is available" >&5 +$as_echo_n "checking if RFC2553 API is available... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15711,26 +16043,27 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } ipv6=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ipv6=no fi @@ -15752,8 +16085,8 @@ ipv6trylibc=no if test "$ipv6" = "yes"; then - { echo "$as_me:$LINENO: checking ipv6 stack type" >&5 -echo $ECHO_N "checking ipv6 stack type... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking ipv6 stack type" >&5 +$as_echo_n "checking ipv6 stack type... " >&6; } for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta; do case $i in @@ -15909,8 +16242,8 @@ break fi done - { echo "$as_me:$LINENO: result: $ipv6type" >&5 -echo "${ECHO_T}$ipv6type" >&6; } + { $as_echo "$as_me:$LINENO: result: $ipv6type" >&5 +$as_echo "$ipv6type" >&6; } fi if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then @@ -15929,8 +16262,8 @@ fi fi -{ echo "$as_me:$LINENO: checking for OSX 10.5 SDK or later" >&5 -echo $ECHO_N "checking for OSX 10.5 SDK or later... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for OSX 10.5 SDK or later" >&5 +$as_echo_n "checking for OSX 10.5 SDK or later... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15952,13 +16285,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -15968,22 +16302,22 @@ #define HAVE_OSX105_SDK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Check for --with-doc-strings -{ echo "$as_me:$LINENO: checking for --with-doc-strings" >&5 -echo $ECHO_N "checking for --with-doc-strings... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-doc-strings" >&5 +$as_echo_n "checking for --with-doc-strings... " >&6; } # Check whether --with-doc-strings was given. if test "${with_doc_strings+set}" = set; then @@ -16002,12 +16336,12 @@ _ACEOF fi -{ echo "$as_me:$LINENO: result: $with_doc_strings" >&5 -echo "${ECHO_T}$with_doc_strings" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_doc_strings" >&5 +$as_echo "$with_doc_strings" >&6; } # Check for Python-specific malloc support -{ echo "$as_me:$LINENO: checking for --with-tsc" >&5 -echo $ECHO_N "checking for --with-tsc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-tsc" >&5 +$as_echo_n "checking for --with-tsc... " >&6; } # Check whether --with-tsc was given. if test "${with_tsc+set}" = set; then @@ -16019,20 +16353,20 @@ #define WITH_TSC 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Check for Python-specific malloc support -{ echo "$as_me:$LINENO: checking for --with-pymalloc" >&5 -echo $ECHO_N "checking for --with-pymalloc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-pymalloc" >&5 +$as_echo_n "checking for --with-pymalloc... " >&6; } # Check whether --with-pymalloc was given. if test "${with_pymalloc+set}" = set; then @@ -16051,12 +16385,12 @@ _ACEOF fi -{ echo "$as_me:$LINENO: result: $with_pymalloc" >&5 -echo "${ECHO_T}$with_pymalloc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $with_pymalloc" >&5 +$as_echo "$with_pymalloc" >&6; } # Check for --with-wctype-functions -{ echo "$as_me:$LINENO: checking for --with-wctype-functions" >&5 -echo $ECHO_N "checking for --with-wctype-functions... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-wctype-functions" >&5 +$as_echo_n "checking for --with-wctype-functions... " >&6; } # Check whether --with-wctype-functions was given. if test "${with_wctype_functions+set}" = set; then @@ -16068,14 +16402,14 @@ #define WANT_WCTYPE_FUNCTIONS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -16088,11 +16422,11 @@ for ac_func in dlopen do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -16145,35 +16479,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -16183,8 +16524,8 @@ # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic # loading of modules. -{ echo "$as_me:$LINENO: checking DYNLOADFILE" >&5 -echo $ECHO_N "checking DYNLOADFILE... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking DYNLOADFILE" >&5 +$as_echo_n "checking DYNLOADFILE... " >&6; } if test -z "$DYNLOADFILE" then case $ac_sys_system/$ac_sys_release in @@ -16208,8 +16549,8 @@ ;; esac fi -{ echo "$as_me:$LINENO: result: $DYNLOADFILE" >&5 -echo "${ECHO_T}$DYNLOADFILE" >&6; } +{ $as_echo "$as_me:$LINENO: result: $DYNLOADFILE" >&5 +$as_echo "$DYNLOADFILE" >&6; } if test "$DYNLOADFILE" != "dynload_stub.o" then @@ -16222,16 +16563,16 @@ # MACHDEP_OBJS can be set to platform-specific object files needed by Python -{ echo "$as_me:$LINENO: checking MACHDEP_OBJS" >&5 -echo $ECHO_N "checking MACHDEP_OBJS... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking MACHDEP_OBJS" >&5 +$as_echo_n "checking MACHDEP_OBJS... " >&6; } if test -z "$MACHDEP_OBJS" then MACHDEP_OBJS=$extra_machdep_objs else MACHDEP_OBJS="$MACHDEP_OBJS $extra_machdep_objs" fi -{ echo "$as_me:$LINENO: result: MACHDEP_OBJS" >&5 -echo "${ECHO_T}MACHDEP_OBJS" >&6; } +{ $as_echo "$as_me:$LINENO: result: MACHDEP_OBJS" >&5 +$as_echo "MACHDEP_OBJS" >&6; } # checks for library functions @@ -16336,11 +16677,11 @@ sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ truncate uname unsetenv utimes waitpid wait3 wait4 wcscoll wcsxfrm _getpty do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -16393,35 +16734,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -16430,8 +16778,8 @@ # For some functions, having a definition is not sufficient, since # we want to take their address. -{ echo "$as_me:$LINENO: checking for chroot" >&5 -echo $ECHO_N "checking for chroot... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for chroot" >&5 +$as_echo_n "checking for chroot... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16453,13 +16801,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16469,20 +16818,20 @@ #define HAVE_CHROOT 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for link" >&5 -echo $ECHO_N "checking for link... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for link" >&5 +$as_echo_n "checking for link... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16504,13 +16853,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16520,20 +16870,20 @@ #define HAVE_LINK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for symlink" >&5 -echo $ECHO_N "checking for symlink... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for symlink" >&5 +$as_echo_n "checking for symlink... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16555,13 +16905,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16571,20 +16922,20 @@ #define HAVE_SYMLINK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for fchdir" >&5 -echo $ECHO_N "checking for fchdir... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fchdir" >&5 +$as_echo_n "checking for fchdir... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16606,13 +16957,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16622,20 +16974,20 @@ #define HAVE_FCHDIR 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for fsync" >&5 -echo $ECHO_N "checking for fsync... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fsync" >&5 +$as_echo_n "checking for fsync... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16657,13 +17009,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16673,20 +17026,20 @@ #define HAVE_FSYNC 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for fdatasync" >&5 -echo $ECHO_N "checking for fdatasync... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for fdatasync" >&5 +$as_echo_n "checking for fdatasync... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16708,13 +17061,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16724,20 +17078,20 @@ #define HAVE_FDATASYNC 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for epoll" >&5 -echo $ECHO_N "checking for epoll... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for epoll" >&5 +$as_echo_n "checking for epoll... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16759,13 +17113,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16775,20 +17130,20 @@ #define HAVE_EPOLL 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for kqueue" >&5 -echo $ECHO_N "checking for kqueue... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for kqueue" >&5 +$as_echo_n "checking for kqueue... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16813,13 +17168,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16829,14 +17185,14 @@ #define HAVE_KQUEUE 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -16847,8 +17203,8 @@ # address to avoid compiler warnings and potential miscompilations # because of the missing prototypes. -{ echo "$as_me:$LINENO: checking for ctermid_r" >&5 -echo $ECHO_N "checking for ctermid_r... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ctermid_r" >&5 +$as_echo_n "checking for ctermid_r... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16873,13 +17229,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16889,21 +17246,21 @@ #define HAVE_CTERMID_R 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for flock" >&5 -echo $ECHO_N "checking for flock... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for flock" >&5 +$as_echo_n "checking for flock... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16928,13 +17285,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16944,21 +17302,21 @@ #define HAVE_FLOCK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for getpagesize" >&5 -echo $ECHO_N "checking for getpagesize... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getpagesize" >&5 +$as_echo_n "checking for getpagesize... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16983,13 +17341,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16999,14 +17358,14 @@ #define HAVE_GETPAGESIZE 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -17016,10 +17375,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_TRUE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$TRUE"; then ac_cv_prog_TRUE="$TRUE" # Let the user override the test. @@ -17032,7 +17391,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_TRUE="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -17043,11 +17402,11 @@ fi TRUE=$ac_cv_prog_TRUE if test -n "$TRUE"; then - { echo "$as_me:$LINENO: result: $TRUE" >&5 -echo "${ECHO_T}$TRUE" >&6; } + { $as_echo "$as_me:$LINENO: result: $TRUE" >&5 +$as_echo "$TRUE" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -17056,10 +17415,10 @@ test -n "$TRUE" || TRUE="/bin/true" -{ echo "$as_me:$LINENO: checking for inet_aton in -lc" >&5 -echo $ECHO_N "checking for inet_aton in -lc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_aton in -lc" >&5 +$as_echo_n "checking for inet_aton in -lc... " >&6; } if test "${ac_cv_lib_c_inet_aton+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" @@ -17091,40 +17450,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_c_inet_aton=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_inet_aton=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_inet_aton" >&5 -echo "${ECHO_T}$ac_cv_lib_c_inet_aton" >&6; } -if test $ac_cv_lib_c_inet_aton = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_inet_aton" >&5 +$as_echo "$ac_cv_lib_c_inet_aton" >&6; } +if test "x$ac_cv_lib_c_inet_aton" = x""yes; then $ac_cv_prog_TRUE else -{ echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5 -echo $ECHO_N "checking for inet_aton in -lresolv... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5 +$as_echo_n "checking for inet_aton in -lresolv... " >&6; } if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" @@ -17156,33 +17519,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_resolv_inet_aton=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_resolv_inet_aton=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5 -echo "${ECHO_T}$ac_cv_lib_resolv_inet_aton" >&6; } -if test $ac_cv_lib_resolv_inet_aton = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5 +$as_echo "$ac_cv_lib_resolv_inet_aton" >&6; } +if test "x$ac_cv_lib_resolv_inet_aton" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF @@ -17197,14 +17564,16 @@ # On Tru64, chflags seems to be present, but calling it will # exit Python -{ echo "$as_me:$LINENO: checking for chflags" >&5 -echo $ECHO_N "checking for chflags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for chflags" >&5 +$as_echo_n "checking for chflags... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17229,50 +17598,55 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_CHFLAGS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: checking for lchflags" >&5 -echo $ECHO_N "checking for lchflags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for lchflags" >&5 +$as_echo_n "checking for lchflags... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17297,37 +17671,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_LCHFLAGS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -17342,10 +17719,10 @@ ;; esac -{ echo "$as_me:$LINENO: checking for inflateCopy in -lz" >&5 -echo $ECHO_N "checking for inflateCopy in -lz... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inflateCopy in -lz" >&5 +$as_echo_n "checking for inflateCopy in -lz... " >&6; } if test "${ac_cv_lib_z_inflateCopy+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" @@ -17377,33 +17754,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_z_inflateCopy=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_inflateCopy=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateCopy" >&5 -echo "${ECHO_T}$ac_cv_lib_z_inflateCopy" >&6; } -if test $ac_cv_lib_z_inflateCopy = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateCopy" >&5 +$as_echo "$ac_cv_lib_z_inflateCopy" >&6; } +if test "x$ac_cv_lib_z_inflateCopy" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ZLIB_COPY 1 @@ -17419,8 +17800,8 @@ ;; esac -{ echo "$as_me:$LINENO: checking for hstrerror" >&5 -echo $ECHO_N "checking for hstrerror... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for hstrerror" >&5 +$as_echo_n "checking for hstrerror... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17445,39 +17826,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define HAVE_HSTRERROR 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for inet_aton" >&5 -echo $ECHO_N "checking for inet_aton... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_aton" >&5 +$as_echo_n "checking for inet_aton... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17505,39 +17890,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define HAVE_INET_ATON 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for inet_pton" >&5 -echo $ECHO_N "checking for inet_pton... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for inet_pton" >&5 +$as_echo_n "checking for inet_pton... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17565,13 +17954,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17581,22 +17971,22 @@ #define HAVE_INET_PTON 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # On some systems, setgroups is in unistd.h, on others, in grp.h -{ echo "$as_me:$LINENO: checking for setgroups" >&5 -echo $ECHO_N "checking for setgroups... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for setgroups" >&5 +$as_echo_n "checking for setgroups... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17624,13 +18014,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17640,14 +18031,14 @@ #define HAVE_SETGROUPS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -17658,11 +18049,11 @@ for ac_func in openpty do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17715,42 +18106,49 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else - { echo "$as_me:$LINENO: checking for openpty in -lutil" >&5 -echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for openpty in -lutil" >&5 +$as_echo_n "checking for openpty in -lutil... " >&6; } if test "${ac_cv_lib_util_openpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" @@ -17782,42 +18180,46 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_util_openpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_util_openpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_util_openpty" >&5 -echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6; } -if test $ac_cv_lib_util_openpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_util_openpty" >&5 +$as_echo "$ac_cv_lib_util_openpty" >&6; } +if test "x$ac_cv_lib_util_openpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_OPENPTY 1 _ACEOF LIBS="$LIBS -lutil" else - { echo "$as_me:$LINENO: checking for openpty in -lbsd" >&5 -echo $ECHO_N "checking for openpty in -lbsd... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for openpty in -lbsd" >&5 +$as_echo_n "checking for openpty in -lbsd... " >&6; } if test "${ac_cv_lib_bsd_openpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" @@ -17849,33 +18251,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_bsd_openpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_openpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_openpty" >&5 -echo "${ECHO_T}$ac_cv_lib_bsd_openpty" >&6; } -if test $ac_cv_lib_bsd_openpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_openpty" >&5 +$as_echo "$ac_cv_lib_bsd_openpty" >&6; } +if test "x$ac_cv_lib_bsd_openpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_OPENPTY 1 _ACEOF @@ -17892,11 +18298,11 @@ for ac_func in forkpty do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17949,42 +18355,49 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else - { echo "$as_me:$LINENO: checking for forkpty in -lutil" >&5 -echo $ECHO_N "checking for forkpty in -lutil... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for forkpty in -lutil" >&5 +$as_echo_n "checking for forkpty in -lutil... " >&6; } if test "${ac_cv_lib_util_forkpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" @@ -18016,42 +18429,46 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_util_forkpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_util_forkpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_util_forkpty" >&5 -echo "${ECHO_T}$ac_cv_lib_util_forkpty" >&6; } -if test $ac_cv_lib_util_forkpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_util_forkpty" >&5 +$as_echo "$ac_cv_lib_util_forkpty" >&6; } +if test "x$ac_cv_lib_util_forkpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FORKPTY 1 _ACEOF LIBS="$LIBS -lutil" else - { echo "$as_me:$LINENO: checking for forkpty in -lbsd" >&5 -echo $ECHO_N "checking for forkpty in -lbsd... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for forkpty in -lbsd" >&5 +$as_echo_n "checking for forkpty in -lbsd... " >&6; } if test "${ac_cv_lib_bsd_forkpty+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" @@ -18083,33 +18500,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_bsd_forkpty=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_forkpty=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_forkpty" >&5 -echo "${ECHO_T}$ac_cv_lib_bsd_forkpty" >&6; } -if test $ac_cv_lib_bsd_forkpty = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_forkpty" >&5 +$as_echo "$ac_cv_lib_bsd_forkpty" >&6; } +if test "x$ac_cv_lib_bsd_forkpty" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FORKPTY 1 _ACEOF @@ -18128,11 +18549,11 @@ for ac_func in memmove do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18185,35 +18606,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -18229,11 +18657,11 @@ for ac_func in fseek64 fseeko fstatvfs ftell64 ftello statvfs do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18286,35 +18714,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -18326,11 +18761,11 @@ for ac_func in dup2 getcwd strdup do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18383,35 +18818,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else @@ -18428,11 +18870,11 @@ for ac_func in getpgrp do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18485,35 +18927,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18536,13 +18985,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -18554,7 +19004,7 @@ else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18568,11 +19018,11 @@ for ac_func in setpgrp do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18625,35 +19075,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18676,13 +19133,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -18694,7 +19152,7 @@ else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18708,11 +19166,11 @@ for ac_func in gettimeofday do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18765,35 +19223,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18816,20 +19281,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -18846,8 +19312,8 @@ done -{ echo "$as_me:$LINENO: checking for major" >&5 -echo $ECHO_N "checking for major... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for major" >&5 +$as_echo_n "checking for major... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -18879,44 +19345,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then cat >>confdefs.h <<\_ACEOF #define HAVE_DEVICE_MACROS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext # On OSF/1 V5.1, getaddrinfo is available, but a define # for [no]getaddrinfo in netdb.h. -{ echo "$as_me:$LINENO: checking for getaddrinfo" >&5 -echo $ECHO_N "checking for getaddrinfo... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getaddrinfo" >&5 +$as_echo_n "checking for getaddrinfo... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -18945,26 +19415,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -{ echo "$as_me:$LINENO: checking getaddrinfo bug" >&5 -echo $ECHO_N "checking getaddrinfo bug... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +{ $as_echo "$as_me:$LINENO: checking getaddrinfo bug" >&5 +$as_echo_n "checking getaddrinfo bug... " >&6; } if test "$cross_compiling" = yes; then - { echo "$as_me:$LINENO: result: buggy" >&5 -echo "${ECHO_T}buggy" >&6; } + { $as_echo "$as_me:$LINENO: result: buggy" >&5 +$as_echo "buggy" >&6; } buggygetaddrinfo=yes else cat >conftest.$ac_ext <<_ACEOF @@ -19067,48 +19540,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: good" >&5 -echo "${ECHO_T}good" >&6; } + { $as_echo "$as_me:$LINENO: result: good" >&5 +$as_echo "good" >&6; } buggygetaddrinfo=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: buggy" >&5 -echo "${ECHO_T}buggy" >&6; } +{ $as_echo "$as_me:$LINENO: result: buggy" >&5 +$as_echo "buggy" >&6; } buggygetaddrinfo=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } buggygetaddrinfo=yes fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext @@ -19128,11 +19605,11 @@ for ac_func in getnameinfo do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19185,35 +19662,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -19221,10 +19705,10 @@ # checks for structures -{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if test "${ac_cv_header_time+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19251,20 +19735,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no @@ -19272,8 +19757,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -echo "${ECHO_T}$ac_cv_header_time" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +$as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF @@ -19282,10 +19767,10 @@ fi -{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } if test "${ac_cv_struct_tm+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19301,7 +19786,7 @@ { struct tm tm; int *p = &tm.tm_sec; - return !p; + return !p; ; return 0; } @@ -19312,20 +19797,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_tm=time.h else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h @@ -19333,8 +19819,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -echo "${ECHO_T}$ac_cv_struct_tm" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF @@ -19343,10 +19829,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 -echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 +$as_echo_n "checking for struct tm.tm_zone... " >&6; } if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19374,20 +19860,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19416,20 +19903,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_zone=no @@ -19440,9 +19928,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 -echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6; } -if test $ac_cv_member_struct_tm_tm_zone = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 +$as_echo "$ac_cv_member_struct_tm_tm_zone" >&6; } +if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 @@ -19458,10 +19946,10 @@ _ACEOF else - { echo "$as_me:$LINENO: checking whether tzname is declared" >&5 -echo $ECHO_N "checking whether tzname is declared... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether tzname is declared" >&5 +$as_echo_n "checking whether tzname is declared... " >&6; } if test "${ac_cv_have_decl_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19488,20 +19976,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_tzname=no @@ -19509,9 +19998,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 -echo "${ECHO_T}$ac_cv_have_decl_tzname" >&6; } -if test $ac_cv_have_decl_tzname = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 +$as_echo "$ac_cv_have_decl_tzname" >&6; } +if test "x$ac_cv_have_decl_tzname" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_TZNAME 1 @@ -19527,10 +20016,10 @@ fi - { echo "$as_me:$LINENO: checking for tzname" >&5 -echo $ECHO_N "checking for tzname... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for tzname" >&5 +$as_echo_n "checking for tzname... " >&6; } if test "${ac_cv_var_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19557,31 +20046,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_var_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_var_tzname=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 -echo "${ECHO_T}$ac_cv_var_tzname" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 +$as_echo "$ac_cv_var_tzname" >&6; } if test $ac_cv_var_tzname = yes; then cat >>confdefs.h <<\_ACEOF @@ -19591,10 +20084,10 @@ fi fi -{ echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 -echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 +$as_echo_n "checking for struct stat.st_rdev... " >&6; } if test "${ac_cv_member_struct_stat_st_rdev+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19619,20 +20112,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19658,20 +20152,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_rdev=no @@ -19682,9 +20177,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6; } -if test $ac_cv_member_struct_stat_st_rdev = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 +$as_echo "$ac_cv_member_struct_stat_st_rdev" >&6; } +if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_RDEV 1 @@ -19693,10 +20188,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 -echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 +$as_echo_n "checking for struct stat.st_blksize... " >&6; } if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19721,20 +20216,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blksize=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19760,20 +20256,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blksize=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_blksize=no @@ -19784,9 +20281,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6; } -if test $ac_cv_member_struct_stat_st_blksize = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 +$as_echo "$ac_cv_member_struct_stat_st_blksize" >&6; } +if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLKSIZE 1 @@ -19795,10 +20292,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_flags" >&5 -echo $ECHO_N "checking for struct stat.st_flags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_flags" >&5 +$as_echo_n "checking for struct stat.st_flags... " >&6; } if test "${ac_cv_member_struct_stat_st_flags+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19823,20 +20320,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_flags=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19862,20 +20360,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_flags=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_flags=no @@ -19886,9 +20385,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_flags" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_flags" >&6; } -if test $ac_cv_member_struct_stat_st_flags = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_flags" >&5 +$as_echo "$ac_cv_member_struct_stat_st_flags" >&6; } +if test "x$ac_cv_member_struct_stat_st_flags" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_FLAGS 1 @@ -19897,10 +20396,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_gen" >&5 -echo $ECHO_N "checking for struct stat.st_gen... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_gen" >&5 +$as_echo_n "checking for struct stat.st_gen... " >&6; } if test "${ac_cv_member_struct_stat_st_gen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19925,20 +20424,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_gen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19964,20 +20464,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_gen=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_gen=no @@ -19988,9 +20489,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_gen" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_gen" >&6; } -if test $ac_cv_member_struct_stat_st_gen = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_gen" >&5 +$as_echo "$ac_cv_member_struct_stat_st_gen" >&6; } +if test "x$ac_cv_member_struct_stat_st_gen" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_GEN 1 @@ -19999,10 +20500,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_birthtime" >&5 -echo $ECHO_N "checking for struct stat.st_birthtime... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_birthtime" >&5 +$as_echo_n "checking for struct stat.st_birthtime... " >&6; } if test "${ac_cv_member_struct_stat_st_birthtime+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20027,20 +20528,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_birthtime=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -20066,20 +20568,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_birthtime=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_birthtime=no @@ -20090,9 +20593,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_birthtime" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_birthtime" >&6; } -if test $ac_cv_member_struct_stat_st_birthtime = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_birthtime" >&5 +$as_echo "$ac_cv_member_struct_stat_st_birthtime" >&6; } +if test "x$ac_cv_member_struct_stat_st_birthtime" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BIRTHTIME 1 @@ -20101,10 +20604,10 @@ fi -{ echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5 -echo $ECHO_N "checking for struct stat.st_blocks... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5 +$as_echo_n "checking for struct stat.st_blocks... " >&6; } if test "${ac_cv_member_struct_stat_st_blocks+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20129,20 +20632,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blocks=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -20168,20 +20672,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blocks=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_blocks=no @@ -20192,9 +20697,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5 -echo "${ECHO_T}$ac_cv_member_struct_stat_st_blocks" >&6; } -if test $ac_cv_member_struct_stat_st_blocks = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5 +$as_echo "$ac_cv_member_struct_stat_st_blocks" >&6; } +if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLOCKS 1 @@ -20216,10 +20721,10 @@ -{ echo "$as_me:$LINENO: checking for time.h that defines altzone" >&5 -echo $ECHO_N "checking for time.h that defines altzone... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for time.h that defines altzone" >&5 +$as_echo_n "checking for time.h that defines altzone... " >&6; } if test "${ac_cv_header_time_altzone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20242,20 +20747,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time_altzone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time_altzone=no @@ -20264,8 +20770,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_time_altzone" >&5 -echo "${ECHO_T}$ac_cv_header_time_altzone" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time_altzone" >&5 +$as_echo "$ac_cv_header_time_altzone" >&6; } if test $ac_cv_header_time_altzone = yes; then cat >>confdefs.h <<\_ACEOF @@ -20275,8 +20781,8 @@ fi was_it_defined=no -{ echo "$as_me:$LINENO: checking whether sys/select.h and sys/time.h may both be included" >&5 -echo $ECHO_N "checking whether sys/select.h and sys/time.h may both be included... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether sys/select.h and sys/time.h may both be included" >&5 +$as_echo_n "checking whether sys/select.h and sys/time.h may both be included... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20302,13 +20808,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20322,20 +20829,20 @@ was_it_defined=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $was_it_defined" >&5 -echo "${ECHO_T}$was_it_defined" >&6; } +{ $as_echo "$as_me:$LINENO: result: $was_it_defined" >&5 +$as_echo "$was_it_defined" >&6; } -{ echo "$as_me:$LINENO: checking for addrinfo" >&5 -echo $ECHO_N "checking for addrinfo... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for addrinfo" >&5 +$as_echo_n "checking for addrinfo... " >&6; } if test "${ac_cv_struct_addrinfo+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20359,20 +20866,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_addrinfo=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_addrinfo=no @@ -20381,8 +20889,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_addrinfo" >&5 -echo "${ECHO_T}$ac_cv_struct_addrinfo" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_addrinfo" >&5 +$as_echo "$ac_cv_struct_addrinfo" >&6; } if test $ac_cv_struct_addrinfo = yes; then cat >>confdefs.h <<\_ACEOF @@ -20391,10 +20899,10 @@ fi -{ echo "$as_me:$LINENO: checking for sockaddr_storage" >&5 -echo $ECHO_N "checking for sockaddr_storage... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for sockaddr_storage" >&5 +$as_echo_n "checking for sockaddr_storage... " >&6; } if test "${ac_cv_struct_sockaddr_storage+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20419,20 +20927,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_sockaddr_storage=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_sockaddr_storage=no @@ -20441,8 +20950,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_struct_sockaddr_storage" >&5 -echo "${ECHO_T}$ac_cv_struct_sockaddr_storage" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_sockaddr_storage" >&5 +$as_echo "$ac_cv_struct_sockaddr_storage" >&6; } if test $ac_cv_struct_sockaddr_storage = yes; then cat >>confdefs.h <<\_ACEOF @@ -20454,10 +20963,10 @@ # checks for compiler characteristics -{ echo "$as_me:$LINENO: checking whether char is unsigned" >&5 -echo $ECHO_N "checking whether char is unsigned... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether char is unsigned" >&5 +$as_echo_n "checking whether char is unsigned... " >&6; } if test "${ac_cv_c_char_unsigned+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20482,20 +20991,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_char_unsigned=no else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_char_unsigned=yes @@ -20503,8 +21013,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5 -echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5 +$as_echo "$ac_cv_c_char_unsigned" >&6; } if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then cat >>confdefs.h <<\_ACEOF #define __CHAR_UNSIGNED__ 1 @@ -20512,10 +21022,10 @@ fi -{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20587,20 +21097,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no @@ -20608,20 +21119,20 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -echo "${ECHO_T}$ac_cv_c_const" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF -#define const +#define const /**/ _ACEOF fi works=no -{ echo "$as_me:$LINENO: checking for working volatile" >&5 -echo $ECHO_N "checking for working volatile... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for working volatile" >&5 +$as_echo_n "checking for working volatile... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20643,37 +21154,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then works=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >>confdefs.h <<\_ACEOF -#define volatile +#define volatile /**/ _ACEOF fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $works" >&5 -echo "${ECHO_T}$works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $works" >&5 +$as_echo "$works" >&6; } works=no -{ echo "$as_me:$LINENO: checking for working signed char" >&5 -echo $ECHO_N "checking for working signed char... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for working signed char" >&5 +$as_echo_n "checking for working signed char... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20695,37 +21207,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then works=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >>confdefs.h <<\_ACEOF -#define signed +#define signed /**/ _ACEOF fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $works" >&5 -echo "${ECHO_T}$works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $works" >&5 +$as_echo "$works" >&6; } have_prototypes=no -{ echo "$as_me:$LINENO: checking for prototypes" >&5 -echo $ECHO_N "checking for prototypes... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for prototypes" >&5 +$as_echo_n "checking for prototypes... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20747,13 +21260,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20767,19 +21281,19 @@ have_prototypes=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_prototypes" >&5 -echo "${ECHO_T}$have_prototypes" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_prototypes" >&5 +$as_echo "$have_prototypes" >&6; } works=no -{ echo "$as_me:$LINENO: checking for variable length prototypes and stdarg.h" >&5 -echo $ECHO_N "checking for variable length prototypes and stdarg.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for variable length prototypes and stdarg.h" >&5 +$as_echo_n "checking for variable length prototypes and stdarg.h... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20811,13 +21325,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20831,19 +21346,19 @@ works=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $works" >&5 -echo "${ECHO_T}$works" >&6; } +{ $as_echo "$as_me:$LINENO: result: $works" >&5 +$as_echo "$works" >&6; } # check for socketpair -{ echo "$as_me:$LINENO: checking for socketpair" >&5 -echo $ECHO_N "checking for socketpair... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for socketpair" >&5 +$as_echo_n "checking for socketpair... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20868,13 +21383,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20884,22 +21400,22 @@ #define HAVE_SOCKETPAIR 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # check if sockaddr has sa_len member -{ echo "$as_me:$LINENO: checking if sockaddr has sa_len member" >&5 -echo $ECHO_N "checking if sockaddr has sa_len member... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if sockaddr has sa_len member" >&5 +$as_echo_n "checking if sockaddr has sa_len member... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20923,37 +21439,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKADDR_SA_LEN 1 _ACEOF else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext va_list_is_array=no -{ echo "$as_me:$LINENO: checking whether va_list is an array" >&5 -echo $ECHO_N "checking whether va_list is an array... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether va_list is an array" >&5 +$as_echo_n "checking whether va_list is an array... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20981,20 +21498,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -21008,17 +21526,17 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $va_list_is_array" >&5 -echo "${ECHO_T}$va_list_is_array" >&6; } +{ $as_echo "$as_me:$LINENO: result: $va_list_is_array" >&5 +$as_echo "$va_list_is_array" >&6; } # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-( -{ echo "$as_me:$LINENO: checking for gethostbyname_r" >&5 -echo $ECHO_N "checking for gethostbyname_r... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for gethostbyname_r" >&5 +$as_echo_n "checking for gethostbyname_r... " >&6; } if test "${ac_cv_func_gethostbyname_r+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21071,39 +21589,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_gethostbyname_r=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname_r=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5 -echo "${ECHO_T}$ac_cv_func_gethostbyname_r" >&6; } -if test $ac_cv_func_gethostbyname_r = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5 +$as_echo "$ac_cv_func_gethostbyname_r" >&6; } +if test "x$ac_cv_func_gethostbyname_r" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_GETHOSTBYNAME_R 1 _ACEOF - { echo "$as_me:$LINENO: checking gethostbyname_r with 6 args" >&5 -echo $ECHO_N "checking gethostbyname_r with 6 args... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 6 args" >&5 +$as_echo_n "checking gethostbyname_r with 6 args... " >&6; } OLD_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS" cat >conftest.$ac_ext <<_ACEOF @@ -21137,13 +21659,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21158,18 +21681,18 @@ #define HAVE_GETHOSTBYNAME_R_6_ARG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - { echo "$as_me:$LINENO: checking gethostbyname_r with 5 args" >&5 -echo $ECHO_N "checking gethostbyname_r with 5 args... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 5 args" >&5 +$as_echo_n "checking gethostbyname_r with 5 args... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21201,13 +21724,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21222,18 +21746,18 @@ #define HAVE_GETHOSTBYNAME_R_5_ARG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - { echo "$as_me:$LINENO: checking gethostbyname_r with 3 args" >&5 -echo $ECHO_N "checking gethostbyname_r with 3 args... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 3 args" >&5 +$as_echo_n "checking gethostbyname_r with 3 args... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21263,13 +21787,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21284,16 +21809,16 @@ #define HAVE_GETHOSTBYNAME_R_3_ARG 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -21313,11 +21838,11 @@ for ac_func in gethostbyname do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21370,35 +21895,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -21417,10 +21949,10 @@ # (none yet) # Linux requires this for correct f.p. operations -{ echo "$as_me:$LINENO: checking for __fpu_control" >&5 -echo $ECHO_N "checking for __fpu_control... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for __fpu_control" >&5 +$as_echo_n "checking for __fpu_control... " >&6; } if test "${ac_cv_func___fpu_control+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21473,39 +22005,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func___fpu_control=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func___fpu_control=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func___fpu_control" >&5 -echo "${ECHO_T}$ac_cv_func___fpu_control" >&6; } -if test $ac_cv_func___fpu_control = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func___fpu_control" >&5 +$as_echo "$ac_cv_func___fpu_control" >&6; } +if test "x$ac_cv_func___fpu_control" = x""yes; then : else -{ echo "$as_me:$LINENO: checking for __fpu_control in -lieee" >&5 -echo $ECHO_N "checking for __fpu_control in -lieee... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for __fpu_control in -lieee" >&5 +$as_echo_n "checking for __fpu_control in -lieee... " >&6; } if test "${ac_cv_lib_ieee___fpu_control+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" @@ -21537,33 +22073,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_ieee___fpu_control=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ieee___fpu_control=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_ieee___fpu_control" >&5 -echo "${ECHO_T}$ac_cv_lib_ieee___fpu_control" >&6; } -if test $ac_cv_lib_ieee___fpu_control = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ieee___fpu_control" >&5 +$as_echo "$ac_cv_lib_ieee___fpu_control" >&6; } +if test "x$ac_cv_lib_ieee___fpu_control" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBIEEE 1 _ACEOF @@ -21577,8 +22117,8 @@ # Check for --with-fpectl -{ echo "$as_me:$LINENO: checking for --with-fpectl" >&5 -echo $ECHO_N "checking for --with-fpectl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-fpectl" >&5 +$as_echo_n "checking for --with-fpectl... " >&6; } # Check whether --with-fpectl was given. if test "${with_fpectl+set}" = set; then @@ -21590,14 +22130,14 @@ #define WANT_SIGFPE_HANDLER 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -21607,53 +22147,53 @@ Darwin) ;; *) LIBM=-lm esac -{ echo "$as_me:$LINENO: checking for --with-libm=STRING" >&5 -echo $ECHO_N "checking for --with-libm=STRING... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-libm=STRING" >&5 +$as_echo_n "checking for --with-libm=STRING... " >&6; } # Check whether --with-libm was given. if test "${with_libm+set}" = set; then withval=$with_libm; if test "$withval" = no then LIBM= - { echo "$as_me:$LINENO: result: force LIBM empty" >&5 -echo "${ECHO_T}force LIBM empty" >&6; } + { $as_echo "$as_me:$LINENO: result: force LIBM empty" >&5 +$as_echo "force LIBM empty" >&6; } elif test "$withval" != yes then LIBM=$withval - { echo "$as_me:$LINENO: result: set LIBM=\"$withval\"" >&5 -echo "${ECHO_T}set LIBM=\"$withval\"" >&6; } -else { { echo "$as_me:$LINENO: error: proper usage is --with-libm=STRING" >&5 -echo "$as_me: error: proper usage is --with-libm=STRING" >&2;} + { $as_echo "$as_me:$LINENO: result: set LIBM=\"$withval\"" >&5 +$as_echo "set LIBM=\"$withval\"" >&6; } +else { { $as_echo "$as_me:$LINENO: error: proper usage is --with-libm=STRING" >&5 +$as_echo "$as_me: error: proper usage is --with-libm=STRING" >&2;} { (exit 1); exit 1; }; } fi else - { echo "$as_me:$LINENO: result: default LIBM=\"$LIBM\"" >&5 -echo "${ECHO_T}default LIBM=\"$LIBM\"" >&6; } + { $as_echo "$as_me:$LINENO: result: default LIBM=\"$LIBM\"" >&5 +$as_echo "default LIBM=\"$LIBM\"" >&6; } fi # check for --with-libc=... -{ echo "$as_me:$LINENO: checking for --with-libc=STRING" >&5 -echo $ECHO_N "checking for --with-libc=STRING... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-libc=STRING" >&5 +$as_echo_n "checking for --with-libc=STRING... " >&6; } # Check whether --with-libc was given. if test "${with_libc+set}" = set; then withval=$with_libc; if test "$withval" = no then LIBC= - { echo "$as_me:$LINENO: result: force LIBC empty" >&5 -echo "${ECHO_T}force LIBC empty" >&6; } + { $as_echo "$as_me:$LINENO: result: force LIBC empty" >&5 +$as_echo "force LIBC empty" >&6; } elif test "$withval" != yes then LIBC=$withval - { echo "$as_me:$LINENO: result: set LIBC=\"$withval\"" >&5 -echo "${ECHO_T}set LIBC=\"$withval\"" >&6; } -else { { echo "$as_me:$LINENO: error: proper usage is --with-libc=STRING" >&5 -echo "$as_me: error: proper usage is --with-libc=STRING" >&2;} + { $as_echo "$as_me:$LINENO: result: set LIBC=\"$withval\"" >&5 +$as_echo "set LIBC=\"$withval\"" >&6; } +else { { $as_echo "$as_me:$LINENO: error: proper usage is --with-libc=STRING" >&5 +$as_echo "$as_me: error: proper usage is --with-libc=STRING" >&2;} { (exit 1); exit 1; }; } fi else - { echo "$as_me:$LINENO: result: default LIBC=\"$LIBC\"" >&5 -echo "${ECHO_T}default LIBC=\"$LIBC\"" >&6; } + { $as_echo "$as_me:$LINENO: result: default LIBC=\"$LIBC\"" >&5 +$as_echo "default LIBC=\"$LIBC\"" >&6; } fi @@ -21661,10 +22201,10 @@ # * Check for various properties of floating point * # ************************************************** -{ echo "$as_me:$LINENO: checking whether C doubles are little-endian IEEE 754 binary64" >&5 -echo $ECHO_N "checking whether C doubles are little-endian IEEE 754 binary64... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether C doubles are little-endian IEEE 754 binary64" >&5 +$as_echo_n "checking whether C doubles are little-endian IEEE 754 binary64... " >&6; } if test "${ac_cv_little_endian_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -21693,37 +22233,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_little_endian_double=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_little_endian_double=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_little_endian_double" >&5 -echo "${ECHO_T}$ac_cv_little_endian_double" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_little_endian_double" >&5 +$as_echo "$ac_cv_little_endian_double" >&6; } if test "$ac_cv_little_endian_double" = yes then @@ -21733,10 +22276,10 @@ fi -{ echo "$as_me:$LINENO: checking whether C doubles are big-endian IEEE 754 binary64" >&5 -echo $ECHO_N "checking whether C doubles are big-endian IEEE 754 binary64... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether C doubles are big-endian IEEE 754 binary64" >&5 +$as_echo_n "checking whether C doubles are big-endian IEEE 754 binary64... " >&6; } if test "${ac_cv_big_endian_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -21765,37 +22308,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_big_endian_double=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_big_endian_double=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_big_endian_double" >&5 -echo "${ECHO_T}$ac_cv_big_endian_double" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_big_endian_double" >&5 +$as_echo "$ac_cv_big_endian_double" >&6; } if test "$ac_cv_big_endian_double" = yes then @@ -21809,10 +22355,10 @@ # While Python doesn't currently have full support for these platforms # (see e.g., issue 1762561), we can at least make sure that float <-> string # conversions work. -{ echo "$as_me:$LINENO: checking whether C doubles are ARM mixed-endian IEEE 754 binary64" >&5 -echo $ECHO_N "checking whether C doubles are ARM mixed-endian IEEE 754 binary64... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether C doubles are ARM mixed-endian IEEE 754 binary64" >&5 +$as_echo_n "checking whether C doubles are ARM mixed-endian IEEE 754 binary64... " >&6; } if test "${ac_cv_mixed_endian_double+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -21841,37 +22387,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_mixed_endian_double=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_mixed_endian_double=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_mixed_endian_double" >&5 -echo "${ECHO_T}$ac_cv_mixed_endian_double" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_mixed_endian_double" >&5 +$as_echo "$ac_cv_mixed_endian_double" >&6; } if test "$ac_cv_mixed_endian_double" = yes then @@ -21891,8 +22440,8 @@ then # Check that it's okay to use gcc inline assembler to get and set # x87 control word. It should be, but you never know... - { echo "$as_me:$LINENO: checking whether we can use gcc inline assembler to get and set x87 control word" >&5 -echo $ECHO_N "checking whether we can use gcc inline assembler to get and set x87 control word... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether we can use gcc inline assembler to get and set x87 control word" >&5 +$as_echo_n "checking whether we can use gcc inline assembler to get and set x87 control word... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21918,28 +22467,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then have_gcc_asm_for_x87=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 have_gcc_asm_for_x87=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { echo "$as_me:$LINENO: result: $have_gcc_asm_for_x87" >&5 -echo "${ECHO_T}$have_gcc_asm_for_x87" >&6; } + { $as_echo "$as_me:$LINENO: result: $have_gcc_asm_for_x87" >&5 +$as_echo "$have_gcc_asm_for_x87" >&6; } if test "$have_gcc_asm_for_x87" = yes then @@ -21955,8 +22505,8 @@ # IEEE 754 platforms. On IEEE 754, test should return 1 if rounding # mode is round-to-nearest and double rounding issues are present, and # 0 otherwise. See http://bugs.python.org/issue2937 for more info. -{ echo "$as_me:$LINENO: checking for x87-style double rounding" >&5 -echo $ECHO_N "checking for x87-style double rounding... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for x87-style double rounding" >&5 +$as_echo_n "checking for x87-style double rounding... " >&6; } # $BASECFLAGS may affect the result ac_save_cc="$CC" CC="$CC $BASECFLAGS" @@ -21996,36 +22546,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_x87_double_rounding=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_x87_double_rounding=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CC="$ac_save_cc" -{ echo "$as_me:$LINENO: result: $ac_cv_x87_double_rounding" >&5 -echo "${ECHO_T}$ac_cv_x87_double_rounding" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_x87_double_rounding" >&5 +$as_echo "$ac_cv_x87_double_rounding" >&6; } if test "$ac_cv_x87_double_rounding" = yes then @@ -22044,10 +22597,10 @@ # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of # -0. on some architectures. -{ echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5 -echo $ECHO_N "checking whether tanh preserves the sign of zero... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5 +$as_echo_n "checking whether tanh preserves the sign of zero... " >&6; } if test "${ac_cv_tanh_preserves_zero_sign+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -22078,37 +22631,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_tanh_preserves_zero_sign=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_tanh_preserves_zero_sign=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_tanh_preserves_zero_sign" >&5 -echo "${ECHO_T}$ac_cv_tanh_preserves_zero_sign" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_tanh_preserves_zero_sign" >&5 +$as_echo "$ac_cv_tanh_preserves_zero_sign" >&6; } if test "$ac_cv_tanh_preserves_zero_sign" = yes then @@ -22129,11 +22685,11 @@ for ac_func in acosh asinh atanh copysign expm1 finite hypot log1p round do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22186,44 +22742,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done -{ echo "$as_me:$LINENO: checking whether isinf is declared" >&5 -echo $ECHO_N "checking whether isinf is declared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether isinf is declared" >&5 +$as_echo_n "checking whether isinf is declared... " >&6; } if test "${ac_cv_have_decl_isinf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22250,20 +22813,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_isinf=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_isinf=no @@ -22271,9 +22835,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5 -echo "${ECHO_T}$ac_cv_have_decl_isinf" >&6; } -if test $ac_cv_have_decl_isinf = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5 +$as_echo "$ac_cv_have_decl_isinf" >&6; } +if test "x$ac_cv_have_decl_isinf" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ISINF 1 @@ -22287,10 +22851,10 @@ fi -{ echo "$as_me:$LINENO: checking whether isnan is declared" >&5 -echo $ECHO_N "checking whether isnan is declared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether isnan is declared" >&5 +$as_echo_n "checking whether isnan is declared... " >&6; } if test "${ac_cv_have_decl_isnan+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22317,20 +22881,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_isnan=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_isnan=no @@ -22338,9 +22903,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5 -echo "${ECHO_T}$ac_cv_have_decl_isnan" >&6; } -if test $ac_cv_have_decl_isnan = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5 +$as_echo "$ac_cv_have_decl_isnan" >&6; } +if test "x$ac_cv_have_decl_isnan" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ISNAN 1 @@ -22354,10 +22919,10 @@ fi -{ echo "$as_me:$LINENO: checking whether isfinite is declared" >&5 -echo $ECHO_N "checking whether isfinite is declared... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether isfinite is declared" >&5 +$as_echo_n "checking whether isfinite is declared... " >&6; } if test "${ac_cv_have_decl_isfinite+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22384,20 +22949,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_isfinite=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_isfinite=no @@ -22405,9 +22971,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5 -echo "${ECHO_T}$ac_cv_have_decl_isfinite" >&6; } -if test $ac_cv_have_decl_isfinite = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5 +$as_echo "$ac_cv_have_decl_isfinite" >&6; } +if test "x$ac_cv_have_decl_isfinite" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ISFINITE 1 @@ -22427,14 +22993,16 @@ LIBS=$LIBS_SAVE # Multiprocessing check for broken sem_getvalue -{ echo "$as_me:$LINENO: checking for broken sem_getvalue" >&5 -echo $ECHO_N "checking for broken sem_getvalue... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for broken sem_getvalue" >&5 +$as_echo_n "checking for broken sem_getvalue... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22471,30 +23039,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_BROKEN_SEM_GETVALUE 1 @@ -22502,14 +23072,15 @@ fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi # determine what size digit to use for Python's longs -{ echo "$as_me:$LINENO: checking digit size for Python's longs" >&5 -echo $ECHO_N "checking digit size for Python's longs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking digit size for Python's longs" >&5 +$as_echo_n "checking digit size for Python's longs... " >&6; } # Check whether --enable-big-digits was given. if test "${enable_big_digits+set}" = set; then enableval=$enable_big_digits; case $enable_big_digits in @@ -22520,12 +23091,12 @@ 15|30) ;; *) - { { echo "$as_me:$LINENO: error: bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30" >&5 -echo "$as_me: error: bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30" >&2;} + { { $as_echo "$as_me:$LINENO: error: bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30" >&5 +$as_echo "$as_me: error: bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30" >&2;} { (exit 1); exit 1; }; } ;; esac -{ echo "$as_me:$LINENO: result: $enable_big_digits" >&5 -echo "${ECHO_T}$enable_big_digits" >&6; } +{ $as_echo "$as_me:$LINENO: result: $enable_big_digits" >&5 +$as_echo "$enable_big_digits" >&6; } cat >>confdefs.h <<_ACEOF #define PYLONG_BITS_IN_DIGIT $enable_big_digits @@ -22533,24 +23104,24 @@ else - { echo "$as_me:$LINENO: result: no value specified" >&5 -echo "${ECHO_T}no value specified" >&6; } + { $as_echo "$as_me:$LINENO: result: no value specified" >&5 +$as_echo "no value specified" >&6; } fi # check for wchar.h if test "${ac_cv_header_wchar_h+set}" = set; then - { echo "$as_me:$LINENO: checking for wchar.h" >&5 -echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for wchar.h" >&5 +$as_echo_n "checking for wchar.h... " >&6; } if test "${ac_cv_header_wchar_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 -echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 +$as_echo "$ac_cv_header_wchar_h" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking wchar.h usability" >&5 -echo $ECHO_N "checking wchar.h usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking wchar.h usability" >&5 +$as_echo_n "checking wchar.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -22566,32 +23137,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking wchar.h presence" >&5 -echo $ECHO_N "checking wchar.h presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking wchar.h presence" >&5 +$as_echo_n "checking wchar.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -22605,51 +23177,52 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: wchar.h: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: wchar.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: wchar.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: wchar.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: wchar.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: wchar.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: wchar.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: wchar.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: wchar.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: wchar.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: wchar.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -22658,18 +23231,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for wchar.h" >&5 -echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for wchar.h" >&5 +$as_echo_n "checking for wchar.h... " >&6; } if test "${ac_cv_header_wchar_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_wchar_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 -echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 +$as_echo "$ac_cv_header_wchar_h" >&6; } fi -if test $ac_cv_header_wchar_h = yes; then +if test "x$ac_cv_header_wchar_h" = x""yes; then cat >>confdefs.h <<\_ACEOF @@ -22688,69 +23261,14 @@ # determine wchar_t size if test "$wchar_h" = yes then - { echo "$as_me:$LINENO: checking for wchar_t" >&5 -echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6; } -if test "${ac_cv_type_wchar_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -typedef wchar_t ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_wchar_t=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_wchar_t=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_wchar_t" >&5 -echo "${ECHO_T}$ac_cv_type_wchar_t" >&6; } - -# The cast to long int works around a bug in the HP C Compiler + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of wchar_t" >&5 -echo $ECHO_N "checking size of wchar_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of wchar_t" >&5 +$as_echo_n "checking size of wchar_t... " >&6; } if test "${ac_cv_sizeof_wchar_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -22762,11 +23280,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) >= 0)]; test_array [0] = 0 ; @@ -22779,13 +23296,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -22800,11 +23318,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -22817,20 +23334,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -22844,7 +23362,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -22855,11 +23373,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) < 0)]; test_array [0] = 0 ; @@ -22872,13 +23389,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -22893,11 +23411,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) >= $ac_mid)]; test_array [0] = 0 ; @@ -22910,20 +23427,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -22937,7 +23455,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -22958,11 +23476,10 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) <= $ac_mid)]; test_array [0] = 0 ; @@ -22975,20 +23492,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -22999,11 +23517,13 @@ case $ac_lo in ?*) ac_cv_sizeof_wchar_t=$ac_lo;; '') if test "$ac_cv_type_wchar_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (wchar_t) +$as_echo "$as_me: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_wchar_t=0 fi ;; @@ -23017,9 +23537,8 @@ /* end confdefs.h. */ #include - typedef wchar_t ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (wchar_t)); } +static unsigned long int ulongval () { return (long int) (sizeof (wchar_t)); } #include #include int @@ -23029,20 +23548,22 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (wchar_t))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (wchar_t)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (wchar_t)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -23055,43 +23576,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_wchar_t=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_wchar_t" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (wchar_t) +$as_echo "$as_me: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_wchar_t=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5 -echo "${ECHO_T}$ac_cv_sizeof_wchar_t" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5 +$as_echo "$ac_cv_sizeof_wchar_t" >&6; } @@ -23102,8 +23628,8 @@ fi -{ echo "$as_me:$LINENO: checking for UCS-4 tcl" >&5 -echo $ECHO_N "checking for UCS-4 tcl... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for UCS-4 tcl" >&5 +$as_echo_n "checking for UCS-4 tcl... " >&6; } have_ucs4_tcl=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23130,13 +23656,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -23150,24 +23677,24 @@ have_ucs4_tcl=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $have_ucs4_tcl" >&5 -echo "${ECHO_T}$have_ucs4_tcl" >&6; } +{ $as_echo "$as_me:$LINENO: result: $have_ucs4_tcl" >&5 +$as_echo "$have_ucs4_tcl" >&6; } # check whether wchar_t is signed or not if test "$wchar_h" = yes then # check whether wchar_t is signed or not - { echo "$as_me:$LINENO: checking whether wchar_t is signed" >&5 -echo $ECHO_N "checking whether wchar_t is signed... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether wchar_t is signed" >&5 +$as_echo_n "checking whether wchar_t is signed... " >&6; } if test "${ac_cv_wchar_t_signed+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -23194,41 +23721,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_wchar_t_signed=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_wchar_t_signed=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi - { echo "$as_me:$LINENO: result: $ac_cv_wchar_t_signed" >&5 -echo "${ECHO_T}$ac_cv_wchar_t_signed" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_cv_wchar_t_signed" >&5 +$as_echo "$ac_cv_wchar_t_signed" >&6; } fi -{ echo "$as_me:$LINENO: checking what type to use for str" >&5 -echo $ECHO_N "checking what type to use for str... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking what type to use for str" >&5 +$as_echo_n "checking what type to use for str... " >&6; } # Check whether --with-wide-unicode was given. if test "${with_wide_unicode+set}" = set; then @@ -23278,49 +23808,195 @@ #define PY_UNICODE_TYPE wchar_t _ACEOF -elif test "$ac_cv_sizeof_short" = "$unicode_size" -then - PY_UNICODE_TYPE="unsigned short" - cat >>confdefs.h <<\_ACEOF -#define PY_UNICODE_TYPE unsigned short +elif test "$ac_cv_sizeof_short" = "$unicode_size" +then + PY_UNICODE_TYPE="unsigned short" + cat >>confdefs.h <<\_ACEOF +#define PY_UNICODE_TYPE unsigned short +_ACEOF + +elif test "$ac_cv_sizeof_long" = "$unicode_size" +then + PY_UNICODE_TYPE="unsigned long" + cat >>confdefs.h <<\_ACEOF +#define PY_UNICODE_TYPE unsigned long +_ACEOF + +else + PY_UNICODE_TYPE="no type found" +fi +{ $as_echo "$as_me:$LINENO: result: $PY_UNICODE_TYPE" >&5 +$as_echo "$PY_UNICODE_TYPE" >&6; } + +# check for endianness + + { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + + # Check for potential -arch flags. It is not universal unless + # there are some -arch flags. Note that *ppc* also matches + # ppc64. This check is also rather less than ideal. + case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( + *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; + esac +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + # It does; now see whether it defined to BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} _ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_bigendian=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -elif test "$ac_cv_sizeof_long" = "$unicode_size" -then - PY_UNICODE_TYPE="unsigned long" - cat >>confdefs.h <<\_ACEOF -#define PY_UNICODE_TYPE unsigned long -_ACEOF + ac_cv_c_bigendian=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - PY_UNICODE_TYPE="no type found" + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -{ echo "$as_me:$LINENO: result: $PY_UNICODE_TYPE" >&5 -echo "${ECHO_T}$PY_UNICODE_TYPE" >&6; } -# check for endianness -{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include +#include int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ - && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) - bogus endian macros -#endif +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif ; return 0; @@ -23332,33 +24008,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include +#include int main () { -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif +#ifndef _BIG_ENDIAN + not big endian + #endif ; return 0; @@ -23370,20 +24046,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no @@ -23391,29 +24068,44 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - # It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then + # Try to guess by grepping values from an object file. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + int main () { - _ascii (); _ebcdic (); +return use_ascii (foo) == use_ebcdic (foo); ; return 0; } @@ -23424,30 +24116,31 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -23466,14 +24159,14 @@ main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; ; return 0; @@ -23485,63 +24178,70 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + fi fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } -case $ac_cv_c_bigendian in - yes) +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF +;; #( + no) + ;; #( + universal) cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 +#define AC_APPLE_UNIVERSAL_BUILD 1 _ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + + ;; #( + *) + { { $as_echo "$as_me:$LINENO: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +$as_echo "$as_me: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; -esac + esac # Check whether right shifting a negative integer extends the sign bit # or fills with zeros (like the Cray J90, according to Tim Peters). -{ echo "$as_me:$LINENO: checking whether right shift extends the sign bit" >&5 -echo $ECHO_N "checking whether right shift extends the sign bit... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether right shift extends the sign bit" >&5 +$as_echo_n "checking whether right shift extends the sign bit... " >&6; } if test "${ac_cv_rshift_extends_sign+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -23566,37 +24266,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_rshift_extends_sign=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_rshift_extends_sign=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_rshift_extends_sign" >&5 -echo "${ECHO_T}$ac_cv_rshift_extends_sign" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_rshift_extends_sign" >&5 +$as_echo "$ac_cv_rshift_extends_sign" >&6; } if test "$ac_cv_rshift_extends_sign" = no then @@ -23607,10 +24310,10 @@ fi # check for getc_unlocked and related locking functions -{ echo "$as_me:$LINENO: checking for getc_unlocked() and friends" >&5 -echo $ECHO_N "checking for getc_unlocked() and friends... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for getc_unlocked() and friends" >&5 +$as_echo_n "checking for getc_unlocked() and friends... " >&6; } if test "${ac_cv_have_getc_unlocked+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -23639,32 +24342,36 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_have_getc_unlocked=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_getc_unlocked=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_getc_unlocked" >&5 -echo "${ECHO_T}$ac_cv_have_getc_unlocked" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_getc_unlocked" >&5 +$as_echo "$ac_cv_have_getc_unlocked" >&6; } if test "$ac_cv_have_getc_unlocked" = yes then @@ -23682,8 +24389,8 @@ # library. NOTE: Keep the precedence of listed libraries synchronised # with setup.py. py_cv_lib_readline=no -{ echo "$as_me:$LINENO: checking how to link readline libs" >&5 -echo $ECHO_N "checking how to link readline libs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to link readline libs" >&5 +$as_echo_n "checking how to link readline libs... " >&6; } for py_libtermcap in "" ncursesw ncurses curses termcap; do if test -z "$py_libtermcap"; then READLINE_LIBS="-lreadline" @@ -23719,26 +24426,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then py_cv_lib_readline=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test $py_cv_lib_readline = yes; then @@ -23748,11 +24459,11 @@ # Uncomment this line if you want to use READINE_LIBS in Makefile or scripts #AC_SUBST([READLINE_LIBS]) if test $py_cv_lib_readline = no; then - { echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6; } + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } else - { echo "$as_me:$LINENO: result: $READLINE_LIBS" >&5 -echo "${ECHO_T}$READLINE_LIBS" >&6; } + { $as_echo "$as_me:$LINENO: result: $READLINE_LIBS" >&5 +$as_echo "$READLINE_LIBS" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_LIBREADLINE 1 @@ -23761,10 +24472,10 @@ fi # check for readline 2.1 -{ echo "$as_me:$LINENO: checking for rl_callback_handler_install in -lreadline" >&5 -echo $ECHO_N "checking for rl_callback_handler_install in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_callback_handler_install in -lreadline" >&5 +$as_echo_n "checking for rl_callback_handler_install in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_callback_handler_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -23796,33 +24507,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_callback_handler_install=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_callback_handler_install=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_callback_handler_install" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_callback_handler_install" >&6; } -if test $ac_cv_lib_readline_rl_callback_handler_install = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_callback_handler_install" >&5 +$as_echo "$ac_cv_lib_readline_rl_callback_handler_install" >&6; } +if test "x$ac_cv_lib_readline_rl_callback_handler_install" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_CALLBACK 1 @@ -23845,20 +24560,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then have_readline=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 have_readline=no @@ -23889,10 +24605,10 @@ fi # check for readline 4.0 -{ echo "$as_me:$LINENO: checking for rl_pre_input_hook in -lreadline" >&5 -echo $ECHO_N "checking for rl_pre_input_hook in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_pre_input_hook in -lreadline" >&5 +$as_echo_n "checking for rl_pre_input_hook in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_pre_input_hook+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -23924,33 +24640,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_pre_input_hook=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_pre_input_hook=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_pre_input_hook" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_pre_input_hook" >&6; } -if test $ac_cv_lib_readline_rl_pre_input_hook = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_pre_input_hook" >&5 +$as_echo "$ac_cv_lib_readline_rl_pre_input_hook" >&6; } +if test "x$ac_cv_lib_readline_rl_pre_input_hook" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_PRE_INPUT_HOOK 1 @@ -23960,10 +24680,10 @@ # also in 4.0 -{ echo "$as_me:$LINENO: checking for rl_completion_display_matches_hook in -lreadline" >&5 -echo $ECHO_N "checking for rl_completion_display_matches_hook in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_completion_display_matches_hook in -lreadline" >&5 +$as_echo_n "checking for rl_completion_display_matches_hook in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_completion_display_matches_hook+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -23995,33 +24715,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_completion_display_matches_hook=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_completion_display_matches_hook=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_display_matches_hook" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6; } -if test $ac_cv_lib_readline_rl_completion_display_matches_hook = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_display_matches_hook" >&5 +$as_echo "$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6; } +if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1 @@ -24031,10 +24755,10 @@ # check for readline 4.2 -{ echo "$as_me:$LINENO: checking for rl_completion_matches in -lreadline" >&5 -echo $ECHO_N "checking for rl_completion_matches in -lreadline... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for rl_completion_matches in -lreadline" >&5 +$as_echo_n "checking for rl_completion_matches in -lreadline... " >&6; } if test "${ac_cv_lib_readline_rl_completion_matches+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -24066,33 +24790,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_readline_rl_completion_matches=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_completion_matches=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_matches" >&5 -echo "${ECHO_T}$ac_cv_lib_readline_rl_completion_matches" >&6; } -if test $ac_cv_lib_readline_rl_completion_matches = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_matches" >&5 +$as_echo "$ac_cv_lib_readline_rl_completion_matches" >&6; } +if test "x$ac_cv_lib_readline_rl_completion_matches" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_COMPLETION_MATCHES 1 @@ -24115,20 +24843,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then have_readline=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 have_readline=no @@ -24161,10 +24890,10 @@ # End of readline checks: restore LIBS LIBS=$LIBS_no_readline -{ echo "$as_me:$LINENO: checking for broken nice()" >&5 -echo $ECHO_N "checking for broken nice()... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for broken nice()" >&5 +$as_echo_n "checking for broken nice()... " >&6; } if test "${ac_cv_broken_nice+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -24192,37 +24921,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_broken_nice=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_broken_nice=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_broken_nice" >&5 -echo "${ECHO_T}$ac_cv_broken_nice" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_nice" >&5 +$as_echo "$ac_cv_broken_nice" >&6; } if test "$ac_cv_broken_nice" = yes then @@ -24232,8 +24964,8 @@ fi -{ echo "$as_me:$LINENO: checking for broken poll()" >&5 -echo $ECHO_N "checking for broken poll()... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for broken poll()" >&5 +$as_echo_n "checking for broken poll()... " >&6; } if test "$cross_compiling" = yes; then ac_cv_broken_poll=no else @@ -24275,35 +25007,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_broken_poll=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_broken_poll=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_broken_poll" >&5 -echo "${ECHO_T}$ac_cv_broken_poll" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_poll" >&5 +$as_echo "$ac_cv_broken_poll" >&6; } if test "$ac_cv_broken_poll" = yes then @@ -24316,10 +25051,10 @@ # Before we can test tzset, we need to check if struct tm has a tm_zone # (which is not required by ISO C or UNIX spec) and/or if we support # tzname[] -{ echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 -echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 +$as_echo_n "checking for struct tm.tm_zone... " >&6; } if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24347,20 +25082,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -24389,20 +25125,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_zone=no @@ -24413,9 +25150,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 -echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6; } -if test $ac_cv_member_struct_tm_tm_zone = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 +$as_echo "$ac_cv_member_struct_tm_tm_zone" >&6; } +if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 @@ -24431,10 +25168,10 @@ _ACEOF else - { echo "$as_me:$LINENO: checking whether tzname is declared" >&5 -echo $ECHO_N "checking whether tzname is declared... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether tzname is declared" >&5 +$as_echo_n "checking whether tzname is declared... " >&6; } if test "${ac_cv_have_decl_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24461,20 +25198,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_tzname=no @@ -24482,9 +25220,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 -echo "${ECHO_T}$ac_cv_have_decl_tzname" >&6; } -if test $ac_cv_have_decl_tzname = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 +$as_echo "$ac_cv_have_decl_tzname" >&6; } +if test "x$ac_cv_have_decl_tzname" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_TZNAME 1 @@ -24500,10 +25238,10 @@ fi - { echo "$as_me:$LINENO: checking for tzname" >&5 -echo $ECHO_N "checking for tzname... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for tzname" >&5 +$as_echo_n "checking for tzname... " >&6; } if test "${ac_cv_var_tzname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24530,31 +25268,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_var_tzname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_var_tzname=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 -echo "${ECHO_T}$ac_cv_var_tzname" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 +$as_echo "$ac_cv_var_tzname" >&6; } if test $ac_cv_var_tzname = yes; then cat >>confdefs.h <<\_ACEOF @@ -24566,10 +25308,10 @@ # check tzset(3) exists and works like we expect it to -{ echo "$as_me:$LINENO: checking for working tzset()" >&5 -echo $ECHO_N "checking for working tzset()... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for working tzset()" >&5 +$as_echo_n "checking for working tzset()... " >&6; } if test "${ac_cv_working_tzset+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then @@ -24652,37 +25394,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_working_tzset=yes else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_working_tzset=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_working_tzset" >&5 -echo "${ECHO_T}$ac_cv_working_tzset" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_working_tzset" >&5 +$as_echo "$ac_cv_working_tzset" >&6; } if test "$ac_cv_working_tzset" = yes then @@ -24693,10 +25438,10 @@ fi # Look for subsecond timestamps in struct stat -{ echo "$as_me:$LINENO: checking for tv_nsec in struct stat" >&5 -echo $ECHO_N "checking for tv_nsec in struct stat... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for tv_nsec in struct stat" >&5 +$as_echo_n "checking for tv_nsec in struct stat... " >&6; } if test "${ac_cv_stat_tv_nsec+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24722,20 +25467,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_stat_tv_nsec=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_stat_tv_nsec=no @@ -24744,8 +25490,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec" >&5 -echo "${ECHO_T}$ac_cv_stat_tv_nsec" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec" >&5 +$as_echo "$ac_cv_stat_tv_nsec" >&6; } if test "$ac_cv_stat_tv_nsec" = yes then @@ -24756,10 +25502,10 @@ fi # Look for BSD style subsecond timestamps in struct stat -{ echo "$as_me:$LINENO: checking for tv_nsec2 in struct stat" >&5 -echo $ECHO_N "checking for tv_nsec2 in struct stat... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for tv_nsec2 in struct stat" >&5 +$as_echo_n "checking for tv_nsec2 in struct stat... " >&6; } if test "${ac_cv_stat_tv_nsec2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24785,20 +25531,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_stat_tv_nsec2=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_stat_tv_nsec2=no @@ -24807,8 +25554,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec2" >&5 -echo "${ECHO_T}$ac_cv_stat_tv_nsec2" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec2" >&5 +$as_echo "$ac_cv_stat_tv_nsec2" >&6; } if test "$ac_cv_stat_tv_nsec2" = yes then @@ -24819,10 +25566,10 @@ fi # On HP/UX 11.0, mvwdelch is a block with a return statement -{ echo "$as_me:$LINENO: checking whether mvwdelch is an expression" >&5 -echo $ECHO_N "checking whether mvwdelch is an expression... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether mvwdelch is an expression" >&5 +$as_echo_n "checking whether mvwdelch is an expression... " >&6; } if test "${ac_cv_mvwdelch_is_expression+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24848,20 +25595,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_mvwdelch_is_expression=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_mvwdelch_is_expression=no @@ -24870,8 +25618,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_mvwdelch_is_expression" >&5 -echo "${ECHO_T}$ac_cv_mvwdelch_is_expression" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_mvwdelch_is_expression" >&5 +$as_echo "$ac_cv_mvwdelch_is_expression" >&6; } if test "$ac_cv_mvwdelch_is_expression" = yes then @@ -24882,10 +25630,10 @@ fi -{ echo "$as_me:$LINENO: checking whether WINDOW has _flags" >&5 -echo $ECHO_N "checking whether WINDOW has _flags... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether WINDOW has _flags" >&5 +$as_echo_n "checking whether WINDOW has _flags... " >&6; } if test "${ac_cv_window_has_flags+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -24911,20 +25659,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_window_has_flags=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_window_has_flags=no @@ -24933,8 +25682,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_window_has_flags" >&5 -echo "${ECHO_T}$ac_cv_window_has_flags" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_window_has_flags" >&5 +$as_echo "$ac_cv_window_has_flags" >&6; } if test "$ac_cv_window_has_flags" = yes @@ -24946,8 +25695,8 @@ fi -{ echo "$as_me:$LINENO: checking for is_term_resized" >&5 -echo $ECHO_N "checking for is_term_resized... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for is_term_resized" >&5 +$as_echo_n "checking for is_term_resized... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -24969,13 +25718,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -24985,21 +25735,21 @@ #define HAVE_CURSES_IS_TERM_RESIZED 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for resize_term" >&5 -echo $ECHO_N "checking for resize_term... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for resize_term" >&5 +$as_echo_n "checking for resize_term... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -25021,13 +25771,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -25037,21 +25788,21 @@ #define HAVE_CURSES_RESIZE_TERM 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for resizeterm" >&5 -echo $ECHO_N "checking for resizeterm... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for resizeterm" >&5 +$as_echo_n "checking for resizeterm... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -25073,13 +25824,14 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -25089,61 +25841,63 @@ #define HAVE_CURSES_RESIZETERM 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: checking for /dev/ptmx" >&5 -echo $ECHO_N "checking for /dev/ptmx... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for /dev/ptmx" >&5 +$as_echo_n "checking for /dev/ptmx... " >&6; } if test -r /dev/ptmx then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_DEV_PTMX 1 _ACEOF else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -{ echo "$as_me:$LINENO: checking for /dev/ptc" >&5 -echo $ECHO_N "checking for /dev/ptc... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for /dev/ptc" >&5 +$as_echo_n "checking for /dev/ptc... " >&6; } if test -r /dev/ptc then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_DEV_PTC 1 _ACEOF else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -{ echo "$as_me:$LINENO: checking for %zd printf() format support" >&5 -echo $ECHO_N "checking for %zd printf() format support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for %zd printf() format support" >&5 +$as_echo_n "checking for %zd printf() format support... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -25192,47 +25946,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } cat >>confdefs.h <<\_ACEOF #define PY_FORMAT_SIZE_T "z" _ACEOF else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: checking for socklen_t" >&5 -echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for socklen_t" >&5 +$as_echo_n "checking for socklen_t... " >&6; } if test "${ac_cv_type_socklen_t+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_cv_type_socklen_t=no +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -25247,14 +26005,53 @@ #endif -typedef socklen_t ac__type_new_; int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) +if (sizeof (socklen_t)) + return 0; + ; return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + + +int +main () +{ +if (sizeof ((socklen_t))) + return 0; ; return 0; } @@ -25265,30 +26062,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_socklen_t=yes + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_socklen_t=yes +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_socklen_t=no + fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 -echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; } -if test $ac_cv_type_socklen_t = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 +$as_echo "$ac_cv_type_socklen_t" >&6; } +if test "x$ac_cv_type_socklen_t" = x""yes; then : else @@ -25299,8 +26105,8 @@ fi -{ echo "$as_me:$LINENO: checking for broken mbstowcs" >&5 -echo $ECHO_N "checking for broken mbstowcs... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for broken mbstowcs" >&5 +$as_echo_n "checking for broken mbstowcs... " >&6; } if test "$cross_compiling" = yes; then ac_cv_broken_mbstowcs=no else @@ -25326,35 +26132,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_broken_mbstowcs=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_broken_mbstowcs=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_broken_mbstowcs" >&5 -echo "${ECHO_T}$ac_cv_broken_mbstowcs" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_mbstowcs" >&5 +$as_echo "$ac_cv_broken_mbstowcs" >&6; } if test "$ac_cv_broken_mbstowcs" = yes then @@ -25365,8 +26174,8 @@ fi # Check for --with-computed-gotos -{ echo "$as_me:$LINENO: checking for --with-computed-gotos" >&5 -echo $ECHO_N "checking for --with-computed-gotos... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for --with-computed-gotos" >&5 +$as_echo_n "checking for --with-computed-gotos... " >&6; } # Check whether --with-computed-gotos was given. if test "${with_computed_gotos+set}" = set; then @@ -25378,14 +26187,14 @@ #define USE_COMPUTED_GOTOS 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +else { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -25399,18 +26208,18 @@ SRCDIRS="Parser Grammar Objects Python Modules Mac" -{ echo "$as_me:$LINENO: checking for build directories" >&5 -echo $ECHO_N "checking for build directories... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for build directories" >&5 +$as_echo_n "checking for build directories... " >&6; } for dir in $SRCDIRS; do if test ! -d $dir; then mkdir $dir fi done -{ echo "$as_me:$LINENO: result: done" >&5 -echo "${ECHO_T}done" >&6; } +{ $as_echo "$as_me:$LINENO: result: done" >&5 +$as_echo "done" >&6; } # generate output files -ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config" +ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config Misc/python.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -25439,11 +26248,12 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -25476,12 +26286,12 @@ if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -25497,7 +26307,7 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -25509,12 +26319,14 @@ + : ${CONFIG_STATUS=./config.status} +ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -25527,7 +26339,7 @@ SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -25537,7 +26349,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -25559,17 +26371,45 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' else - PATH_SEPARATOR=: + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' fi - rm -f conf$$.sh + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. @@ -25585,8 +26425,6 @@ # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -25609,7 +26447,7 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -25622,17 +26460,10 @@ PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -25654,7 +26485,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -25705,7 +26536,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -25733,7 +26564,6 @@ *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -25746,19 +26576,22 @@ rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -25783,10 +26616,10 @@ as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -25809,7 +26642,7 @@ # values after options handling. ac_log=" This file was extended by python $as_me 3.1, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -25822,29 +26655,39 @@ _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" +config_files="`echo $ac_config_files`" +config_headers="`echo $ac_config_headers`" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. -Usage: $0 [OPTIONS] [FILE]... +Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages + -q, --quiet, --silent + do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -25855,24 +26698,24 @@ Report bugs to ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ python config.status 3.1 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2006 Free Software Foundation, Inc. +Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do @@ -25894,30 +26737,36 @@ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; + $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 + { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 + -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -25936,30 +26785,32 @@ fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + exec "\$@" fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - echo "$ac_log" + $as_echo "$ac_log" } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets @@ -25972,9 +26823,10 @@ "Mac/Resources/app/Info.plist") CONFIG_FILES="$CONFIG_FILES Mac/Resources/app/Info.plist" ;; "Makefile.pre") CONFIG_FILES="$CONFIG_FILES Makefile.pre" ;; "Modules/Setup.config") CONFIG_FILES="$CONFIG_FILES Modules/Setup.config" ;; + "Misc/python.pc") CONFIG_FILES="$CONFIG_FILES Misc/python.pc" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done @@ -26014,224 +26866,145 @@ (umask 077 && mkdir "$tmp") } || { - echo "$me: cannot create a temporary directory in ." >&2 + $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then -_ACEOF +ac_cr=' +' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -VERSION!$VERSION$ac_delim -SOVERSION!$SOVERSION$ac_delim -CONFIG_ARGS!$CONFIG_ARGS$ac_delim -UNIVERSALSDK!$UNIVERSALSDK$ac_delim -ARCH_RUN_32BIT!$ARCH_RUN_32BIT$ac_delim -PYTHONFRAMEWORK!$PYTHONFRAMEWORK$ac_delim -PYTHONFRAMEWORKIDENTIFIER!$PYTHONFRAMEWORKIDENTIFIER$ac_delim -PYTHONFRAMEWORKDIR!$PYTHONFRAMEWORKDIR$ac_delim -PYTHONFRAMEWORKPREFIX!$PYTHONFRAMEWORKPREFIX$ac_delim -PYTHONFRAMEWORKINSTALLDIR!$PYTHONFRAMEWORKINSTALLDIR$ac_delim -FRAMEWORKINSTALLFIRST!$FRAMEWORKINSTALLFIRST$ac_delim -FRAMEWORKINSTALLLAST!$FRAMEWORKINSTALLLAST$ac_delim -FRAMEWORKALTINSTALLFIRST!$FRAMEWORKALTINSTALLFIRST$ac_delim -FRAMEWORKALTINSTALLLAST!$FRAMEWORKALTINSTALLLAST$ac_delim -FRAMEWORKUNIXTOOLSPREFIX!$FRAMEWORKUNIXTOOLSPREFIX$ac_delim -MACHDEP!$MACHDEP$ac_delim -SGI_ABI!$SGI_ABI$ac_delim -CONFIGURE_MACOSX_DEPLOYMENT_TARGET!$CONFIGURE_MACOSX_DEPLOYMENT_TARGET$ac_delim -EXPORT_MACOSX_DEPLOYMENT_TARGET!$EXPORT_MACOSX_DEPLOYMENT_TARGET$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -CXX!$CXX$ac_delim -MAINCC!$MAINCC$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -BUILDEXEEXT!$BUILDEXEEXT$ac_delim -LIBRARY!$LIBRARY$ac_delim -LDLIBRARY!$LDLIBRARY$ac_delim -DLLLIBRARY!$DLLLIBRARY$ac_delim -BLDLIBRARY!$BLDLIBRARY$ac_delim -LDLIBRARYDIR!$LDLIBRARYDIR$ac_delim -INSTSONAME!$INSTSONAME$ac_delim -RUNSHARED!$RUNSHARED$ac_delim -LINKCC!$LINKCC$ac_delim -GNULD!$GNULD$ac_delim -RANLIB!$RANLIB$ac_delim -AR!$AR$ac_delim -ARFLAGS!$ARFLAGS$ac_delim -SVNVERSION!$SVNVERSION$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -LN!$LN$ac_delim -OPT!$OPT$ac_delim -BASECFLAGS!$BASECFLAGS$ac_delim -UNIVERSAL_ARCH_FLAGS!$UNIVERSAL_ARCH_FLAGS$ac_delim -OTHER_LIBTOOL_OPT!$OTHER_LIBTOOL_OPT$ac_delim -LIBTOOL_CRUFT!$LIBTOOL_CRUFT$ac_delim -SO!$SO$ac_delim -LDSHARED!$LDSHARED$ac_delim -BLDSHARED!$BLDSHARED$ac_delim -CCSHARED!$CCSHARED$ac_delim -LINKFORSHARED!$LINKFORSHARED$ac_delim -CFLAGSFORSHARED!$CFLAGSFORSHARED$ac_delim -_ACEOF + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done +rm -f conf$$subs.sh -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + print line +} -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHLIBS!$SHLIBS$ac_delim -USE_SIGNAL_MODULE!$USE_SIGNAL_MODULE$ac_delim -SIGNAL_OBJS!$SIGNAL_OBJS$ac_delim -USE_THREAD_MODULE!$USE_THREAD_MODULE$ac_delim -LDLAST!$LDLAST$ac_delim -THREADOBJ!$THREADOBJ$ac_delim -DLINCLDIR!$DLINCLDIR$ac_delim -DYNLOADFILE!$DYNLOADFILE$ac_delim -MACHDEP_OBJS!$MACHDEP_OBJS$ac_delim -TRUE!$TRUE$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -HAVE_GETHOSTBYNAME_R_6_ARG!$HAVE_GETHOSTBYNAME_R_6_ARG$ac_delim -HAVE_GETHOSTBYNAME_R_5_ARG!$HAVE_GETHOSTBYNAME_R_5_ARG$ac_delim -HAVE_GETHOSTBYNAME_R_3_ARG!$HAVE_GETHOSTBYNAME_R_3_ARG$ac_delim -HAVE_GETHOSTBYNAME_R!$HAVE_GETHOSTBYNAME_R$ac_delim -HAVE_GETHOSTBYNAME!$HAVE_GETHOSTBYNAME$ac_delim -LIBM!$LIBM$ac_delim -LIBC!$LIBC$ac_delim -THREADHEADERS!$THREADHEADERS$ac_delim -SRCDIRS!$SRCDIRS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACAWK _ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 21; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof _ACEOF - # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty @@ -26247,19 +27020,133 @@ }' fi -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 +$as_echo "$as_me: error: could not setup config headers machinery" >&2;} + { (exit 1); exit 1; }; } +fi # test -n "$CONFIG_HEADERS" + -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " +shift +for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; @@ -26288,26 +27175,38 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac - ac_file_inputs="$ac_file_inputs $ac_f" + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; esac ;; esac @@ -26317,7 +27216,7 @@ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | +$as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -26343,7 +27242,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -26352,7 +27251,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -26373,17 +27272,17 @@ test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -26423,12 +27322,13 @@ esac _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= -case `sed -n '/datarootdir/ { +ac_sed_dataroot=' +/datarootdir/ { p q } @@ -26437,13 +27337,14 @@ /@infodir@/p /@localedir@/p /@mandir@/p -' $ac_file_inputs` in +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g @@ -26457,15 +27358,16 @@ # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t +s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t @@ -26475,119 +27377,58 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} else - rm -f $ac_file - mv "$tmp/config.h" $ac_file + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } fi else - echo "/* $configure_input */" - cat "$ac_result" + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 +$as_echo "$as_me: error: could not create -" >&2;} + { (exit 1); exit 1; }; } fi - rm -f "$tmp/out12" ;; @@ -26601,6 +27442,11 @@ chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -26622,6 +27468,10 @@ # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi echo "creating Modules/Setup" Modified: python/branches/py3k/configure.in ============================================================================== --- python/branches/py3k/configure.in (original) +++ python/branches/py3k/configure.in Sun May 24 22:39:11 2009 @@ -3897,7 +3897,7 @@ AC_MSG_RESULT(done) # generate output files -AC_CONFIG_FILES(Makefile.pre Modules/Setup.config) +AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc) AC_OUTPUT echo "creating Modules/Setup" Modified: python/branches/py3k/pyconfig.h.in ============================================================================== --- python/branches/py3k/pyconfig.h.in (original) +++ python/branches/py3k/pyconfig.h.in Sun May 24 22:39:11 2009 @@ -5,6 +5,9 @@ #define Py_PYCONFIG_H +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + /* Define for AIX if your compiler is a genuine IBM xlC/xlC_r and you want support for AIX C++ shared extension modules. */ #undef AIX_GENUINE_CPLUSPLUS @@ -992,6 +995,28 @@ /* Define if you want to use computed gotos in ceval.c. */ #undef USE_COMPUTED_GOTOS +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + /* Define if a va_list is an array of some kind */ #undef VA_LIST_IS_ARRAY @@ -1029,20 +1054,21 @@ /* Define to profile with the Pentium timestamp counter */ #undef WITH_TSC -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif /* Define if arithmetic is subject to x87-style double rounding issue */ #undef X87_DOUBLE_ROUNDING -/* Define to 1 if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif - /* Define on OpenBSD to activate all library features */ #undef _BSD_SOURCE @@ -1061,15 +1087,25 @@ /* This must be defined on some systems to enable large file support. */ #undef _LARGEFILE_SOURCE +/* Define to 1 if on MINIX. */ +#undef _MINIX + /* Define on NetBSD to activate all library features */ #undef _NETBSD_SOURCE /* Define _OSF_SOURCE to get the makedev macro. */ #undef _OSF_SOURCE +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + /* Define to activate features from IEEE Stds 1003.1-2001 */ #undef _POSIX_C_SOURCE +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE + /* Define if you have POSIX threads, and your system does not define that. */ #undef _POSIX_THREADS @@ -1077,12 +1113,12 @@ #undef _REENTRANT /* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or is not used. If the typedef was allowed, the + , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT32_T /* Define for Solaris 2.5.1 so the uint64_t typedef from , - , or is not used. If the typedef was allowed, the + , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT64_T From python-checkins at python.org Sun May 24 22:46:06 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 24 May 2009 22:46:06 +0200 (CEST) Subject: [Python-checkins] r72900 - in python/trunk: .bzrignore .hgignore Misc Message-ID: <20090524204606.7BA90C461@mail.python.org> Author: antoine.pitrou Date: Sun May 24 22:46:06 2009 New Revision: 72900 Log: Add Misc/python.pc to the list of ignored files Modified: python/trunk/.bzrignore python/trunk/.hgignore python/trunk/Misc/ (props changed) Modified: python/trunk/.bzrignore ============================================================================== --- python/trunk/.bzrignore (original) +++ python/trunk/.bzrignore Sun May 24 22:46:06 2009 @@ -39,6 +39,7 @@ Doc/tools/jinja Doc/tools/pygments Doc/tools/docutils +Misc/python.pc Modules/Setup Modules/Setup.config Modules/Setup.local Modified: python/trunk/.hgignore ============================================================================== --- python/trunk/.hgignore (original) +++ python/trunk/.hgignore Sun May 24 22:46:06 2009 @@ -40,6 +40,7 @@ Doc/tools/docutils/ Doc/tools/jinja/ Doc/tools/pygments/ +Misc/python.pc Modules/Setup Modules/Setup.config Modules/Setup.local @@ -66,4 +67,4 @@ PCbuild/*.o PCbuild/*.ncb PCbuild/*.bsc -PCbuild/Win32-temp-* \ No newline at end of file +PCbuild/Win32-temp-* From python-checkins at python.org Sun May 24 22:47:04 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 24 May 2009 22:47:04 +0200 (CEST) Subject: [Python-checkins] r72901 - in python/branches/py3k: .bzrignore .hgignore Misc Message-ID: <20090524204704.E87EDC461@mail.python.org> Author: antoine.pitrou Date: Sun May 24 22:47:04 2009 New Revision: 72901 Log: Merged revisions 72900 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72900 | antoine.pitrou | 2009-05-24 22:46:06 +0200 (dim., 24 mai 2009) | 3 lines Add Misc/python.pc to the list of ignored files ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/.bzrignore python/branches/py3k/.hgignore python/branches/py3k/Misc/ (props changed) Modified: python/branches/py3k/.bzrignore ============================================================================== --- python/branches/py3k/.bzrignore (original) +++ python/branches/py3k/.bzrignore Sun May 24 22:47:04 2009 @@ -39,6 +39,7 @@ Doc/tools/jinja Doc/tools/pygments Doc/tools/docutils +Misc/python.pc Modules/Setup Modules/Setup.config Modules/Setup.local Modified: python/branches/py3k/.hgignore ============================================================================== --- python/branches/py3k/.hgignore (original) +++ python/branches/py3k/.hgignore Sun May 24 22:47:04 2009 @@ -40,6 +40,7 @@ Doc/tools/docutils/ Doc/tools/jinja/ Doc/tools/pygments/ +Misc/python.pc Modules/Setup Modules/Setup.config Modules/Setup.local @@ -66,4 +67,4 @@ PCbuild/*.o PCbuild/*.ncb PCbuild/*.bsc -PCbuild/Win32-temp-* \ No newline at end of file +PCbuild/Win32-temp-* From buildbot at python.org Sun May 24 23:05:14 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 24 May 2009 21:05:14 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090524210514.E41EAC41B@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/736 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_import test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sun May 24 23:25:50 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 24 May 2009 23:25:50 +0200 (CEST) Subject: [Python-checkins] r72902 - in python/branches/py3k/Modules: _functoolsmodule.c posixmodule.c Message-ID: <20090524212550.1B58CD3FD@mail.python.org> Author: antoine.pitrou Date: Sun May 24 23:25:49 2009 New Revision: 72902 Log: Make some private functions static (thanks `make smelly`) Modified: python/branches/py3k/Modules/_functoolsmodule.c python/branches/py3k/Modules/posixmodule.c Modified: python/branches/py3k/Modules/_functoolsmodule.c ============================================================================== --- python/branches/py3k/Modules/_functoolsmodule.c (original) +++ python/branches/py3k/Modules/_functoolsmodule.c Sun May 24 23:25:49 2009 @@ -203,7 +203,7 @@ it as a hook to do stange things. */ -PyObject * +static PyObject * partial_reduce(partialobject *pto, PyObject *unused) { return Py_BuildValue("O(O)(OOOO)", Py_TYPE(pto), pto->fn, pto->fn, @@ -211,7 +211,7 @@ pto->dict ? pto->dict : Py_None); } -PyObject * +static PyObject * partial_setstate(partialobject *pto, PyObject *args) { PyObject *fn, *fnargs, *kw, *dict; Modified: python/branches/py3k/Modules/posixmodule.c ============================================================================== --- python/branches/py3k/Modules/posixmodule.c (original) +++ python/branches/py3k/Modules/posixmodule.c Sun May 24 23:25:49 2009 @@ -3117,6 +3117,7 @@ PyMem_DEL(array); } +static int fsconvert_strdup(PyObject *o, char**out) { PyObject *bytes; From buildbot at python.org Mon May 25 00:44:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 24 May 2009 22:44:35 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090524224435.41145C4B0@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/387 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Mon May 25 01:13:33 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 25 May 2009 01:13:33 +0200 (CEST) Subject: [Python-checkins] r72903 - python/trunk/Modules/threadmodule.c Message-ID: <20090524231333.16B7FC366@mail.python.org> Author: benjamin.peterson Date: Mon May 25 01:13:32 2009 New Revision: 72903 Log: stop using Py_FindMethod Modified: python/trunk/Modules/threadmodule.c Modified: python/trunk/Modules/threadmodule.c ============================================================================== --- python/trunk/Modules/threadmodule.c (original) +++ python/trunk/Modules/threadmodule.c Mon May 25 01:13:32 2009 @@ -116,15 +116,9 @@ METH_VARARGS, acquire_doc}, {"__exit__", (PyCFunction)lock_PyThread_release_lock, METH_VARARGS, release_doc}, - {NULL, NULL} /* sentinel */ + {NULL} /* sentinel */ }; -static PyObject * -lock_getattr(lockobject *self, char *name) -{ - return Py_FindMethod(lock_methods, (PyObject *)self, name); -} - static PyTypeObject Locktype = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "thread.lock", /*tp_name*/ @@ -133,10 +127,28 @@ /* methods */ (destructor)lock_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ - (getattrfunc)lock_getattr, /*tp_getattr*/ + 0, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + 0, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + lock_methods, /* tp_methods */ }; static lockobject * @@ -709,6 +721,8 @@ ThreadError = PyErr_NewException("thread.error", NULL, NULL); PyDict_SetItemString(d, "error", ThreadError); Locktype.tp_doc = lock_doc; + if (PyType_Ready(&Locktype) < 0) + return; Py_INCREF(&Locktype); PyDict_SetItemString(d, "LockType", (PyObject *)&Locktype); From buildbot at python.org Mon May 25 01:15:04 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 24 May 2009 23:15:04 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090524231504.DA164C464@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%20trunk/builds/65 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon May 25 01:31:27 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 25 May 2009 01:31:27 +0200 (CEST) Subject: [Python-checkins] r72904 - python/branches/py3k Message-ID: <20090524233127.96646C468@mail.python.org> Author: benjamin.peterson Date: Mon May 25 01:31:27 2009 New Revision: 72904 Log: Blocked revisions 72903 via svnmerge ........ r72903 | benjamin.peterson | 2009-05-24 18:13:32 -0500 (Sun, 24 May 2009) | 1 line stop using Py_FindMethod ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Mon May 25 02:48:58 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 25 May 2009 02:48:58 +0200 (CEST) Subject: [Python-checkins] r72905 - in python/trunk: Doc/library/unittest.rst Lib/test/test_unittest.py Lib/unittest.py Misc/NEWS Message-ID: <20090525004858.8D5FAC4AE@mail.python.org> Author: benjamin.peterson Date: Mon May 25 02:48:58 2009 New Revision: 72905 Log: make class skipping decorators the same as skipping every test of the class This removes ClassTestSuite and a good bit of hacks. Modified: python/trunk/Doc/library/unittest.rst python/trunk/Lib/test/test_unittest.py python/trunk/Lib/unittest.py python/trunk/Misc/NEWS Modified: python/trunk/Doc/library/unittest.rst ============================================================================== --- python/trunk/Doc/library/unittest.rst (original) +++ python/trunk/Doc/library/unittest.rst Mon May 25 02:48:58 2009 @@ -62,8 +62,7 @@ Test suites are implemented by the :class:`TestSuite` class. This class allows individual tests and test suites to be aggregated; when the suite is executed, -all tests added directly to the suite and in "child" test suites are run. A -:class:`ClassTestSuite` contains the test cases of a class. +all tests added directly to the suite and in "child" test suites are run. A test runner is an object that provides a single method, :meth:`~TestRunner.run`, which accepts a :class:`TestCase` or :class:`TestSuite` @@ -1057,11 +1056,10 @@ test suites that will be used to build the suite initially. Additional methods are provided to add test cases and suites to the collection later on. - :class:`TestSuite` (including :class:`ClassTestSuite`) objects behave much - like :class:`TestCase` objects, except they do not actually implement a test. - Instead, they are used to aggregate tests into groups of tests that should be - run together. Some additional methods are available to add tests to - :class:`TestSuite` instances: + :class:`TestSuite` objects behave much like :class:`TestCase` objects, except + they do not actually implement a test. Instead, they are used to aggregate + tests into groups of tests that should be run together. Some additional + methods are available to add tests to :class:`TestSuite` instances: .. method:: TestSuite.addTest(test) @@ -1118,14 +1116,6 @@ is invoked by a :class:`TestRunner` rather than by the end-user test harness. -.. class:: ClassTestSuite(tests, collected_from) - - This subclass of :class:`TestSuite` repesents an aggregation of individuals - tests from one :class:`TestCase` class. *tests* is an iterable of - :class:`TestCase` instances created from the class. *collected_from* is the - class they came from. - - Loading and running tests ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1229,12 +1219,6 @@ This affects all the :meth:`loadTestsFrom\*` methods. - .. attribute:: classSuiteClass - - Callable object that constructs a test suite for the tests cases from one - class. The default value is :class:`ClassTestSuite`. - - .. class:: TestResult This class is used to compile information about which tests have succeeded Modified: python/trunk/Lib/test/test_unittest.py ============================================================================== --- python/trunk/Lib/test/test_unittest.py (original) +++ python/trunk/Lib/test/test_unittest.py Mon May 25 02:48:58 2009 @@ -107,7 +107,7 @@ # List subclass we can add attributes to. class MyClassSuite(list): - def __init__(self, tests, klass): + def __init__(self, tests): super(MyClassSuite, self).__init__(tests) @@ -1262,7 +1262,7 @@ tests = [Foo('test_1'), Foo('test_2')] loader = unittest.TestLoader() - loader.classSuiteClass = MyClassSuite + loader.suiteClass = list self.assertEqual(loader.loadTestsFromTestCase(Foo), tests) # It is implicit in the documentation for TestLoader.suiteClass that @@ -1275,7 +1275,7 @@ def foo_bar(self): pass m.Foo = Foo - tests = [unittest.ClassTestSuite([Foo('test_1'), Foo('test_2')], Foo)] + tests = [[Foo('test_1'), Foo('test_2')]] loader = unittest.TestLoader() loader.suiteClass = list @@ -1294,7 +1294,7 @@ tests = [Foo('test_1'), Foo('test_2')] loader = unittest.TestLoader() - loader.classSuiteClass = MyClassSuite + loader.suiteClass = list self.assertEqual(loader.loadTestsFromName('Foo', m), tests) # It is implicit in the documentation for TestLoader.suiteClass that @@ -1307,7 +1307,7 @@ def foo_bar(self): pass m.Foo = Foo - tests = [unittest.ClassTestSuite([Foo('test_1'), Foo('test_2')], Foo)] + tests = [[Foo('test_1'), Foo('test_2')]] loader = unittest.TestLoader() loader.suiteClass = list @@ -2871,7 +2871,7 @@ def test_dont_skip(self): pass test_do_skip = Foo("test_skip") test_dont_skip = Foo("test_dont_skip") - suite = unittest.ClassTestSuite([test_do_skip, test_dont_skip], Foo) + suite = unittest.TestSuite([test_do_skip, test_dont_skip]) events = [] result = LoggingResult(events) suite.run(result) @@ -2890,9 +2890,10 @@ record.append(1) record = [] result = unittest.TestResult() - suite = unittest.ClassTestSuite([Foo("test_1")], Foo) + test = Foo("test_1") + suite = unittest.TestSuite([test]) suite.run(result) - self.assertEqual(result.skipped, [(suite, "testing")]) + self.assertEqual(result.skipped, [(test, "testing")]) self.assertEqual(record, []) def test_expected_failure(self): Modified: python/trunk/Lib/unittest.py ============================================================================== --- python/trunk/Lib/unittest.py (original) +++ python/trunk/Lib/unittest.py Mon May 25 02:48:58 2009 @@ -59,7 +59,7 @@ ############################################################################## # Exported classes and functions ############################################################################## -__all__ = ['TestResult', 'TestCase', 'TestSuite', 'ClassTestSuite', +__all__ = ['TestResult', 'TestCase', 'TestSuite', 'TextTestRunner', 'TestLoader', 'FunctionTestCase', 'main', 'defaultTestLoader', 'SkipTest', 'skip', 'skipIf', 'skipUnless', 'expectedFailure'] @@ -458,6 +458,13 @@ self._resultForDoCleanups = result result.startTest(self) + if getattr(self.__class__, "__unittest_skip__", False): + # If the whole class was skipped. + try: + result.addSkip(self, self.__class__.__unittest_skip_why__) + finally: + result.stopTest(self) + return testMethod = getattr(self, self._testMethodName) try: success = False @@ -1110,37 +1117,6 @@ test.debug() -class ClassTestSuite(TestSuite): - """ - Suite of tests derived from a single TestCase class. - """ - - def __init__(self, tests, class_collected_from): - super(ClassTestSuite, self).__init__(tests) - self.collected_from = class_collected_from - - def id(self): - module = getattr(self.collected_from, "__module__", None) - if module is not None: - return "{0}.{1}".format(module, self.collected_from.__name__) - return self.collected_from.__name__ - - def run(self, result): - if getattr(self.collected_from, "__unittest_skip__", False): - # ClassTestSuite result pretends to be a TestCase enough to be - # reported. - result.startTest(self) - try: - result.addSkip(self, self.collected_from.__unittest_skip_why__) - finally: - result.stopTest(self) - else: - result = super(ClassTestSuite, self).run(result) - return result - - shortDescription = id - - class FunctionTestCase(TestCase): """A test case that wraps a test function. @@ -1213,7 +1189,6 @@ testMethodPrefix = 'test' sortTestMethodsUsing = cmp suiteClass = TestSuite - classSuiteClass = ClassTestSuite def loadTestsFromTestCase(self, testCaseClass): """Return a suite of all tests cases contained in testCaseClass""" @@ -1223,8 +1198,7 @@ testCaseNames = self.getTestCaseNames(testCaseClass) if not testCaseNames and hasattr(testCaseClass, 'runTest'): testCaseNames = ['runTest'] - suite = self.classSuiteClass(map(testCaseClass, testCaseNames), - testCaseClass) + suite = self.suiteClass(map(testCaseClass, testCaseNames)) return suite def loadTestsFromModule(self, module): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon May 25 02:48:58 2009 @@ -302,6 +302,9 @@ Library ------- +- In unittest, using a skipping decorator on a class is now equivalent to + skipping every test on the class. The ClassTestSuite class has been removed. + - Issue #6050: Don't fail extracting a directory from a zipfile if the directory already exists. From python-checkins at python.org Mon May 25 02:51:58 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 25 May 2009 02:51:58 +0200 (CEST) Subject: [Python-checkins] r72906 - in python/branches/py3k: Doc/library/unittest.rst Lib/test/test_unittest.py Lib/unittest.py Misc/NEWS Message-ID: <20090525005158.8AE0AC4BA@mail.python.org> Author: benjamin.peterson Date: Mon May 25 02:51:58 2009 New Revision: 72906 Log: Merged revisions 72905 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72905 | benjamin.peterson | 2009-05-24 19:48:58 -0500 (Sun, 24 May 2009) | 4 lines make class skipping decorators the same as skipping every test of the class This removes ClassTestSuite and a good bit of hacks. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/unittest.rst python/branches/py3k/Lib/test/test_unittest.py python/branches/py3k/Lib/unittest.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Doc/library/unittest.rst ============================================================================== --- python/branches/py3k/Doc/library/unittest.rst (original) +++ python/branches/py3k/Doc/library/unittest.rst Mon May 25 02:51:58 2009 @@ -60,8 +60,7 @@ Test suites are implemented by the :class:`TestSuite` class. This class allows individual tests and test suites to be aggregated; when the suite is executed, -all tests added directly to the suite and in "child" test suites are run. A -:class:`ClassTestSuite` contains the test cases of a class. +all tests added directly to the suite and in "child" test suites are run. A test runner is an object that provides a single method, :meth:`~TestRunner.run`, which accepts a :class:`TestCase` or :class:`TestSuite` @@ -1032,11 +1031,10 @@ test suites that will be used to build the suite initially. Additional methods are provided to add test cases and suites to the collection later on. - :class:`TestSuite` (including :class:`ClassTestSuite`) objects behave much - like :class:`TestCase` objects, except they do not actually implement a test. - Instead, they are used to aggregate tests into groups of tests that should be - run together. Some additional methods are available to add tests to - :class:`TestSuite` instances: + :class:`TestSuite` objects behave much like :class:`TestCase` objects, except + they do not actually implement a test. Instead, they are used to aggregate + tests into groups of tests that should be run together. Some additional + methods are available to add tests to :class:`TestSuite` instances: .. method:: TestSuite.addTest(test) @@ -1093,14 +1091,6 @@ is invoked by a :class:`TestRunner` rather than by the end-user test harness. -.. class:: ClassTestSuite(tests, collected_from) - - This subclass of :class:`TestSuite` repesents an aggregation of individuals - tests from one :class:`TestCase` class. *tests* is an iterable of - :class:`TestCase` instances created from the class. *collected_from* is the - class they came from. - - Loading and running tests ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1202,12 +1192,6 @@ This affects all the :meth:`loadTestsFrom\*` methods. - .. attribute:: classSuiteClass - - Callable object that constructs a test suite for the tests cases from one - class. The default value is :class:`ClassTestSuite`. - - .. class:: TestResult This class is used to compile information about which tests have succeeded Modified: python/branches/py3k/Lib/test/test_unittest.py ============================================================================== --- python/branches/py3k/Lib/test/test_unittest.py (original) +++ python/branches/py3k/Lib/test/test_unittest.py Mon May 25 02:51:58 2009 @@ -106,7 +106,7 @@ # List subclass we can add attributes to. class MyClassSuite(list): - def __init__(self, tests, klass): + def __init__(self, tests): super(MyClassSuite, self).__init__(tests) @@ -1271,7 +1271,7 @@ tests = [Foo('test_1'), Foo('test_2')] loader = unittest.TestLoader() - loader.classSuiteClass = MyClassSuite + loader.suiteClass = list self.assertEqual(loader.loadTestsFromTestCase(Foo), tests) # It is implicit in the documentation for TestLoader.suiteClass that @@ -1284,7 +1284,7 @@ def foo_bar(self): pass m.Foo = Foo - tests = [unittest.ClassTestSuite([Foo('test_1'), Foo('test_2')], Foo)] + tests = [[Foo('test_1'), Foo('test_2')]] loader = unittest.TestLoader() loader.suiteClass = list @@ -1303,7 +1303,7 @@ tests = [Foo('test_1'), Foo('test_2')] loader = unittest.TestLoader() - loader.classSuiteClass = MyClassSuite + loader.suiteClass = list self.assertEqual(loader.loadTestsFromName('Foo', m), tests) # It is implicit in the documentation for TestLoader.suiteClass that @@ -1316,7 +1316,7 @@ def foo_bar(self): pass m.Foo = Foo - tests = [unittest.ClassTestSuite([Foo('test_1'), Foo('test_2')], Foo)] + tests = [[Foo('test_1'), Foo('test_2')]] loader = unittest.TestLoader() loader.suiteClass = list @@ -2842,7 +2842,7 @@ def test_dont_skip(self): pass test_do_skip = Foo("test_skip") test_dont_skip = Foo("test_dont_skip") - suite = unittest.ClassTestSuite([test_do_skip, test_dont_skip], Foo) + suite = unittest.TestSuite([test_do_skip, test_dont_skip]) events = [] result = LoggingResult(events) suite.run(result) @@ -2861,9 +2861,10 @@ record.append(1) record = [] result = unittest.TestResult() - suite = unittest.ClassTestSuite([Foo("test_1")], Foo) + test = Foo("test_1") + suite = unittest.TestSuite([test]) suite.run(result) - self.assertEqual(result.skipped, [(suite, "testing")]) + self.assertEqual(result.skipped, [(test, "testing")]) self.assertEqual(record, []) def test_expected_failure(self): Modified: python/branches/py3k/Lib/unittest.py ============================================================================== --- python/branches/py3k/Lib/unittest.py (original) +++ python/branches/py3k/Lib/unittest.py Mon May 25 02:51:58 2009 @@ -59,7 +59,7 @@ ############################################################################## # Exported classes and functions ############################################################################## -__all__ = ['TestResult', 'TestCase', 'TestSuite', 'ClassTestSuite', +__all__ = ['TestResult', 'TestCase', 'TestSuite', 'TextTestRunner', 'TestLoader', 'FunctionTestCase', 'main', 'defaultTestLoader', 'SkipTest', 'skip', 'skipIf', 'skipUnless', 'expectedFailure'] @@ -459,6 +459,13 @@ self._result = result result.startTest(self) + if getattr(self.__class__, "__unittest_skip__", False): + # If the whole class was skipped. + try: + result.addSkip(self, self.__class__.__unittest_skip_why__) + finally: + result.stopTest(self) + return testMethod = getattr(self, self._testMethodName) try: success = False @@ -1129,37 +1136,6 @@ test.debug() -class ClassTestSuite(TestSuite): - """ - Suite of tests derived from a single TestCase class. - """ - - def __init__(self, tests, class_collected_from): - super(ClassTestSuite, self).__init__(tests) - self.collected_from = class_collected_from - - def id(self): - module = getattr(self.collected_from, "__module__", None) - if module is not None: - return "{0}.{1}".format(module, self.collected_from.__name__) - return self.collected_from.__name__ - - def run(self, result): - if getattr(self.collected_from, "__unittest_skip__", False): - # ClassTestSuite result pretends to be a TestCase enough to be - # reported. - result.startTest(self) - try: - result.addSkip(self, self.collected_from.__unittest_skip_why__) - finally: - result.stopTest(self) - else: - result = super(ClassTestSuite, self).run(result) - return result - - shortDescription = id - - class FunctionTestCase(TestCase): """A test case that wraps a test function. @@ -1245,7 +1221,6 @@ testMethodPrefix = 'test' sortTestMethodsUsing = staticmethod(three_way_cmp) suiteClass = TestSuite - classSuiteClass = ClassTestSuite def loadTestsFromTestCase(self, testCaseClass): """Return a suite of all tests cases contained in testCaseClass""" @@ -1255,8 +1230,7 @@ testCaseNames = self.getTestCaseNames(testCaseClass) if not testCaseNames and hasattr(testCaseClass, 'runTest'): testCaseNames = ['runTest'] - suite = self.classSuiteClass(map(testCaseClass, testCaseNames), - testCaseClass) + suite = self.suiteClass(map(testCaseClass, testCaseNames)) return suite def loadTestsFromModule(self, module): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon May 25 02:51:58 2009 @@ -32,6 +32,9 @@ Library ------- +- In unittest, using a skipping decorator on a class is now equivalent to + skipping every test on the class. The ClassTestSuite class has been removed. + - Issue #6050: Don't fail extracting a directory from a zipfile if the directory already exists. From buildbot at python.org Mon May 25 03:33:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 25 May 2009 01:33:00 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090525013301.1A112C336@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1370 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Mon May 25 04:40:21 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 25 May 2009 04:40:21 +0200 (CEST) Subject: [Python-checkins] r72907 - in python/trunk: Lib/test/test_descr.py Objects/abstract.c Objects/enumobject.c Objects/object.c Python/sysmodule.c Message-ID: <20090525024021.A4875D340@mail.python.org> Author: benjamin.peterson Date: Mon May 25 04:40:21 2009 New Revision: 72907 Log: handle errors from _PyObject_LookupSpecial when __get__ fails Modified: python/trunk/Lib/test/test_descr.py python/trunk/Objects/abstract.c python/trunk/Objects/enumobject.c python/trunk/Objects/object.c python/trunk/Python/sysmodule.c Modified: python/trunk/Lib/test/test_descr.py ============================================================================== --- python/trunk/Lib/test/test_descr.py (original) +++ python/trunk/Lib/test/test_descr.py Mon May 25 04:40:21 2009 @@ -1722,7 +1722,11 @@ def __get__(self, obj, owner): record.append(1) return self.impl.__get__(obj, owner) - + class MyException(Exception): + pass + class ErrDescr(object): + def __get__(self, obj, owner): + raise MyException for name, runner, meth_impl, ok, env in specials: class X(Checker): @@ -1741,6 +1745,18 @@ runner(X()) self.assertEqual(record, [1], name) + class X(Checker): + pass + for attr, obj in env.iteritems(): + setattr(X, attr, obj) + setattr(X, name, ErrDescr()) + try: + runner(X()) + except MyException: + pass + else: + self.fail("{0!r} didn't raise".format(name)) + def test_specials(self): # Testing special operators... # Test operators like __hash__ for which a built-in default exists Modified: python/trunk/Objects/abstract.c ============================================================================== --- python/trunk/Objects/abstract.c (original) +++ python/trunk/Objects/abstract.c Mon May 25 04:40:21 2009 @@ -111,8 +111,12 @@ return defaultvalue; /* try o.__length_hint__() */ hintmeth = _PyObject_LookupSpecial(o, "__length_hint__", &hintstrobj); - if (hintmeth == NULL) - return defaultvalue; + if (hintmeth == NULL) { + if (PyErr_Occurred()) + return -1; + else + return defaultvalue; + } ro = PyObject_CallFunctionObjArgs(hintmeth, NULL); Py_DECREF(hintmeth); if (ro == NULL) { @@ -2945,6 +2949,8 @@ } return ok; } + else if (PyErr_Occurred()) + return -1; } return recursive_isinstance(inst, cls); } @@ -3021,6 +3027,9 @@ } return ok; } + else if (PyErr_Occurred()) { + return -1; + } } return recursive_issubclass(derived, cls); } Modified: python/trunk/Objects/enumobject.c ============================================================================== --- python/trunk/Objects/enumobject.c (original) +++ python/trunk/Objects/enumobject.c Mon May 25 04:40:21 2009 @@ -241,9 +241,12 @@ return NULL; } } - else + else { reversed_meth = _PyObject_LookupSpecial(seq, "__reversed__", &reversed_cache); + if (reversed_meth == NULL && PyErr_Occurred()) + return NULL; + } if (reversed_meth != NULL) { PyObject *res = PyObject_CallFunctionObjArgs(reversed_meth, NULL); Py_DECREF(reversed_meth); Modified: python/trunk/Objects/object.c ============================================================================== --- python/trunk/Objects/object.c (original) +++ python/trunk/Objects/object.c Mon May 25 04:40:21 2009 @@ -509,6 +509,8 @@ res = PyObject_CallFunctionObjArgs(func, NULL); Py_DECREF(func); } + else if (PyErr_Occurred()) + return NULL; } /* Didn't find __unicode__ */ Modified: python/trunk/Python/sysmodule.c ============================================================================== --- python/trunk/Python/sysmodule.c (original) +++ python/trunk/Python/sysmodule.c Mon May 25 04:40:21 2009 @@ -669,10 +669,12 @@ else { PyObject *method = _PyObject_LookupSpecial(o, "__sizeof__", &str__sizeof__); - if (method == NULL) - PyErr_Format(PyExc_TypeError, - "Type %.100s doesn't define __sizeof__", - Py_TYPE(o)->tp_name); + if (method == NULL) { + if (!PyErr_Occurred()) + PyErr_Format(PyExc_TypeError, + "Type %.100s doesn't define __sizeof__", + Py_TYPE(o)->tp_name); + } else { res = PyObject_CallFunctionObjArgs(method, NULL); Py_DECREF(method); From buildbot at python.org Mon May 25 04:52:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 25 May 2009 02:52:48 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090525025248.17135D2AC@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/738 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou,benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Mon May 25 05:10:48 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 25 May 2009 05:10:48 +0200 (CEST) Subject: [Python-checkins] r72908 - in python/branches/py3k: Lib/test/test_descr.py Objects/abstract.c Objects/enumobject.c Objects/object.c Python/sysmodule.c Message-ID: <20090525031048.84E4BD31A@mail.python.org> Author: benjamin.peterson Date: Mon May 25 05:10:48 2009 New Revision: 72908 Log: Merged revisions 72907 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72907 | benjamin.peterson | 2009-05-24 21:40:21 -0500 (Sun, 24 May 2009) | 1 line handle errors from _PyObject_LookupSpecial when __get__ fails ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_descr.py python/branches/py3k/Objects/abstract.c python/branches/py3k/Objects/enumobject.c python/branches/py3k/Objects/object.c python/branches/py3k/Python/sysmodule.c Modified: python/branches/py3k/Lib/test/test_descr.py ============================================================================== --- python/branches/py3k/Lib/test/test_descr.py (original) +++ python/branches/py3k/Lib/test/test_descr.py Mon May 25 05:10:48 2009 @@ -1595,7 +1595,11 @@ def __get__(self, obj, owner): record.append(1) return self.impl.__get__(obj, owner) - + class MyException(Exception): + pass + class ErrDescr(object): + def __get__(self, obj, owner): + raise MyException for name, runner, meth_impl, ok, env in specials: class X(Checker): @@ -1614,6 +1618,18 @@ runner(X()) self.assertEqual(record, [1], name) + class X(Checker): + pass + for attr, obj in env.items(): + setattr(X, attr, obj) + setattr(X, name, ErrDescr()) + try: + runner(X()) + except MyException: + pass + else: + self.fail("{0!r} didn't raise".format(name)) + def test_specials(self): # Testing special operators... # Test operators like __hash__ for which a built-in default exists Modified: python/branches/py3k/Objects/abstract.c ============================================================================== --- python/branches/py3k/Objects/abstract.c (original) +++ python/branches/py3k/Objects/abstract.c Mon May 25 05:10:48 2009 @@ -90,8 +90,12 @@ /* try o.__length_hint__() */ hintmeth = _PyObject_LookupSpecial(o, "__length_hint__", &hintstrobj); - if (hintmeth == NULL) - return defaultvalue; + if (hintmeth == NULL) { + if (PyErr_Occurred()) + return -1; + else + return defaultvalue; + } ro = PyObject_CallFunctionObjArgs(hintmeth, NULL); Py_DECREF(hintmeth); if (ro == NULL) { @@ -2592,6 +2596,8 @@ } return ok; } + else if (PyErr_Occurred()) + return -1; return recursive_isinstance(inst, cls); } @@ -2655,6 +2661,8 @@ } return ok; } + else if (PyErr_Occurred()) + return -1; return recursive_issubclass(derived, cls); } Modified: python/branches/py3k/Objects/enumobject.c ============================================================================== --- python/branches/py3k/Objects/enumobject.c (original) +++ python/branches/py3k/Objects/enumobject.c Mon May 25 05:10:48 2009 @@ -238,6 +238,8 @@ Py_DECREF(reversed_meth); return res; } + else if (PyErr_Occurred()) + return NULL; if (!PySequence_Check(seq)) { PyErr_SetString(PyExc_TypeError, Modified: python/branches/py3k/Objects/object.c ============================================================================== --- python/branches/py3k/Objects/object.c (original) +++ python/branches/py3k/Objects/object.c Mon May 25 05:10:48 2009 @@ -497,6 +497,8 @@ } return result; } + else if (PyErr_Occurred()) + return NULL; return PyBytes_FromObject(v); } Modified: python/branches/py3k/Python/sysmodule.c ============================================================================== --- python/branches/py3k/Python/sysmodule.c (original) +++ python/branches/py3k/Python/sysmodule.c Mon May 25 05:10:48 2009 @@ -652,10 +652,12 @@ method = _PyObject_LookupSpecial(o, "__sizeof__", &str__sizeof__); - if (method == NULL) - PyErr_Format(PyExc_TypeError, - "Type %.100s doesn't define __sizeof__", - Py_TYPE(o)->tp_name); + if (method == NULL) { + if (!PyErr_Occurred()) + PyErr_Format(PyExc_TypeError, + "Type %.100s doesn't define __sizeof__", + Py_TYPE(o)->tp_name); + } else { res = PyObject_CallFunctionObjArgs(method, NULL); Py_DECREF(method); From buildbot at python.org Mon May 25 05:54:09 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 25 May 2009 03:54:09 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090525035409.2712AC396@mail.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/611 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou,martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 533, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' 1 test failed: test_import ====================================================================== ERROR: testImport (test.test_import.ImportTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 61, in test_with_extension mod = __import__(TESTFN) ImportError: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 533, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 533, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' sincerely, -The Buildbot From buildbot at python.org Mon May 25 06:34:02 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 25 May 2009 04:34:02 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090525043404.1FB1BD268@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/798 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon May 25 06:34:39 2009 From: python-checkins at python.org (collin.winter) Date: Mon, 25 May 2009 06:34:39 +0200 (CEST) Subject: [Python-checkins] r72909 - python/trunk/Modules/cPickle.c Message-ID: <20090525043439.B0C4DC345@mail.python.org> Author: collin.winter Date: Mon May 25 06:34:39 2009 New Revision: 72909 Log: Issue 5670: special-case pickling of dicts. This nearly doubles the performance of dict pickling in cPickle. Modified: python/trunk/Modules/cPickle.c Modified: python/trunk/Modules/cPickle.c ============================================================================== --- python/trunk/Modules/cPickle.c (original) +++ python/trunk/Modules/cPickle.c Mon May 25 06:34:39 2009 @@ -1860,13 +1860,74 @@ return -1; } +/* This is a variant of batch_dict() above that specializes for dicts, with no + * support for dict subclasses. Like batch_dict(), we batch up chunks of + * MARK key value ... key value SETITEMS + * opcode sequences. Calling code should have arranged to first create an + * empty dict, or dict-like object, for the SETITEMS to operate on. + * Returns 0 on success, -1 on error. + * + * Note that this currently doesn't work for protocol 0. + */ +static int +batch_dict_exact(Picklerobject *self, PyObject *obj) +{ + PyObject *key = NULL, *value = NULL; + int i; + Py_ssize_t dict_size, ppos = 0; + + static char setitem = SETITEM; + static char setitems = SETITEMS; + + assert(obj != NULL); + assert(self->proto > 0); + + dict_size = PyDict_Size(obj); + + /* Special-case len(d) == 1 to save space. */ + if (dict_size == 1) { + PyDict_Next(obj, &ppos, &key, &value); + if (save(self, key, 0) < 0) + return -1; + if (save(self, value, 0) < 0) + return -1; + if (self->write_func(self, &setitem, 1) < 0) + return -1; + return 0; + } + + /* Write in batches of BATCHSIZE. */ + do { + i = 0; + if (self->write_func(self, &MARKv, 1) < 0) + return -1; + while (PyDict_Next(obj, &ppos, &key, &value)) { + if (save(self, key, 0) < 0) + return -1; + if (save(self, value, 0) < 0) + return -1; + if (++i == BATCHSIZE) + break; + } + if (self->write_func(self, &setitems, 1) < 0) + return -1; + if (PyDict_Size(obj) != dict_size) { + PyErr_Format( + PyExc_RuntimeError, + "dictionary changed size during iteration"); + return -1; + } + + } while (i == BATCHSIZE); + return 0; +} + static int save_dict(Picklerobject *self, PyObject *args) { int res = -1; char s[3]; int len; - PyObject *iter; if (self->fast && !fast_save_enter(self, args)) goto finally; @@ -1898,15 +1959,23 @@ goto finally; /* Materialize the dict items. */ - iter = PyObject_CallMethod(args, "iteritems", "()"); - if (iter == NULL) - goto finally; - if (Py_EnterRecursiveCall(" while pickling an object") == 0) - { - res = batch_dict(self, iter); - Py_LeaveRecursiveCall(); + if (PyDict_CheckExact(args) && self->proto > 0) { + /* We can take certain shortcuts if we know this is a dict and + not a dict subclass. */ + if (Py_EnterRecursiveCall(" while pickling an object") == 0) { + res = batch_dict_exact(self, args); + Py_LeaveRecursiveCall(); + } + } else { + PyObject *iter = PyObject_CallMethod(args, "iteritems", "()"); + if (iter == NULL) + goto finally; + if (Py_EnterRecursiveCall(" while pickling an object") == 0) { + res = batch_dict(self, iter); + Py_LeaveRecursiveCall(); + } + Py_DECREF(iter); } - Py_DECREF(iter); finally: if (self->fast && !fast_save_leave(self, args)) From python-checkins at python.org Mon May 25 07:43:30 2009 From: python-checkins at python.org (collin.winter) Date: Mon, 25 May 2009 07:43:30 +0200 (CEST) Subject: [Python-checkins] r72910 - in python/branches/py3k: Modules/_pickle.c Message-ID: <20090525054330.E8DB9C4B1@mail.python.org> Author: collin.winter Date: Mon May 25 07:43:30 2009 New Revision: 72910 Log: Merged revisions 72909 via svnmerge from http://svn.python.org/projects/python/trunk Note that the performance improvement for the py3k branch is not as high as for trunk. ........ r72909 | collin.winter | 2009-05-24 21:34:39 -0700 (Sun, 24 May 2009) | 2 lines Issue 5670: special-case pickling of dicts. This nearly doubles the performance of dict pickling in cPickle. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Modules/_pickle.c Modified: python/branches/py3k/Modules/_pickle.c ============================================================================== --- python/branches/py3k/Modules/_pickle.c (original) +++ python/branches/py3k/Modules/_pickle.c Mon May 25 07:43:30 2009 @@ -1699,6 +1699,69 @@ return -1; } +/* This is a variant of batch_dict() above that specializes for dicts, with no + * support for dict subclasses. Like batch_dict(), we batch up chunks of + * MARK key value ... key value SETITEMS + * opcode sequences. Calling code should have arranged to first create an + * empty dict, or dict-like object, for the SETITEMS to operate on. + * Returns 0 on success, -1 on error. + * + * Note that this currently doesn't work for protocol 0. + */ +static int +batch_dict_exact(PicklerObject *self, PyObject *obj) +{ + PyObject *key = NULL, *value = NULL; + int i; + Py_ssize_t dict_size, ppos = 0; + + static const char mark_op = MARK; + static const char setitem = SETITEM; + static const char setitems = SETITEMS; + + assert(obj != NULL); + assert(self->proto > 0); + + dict_size = PyDict_Size(obj); + + /* Special-case len(d) == 1 to save space. */ + if (dict_size == 1) { + PyDict_Next(obj, &ppos, &key, &value); + if (save(self, key, 0) < 0) + return -1; + if (save(self, value, 0) < 0) + return -1; + if (pickler_write(self, &setitem, 1) < 0) + return -1; + return 0; + } + + /* Write in batches of BATCHSIZE. */ + do { + i = 0; + if (pickler_write(self, &mark_op, 1) < 0) + return -1; + while (PyDict_Next(obj, &ppos, &key, &value)) { + if (save(self, key, 0) < 0) + return -1; + if (save(self, value, 0) < 0) + return -1; + if (++i == BATCHSIZE) + break; + } + if (pickler_write(self, &setitems, 1) < 0) + return -1; + if (PyDict_Size(obj) != dict_size) { + PyErr_Format( + PyExc_RuntimeError, + "dictionary changed size during iteration"); + return -1; + } + + } while (i == BATCHSIZE); + return 0; +} + static int save_dict(PicklerObject *self, PyObject *obj) { @@ -1733,15 +1796,24 @@ if (len != 0) { /* Save the dict items. */ - items = PyObject_CallMethod(obj, "items", "()"); - if (items == NULL) - goto error; - iter = PyObject_GetIter(items); - Py_DECREF(items); - if (iter == NULL) - goto error; - status = batch_dict(self, iter); - Py_DECREF(iter); + if (PyDict_CheckExact(obj) && self->proto > 0) { + /* We can take certain shortcuts if we know this is a dict and + not a dict subclass. */ + if (Py_EnterRecursiveCall(" while pickling an object") == 0) { + status = batch_dict_exact(self, obj); + Py_LeaveRecursiveCall(); + } + } else { + items = PyObject_CallMethod(obj, "items", "()"); + if (items == NULL) + goto error; + iter = PyObject_GetIter(items); + Py_DECREF(items); + if (iter == NULL) + goto error; + status = batch_dict(self, iter); + Py_DECREF(iter); + } } if (0) { From buildbot at python.org Mon May 25 08:20:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 25 May 2009 06:20:25 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090525062025.37977C377@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/740 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Mon May 25 12:22:46 2009 From: python-checkins at python.org (tarek.ziade) Date: Mon, 25 May 2009 12:22:46 +0200 (CEST) Subject: [Python-checkins] r72911 - peps/trunk/pep-0376.txt Message-ID: <20090525102246.DED6AC461@mail.python.org> Author: tarek.ziade Date: Mon May 25 12:22:46 2009 New Revision: 72911 Log: updated PEP 376 to reflect the prototype API + more details Modified: peps/trunk/pep-0376.txt Modified: peps/trunk/pep-0376.txt ============================================================================== --- peps/trunk/pep-0376.txt (original) +++ peps/trunk/pep-0376.txt Mon May 25 12:22:46 2009 @@ -18,18 +18,20 @@ - A new format for the .egg-info structure. - Some APIs to read the meta-data of a project +- Replace PEP 262 +- An uninstall feature Definitions =========== A **project** is a Python application composed of one or several files, which can -be Python modules, extensions or data. It is distributed using a `setup.py` script -with Distutils and/or Setuptools. The `setup.py` script indicates where each +be Python modules, extensions or data. It is distributed using a `setup.py` script +with Distutils and/or Setuptools. The `setup.py` script indicates where each elements should be installed. Once installed, the elements are located in various places in the system, like: -- in Python's site-packages (Python modules, Python modules organized into packages, +- in Python's site-packages (Python modules, Python modules organized into packages, Extensions, etc.) - in Python's `include` directory. - in Python's `bin` or `Script` directory. @@ -46,16 +48,16 @@ How projects are installed -------------------------- -Right now, when a project is installed in Python, every elements its contains -is installed in various directories. +Right now, when a project is installed in Python, every elements its contains +is installed in various directories. The pure Python code for instance is installed in the `purelib` directory, which is located in the Python installation in `lib\python2.6\site-packages` -for example under unix-like systems or Mac OS X, and in `Lib/site-packages` +for example under unix-like systems or Mac OS X, and in `Lib/site-packages` under Windows. This is done with the Distutils `install` command, which calls various subcommands. -The `install_egg_info` subcommand is called during this process, in order to +The `install_egg_info` subcommand is called during this process, in order to create an `.egg-info` file in the `purelib` directory. For example, if the `zlib` project (which contains one package) is installed, @@ -67,17 +69,17 @@ Where `zlib` is a Python package, and `zlib-2.5.2-py2.4.egg-info` is a file containing the project metadata as described in PEP 314 [#pep314]_. -This file corresponds to the file called `PKG-INFO`, built by +This file corresponds to the file called `PKG-INFO`, built by the `sdist` command. -The problem is that many people use `easy_install` (setuptools [#setuptools]_) -or `pip` [#pip]_ to install their packages, and these third-party tools do not +The problem is that many people use `easy_install` (setuptools [#setuptools]_) +or `pip` [#pip]_ to install their packages, and these third-party tools do not install packages in the same way that Distutils does: -- `easy_install` creates an `EGG-INFO` directory inside an `.egg` directory, - and adds a `PKG-INFO` file inside this directory. The `.egg` directory +- `easy_install` creates an `EGG-INFO` directory inside an `.egg` directory, + and adds a `PKG-INFO` file inside this directory. The `.egg` directory contains in that case all the elements of the project that are supposed to - be installed in `site-packages`, and is placed in the `site-packages` + be installed in `site-packages`, and is placed in the `site-packages` directory. - `pip` creates an `.egg-info` directory inside the `site-packages` directory @@ -97,12 +99,12 @@ And the process differs, depending on the tools you have used to install the project, and if the project's `setup.py` uses Distutils or Setuptools. -Under some circumstances, you might not be able to know for sure that you +Under some circumstances, you might not be able to know for sure that you have removed everything, or that you didn't break another project by -removing a file that was shared among the two projects. +removing a file that was shared among several projects. -But there's common behavior: when you install a project, files are copied -in your system. And there's a way to keep track of theses files, so to remove +But there's common behavior: when you install a project, files are copied +in your system. And there's a way to keep track of theses files, so to remove them. What this PEP proposes @@ -110,23 +112,29 @@ To address those issues, this PEP proposes a few changes: -- a new `.egg-info` structure using a directory; -- a list of elements this directory holds; -- new functions in `pkgutil` to be able to query the information - of installed projects. +- a new `.egg-info` structure using a directory, based on the `EggFormats` + standard from `setuptools` [#eggformats]_. +- new APIs in `pkgutil` to be able to query the information of installed + projects. +- a de-facto replacement for PEP 262 +- an uninstall function in Distutils. + .egg-info becomes a directory ============================= The first change would be to make `.egg-info` a directory and let it -hold the `PKG-INFO` file built by the `write_pkg_file` method of +hold the `PKG-INFO` file built by the `write_pkg_file` method of the `Distribution` class in Distutils. +Notice that this change is based on the standard proposed by `EggFormats`. +You may refer to its documentation for more information. + This change will not impact Python itself, because `egg-info` files are not -used anywhere yet in the standard library besides Distutils. +used anywhere yet in the standard library besides Distutils. -Although it will impact the `setuptools` and `pip` projects, but given -the fact that they already work with a directory that contains a `PKG-INFO` +Although it will impact the `setuptools` and `pip` projects, but given +the fact that they already work with a directory that contains a `PKG-INFO` file, the change will have no deep consequences. For example, if the `zlib` package is installed, the elements that @@ -136,32 +144,53 @@ - zlib-2.5.2.egg-info/ PKG-INFO -The Python version will also be removed from the `.egg-info` directory -name. +The syntax of the egg-info directory name is as follows:: + + name + '-' + version + '.egg-info' + +The egg-info directory name is created using a new function called +``egg_info_dirname(name, version)`` added to ``pkgutil``. ``name`` is +converted to a standard distribution name any runs of non-alphanumeric +characters are replaced with a single '-'. ``version`` is converted +to a standard version string. Spaces become dots, and all other +non-alphanumeric characters become dashes, with runs of multiple dashes +condensed to a single dash. Both attributes are then converted into their +filename-escaped form. Any '-' characters are currently replaced with '_'. + +Examples:: + + >>> egg_info_dirname('zlib', '2.5.2') + 'zlib-2.5.2.egg-info' + + >>> egg_info_dirname('python-ldap', '2.5') + 'python_ldap-2.5.egg-info' + + >>> egg_info_dirname('python-ldap', '2.5 a---5') + 'python_ldap-2.5.a_5.egg-info' -Adding a RECORD in the .egg-info directory -========================================== +Adding a RECORD file in the .egg-info directory +=============================================== A `RECORD` file will be added inside the `.egg-info` directory at installation -time. The `RECORD` file will hold the list of installed files. These correspond -to the files listed by the `record` option of the `install` command, and will -always be generated. This will allow uninstallation, as explained later in this +time. The `RECORD` file will hold the list of installed files. These correspond +to the files listed by the `record` option of the `install` command, and will +always be generated. This will allow uninstallation, as explained later in this PEP. This RECORD file is inspired from PEP 262 FILES [#pep262]_. The RECORD format ----------------- -The `RECORD` file is composed of records, one line per installed file. -Each record is composed of three elements separated by a character: +The `RECORD` file is a CSV-like file, composed of records, one line per +installed file. Each record is composed of three elements. - the file's full **path** - if the installed file is located in the directory where the .egg-info - directory of the package is located, it will be a '/'-separated relative - path, no matter what is the target system. This makes this information + directory of the package is located, it will be a '/'-separated relative + path, no matter what is the target system. This makes this information cross-compatible and allows simple installation to be relocatable. - - if the installed file is located elsewhere in the system, a + - if the installed file is located elsewhere in the system, a '/'-separated absolute path is used. - the **MD5** hash of the file, encoded in hex. Notice that `pyc` and `pyo` @@ -169,6 +198,10 @@ - the file's size in bytes +The ``csv`` module with its default options will be used to generate this file, +so the field separator will be ",". Any "," characters found within a field +will be escaped automatically by ``csv``. + Example ------- @@ -181,116 +214,166 @@ And the RECORD file will contain:: - zlib/include/zconf.h b690274f621402dda63bf11ba5373bf2 9544 - zlib/include/zlib.h 9c4b84aff68aa55f2e9bf70481b94333 66188 - zlib/lib/libz.a e6d43fb94292411909404b07d0692d46 91128 - zlib/share/man/man3/zlib.3 785dc03452f0508ff0678fba2457e0ba 4486 - zlib-2.5.2.egg-info/PKG-INFO 6fe57de576d749536082d8e205b77748 195 + zlib/include/zconf.h,b690274f621402dda63bf11ba5373bf2,9544 + zlib/include/zlib.h,9c4b84aff68aa55f2e9bf70481b94333,66188 + zlib/lib/libz.a,e6d43fb94292411909404b07d0692d46,91128 + zlib/share/man/man3/zlib.3,785dc03452f0508ff0678fba2457e0ba,4486 + zlib-2.5.2.egg-info/PKG-INFO,6fe57de576d749536082d8e205b77748,195 zlib-2.5.2.egg-info/RECORD Notice that: - the `RECORD` file can't contain a hash of itself and is just mentioned here -- `zlib` and `zlib-2.5.2.egg-info` are located in `site-packages` so the file +- `zlib` and `zlib-2.5.2.egg-info` are located in `site-packages` so the file paths are relative to it. -New functions in pkgutil -======================== +New APIs in pkgutil +=================== -To use the `.egg-info` directory content, we need to add in the standard +To use the `.egg-info` directory content, we need to add in the standard library a set of APIs. The best place to put these APIs seems to be `pkgutil`. -The new functions added in the package are : +EggInfo class +------------- -- get_projects() -> iterator +A new class called ``EggInfo`` is created, which provides the following +attributes: - Provides an iterator that will return (name, path) tuples, where `name` - is the name of a registered project and `path` the path to its `egg-info` - directory. +- ``name``: The name of the project + +- ``metadata``: A ``DistributionMetadata`` instance loaded with the project's + PKG-INFO file + +The following methods are provided: + +- ``get_installed_files(local=False)`` -> iterator of (path, md5, size) + + Iterates over the `RECORD` entries and return a tuple ``(path, md5, size)`` + for each line. If ``local`` is ``True``, the path is transformed into a + local absolute path. Otherwise the raw value from `RECORD` is returned. + +- ``uses(path)`` -> Boolean + + Returns ``True`` if ``path`` is listed in `RECORD`. ``path`` + can be a local absolute path or a relative '/'-separated path. -- get_egg_info(project_name) -> path or None +- ``owns(path)`` -> Boolean - Scans all elements in `sys.path` and looks for all directories ending with - `.egg-info`. Returns the directory path that contains a PKG-INFO that matches - `project_name` for the `name` metadata. Notice that there should be at most - one result. The first result founded will be returned. + Returns ``True`` if ``path`` is owned by the project. + Owned means that the path is used only by this project and is not used + by any other project. ``path`` can be a local absolute path or a relative + '/'-separated path. - If the directory is not found, returns None. +- ``get_file(path, binary=False)`` -> file object - XXX The implementation of `get_egg_info` will focus on minimizing the I/O - accesses. + Returns a ``file`` instance for the file pointed by ``path``. ``path`` can be + a local absolute path or a relative '/'-separated path. If ``binary`` is + ``True``, opens the file in binary mode. -- get_metadata(project_name) -> DistributionMetadata or None +.egg-info functions +------------------- - Uses `get_egg_info` to get the `PKG-INFO` file, and returns a - `DistributionMetadata` instance that contains the metadata. +The new functions added in the ``pkgutil`` are : -- get_files(project_name, local=False) -> iterator of (path, hash, size, - other_projects) +- ``get_egg_infos()`` -> iterator - Uses `get_egg_info` to get the `RECORD` file, and returns an iterator. + Provides an iterator that looks for ``.egg-info`` directories in ``sys.path`` + and returns ``EggInfo`` instances for each one of them. - Each returned element is a tuple `(path, hash, size, other_projects)` where - ``path``, ``hash``, ``size`` are the values found in the RECORD file. +- ``get_egg_info(project_name)`` -> path or None - `path` is the raw value founded in the RECORD file. If `local` is - set to True, `path` will be translated to its real absolute path, using - the local path separator. + Scans all elements in ``sys.path`` and looks for all directories ending with + ``.egg-info``. Returns an ``EggInfo`` corresponding to the ``.egg-info`` + directory that contains a PKG-INFO that matches `project_name` for the `name` + metadata. - `other_projects` is a tuple containing the name of the projects that are - also referring to this file in their own RECORD file (same path). + Notice that there should be at most one result. The first result founded + will be returned. If the directory is not found, returns None. - If `other_projects` is empty, it means that the file is only referred by the - current project. In other words, it can be removed if the project is removed. +- ``get_file_users(path)`` -> iterator of ``EggInfo`` instances. -- get_egg_info_file(project_name, path, binary=False) -> file object or None + Iterates over all projects to find out which project uses ``path``. + ``path`` can be a local absolute path or a relative '/'-separated path. - Uses `get_egg_info` and gets any element inside the directory, - pointed by its relative path. `get_egg_info_file` will perform - an `os.path.join` on `get_egg_info(project_name)` and `path` to build the - whole path. +Cache functions +--------------- - `path` can be a '/'-separated path or can use the local separator. - `get_egg_info_file` will automatically convert it using the platform path - separator, to look for the file. +The functions from the previous section work with a global memory cache to +reduce the numbers of I/O accesses and speed up the lookups. - If `binary` is set True, the file will be opened using the binary mode. +The cache can be managed with these functions: -Let's use it with our `zlib` example:: +- ``purge_cache``: removes all entries from cache. +- ``cache_enabled``: returns ``True`` if the cache is enabled. +- ``enable_cache``: enables the cache. +- ``disable_cache``: disables the cache. + +Example +------- + +Let's use some of the new APIs with our `zlib` example:: + + >>> from pkgutil import get_egg_info, get_file_users + >>> egg_info = get_egg_info('zlib') + >>> egg_info.name + 'zlib' + >>> egg_info.metadata.version + '2.5.2' - >>> from pkgutil import (get_egg_info, get_metadata, get_egg_info_file, - ... get_files) - >>> get_egg_info('zlib') '/opt/local/lib/python2.6/site-packages/zlib-2.5.2.egg-info' >>> metadata = get_metadata('zlib') >>> metadata.version '2.5.2' - >>> get_egg_info_file('zlib', 'PKG-INFO').read() - some - ... - files - >>> for path, hash, size, other_projects in get_files('zlib'): - ... print '%s %s %d %s' % (path, hash, size, ','.join(other_projects)) + + >>> for path, hash, size in egg_info.get_installed_files():: + ... print '%s %s %d %s' % (path, hash, size) ... zlib/include/zconf.h b690274f621402dda63bf11ba5373bf2 9544 zlib/include/zlib.h 9c4b84aff68aa55f2e9bf70481b94333 66188 - zlib/lib/libz.a e6d43fb94292411909404b07d0692d46 91128 - zlib/share/man/man3/zlib.3 785dc03452f0508ff0678fba2457e0ba 4486 - zlib-2.5.2.egg-info/PKG-INFO 6fe57de576d749536082d8e205b77748 195 - zlib-2.5.2.egg-info/RECORD None None + zlib/lib/libz.a e6d43fb94292411909404b07d0692d46 91128 + zlib/share/man/man3/zlib.3 785dc03452f0508ff0678fba2457e0ba 4486 + zlib-2.5.2.egg-info/PKG-INFO 6fe57de576d749536082d8e205b77748 195 + zlib-2.5.2.egg-info/RECORD None None + + >>> egg_info.uses('zlib/include/zlib.h') + True + >>> egg_info.owns('zlib/include/zlib.h') + True + >>> egg_info.get_file('zlib/include/zlib.h') + + +PEP 262 replacement +=================== + +In the past an attempt was made to create a installation database (see PEP 262 +[#pep262]_). + +Extract from PEP 262 Requirements: + + " We need a way to figure out what distributions, and what versions of + those distributions, are installed on a system..." + + +Since the APIs proposed in the current PEP provide everything needed to meet +this requirement, PEP 376 will replace PEP 262 and will become the official +`installation database` standard. + +The new version of PEP 345 (XXX work in progress) will extend the Metadata +standard and will fullfill the requirements described in PEP 262, like the +`REQUIRES` section. Adding an Uninstall function ============================ -Distutils provides a very basic way to install a project, which is running +Distutils already provides a very basic way to install a project, which is running the `install` command over the `setup.py` script of the distribution. -Distutils will provide a very basic ``uninstall`` function, that will be added -in ``distutils.util`` and will take the name of the project to uninstall as -its argument. ``uninstall`` will use ``pkgutil.get_files`` and remove all +Distutils will provide a very basic ``uninstall`` function, that will be added +in ``distutils.util`` and will take the name of the project to uninstall as +its argument. ``uninstall`` will use the APIs desribed earlier and remove all unique files, as long as their hash didn't change. Then it will remove -directories where it removed the last elements. +empty directories left behind. ``uninstall`` will return a list of uninstalled files:: @@ -301,9 +384,9 @@ If the project is not found, a ``DistutilsUninstallError`` will be raised. -To make it a reference API for third-party projects that wish to control -how `uninstall` works, a second callable argument can be used. It will be -called for each file that is removed. If the callable returns `True`, the +To make it a reference API for third-party projects that wish to control +how `uninstall` works, a second callable argument can be used. It will be +called for each file that is removed. If the callable returns `True`, the file will be removed. If it returns False, it will be left alone. Examples:: @@ -320,7 +403,7 @@ ... >>> uninstall('zlib', _dry_run) -Of course, a third-party tool can use ``pkgutil.get_files``, to implement +Of course, a third-party tool can use ``pkgutil`` APIs to implement its own uninstall feature. Backward compatibility and roadmap @@ -349,6 +432,9 @@ .. [#pip] http://pypi.python.org/pypi/pip +.. [#eggformats] + http://peak.telecommunity.com/DevCenter/EggFormats + Aknowledgments ============== From python-checkins at python.org Mon May 25 15:13:45 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 25 May 2009 15:13:45 +0200 (CEST) Subject: [Python-checkins] r72912 - in python/trunk: Doc/library/dis.rst Doc/reference/compound_stmts.rst Include/opcode.h Lib/opcode.py Lib/test/test_descr.py Misc/NEWS Python/ceval.c Python/compile.c Python/import.c Message-ID: <20090525131345.0C7A3D471@mail.python.org> Author: benjamin.peterson Date: Mon May 25 15:13:44 2009 New Revision: 72912 Log: add a SETUP_WITH opcode It speeds up the with statement and correctly looks up the special methods involved. Modified: python/trunk/Doc/library/dis.rst python/trunk/Doc/reference/compound_stmts.rst python/trunk/Include/opcode.h python/trunk/Lib/opcode.py python/trunk/Lib/test/test_descr.py python/trunk/Misc/NEWS python/trunk/Python/ceval.c python/trunk/Python/compile.c python/trunk/Python/import.c Modified: python/trunk/Doc/library/dis.rst ============================================================================== --- python/trunk/Doc/library/dis.rst (original) +++ python/trunk/Doc/library/dis.rst Mon May 25 15:13:44 2009 @@ -532,6 +532,18 @@ the names of the base classes, and TOS2 the class name. +.. opcode:: SETUP_WITH (delta) + + This opcode performs several operations before a with block starts. First, + it loads :meth:`~object.__exit__` from the context manager and pushes it onto + the stack for later use by :opcode:`WITH_CLEANUP`. Then, + :meth:`~object.__enter__` is called, and a finally block pointing to *delta* + is pushed. Finally, the result of calling the enter method is pushed onto + the stack. The next opcode will either ignore it (:opcode:`POP_TOP`), or + store it in (a) variable(s) (:opcode:`STORE_FAST`, :opcode:`STORE_NAME`, or + :opcode:`UNPACK_SEQUENCE`). + + .. opcode:: WITH_CLEANUP () Cleans up the stack when a :keyword:`with` statement block exits. On top of Modified: python/trunk/Doc/reference/compound_stmts.rst ============================================================================== --- python/trunk/Doc/reference/compound_stmts.rst (original) +++ python/trunk/Doc/reference/compound_stmts.rst Mon May 25 15:13:44 2009 @@ -339,6 +339,8 @@ #. The context expression is evaluated to obtain a context manager. +#. The context manager's :meth:`__exit__` is loaded for later use. + #. The context manager's :meth:`__enter__` method is invoked. #. If a target was included in the :keyword:`with` statement, the return value @@ -349,7 +351,7 @@ The :keyword:`with` statement guarantees that if the :meth:`__enter__` method returns without an error, then :meth:`__exit__` will always be called. Thus, if an error occurs during the assignment to the target list, it will be treated the - same as an error occurring within the suite would be. See step 5 below. + same as an error occurring within the suite would be. See step 6 below. #. The suite is executed. Modified: python/trunk/Include/opcode.h ============================================================================== --- python/trunk/Include/opcode.h (original) +++ python/trunk/Include/opcode.h Mon May 25 15:13:44 2009 @@ -141,8 +141,10 @@ #define CALL_FUNCTION_KW 141 /* #args + (#kwargs<<8) */ #define CALL_FUNCTION_VAR_KW 142 /* #args + (#kwargs<<8) */ +#define SETUP_WITH 143 + /* Support for opargs more than 16 bits long */ -#define EXTENDED_ARG 143 +#define EXTENDED_ARG 145 enum cmp_op {PyCmp_LT=Py_LT, PyCmp_LE=Py_LE, PyCmp_EQ=Py_EQ, PyCmp_NE=Py_NE, PyCmp_GT=Py_GT, PyCmp_GE=Py_GE, Modified: python/trunk/Lib/opcode.py ============================================================================== --- python/trunk/Lib/opcode.py (original) +++ python/trunk/Lib/opcode.py Mon May 25 15:13:44 2009 @@ -181,7 +181,10 @@ def_op('CALL_FUNCTION_VAR', 140) # #args + (#kwargs << 8) def_op('CALL_FUNCTION_KW', 141) # #args + (#kwargs << 8) def_op('CALL_FUNCTION_VAR_KW', 142) # #args + (#kwargs << 8) -def_op('EXTENDED_ARG', 143) -EXTENDED_ARG = 143 + +jrel_op('SETUP_WITH', 143) + +def_op('EXTENDED_ARG', 145) +EXTENDED_ARG = 145 del def_op, name_op, jrel_op, jabs_op Modified: python/trunk/Lib/test/test_descr.py ============================================================================== --- python/trunk/Lib/test/test_descr.py (original) +++ python/trunk/Lib/test/test_descr.py Mon May 25 15:13:44 2009 @@ -1689,6 +1689,7 @@ return isinstance(int, obj) def do_issubclass(obj): return issubclass(int, obj) + def swallow(*args): pass # It would be nice to have every special method tested here, but I'm # only listing the ones I can remember outside of typeobject.c, since it @@ -1702,11 +1703,8 @@ ("__instancecheck__", do_isinstance, return_true, set(), {}), ("__subclasscheck__", do_issubclass, return_true, set(("__bases__",)), {}), - # These two fail because the compiler generates LOAD_ATTR to look - # them up. We'd have to add a new opcode to fix this, and it's - # probably not worth it. - # ("__enter__", run_context, iden), - # ("__exit__", run_context, iden), + ("__enter__", run_context, iden, set(), {"__exit__" : swallow}), + ("__exit__", run_context, swallow, set(), {"__enter__" : iden}), ] class Checker(object): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon May 25 15:13:44 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #6101: A new opcode, SETUP_WITH, has been added to speed up the with + statement and correctly lookup the __enter__ and __exit__ special methods. + - Issue #5829: complex("1e500") no longer raises OverflowError. This makes it consistent with float("1e500") and interpretation of real and imaginary literals. Modified: python/trunk/Python/ceval.c ============================================================================== --- python/trunk/Python/ceval.c (original) +++ python/trunk/Python/ceval.c Mon May 25 15:13:44 2009 @@ -128,6 +128,7 @@ static PyObject * string_concatenate(PyObject *, PyObject *, PyFrameObject *, unsigned char *); static PyObject * kwd_as_string(PyObject *); +static PyObject * special_lookup(PyObject *, char *, PyObject **); #define NAME_ERROR_MSG \ "name '%.200s' is not defined" @@ -2467,6 +2468,33 @@ STACK_LEVEL()); continue; + case SETUP_WITH: + { + static PyObject *exit, *enter; + w = TOP(); + x = special_lookup(w, "__exit__", &exit); + if (!x) + break; + SET_TOP(x); + u = special_lookup(w, "__enter__", &enter); + Py_DECREF(w); + if (!u) { + x = NULL; + break; + } + x = PyObject_CallFunctionObjArgs(u, NULL); + Py_DECREF(u); + if (!x) + break; + /* Setup the finally block before pushing the result + of __enter__ on the stack. */ + PyFrame_BlockSetup(f, SETUP_FINALLY, INSTR_OFFSET() + oparg, + STACK_LEVEL()); + + PUSH(x); + continue; + } + case WITH_CLEANUP: { /* At the top of the stack are 1-3 values indicating @@ -3171,6 +3199,24 @@ } +static PyObject * +special_lookup(PyObject *o, char *meth, PyObject **cache) +{ + PyObject *res; + if (PyInstance_Check(o)) { + if (!*cache) + return PyObject_GetAttrString(o, meth); + else + return PyObject_GetAttr(o, *cache); + } + res = _PyObject_LookupSpecial(o, meth, cache); + if (res == NULL && !PyErr_Occurred()) { + PyErr_SetObject(PyExc_AttributeError, *cache); + return NULL; + } + return res; +} + static PyObject * kwd_as_string(PyObject *kwd) { Modified: python/trunk/Python/compile.c ============================================================================== --- python/trunk/Python/compile.c (original) +++ python/trunk/Python/compile.c Mon May 25 15:13:44 2009 @@ -778,6 +778,8 @@ return -1; case BREAK_LOOP: return 0; + case SETUP_WITH: + return 1; case WITH_CLEANUP: return -1; /* XXX Sometimes more */ case LOAD_LOCALS: @@ -2821,80 +2823,31 @@ static int compiler_with(struct compiler *c, stmt_ty s) { - static identifier enter_attr, exit_attr; basicblock *block, *finally; - identifier tmpvalue = NULL; assert(s->kind == With_kind); - if (!enter_attr) { - enter_attr = PyString_InternFromString("__enter__"); - if (!enter_attr) - return 0; - } - if (!exit_attr) { - exit_attr = PyString_InternFromString("__exit__"); - if (!exit_attr) - return 0; - } - block = compiler_new_block(c); finally = compiler_new_block(c); if (!block || !finally) return 0; - if (s->v.With.optional_vars) { - /* Create a temporary variable to hold context.__enter__(). - We need to do this rather than preserving it on the stack - because SETUP_FINALLY remembers the stack level. - We need to do the assignment *inside* the try/finally - so that context.__exit__() is called when the assignment - fails. But we need to call context.__enter__() *before* - the try/finally so that if it fails we won't call - context.__exit__(). - */ - tmpvalue = compiler_new_tmpname(c); - if (tmpvalue == NULL) - return 0; - PyArena_AddPyObject(c->c_arena, tmpvalue); - } - /* Evaluate EXPR */ VISIT(c, expr, s->v.With.context_expr); + ADDOP_JREL(c, SETUP_WITH, finally); - /* Squirrel away context.__exit__ by stuffing it under context */ - ADDOP(c, DUP_TOP); - ADDOP_O(c, LOAD_ATTR, exit_attr, names); - ADDOP(c, ROT_TWO); - - /* Call context.__enter__() */ - ADDOP_O(c, LOAD_ATTR, enter_attr, names); - ADDOP_I(c, CALL_FUNCTION, 0); - - if (s->v.With.optional_vars) { - /* Store it in tmpvalue */ - if (!compiler_nameop(c, tmpvalue, Store)) - return 0; - } - else { - /* Discard result from context.__enter__() */ - ADDOP(c, POP_TOP); - } - - /* Start the try block */ - ADDOP_JREL(c, SETUP_FINALLY, finally); - + /* SETUP_WITH pushes a finally block. */ compiler_use_next_block(c, block); if (!compiler_push_fblock(c, FINALLY_TRY, block)) { return 0; } if (s->v.With.optional_vars) { - /* Bind saved result of context.__enter__() to VAR */ - if (!compiler_nameop(c, tmpvalue, Load) || - !compiler_nameop(c, tmpvalue, Del)) - return 0; - VISIT(c, expr, s->v.With.optional_vars); + VISIT(c, expr, s->v.With.optional_vars); + } + else { + /* Discard result from context.__enter__() */ + ADDOP(c, POP_TOP); } /* BLOCK code */ Modified: python/trunk/Python/import.c ============================================================================== --- python/trunk/Python/import.c (original) +++ python/trunk/Python/import.c Mon May 25 15:13:44 2009 @@ -74,9 +74,10 @@ Python 2.7a0: 62171 (optimize list comprehensions/change LIST_APPEND) Python 2.7a0: 62181 (optimize conditional branches: introduce POP_JUMP_IF_FALSE and POP_JUMP_IF_TRUE) + Python 2.7a0 62191 (introduce SETUP_WITH) . */ -#define MAGIC (62181 | ((long)'\r'<<16) | ((long)'\n'<<24)) +#define MAGIC (62191 | ((long)'\r'<<16) | ((long)'\n'<<24)) /* Magic word as global; note that _PyImport_Init() can change the value of this global to accommodate for alterations of how the From buildbot at python.org Mon May 25 15:25:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 25 May 2009 13:25:07 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc trunk Message-ID: <20090525132508.18C71D29E@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc trunk. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%20trunk/builds/471 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Mon May 25 15:29:16 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 25 May 2009 13:29:16 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090525132916.69DA7D2BA@mail.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/5059 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Aborted sincerely, -The Buildbot From buildbot at python.org Mon May 25 15:32:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 25 May 2009 13:32:18 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090525133219.088CED278@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%20trunk/builds/70 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/threading.py", line 524, in __bootstrap_inner self.run() File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/threading.py", line 477, in run self.__target(*self.__args, **self.__kwargs) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/bsddb/test/test_thread.py", line 306, in readerThread rec = dbutils.DeadlockWrap(c.next, max_retries=10) File "/home/buildbot/slave/py-build/trunk.norwitz-amd64/build/Lib/bsddb/dbutils.py", line 68, in DeadlockWrap return function(*_args, **_kwargs) DBLockDeadlockError: (-30995, 'DB_LOCK_DEADLOCK: Locker killed to resolve a deadlock') make: *** [buildbottest] Aborted (core dumped) sincerely, -The Buildbot From python-checkins at python.org Mon May 25 15:48:17 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 25 May 2009 15:48:17 +0200 (CEST) Subject: [Python-checkins] r72913 - python/branches/py3k/Makefile.pre.in Message-ID: <20090525134817.8C6BBD33F@mail.python.org> Author: benjamin.peterson Date: Mon May 25 15:48:17 2009 New Revision: 72913 Log: link to CoreFoundation in framework builds #6104 Modified: python/branches/py3k/Makefile.pre.in Modified: python/branches/py3k/Makefile.pre.in ============================================================================== --- python/branches/py3k/Makefile.pre.in (original) +++ python/branches/py3k/Makefile.pre.in Mon May 25 15:48:17 2009 @@ -462,10 +462,11 @@ -all_load $(LIBRARY) -Wl,-single_module \ -install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \ -compatibility_version $(VERSION) \ - -current_version $(VERSION); \ + -current_version $(VERSION) \ + -framework CoreFoundation; \ else \ /usr/bin/libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \ - @LIBTOOL_CRUFT@ ;\ + @LIBTOOL_CRUFT@ -framework CoreFoundation;\ fi $(INSTALL) -d -m $(DIRMODE) \ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj From buildbot at python.org Mon May 25 15:52:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 25 May 2009 13:52:25 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu trunk Message-ID: <20090525135225.CC76CD399@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu trunk. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%20trunk/builds/1373 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Mon May 25 16:25:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 25 May 2009 14:25:30 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090525142530.91E24D33F@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/801 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Mon May 25 16:32:36 2009 From: python-checkins at python.org (dirkjan.ochtman) Date: Mon, 25 May 2009 16:32:36 +0200 (CEST) Subject: [Python-checkins] r72914 - peps/trunk/pep-0374.txt Message-ID: <20090525143236.2DCE1D40A@mail.python.org> Author: dirkjan.ochtman Date: Mon May 25 16:32:35 2009 New Revision: 72914 Log: Revert PEP 374 to pre-r72563 state (reinstate comparison). Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Mon May 25 16:32:35 2009 @@ -1,9 +1,11 @@ PEP: 374 -Title: Migrating from svn to Mercurial +Title: Migrating from svn to a distributed VCS Version: $Revision$ Last-Modified: $Date$ Author: Brett Cannon , - Dirkjan Ochtman + Stephen J. Turnbull , + Alexandre Vassalotti , + Barry Warsaw Status: Active Type: Process Content-Type: text/x-rst @@ -13,12 +15,11 @@ .. warning:: This PEP is in the draft stages and is still under active - development in terms of the transition plan even though Hg is the - chosen DVCS. + development. -Motivation -========== +Rationale +========= Python has been using a centralized version control system (VCS; first CVS, now Subversion) for years to great effect. Having a master @@ -99,177 +100,1371 @@ the future as the state of DVCSs evolves. -Choice of DVCS -============== +Terminology +=========== -This PEP included a thorough investigation of three DVCSs as options for -migration, with substantial work from Barry Warsaw, Alexandre Vassalotti and -Stephen Turnbull. That comparison has been moved to `DvcsComparison`_, and -this PEP now includes more information on the migration to Mercurial. +Agreeing on a common terminology is surprisingly difficult, +primarily because each VCS uses these terms when describing subtly +different tasks, objects, and concepts. Where possible, we try to +provide a generic definition of the concepts, but you should consult +the individual system's glossaries for details. Here are some basic +references for terminology, from some of the standard web-based +references on each VCS. You can also refer to glossaries for each +DVCS: -.. _DvcsComparison: http://wiki.python.org/moin/DvcsComparison +* Subversion : http://svnbook.red-bean.com/en/1.5/svn.basic.html +* Bazaar : http://bazaar-vcs.org/BzrGlossary +* Mercurial : http://www.selenic.com/mercurial/wiki/index.cgi/UnderstandingMercurial +* git : http://book.git-scm.com/1_the_git_object_model.html -At PyCon 2009, a `decision -`_ -was made to go with Mercurial. -The choice to go with Mercurial was made for three important reasons: +branch + A line of development; a collection of revisions, ordered by + time. -* According to a small survey, Python developers are more interested in - using Mercurial than in Bazaar or Git. +checkout/working copy/working tree + A tree of code the developer can edit, linked to a branch. -* Mercurial is written in Python, which is congruent with the python-dev - tendency to 'eat their own dogfood'. +index + A "staging area" where a revision is built (unique to git). -* Mercurial is significantly faster than bzr (it's slower than git, though - by a much smaller difference). +repository + A collection of revisions, organized into branches. -* Mercurial is easier to learn for SVN users than bzr. +clone + A complete copy of a branch or repository. -Although all of these points can be debated, in the end a pronouncement from -the BDFL was made to go with hg as the chosen DVCS for the Python project. +commit + To record a revision in a repository. +merge + Applying all the changes and history from one branch/repository + to another. -Transition Plan +pull + To update a checkout/clone from the original branch/repository, + which can be remote or local + +push/publish + To copy a revision, and all revisions it depends on, from a one + repository to another. + +cherry-pick + To merge one or more specific revisions from one branch to + another, possibly in a different repository, possibly without its + dependent revisions. + +rebase + To "detach" a branch, and move it to a new branch point; move + commits to the beginning of a branch instead of where they + happened in time. + + +Typical Workflow +================ + +At the moment, the typical workflow for a Python core developer is: + + +* Edit code in a checkout until it is stable enough to commit/push. +* Commit to the master repository. + +It is a rather simple workflow, but it has drawbacks. For one, +because any work that involves the repository takes time thanks to +the network, commits/pushes tend to not necessarily be as atomic as +possible. There is also the drawback of there not being a +necessarily cheap way to create new checkouts beyond a recursive +copy of the checkout directory. + +A DVCS would lead to a workflow more like this: + +* Branch off of a local clone of the master repository. +* Edit code, committing in atomic pieces. +* Merge the branch into the mainline, and +* Push all commits to the master repository. + +While there are more possible steps, the workflow is much more +independent of the master repository than is currently possible. By +being able to commit locally at the speed of your disk, a core +developer is able to do atomic commits much more frequently, +minimizing having commits that do multiple things to the code. Also +by using a branch, the changes are isolated (if desired) from other +changes being made by other developers. Because branches are cheap, +it is easy to create and maintain many smaller branches that address +one specific issue, e.g. one bug or one new feature. More +sophisticated features of DVCSs allow the developer to more easily +track long running development branches as the official mainline +progresses. + + +Contenders +========== + +========== ========== ======= =================================== ========================================== +Name Short Name Version 2.x Trunk Mirror 3.x Trunk Mirror +---------- ---------- ------- ----------------------------------- ------------------------------------------ +Bazaar_ bzr 1.12 http://code.python.org/python/trunk http://code.python.org/python/3.0 +Mercurial_ hg 1.2.0 http://code.python.org/hg/trunk/ http://code.python.org/hg/branches/py3k/ +git_ N/A 1.6.1 git://code.python.org/python/trunk git://code.python.org/python/branches/py3k +========== ========== ======= =================================== ========================================== + +.. _Bazaar: http://bazaar-vcs.org/ +.. _Mercurial: http://www.selenic.com/mercurial/ +.. _git: http://www.git-scm.com/ + +This PEP does not consider darcs, arch, or monotone. The main +problem with these DVCSs is that they are simply not popular enough +to bother supporting when they do not provide some very compelling +features that the other DVCSs provide. Arch and darcs also have +significant performance problems which seem unlikely to be addressed +in the near future. + + +Interoperability +================ + +For those who have already decided which DVCSs they want to use, and +are willing to maintain local mirrors themselves, all three DVCSs +support interchange via the git "fast-import" changeset format. git +does so natively, of course, and native support for Bazaar is under +active development, and getting good early reviews as of mid-February +2009. Mercurial has idiosyncratic support for importing via its *hg +convert* command, and `third-party fast-import support`_ is available +for exporting. Also, the Tailor_ tool supports automatic maintenance +of mirrors based on an official repository in any of the candidate +formats with a local mirror in any format. + +.. _third-party fast-import support: http://repo.or.cz/r/fast-export.git/.git/description +.. _Tailor: http://progetti.arstecnica.it/tailor/ + + +Usage Scenarios =============== +Probably the best way to help decide on whether/which DVCS should +replace Subversion is to see what it takes to perform some +real-world usage scenarios that developers (core and non-core) have +to work with. Each usage scenario outlines what it is, a bullet list +of what the basic steps are (which can vary slightly per VCS), and +how to perform the usage scenario in the various VCSs +(including Subversion). + +Each VCS had a single author in charge of writing implementations +for each scenario (unless otherwise noted). + +========= === +Name VCS +--------- --- +Brett svn +Barry bzr +Alexandre hg +Stephen git +========= === + + +Initial Setup +------------- + +Some DVCSs have some perks if you do some initial setup upfront. +This section covers what can be done before any of the usage +scenarios are run in order to take better advantage of the tools. + +All of the DVCSs support configuring your project identification. +Unlike the centralized systems, they use your email address to +identify your commits. (Access control is generally done by +mechanisms external to the DVCS, such as ssh or console login). +This identity may be associated with a full name. + +All of the DVCSs will query the system to get some approximation to +this information, but that may not be what you want. They also +support setting this information on a per-user basis, and on a per- +project basis. Convenience commands to set these attributes vary, +but all allow direct editing of configuration files. + +Some VCSs support end-of-line (EOL) conversions on checkout/checkin. + + +svn +''' + +None required, but it is recommended you follow the +`guidelines `_ +in the dev FAQ. + + +bzr +''' + +No setup is required, but for much quicker and space-efficient local +branching, you should create a shared repository to hold all your +Python branches. A shared repository is really just a parent +directory containing a .bzr directory. When bzr commits a revision, +it searches from the local directory on up the file system for a .bzr +directory to hold the revision. By sharing revisions across multiple +branches, you cut down on the amount of disk space used. Do this:: + + cd ~/projects + bzr init-repo python + cd python + +Now, all your Python branches should be created inside of +``~/projects/python``. + +There are also some settings you can put in your +``~/.bzr/bazaar.conf`` +and ``~/.bzr/locations.conf`` file to set up defaults for interacting +with Python code. None of them are required, although some are +recommended. E.g. I would suggest gpg signing all commits, but that +might be too high a barrier for developers. Also, you can set up +default push locations depending on where you want to push branches +by default. If you have write access to the master branches, that +push location could be code.python.org. Otherwise, it might be a +free Bazaar code hosting service such as Launchpad. If Bazaar is +chosen, we should decide what the policies and recommendations are. + +At a minimum, I would set up your email address:: + + bzr whoami "Firstname Lastname " + +As with hg and git below, there are ways to set your email address (or really, +just about any parameter) on a +per-repository basis. You do this with settings in your +``$HOME/.bazaar/locations.conf`` file, which has an ini-style format as does +the other DVCSs. See the Bazaar documentation for details, +which mostly aren't relevant for this discussion. + + +hg +'' + +Minimally, you should set your user name. To do so, create the file +``.hgrc`` in your home directory and add the following:: + + [ui] + username = Firstname Lastname + +If you are using Windows and your tools do not support Unix-style newlines, +you can enable automatic newline translation by adding to your configuration:: + + [extensions] + win32text = + +These options can also be set locally to a given repository by +customizing ``/.hg/hgrc``, instead of ``~/.hgrc``. + + +git +''' + +None needed. However, git supports a number of features that can +smooth your work, with a little preparation. git supports setting +defaults at the workspace, user, and system levels. The system +level is out of scope of this PEP. The user configuration file is +``$HOME/.gitconfig`` on Unix-like systems, and the workspace +configuration file is ``$REPOSITORY/.git/config``. + +You can use the ``git-config`` tool to set preferences for user.name and +user.email either globally (for your system login account) or +locally (to a given git working copy), or you can edit the +configuration files (which have the same format as shown in the +Mercurial section above).:: + + # my full name doesn't change + # note "--global" flag means per user + # (system-wide configuration is set with "--system") + git config --global user.name 'Firstname Lastname' + # but use my Pythonic email address + cd /path/to/python/repository + git config user.email email.address at python.example.com + +If you are using Windows, you probably want to set the core.autocrlf +and core.safecrlf preferences to true using ``git-config``.:: + + # check out files with CRLF line endings rather than Unix-style LF only + git config --global core.autocrlf true + # scream if a transformation would be ambiguous + # (eg, a working file contains both naked LF and CRLF) + # and check them back in with the reverse transformation + git config --global core.safecrlf true + +Although the repository will usually contain a .gitignore file +specifying file names that rarely if ever should be registered in the +VCS, you may have personal conventions (e.g., always editing log +messages in a temporary file named ".msg") that you may wish to +specify.:: + + # tell git where my personal ignores are + git config --global core.excludesfile ~/.gitignore + # I use .msg for my long commit logs, and Emacs makes backups in + # files ending with ~ + # these are globs, not regular expressions + echo '*~' >> ~/.gitignore + echo '.msg' >> ~/.gitignore + +If you use multiple branches, as with the other VCSes, you can save a +lot of space by putting all objects in a common object store. This +also can save download time, if the origins of the branches were in +different repositories, because objects are shared across branches in +your repository even if they were not present in the upstream +repositories. git is very space- and time-efficient and applies a +number of optimizations automatically, so this configuration is +optional. (Examples are omitted.) + + +One-Off Checkout +---------------- + +As a non-core developer, I want to create and publish a one-off patch +that fixes a bug, so that a core developer can review it for +inclusion in the mainline. + +* Checkout/branch/clone trunk. +* Edit some code. +* Generate a patch (based on what is best supported by the VCS, e.g. + branch history). +* Receive reviewer comments and address the issues. +* Generate a second patch for the core developer to commit. + + +svn +''' +:: + + svn checkout http://svn.python.org/projects/python/trunk + cd trunk + # Edit some code. + echo "The cake is a lie!" > README + # Since svn lacks support for local commits, we fake it with patches. + svn diff >> commit-1.diff + svn diff >> patch-1.diff + # Upload the patch-1 to bugs.python.org. + # Receive reviewer comments. + # Edit some code. + echo "The cake is real!" > README + # Since svn lacks support for local commits, we fake it with patches. + svn diff >> commit-2.diff + svn diff >> patch-2.diff + # Upload patch-2 to bugs.python.org + + +bzr +''' +:: + + bzr branch http://code.python.org/python/trunk + cd trunk + # Edit some code. + bzr commit -m 'Stuff I did' + bzr send -o bundle + # Upload bundle to bugs.python.org + # Receive reviewer comments + # Edit some code + bzr commit -m 'Respond to reviewer comments' + bzr send -o bundle + # Upload updated bundle to bugs.python.org + +The ``bundle`` file is like a super-patch. It can be read by ``patch(1)`` but +it contains additional metadata so that it can be fed to ``bzr merge`` to +produce a fully usable branch completely with history. See `Patch Review`_ +section below. + + +hg +'' +:: + + hg clone http://code.python.org/hg/trunk + cd trunk + # Edit some code. + hg commit -m "Stuff I did" + hg outgoing -p > fixes.patch + # Upload patch to bugs.python.org + # Receive reviewer comments + # Edit some code + hg commit -m "Address reviewer comments." + hg outgoing -p > additional-fixes.patch + # Upload patch to bugs.python.org + +While ``hg outgoing`` does not have the flag for it, most Mercurial +commands support git's extended patch format through a ``--git`` +command. This can be set in one's ``.hgrc`` file so that all commands +that generate a patch use the extended format. + + +git +''' + +The patches could be created with +``git diff master > stuff-i-did.patch``, too, but +``git format-patch | git am`` knows some tricks +(empty files, renames, etc) that ordinary patch can't handle. git +grabs "Stuff I did" out of the the commit message to create the file +name 0001-Stuff-I-did.patch. See Patch Review below for a +description of the git-format-patch format. +:: + + # Get the mainline code. + git clone git://code.python.org/python/trunk + cd trunk + # Edit some code. + git commit -a -m 'Stuff I did.' + # Create patch for my changes (i.e, relative to master). + git format-patch master + git tag stuff-v1 + # Upload 0001-Stuff-I-did.patch to bugs.python.org. + # Time passes ... receive reviewer comments. + # Edit more code. + git commit -a -m 'Address reviewer comments.' + # Make an add-on patch to apply on top of the original. + git format-patch stuff-v1 + # Upload 0001-Address-reviewer-comments.patch to bugs.python.org. + + +Backing Out Changes +------------------- + +As a core developer, I want to undo a change that was not ready for +inclusion in the mainline. + +* Back out the unwanted change. +* Push patch to server. + + +svn +''' +:: + + # Assume the change to revert is in revision 40 + svn merge -c -40 . + # Resolve conflicts, if any. + svn commit -m "Reverted revision 40" -Introduction + +bzr +''' +:: + + # Assume the change to revert is in revision 40 + bzr merge -r 40..39 + # Resolve conflicts, if any. + bzr commit -m "Reverted revision 40" + +Note that if the change you want revert is the last one that was +made, you can just use ``bzr uncommit``. + + +hg +'' +:: + + # Assume the change to revert is in revision 9150dd9c6d30 + hg backout --merge -r 9150dd9c6d30 + # Resolve conflicts, if any. + hg commit -m "Reverted changeset 9150dd9c6d30" + hg push + +Note, you can use "hg rollback" and "hg strip" to revert changes you committed +in your local repository, but did not yet push to other repositories. + +git +''' +:: + + # Assume the change to revert is the grandfather of a revision tagged "newhotness". + git revert newhotness~2 + # Resolve conflicts if any. If there are no conflicts, the commit + # will be done automatically by "git revert", which prompts for a log. + git commit -m "Reverted changeset 9150dd9c6d30." + git push + + +Patch Review ------------ -To make the most of hg, I (Dirkjan) want to make a high-fidelity conversion, -such that (a) as much of the svn metadata as possible is retained, and (b) all -metadata is converted to formats that are common in Mercurial. This way, tools -written for Mercurial can be optimally used. In order to do this, I want to use -the `hgsubversion `_ software to do -an initial conversion. This hg extension is focused on providing high-quality -conversion from Subversion to Mercurial for use in two-way correspondence, -meaning it doesn't throw away as much available metadata as other solutions. - -Such a conversion also seems like a good time to reconsider the contents of -the repository and determine if some things are still valuable. In this spirit, -in the following sections I propose discarding some of the older metadata. - -Branch strategy ---------------- - -Mercurial has two basic ways of using branches: cloned branches, where each -branch is kept in a separate directory, and named branches, where each revision -keeps metadata to note on which branch it belongs. The former makes it easier -to distinguish branches, at the expense of requiring more disk space on the -client. The latter makes it a little easier to switch between branches, but -often has somewhat unintuitive results for people (though this has been -getting better in recent versions of Mercurial). - -For Python, I think it would work well to have cloned branches and keep most -things separate. This is predicated on the assumption that most people work on -just one (or maybe two) branches at a time. Branches can be exposed separately, -though I would advocate merging old (and tagged!) branches into mainline so -that people can easily revert to older releases. At what age of a release this -should be done can be debated (a natural point might be when the branch gets -unsupported, e.g. 2.4 at the release of 2.6). +As a core developer, I want to review patches submitted by other +people, so that I can make sure that only approved changes are added +to Python. + +Core developers have to review patches as submitted by other people. +This requires applying the patch, testing it, and then tossing away +the changes. The assumption can be made that a core developer already +has a checkout/branch/clone of the trunk. + +* Branch off of trunk. +* Apply patch w/o any comments as generated by the patch submitter. +* Push patch to server. +* Delete now-useless branch. + + +svn +''' + +Subversion does not exactly fit into this development style very well +as there are no such thing as a "branch" as has been defined in this +PEP. Instead a developer either needs to create another checkout for +testing a patch or create a branch on the server. Up to this point, +core developers have not taken the "branch on the server" approach to +dealing with individual patches. For this scenario the assumption +will be the developer creates a local checkout of the trunk to work +with.:: + + cp -r trunk issue0000 + cd issue0000 + patch -p0 < __patch__ + # Review patch. + svn commit -m "Some patch." + cd .. + rm -r issue0000 + +Another option is to only have a single checkout running at any one +time and use ``svn diff`` along with ``svn revert -R`` to store away +independent changes you may have made. + + +bzr +''' +:: + + bzr branch trunk issueNNNN + # Download `patch` bundle from Roundup + bzr merge patch + # Review patch + bzr commit -m'Patch NNN by So N. So' --fixes python:NNNN + bzr push bzr+ssh://me at code.python.org/trunk + rm -rf ../issueNNNN + +Alternatively, since you're probably going to commit these changes to +the trunk, you could just do a checkout. That would give you a local +working tree while the branch (i.e. all revisions) would continue to +live on the server. This is similar to the svn model and might allow +you to more quickly review the patch. There's no need for the push +in this case.:: + + bzr checkout trunk issueNNNN + # Download `patch` bundle from Roundup + bzr merge patch + # Review patch + bzr commit -m'Patch NNNN by So N. So' --fixes python:NNNN + rm -rf ../issueNNNN + + +hg +'' +:: + + hg clone trunk issue0000 + cd issue0000 + # If the patch was generated using hg export, the user name of the + # submitter is automatically recorded. Otherwise, + # use hg import --no-commit submitted.diff and commit with + # hg commit -u "Firstname Lastname " + hg import submitted.diff + # Review patch. + hg push ssh://alexandre at code.python.org/hg/trunk/ + + +git +''' +We assume a patch created by git-format-patch. This is a Unix mbox +file containing one or more patches, each formatted as an RFC 2822 +message. git-am interprets each message as a commit as follows. The +author of the patch is taken from the From: header, the date from the +Date header. The commit log is created by concatenating the content +of the subject line, a blank line, and the message body up to the +start of the patch.:: + + cd trunk + # Create a branch in case we don't like the patch. + # This checkout takes zero time, since the workspace is left in + # the same state as the master branch. + git checkout -b patch-review + # Download patch from bugs.python.org to submitted.patch. + git am < submitted.patch + # Review and approve patch. + # Merge into master and push. + git checkout master + git merge patch-review + git push -Converting branches -------------------- -There are quite a lot of branches in SVN's branches directory. I propose to -clean this up a bit, by employing the following the strategy: +Backport +-------- + +As a core developer, I want to apply a patch to 2.6, 2.7, 3.0, and 3.1 +so that I can fix a problem in all three versions. + +Thanks to always having the cutting-edge and the latest release +version under development, Python currently has four branches being +worked on simultaneously. That makes it important for a change to +propagate easily through various branches. + +svn +''' + +Because of Python's use of svnmerge, changes start with the trunk +(2.7) and then get merged to the release version of 2.6. To get the +change into the 3.x series, the change is merged into 3.1, fixed up, +and then merged into 3.0 (2.7 -> 2.6; 2.7 -> 3.1 -> 3.0). + +This is in contrast to a port-forward strategy where the patch would +have been added to 2.6 and then pulled forward into newer versions +(2.6 -> 2.7 -> 3.0 -> 3.1). + +:: + + # Assume patch applied to 2.7 in revision 0000. + cd release26-maint + svnmerge merge -r 0000 + # Resolve merge conflicts and make sure patch works. + svn commit -F svnmerge-commit-message.txt # revision 0001. + cd ../py3k + svnmerge merge -r 0000 + # Same as for 2.6, except Misc/NEWS changes are reverted. + svn revert Misc/NEWS + svn commit -F svnmerge-commit-message.txt # revision 0002. + cd ../release30-maint + svnmerge merge -r 0002 + svn commit -F svnmerge-commit-message.txt # revision 0003. + + +bzr +''' + +Bazaar is pretty straightforward here, since it supports cherry +picking revisions manually. In the example below, we could have +given a revision id instead of a revision number, but that's usually +not necessary. Martin Pool suggests "We'd generally recommend doing +the fix first in the oldest supported branch, and then merging it +forward to the later releases.":: + + # Assume patch applied to 2.7 in revision 0000 + cd release26-maint + bzr merge ../trunk -c 0000 + # Resolve conflicts and make sure patch works + bzr commit -m 'Back port patch NNNN' + bzr push bzr+ssh://me at code.python.org/trunk + cd ../py3k + bzr merge ../trunk -r 0000 + # Same as for 2.6 except Misc/NEWS changes are reverted + bzr revert Misc/NEWS + bzr commit -m 'Forward port patch NNNN' + bzr push bzr+ssh://me at code.python.org/py3k + + +hg +'' + +Mercurial, like other DVCS, does not well support the current +workflow used by Python core developers to backport patches. Right +now, bug fixes are first applied to the development mainline +(i.e., trunk), then back-ported to the maintenance branches and +forward-ported, as necessary, to the py3k branch. This workflow +requires the ability to cherry-pick individual changes. Mercurial's +transplant extension provides this ability. Here is an example of +the scenario using this workflow:: + + cd release26-maint + # Assume patch applied to 2.7 in revision 0000 + hg transplant -s ../trunk 0000 + # Resolve conflicts, if any. + cd ../py3k + hg pull ../trunk + hg merge + hg revert Misc/NEWS + hg commit -m "Merged trunk" + hg push + +In the above example, transplant acts much like the current svnmerge +command. When transplant is invoked without the revision, the command +launches an interactive loop useful for transplanting multiple +changes. Another useful feature is the --filter option which can be +used to modify changesets programmatically (e.g., it could be used +for removing changes to Misc/NEWS automatically). + +Alternatively to the traditional workflow, we could avoid +transplanting changesets by committing bug fixes to the oldest +supported release, then merge these fixes upward to the more recent +branches. +:: + + cd release25-maint + hg import fix_some_bug.diff + # Review patch and run test suite. Revert if failure. + hg push + cd ../release26-maint + hg pull ../release25-maint + hg merge + # Resolve conflicts, if any. Then, review patch and run test suite. + hg commit -m "Merged patches from release25-maint." + hg push + cd ../trunk + hg pull ../release26-maint + hg merge + # Resolve conflicts, if any, then review. + hg commit -m "Merged patches from release26-maint." + hg push + +Although this approach makes the history non-linear and slightly +more difficult to follow, it encourages fixing bugs across all +supported releases. Furthermore, it scales better when there is many +changes to backport, because we do not need to seek the specific +revision IDs to merge. + + +git +''' + +In git I would have a workspace which contains all of +the relevant master repository branches. git cherry-pick doesn't +work across repositories; you need to have the branches in the same +repository. +:: + + # Assume patch applied to 2.7 in revision release27~3 (4th patch back from tip). + cd integration + git checkout release26 + git cherry-pick release27~3 + # If there are conflicts, resolve them, and commit those changes. + # git commit -a -m "Resolve conflicts." + # Run test suite. If fixes are necessary, record as a separate commit. + # git commit -a -m "Fix code causing test failures." + git checkout master + git cherry-pick release27~3 + # Do any conflict resolution and test failure fixups. + # Revert Misc/NEWS changes. + git checkout HEAD^ -- Misc/NEWS + git commit -m 'Revert cherry-picked Misc/NEWS changes.' Misc/NEWS + # Push both ports. + git push release26 master + +If you are regularly merging (rather than cherry-picking) from a +given branch, then you can block a given commit from being +accidentally merged in the future by merging, then reverting it. +This does not prevent a cherry-pick from pulling in the unwanted +patch, and this technique requires blocking everything that you don't +want merged. I'm not sure if this differs from svn on this point. +:: + + cd trunk + # Merge in the alpha tested code. + git merge experimental-branch + # We don't want the 3rd-to-last commit from the experimental-branch, + # and we don't want it to ever be merged. + # The notation "^N" means Nth parent of the current commit. Thus HEAD^2^1^1 + # means the first parent of the first parent of the second parent of HEAD. + git revert HEAD^2^1^1 + # Propagate the merge and the prohibition to the public repository. + git push + + +Coordinated Development of a New Feature +---------------------------------------- + +Sometimes core developers end up working on a major feature with +several developers. As a core developer, I want to be able to +publish feature branches to a common public location so that I can +collaborate with other developers. + +This requires creating a branch on a server that other developers +can access. All of the DVCSs support creating new repositories on +hosts where the developer is already able to commit, with +appropriate configuration of the repository host. This is +similar in concept to the existing sandbox in svn, although details +of repository initialization may differ. + +For non-core developers, there are various more-or-less public-access +repository-hosting services. +Bazaar has +Launchpad_, +Mercurial has +`bitbucket.org`_, +and git has +GitHub_. +All also have easy-to-use +CGI interfaces for developers who maintain their own servers. + + +.. _Launchpad: http://www.launchpad.net/ +.. _bitbucket.org: http://www.bitbucket.org/ +.. _GitHub: http://www.github.com/ + +* Branch trunk. +* Pull from branch on the server. +* Pull from trunk. +* Push merge to trunk. + + +svn +''' +:: + + # Create branch. + svn copy svn+ssh://pythondev at svn.python.org/python/trunk svn+ssh://pythondev at svn.python.org/python/branches/NewHotness + svn checkout svn+ssh://pythondev at svn.python.org/python/branches/NewHotness + cd NewHotness + svnmerge init + svn commit -m "Initialize svnmerge." + # Pull in changes from other developers. + svn update + # Pull in trunk and merge to the branch. + svnmerge merge + svn commit -F svnmerge-commit-message.txt + + +bzr +''' +:: + + XXX To be done by Brett as a test of knowledge and online documentation/community. + + +hg +'' +:: + + XXX To be done by Brett as a test of knowledge and online documentation/community. + + +git +''' +:: + + XXX To be done by Brett as a test of knowledge and online documentation/community. + + +Separation of Issue Dependencies +-------------------------------- + +Sometimes, while working on an issue, it becomes apparent that the +problem being worked on is actually a compound issue of various +smaller issues. Being able to take the current work and then begin +working on a separate issue is very helpful to separate out issues +into individual units of work instead of compounding them into a +single, large unit. + +* Create a branch A (e.g. urllib has a bug). +* Edit some code. +* Create a new branch B that branch A depends on (e.g. the urllib + bug exposes a socket bug). +* Edit some code in branch B. +* Commit branch B. +* Edit some code in branch A. +* Commit branch A. +* Clean up. + + +svn +''' + +To make up for svn's lack of cheap branching, it has a changelist +option to associate a file with a single changelist. This is not as +powerful as being able to associate at the commit level. There is +also no way to express dependencies between changelists. +:: + + cp -r trunk issue0000 + cd issue0000 + # Edit some code. + echo "The cake is a lie!" > README + svn changelist A README + # Edit some other code. + echo "I own Python!" . LICENSE + svn changelist B LICENSE + svn ci -m "Tell it how it is." --changelist B + # Edit changelist A some more. + svn ci -m "Speak the truth." --changelist A + cd .. + rm -rf issue0000 + + +bzr +''' +Here's an approach that uses bzr shelf (now a standard part of bzr) +to squirrel away some changes temporarily while you take a detour to +fix the socket bugs. +:: + + bzr branch trunk bug-0000 + cd bug-0000 + # Edit some code. Dang, we need to fix the socket module. + bzr shelve --all + # Edit some code. + bzr commit -m "Socket module fixes" + # Detour over, now resume fixing urllib + bzr unshelve + # Edit some code + +Another approach uses the loom plugin. Looms can +greatly simplify working on dependent branches because they +automatically take care of the stacking dependencies for you. +Imagine looms as a stack of dependent branches (called "threads" in +loom parlance), with easy ways to move up and down the stack of +threads, merge changes up the stack to descendant threads, create +diffs between threads, etc. Occasionally, you may need or want to +export your loom threads into separate branches, either for review +or commit. Higher threads incorporate all the changes in the lower +threads, automatically. +:: + + bzr branch trunk bug-0000 + cd bug-0000 + bzr loomify --base trunk + bzr create-thread fix-urllib + # Edit some code. Dang, we need to fix the socket module first. + bzr commit -m "Checkpointing my work so far" + bzr down-thread + bzr create-thread fix-socket + # Edit some code + bzr commit -m "Socket module fixes" + bzr up-thread + # Manually resolve conflicts if necessary + bzr commit -m 'Merge in socket fixes' + # Edit me some more code + bzr commit -m "Now that socket is fixed, complete the urllib fixes" + bzr record done + +For bonus points, let's say someone else fixes the socket module in +exactly the same way you just did. Perhaps this person even grabbed your +fix-socket thread and applied just that to the trunk. You'd like to +be able to merge their changes into your loom and delete your +now-redundant fix-socket thread. +:: + + bzr down-thread trunk + # Get all new revisions to the trunk. If you've done things + # correctly, this will succeed without conflict. + bzr pull + bzr up-thread + # See? The fix-socket thread is now identical to the trunk + bzr commit -m 'Merge in trunk changes' + bzr diff -r thread: | wc -l # returns 0 + bzr combine-thread + bzr up-thread + # Resolve any conflicts + bzr commit -m 'Merge trunk' + # Now our top-thread has an up-to-date trunk and just the urllib fix. + + +hg +'' + +One approach is to use the shelve extension; this extension is not included +with Mercurial, but it is easy to install. With shelve, you can select changes +to put temporarily aside. +:: + + hg clone trunk issue0000 + cd issue0000 + # Edit some code (e.g. urllib). + hg shelve + # Select changes to put aside + # Edit some other code (e.g. socket). + hg commit + hg unshelve + # Complete initial fix. + hg commit + cd ../trunk + hg pull ../issue0000 + hg merge + hg commit + rm -rf ../issue0000 + +Several other way to approach this scenario with Mercurial. Alexander Solovyov +presented a few `alternative approaches`_ on Mercurial's mailing list. + +.. _alternative approaches: http://selenic.com/pipermail/mercurial/2009-January/023710.html + +git +''' +:: + + cd trunk + # Edit some code in urllib. + # Discover a bug in socket, want to fix that first. + # So save away our current work. + git stash + # Edit some code, commit some changes. + git commit -a -m "Completed fix of socket." + # Restore the in-progress work on urllib. + git stash apply + # Edit me some more code, commit some more fixes. + git commit -a -m "Complete urllib fixes." + # And push both patches to the public repository. + git push + +Bonus points: suppose you took your time, and someone else fixes +socket in the same way you just did, and landed that in the trunk. In +that case, your push will fail because your branch is not up-to-date. +If the fix was a one-liner, there's a very good chance that it's +*exactly* the same, character for character. git would notice that, +and you are done; git will silently merge them. + +Suppose we're not so lucky:: + + # Update your branch. + git pull git://code.python.org/public/trunk master + + # git has fetched all the necessary data, but reports that the + # merge failed. We discover the nearly-duplicated patch. + # Neither our version of the master branch nor the workspace has + # been touched. Revert our socket patch and pull again: + git revert HEAD^ + git pull git://code.python.org/public/trunk master + +Like Bazaar and Mercurial, git has extensions to manage stacks of +patches. You can use the original Quilt by Andrew Morton, or there is +StGit ("stacked git") which integrates patch-tracking for large sets +of patches into the VCS in a way similar to Mercurial Queues or Bazaar +looms. + + +Doing a Python Release +---------------------- + +How does PEP 101 change when using a DVCS? + + +bzr +''' + +It will change, but not substantially so. When doing the +maintenance branch, we'll just push to the new location instead of +doing an svn cp. Tags are totally different, since in svn they are +directory copies, but in bzr (and I'm guessing hg), they are just +symbolic names for revisions on a particular branch. The release.py +script will have to change to use bzr commands instead. It's +possible that because DVCS (in particular, bzr) does cherry picking +and merging well enough that we'll be able to create the maint +branches sooner. It would be a useful exercise to try to do a +release off the bzr/hg mirrors. + + +hg +'' + +Clearly, details specific to Subversion in PEP 101 and in the +release script will need to be updated. In particular, release +tagging and maintenance branches creation process will have to be +modified to use Mercurial's features; this will simplify and +streamline certain aspects of the release process. For example, +tagging and re-tagging a release will become a trivial operation +since a tag, in Mercurial, is simply a symbolic name for a given +revision. + + +git +''' + +It will change, but not substantially so. When doing the +maintenance branch, we'll just git push to the new location instead +of doing an svn cp. Tags are totally different, since in svn they +are directory copies, but in git they are just symbolic names for +revisions, as are branches. (The difference between a tag and a +branch is that tags refer to a particular commit, and will never +change unless you use git tag -f to force them to move. The +checked-out branch, on the other hand, is automatically updated by +git commit.) The release.py script will have to change to use git +commands instead. With git I would create a (local) maintenance +branch as soon as the release engineer is chosen. Then I'd "git +pull" until I didn't like a patch, when it would be "git pull; git +revert ugly-patch", until it started to look like the sensible thing +is to fork off, and start doing "git cherry-pick" on the good +patches. -* Keep all release (maintenance) branches -* Discard branches that haven't been touched in 18 months, unless somone - indicates there's still interest in such a branch -* Keep branches that have been touched in the last 18 months, unless someone - indicates the branch can be deprecated - -Converting tags ---------------- - -The SVN tags directory contains a lot of old stuff. Some of these are not, in -fact, full tags, but contain only a smaller subset of the repository. I think -we should keep all release tags, and consider other tags for inclusion based -on requests from the developer community. I'd like to consider unifying the -release tag naming scheme to make some things more consistent, if people feel -that won't create too many problems. - -Author map ----------- - -In order to provide user names the way they are common in hg (in the 'First Last -' format), we need an author map to map cvs and svn user -names to real names and their email addresses. I have a complete version of such -a map in my `migration tools repository`_. The email addresses in it might be -out of date; that's bound to happen, although it would be nice to try and -have as many people as possible review it for addresses that are out of date. -The current version also still seems to contain some encoding problems. - -.. _migration tools repository: http://hg.xavamedia.nl/cpython/pymigr/ - -Generating .hgignore --------------------- - -The .hgignore file can be used in Mercurial repositories to help ignore files -that are not eligible for version control. It does this by employing several -possible forms of pattern matching. The current Python repository already -includes a rudimentary .hgignore file to help with using the hg mirrors. - -It might be useful to have the .hgignore be generated automatically from -svn:ignore properties. This would make sure all historic revisions also have -useful ignore information (though one could argue ignoring isn't really -relevant to just checking out an old revision). -Revlog reordering +Platform/Tool Support +===================== + +Operating Systems ----------------- +==== ======================================= ============================================= ============================= +DVCS Windows OS X UNIX +---- --------------------------------------- --------------------------------------------- ----------------------------- +bzr yes (installer) w/ tortoise yes (installer, fink or MacPorts) yes (various package formats) +hg yes (third-party installer) w/ tortoise yes (third-party installer, fink or MacPorts) yes (various package formats) +git yes (third-party installer) yes (third-party installer, fink or MacPorts) yes (.deb or .rpm) +==== ======================================= ============================================= ============================= + +As the above table shows, all three DVCSs are available on all three +major OS platforms. But what it also shows is that Bazaar is the +only DVCS that directly supports Windows with a binary installer +while Mercurial and git require you to rely on a third-party for +binaries. Both bzr and hg have a tortoise version while git does not. + +Bazaar and Mercurial also has the benefit of being available in pure +Python with optional extensions available for performance. -As an optional optimization technique, we should consider trying a reordering -pass on the revlogs (internal Mercurial files) resulting from the conversion. -In some cases this results in dramatic decreases in on-disk repository size. -Other repositories +CRLF -> LF Support ------------------ -Richard Tew has indicated that he'd like the Stackless repository to also be -converted. What other projects in the svn.python.org repository should be -converted? Do we want to convert the peps repository? distutils? others? +bzr + My understanding is that support for this is being worked on as + I type, landing in a version RSN. I will try to dig up details. +hg + Supported via the win32text extension. -Infrastructure -============== +git + I can't say from personal experience, but it looks like there's + pretty good support via the core.autocrlf and core.safecrlf + configuration attributes. + + +Case-insensitive filesystem support +----------------------------------- + +bzr + Should be OK. I share branches between Linux and OS X all the + time. I've done case changes (e.g. ``bzr mv Mailman mailman``) and + as long as I did it on Linux (obviously), when I pulled in the + changes on OS X everything was hunky dory. + +hg + Mercurial uses a case safe repository mechanism and detects case + folding collisions. -hg-ssh ------- +git + Since OS X preserves case, you can do case changes there too. + git does not have a problem with renames in either direction. + However, case-insensitive filesystem support is usually taken + to mean complaining about collisions on case-sensitive files + systems. git does not do that. -Developers should access the repositories through ssh, similar to the current -setup. Public keys can be used to grant people access to a shared hg@ account. -A hgwebdir instance should also be set up for easy browsing and read-only -access. Some facility for sandboxes/incubator repositories could be discussed. -Hooks +Tools ----- -A number of hooks is currently in use. The hg equivalents for these should be -developed and deployed. The following hooks are being used: +In terms of code review tools such as `Review Board`_ and Rietveld_, +the former supports all three while the latter supports hg and git but +not bzr. Bazaar does not yet have an online review board, but it +has several ways to manage email based reviews and trunk merging. +There's `Bundle Buggy`_, `Patch Queue Manager`_ (PQM), and +`Launchpad's code reviews `_. -* check whitespace: a hook to reject commits in case the whitespace doesn't - match the rules for the Python codebase. Should be straightforward to - re-implement from the current version. Open issue: do we check only the tip - after each push, or do we check every commit in a changegroup? - -* commit mails: we can leverage the notify extension for this - -* buildbots: both the regular and the community build masters must be notified. - Fortunately buildbot includes support for hg. I've also implemented this for - Mercurial itself, so I don't expect problems here. - -* check contributors: in the current setup, all changesets bear the username of - committers, who must have signed the contributor agreement. In a DVCS, the - committers are not necessarily the same people who push, and so we can't - check if the committer is a contributor. We could use a hook to check if the - committer is a contributor if we keep a list of registered contributors. +.. _Review Board: http://www.review-board.org/ +.. _Rietveld: http://code.google.com/p/rietveld/ -hgwebdir --------- +.. _Bundle Buggy: http://code.aaronbentley.com/bundlebuggy/ +.. _Patch Queue Manager: http://bazaar-vcs.org/PatchQueueManager + +All three have some web site online that provides basic hosting +support for people who want to put a repository online. Bazaar has +Launchpad, Mercurial has bitbucket.org, and git has GitHub. Google +Code also has instructions on how to use git with the service, both +to hold a repository and how to act as a read-only mirror. + +All three also `appear to be supported +`_ +by Buildbot_. + +.. _Buildbot: http://buildbot.net + + +Usage On Top Of Subversion +========================== + +==== ============ +DVCS svn support +---- ------------ +bzr bzr-svn_ (third-party) +hg `multiple third-parties `__ +git git-svn_ +==== ============ + +.. _bzr-svn: http://bazaar-vcs.org/BzrForeignBranches/Subversion +.. _git-svn: http://www.kernel.org/pub/software/scm/git/docs/git-svn.html + +All three DVCSs have svn support, although git is the only one to +come with that support out-of-the-box. + + +Server Support +============== + +==== ================== +DVCS Web page interface +---- ------------------ +bzr loggerhead_ +hg hgweb_ +git gitweb_ +==== ================== + +.. _loggerhead: https://launchpad.net/loggerhead +.. _hgweb: http://www.selenic.com/mercurial/wiki/index.cgi/HgWebDirStepByStep +.. _gitweb: http://git.or.cz/gitwiki/Gitweb + +All three DVCSs support various hooks on the client and server side +for e.g. pre/post-commit verifications. + + +Development +=========== + +All three projects are under active development. Git seems to be on a +monthly release schedule. Bazaar is on a time-released monthly +schedule. Mercurial is on a 4-month, timed release schedule. + + +Special Features +================ + +bzr +--- + +Martin Pool adds: "bzr has a stable Python scripting interface, with +a distinction between public and private interfaces and a +deprecation window for APIs that are changing. Some plugins are +listed in https://edge.launchpad.net/bazaar and +http://bazaar-vcs.org/Documentation". + + +hg +-- + +Alexander Solovyov comments: + + Mercurial has easy to use extensive API with hooks for main events + and ability to extend commands. Also there is the mq (mercurial + queues) extension, distributed with Mercurial, which simplifies + work with patches. + + +git +--- + +git has a cvsserver mode, ie, you can check out a tree from git +using CVS. You can even commit to the tree, but features like +merging are absent, and branches are handled as CVS modules, which +is likely to shock a veteran CVS user. + + +Tests/Impressions +================= + +As I (Brett Cannon) am left with the task of of making the final +decision of which/any DVCS to go with and not my co-authors, I felt +it only fair to write down what tests I ran and my impressions as I +evaluate the various tools so as to be as transparent as possible. + + +Barrier to Entry +---------------- + +The amount of time and effort it takes to get a checkout of Python's +repository is critical. If the difficulty or time is too great then a +person wishing to contribute to Python may very well give up. That +cannot be allowed to happen. + +I measured the checking out of the 2.x trunk as if I was a non-core +developer. Timings were done using the ``time`` command in zsh and +space was calculated with ``du -c -h``. + +======= ================ ========= ===== +DVCS San Francisco Vancouver Space +------- ---------------- --------- ----- +svn 1:04 2:59 139 M +bzr 10:45 16:04 276 M +hg 2:30 5:24 171 M +git 2:54 5:28 134 M +======= ================ ========= ===== + +When comparing these numbers to svn, it is important to realize that +it is not a 1:1 comparison. Svn does not pull down the entire revision +history like all of the DVCSs do. That means svn can perform an +initial checkout much faster than the DVCS purely based on the fact +that it has less information to download for the network. + + +Performance of basic information functionality +---------------------------------------------- + +To see how the tools did for performing a command that required +querying the history, the log for the ``README`` file was timed. + +==== ===== +DVCS Time +---- ----- +bzr 4.5 s +hg 1.1 s +git 1.5 s +==== ===== + +One thing of note during this test was that git took longer than the +other three tools to figure out how to get the log without it using a +pager. While the pager use is a nice touch in general, not having it +automatically turn on took some time (turns out the main ``git`` +command has a ``--no-pager`` flag to disable use of the pager). + + +Figuring out what command to use from built-in help +---------------------------------------------------- + +I ended up trying to find out what the command was to see what URL the +repository was cloned from. To do this I used nothing more than the +help provided by the tool itself or its man pages. + +Bzr was the easiest: ``bzr info``. Running ``bzr help`` didn't show +what I wanted, but mentioned ``bzr help commands``. That list had the +command with a description that made sense. + +Git was the second easiest. The command ``git help`` didn't show much +and did not have a way of listing all commands. That is when I viewed +the man page. Reading through the various commands I discovered ``git +remote``. The command itself spit out nothing more than ``origin``. +Trying ``git remote origin`` said it was an error and printed out the +command usage. That is when I noticed ``git remote show``. Running +``git remote show origin`` gave me the information I wanted. + +For hg, I never found the information I wanted on my own. It turns out +I wanted ``hg paths``, but that was not obvious from the description +of "show definition of symbolic path names" as printed by ``hg help`` +(it should be noted that reporting this in the PEP did lead to the +Mercurial developers to clarify the wording to make the use of the +``hg paths`` command clearer). + + +Updating a checkout +--------------------- + +To see how long it takes to update an outdated repository I timed both +updating a repository 700 commits behind and 50 commits behind (three +weeks stale and 1 week stale, respectively). + +==== =========== ========== +DVCS 700 commits 50 commits +---- ----------- ---------- +bzr 39 s 7 s +hg 17 s 3 s +git N/A 4 s +==== =========== ========== + +.. note:: + Git lacks a value for the *700 commits* scenario as it does + not seem to allow checking out a repository at a specific + revision. + +Git deserves special mention for its output from ``git pull``. It +not only lists the delta change information for each file but also +color-codes the information. + + +XXX ... usage on top of svn, filling in `Coordinated Development of a +New Feature`_ scenario + + + +Chosen DVCS +=========== + +XXX +:: + + import random + print(random.choice(['svn', 'bzr', 'hg', 'git'])) + + +Transition Plan +=============== -A more or less stock hgwebdir installation should be set up. We might want to -come up with a style to match the Python website. It may also be useful to -build a quick extension to augment the URL rev parser so that it can also take -r[0-9]+ args and come up with the matching hg revision. +XXX From buildbot at python.org Mon May 25 16:37:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 25 May 2009 14:37:07 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090525143707.24408C472@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/742 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Mon May 25 16:53:48 2009 From: python-checkins at python.org (dirkjan.ochtman) Date: Mon, 25 May 2009 16:53:48 +0200 (CEST) Subject: [Python-checkins] r72915 - peps/trunk/pep-0385.txt Message-ID: <20090525145348.92A3CC4A6@mail.python.org> Author: dirkjan.ochtman Date: Mon May 25 16:53:48 2009 New Revision: 72915 Log: PEP 385: Migrating to Mercurial (initial version). Added: peps/trunk/pep-0385.txt Added: peps/trunk/pep-0385.txt ============================================================================== --- (empty file) +++ peps/trunk/pep-0385.txt Mon May 25 16:53:48 2009 @@ -0,0 +1,167 @@ +PEP: 385 +Title: Migrating from svn to Mercurial +Version: $Revision: 72563 $ +Last-Modified: $Date: 2009-05-11 14:50:03 +0200 (Mon, 11 May 2009) $ +Author: Dirkjan Ochtman +Status: Active +Type: Process +Content-Type: text/x-rst +Created: 25-May-2009 + +.. warning:: + This PEP is in the draft stages. + + +Motivation +========== + +After having decided to switch to the Mercurial DVCS, the actual migration +still has to be performed. In the case of an important piece of +infrastructure like the version control system for a large, distributed +project like Python, this is a significant effort. This PEP is an attempt +to describe the steps that must be taken for further discussion. It's +equivalent to `PEP 347`_, which discussed the migration to SVN. + +To make the most of hg, I (Dirkjan) would like to make a high-fidelity +conversion, such that (a) as much of the svn metadata as possible is +retained, and (b) all metadata is converted to formats that are common in +Mercurial. This way, tools written for Mercurial can be optimally used. In +order to do this, I want to use the `hgsubversion`_ software to do an initial +conversion. This hg extension is focused on providing high-quality conversion +from Subversion to Mercurial for use in two-way correspondence, meaning it +doesn't throw away as much available metadata as other solutions. + +Such a conversion also seems like a good time to reconsider the contents of +the repository and determine if some things are still valuable. In this spirit, +the following sections also propose discarding some of the older metadata. + +.. _PEP 347: http://www.python.org/dev/peps/pep-0347/ +.. _hgsubversion: http://bitbucket.org/durin42/hgsubversion/ + + +Transition plan +=============== + +Branch strategy +--------------- + +Mercurial has two basic ways of using branches: cloned branches, where each +branch is kept in a separate directory, and named branches, where each revision +keeps metadata to note on which branch it belongs. The former makes it easier +to distinguish branches, at the expense of requiring more disk space on the +client. The latter makes it a little easier to switch between branches, but +often has somewhat unintuitive results for people (though this has been +getting better in recent versions of Mercurial). + +For Python, I think it would work well to have cloned branches and keep most +things separate. This is predicated on the assumption that most people work on +just one (or maybe two) branches at a time. Branches can be exposed separately, +though I would advocate merging old (and tagged!) branches into mainline so +that people can easily revert to older releases. At what age of a release this +should be done can be debated (a natural point might be when the branch gets +unsupported, e.g. 2.4 at the release of 2.6). + +Converting branches +------------------- + +There are quite a lot of branches in SVN's branches directory. I propose to +clean this up a bit, by employing the following the strategy: + +* Keep all release (maintenance) branches +* Discard branches that haven't been touched in 18 months, unless somone + indicates there's still interest in such a branch +* Keep branches that have been touched in the last 18 months, unless someone + indicates the branch can be deprecated + +Converting tags +--------------- + +The SVN tags directory contains a lot of old stuff. Some of these are not, in +fact, full tags, but contain only a smaller subset of the repository. I think +we should keep all release tags, and consider other tags for inclusion based +on requests from the developer community. I'd like to consider unifying the +release tag naming scheme to make some things more consistent, if people feel +that won't create too many problems. + +Author map +---------- + +In order to provide user names the way they are common in hg (in the 'First Last +' format), we need an author map to map cvs and svn user +names to real names and their email addresses. I have a complete version of such +a map in my `migration tools repository`_. The email addresses in it might be +out of date; that's bound to happen, although it would be nice to try and +have as many people as possible review it for addresses that are out of date. +The current version also still seems to contain some encoding problems. + +.. _migration tools repository: http://hg.xavamedia.nl/cpython/pymigr/ + +Generating .hgignore +-------------------- + +The .hgignore file can be used in Mercurial repositories to help ignore files +that are not eligible for version control. It does this by employing several +possible forms of pattern matching. The current Python repository already +includes a rudimentary .hgignore file to help with using the hg mirrors. + +It might be useful to have the .hgignore be generated automatically from +svn:ignore properties. This would make sure all historic revisions also have +useful ignore information (though one could argue ignoring isn't really +relevant to just checking out an old revision). + +Revlog reordering +----------------- + +As an optional optimization technique, we should consider trying a reordering +pass on the revlogs (internal Mercurial files) resulting from the conversion. +In some cases this results in dramatic decreases in on-disk repository size. + +Other repositories +------------------ + +Richard Tew has indicated that he'd like the Stackless repository to also be +converted. What other projects in the svn.python.org repository should be +converted? Do we want to convert the peps repository? distutils? others? + + +Infrastructure +============== + +hg-ssh +------ + +Developers should access the repositories through ssh, similar to the current +setup. Public keys can be used to grant people access to a shared hg@ account. +A hgwebdir instance should also be set up for easy browsing and read-only +access. Some facility for sandboxes/incubator repositories could be discussed. + +Hooks +----- + +A number of hooks is currently in use. The hg equivalents for these should be +developed and deployed. The following hooks are being used: + +* check whitespace: a hook to reject commits in case the whitespace doesn't + match the rules for the Python codebase. Should be straightforward to + re-implement from the current version. Open issue: do we check only the tip + after each push, or do we check every commit in a changegroup? + +* commit mails: we can leverage the notify extension for this + +* buildbots: both the regular and the community build masters must be notified. + Fortunately buildbot includes support for hg. I've also implemented this for + Mercurial itself, so I don't expect problems here. + +* check contributors: in the current setup, all changesets bear the username of + committers, who must have signed the contributor agreement. In a DVCS, the + committers are not necessarily the same people who push, and so we can't + check if the committer is a contributor. We could use a hook to check if the + committer is a contributor if we keep a list of registered contributors. + +hgwebdir +-------- + +A more or less stock hgwebdir installation should be set up. We might want to +come up with a style to match the Python website. It may also be useful to +build a quick extension to augment the URL rev parser so that it can also take +r[0-9]+ args and come up with the matching hg revision. From python-checkins at python.org Mon May 25 16:59:23 2009 From: python-checkins at python.org (dirkjan.ochtman) Date: Mon, 25 May 2009 16:59:23 +0200 (CEST) Subject: [Python-checkins] r72916 - peps/trunk/pep-0374.txt Message-ID: <20090525145923.EAC48D5A4@mail.python.org> Author: dirkjan.ochtman Date: Mon May 25 16:59:23 2009 New Revision: 72916 Log: Update PEP 374 to talk about DVCS decision, and point to PEP 385 for migration details. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Mon May 25 16:59:23 2009 @@ -1,11 +1,12 @@ PEP: 374 -Title: Migrating from svn to a distributed VCS +Title: Chosing a distributed VCS for the Python project Version: $Revision$ Last-Modified: $Date$ Author: Brett Cannon , Stephen J. Turnbull , Alexandre Vassalotti , - Barry Warsaw + Barry Warsaw , + Dirkjan Ochtman Status: Active Type: Process Content-Type: text/x-rst @@ -13,10 +14,6 @@ Post-History: 07-Nov-2008 22-Jan-2009 -.. warning:: - This PEP is in the draft stages and is still under active - development. - Rationale ========= @@ -1453,18 +1450,28 @@ New Feature`_ scenario - Chosen DVCS =========== -XXX -:: +At PyCon 2009, a `decision +`_ +was made to go with Mercurial. - import random - print(random.choice(['svn', 'bzr', 'hg', 'git'])) +The choice to go with Mercurial was made for three important reasons: +* According to a small survey, Python developers are more interested in + using Mercurial than in Bazaar or Git. -Transition Plan -=============== +* Mercurial is written in Python, which is congruent with the python-dev + tendency to 'eat their own dogfood'. + +* Mercurial is significantly faster than bzr (it's slower than git, though + by a much smaller difference). + +* Mercurial is easier to learn for SVN users than bzr. + +Although all of these points can be debated, in the end a pronouncement from +the BDFL was made to go with hg as the chosen DVCS for the Python project. A +detailed plan for the migration strategy has been deferred to `PEP 385`_. -XXX +.. _PEP 385: http://www.python.org/dev/peps/pep-0385/ From python-checkins at python.org Mon May 25 17:09:02 2009 From: python-checkins at python.org (dirkjan.ochtman) Date: Mon, 25 May 2009 17:09:02 +0200 (CEST) Subject: [Python-checkins] r72917 - peps/trunk/pep-0374.txt Message-ID: <20090525150902.6901ED2A4@mail.python.org> Author: dirkjan.ochtman Date: Mon May 25 17:09:02 2009 New Revision: 72917 Log: PEP 374: move section on final decision up. Modified: peps/trunk/pep-0374.txt Modified: peps/trunk/pep-0374.txt ============================================================================== --- peps/trunk/pep-0374.txt (original) +++ peps/trunk/pep-0374.txt Mon May 25 17:09:02 2009 @@ -97,6 +97,33 @@ the future as the state of DVCSs evolves. +Chosen DVCS +=========== + +At PyCon 2009, a `decision +`_ +was made to go with Mercurial. + +The choice to go with Mercurial was made for three important reasons: + +* According to a small survey, Python developers are more interested in + using Mercurial than in Bazaar or Git. + +* Mercurial is written in Python, which is congruent with the python-dev + tendency to 'eat their own dogfood'. + +* Mercurial is significantly faster than bzr (it's slower than git, though + by a much smaller difference). + +* Mercurial is easier to learn for SVN users than bzr. + +Although all of these points can be debated, in the end a pronouncement from +the BDFL was made to go with hg as the chosen DVCS for the Python project. A +detailed plan for the migration strategy has been deferred to `PEP 385`_. + +.. _PEP 385: http://www.python.org/dev/peps/pep-0385/ + + Terminology =========== @@ -1448,30 +1475,3 @@ XXX ... usage on top of svn, filling in `Coordinated Development of a New Feature`_ scenario - - -Chosen DVCS -=========== - -At PyCon 2009, a `decision -`_ -was made to go with Mercurial. - -The choice to go with Mercurial was made for three important reasons: - -* According to a small survey, Python developers are more interested in - using Mercurial than in Bazaar or Git. - -* Mercurial is written in Python, which is congruent with the python-dev - tendency to 'eat their own dogfood'. - -* Mercurial is significantly faster than bzr (it's slower than git, though - by a much smaller difference). - -* Mercurial is easier to learn for SVN users than bzr. - -Although all of these points can be debated, in the end a pronouncement from -the BDFL was made to go with hg as the chosen DVCS for the Python project. A -detailed plan for the migration strategy has been deferred to `PEP 385`_. - -.. _PEP 385: http://www.python.org/dev/peps/pep-0385/ From python-checkins at python.org Mon May 25 20:00:52 2009 From: python-checkins at python.org (alexandre.vassalotti) Date: Mon, 25 May 2009 20:00:52 +0200 (CEST) Subject: [Python-checkins] r72918 - python/branches/py3k/Modules/_pickle.c Message-ID: <20090525180052.354C2D33F@mail.python.org> Author: alexandre.vassalotti Date: Mon May 25 20:00:52 2009 New Revision: 72918 Log: Make variable declarations for opcodes in batch_dict_exact consistent with the rest of the module. Modified: python/branches/py3k/Modules/_pickle.c Modified: python/branches/py3k/Modules/_pickle.c ============================================================================== --- python/branches/py3k/Modules/_pickle.c (original) +++ python/branches/py3k/Modules/_pickle.c Mon May 25 20:00:52 2009 @@ -1715,9 +1715,9 @@ int i; Py_ssize_t dict_size, ppos = 0; - static const char mark_op = MARK; - static const char setitem = SETITEM; - static const char setitems = SETITEMS; + const char mark_op = MARK; + const char setitem_op = SETITEM; + const char setitems_op = SETITEMS; assert(obj != NULL); assert(self->proto > 0); @@ -1731,7 +1731,7 @@ return -1; if (save(self, value, 0) < 0) return -1; - if (pickler_write(self, &setitem, 1) < 0) + if (pickler_write(self, &setitem_op, 1) < 0) return -1; return 0; } @@ -1749,7 +1749,7 @@ if (++i == BATCHSIZE) break; } - if (pickler_write(self, &setitems, 1) < 0) + if (pickler_write(self, &setitems_op, 1) < 0) return -1; if (PyDict_Size(obj) != dict_size) { PyErr_Format( From python-checkins at python.org Mon May 25 20:50:33 2009 From: python-checkins at python.org (alexandre.vassalotti) Date: Mon, 25 May 2009 20:50:33 +0200 (CEST) Subject: [Python-checkins] r72919 - python/branches/py3k/Lib/pickle.py Message-ID: <20090525185033.A029ED5FF@mail.python.org> Author: alexandre.vassalotti Date: Mon May 25 20:50:33 2009 New Revision: 72919 Log: Only try to intern str objects when unpickling attributes. This matches the behaviour implmented in _pickle. Modified: python/branches/py3k/Lib/pickle.py Modified: python/branches/py3k/Lib/pickle.py ============================================================================== --- python/branches/py3k/Lib/pickle.py (original) +++ python/branches/py3k/Lib/pickle.py Mon May 25 20:50:33 2009 @@ -1195,15 +1195,13 @@ if isinstance(state, tuple) and len(state) == 2: state, slotstate = state if state: - d = inst.__dict__ + inst_dict = inst.__dict__ intern = sys.intern - try: - for k, v in state.items(): - d[intern(k)] = v - # keys in state don't have to be strings - # don't blow up, but don't go out of our way - except TypeError: - d.update(state) + for k, v in state.items(): + if type(k) is str: + inst_dict[intern(k)] = v + else: + inst_dict[k] = v if slotstate: for k, v in slotstate.items(): setattr(inst, k, v) From buildbot at python.org Mon May 25 21:32:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 25 May 2009 19:32:15 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090525193215.E9671D408@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/803 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: alexandre.vassalotti BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Mon May 25 22:12:57 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 25 May 2009 22:12:57 +0200 (CEST) Subject: [Python-checkins] r72920 - python/trunk/Python/compile.c Message-ID: <20090525201257.69CEEC3C9@mail.python.org> Author: benjamin.peterson Date: Mon May 25 22:12:57 2009 New Revision: 72920 Log: take into account the fact that SETUP_WITH pushes a finally block Modified: python/trunk/Python/compile.c Modified: python/trunk/Python/compile.c ============================================================================== --- python/trunk/Python/compile.c (original) +++ python/trunk/Python/compile.c Mon May 25 22:12:57 2009 @@ -779,7 +779,7 @@ case BREAK_LOOP: return 0; case SETUP_WITH: - return 1; + return 4; case WITH_CLEANUP: return -1; /* XXX Sometimes more */ case LOAD_LOCALS: From python-checkins at python.org Mon May 25 22:13:36 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 25 May 2009 22:13:36 +0200 (CEST) Subject: [Python-checkins] r72921 - python/trunk/Modules/future_builtins.c Message-ID: <20090525201336.6B639D276@mail.python.org> Author: benjamin.peterson Date: Mon May 25 22:13:36 2009 New Revision: 72921 Log: fix error handling Modified: python/trunk/Modules/future_builtins.c Modified: python/trunk/Modules/future_builtins.c ============================================================================== --- python/trunk/Modules/future_builtins.c (original) +++ python/trunk/Modules/future_builtins.c Mon May 25 22:13:36 2009 @@ -85,11 +85,12 @@ if (itertools == NULL) return; + /* If anything in the following loop fails, we fall through. */ for (cur_func = it_funcs; *cur_func; ++cur_func){ iter_func = PyObject_GetAttrString(itertools, *cur_func); - if (iter_func == NULL) - return; - PyModule_AddObject(m, *cur_func+1, iter_func); + if (iter_func == NULL || + PyModule_AddObject(m, *cur_func+1, iter_func) < 0) + break; } Py_DECREF(itertools); /* any other initialization needed */ From python-checkins at python.org Mon May 25 22:22:06 2009 From: python-checkins at python.org (benjamin.peterson) Date: Mon, 25 May 2009 22:22:06 +0200 (CEST) Subject: [Python-checkins] r72922 - python/branches/py3k Message-ID: <20090525202206.26AC9C49B@mail.python.org> Author: benjamin.peterson Date: Mon May 25 22:22:05 2009 New Revision: 72922 Log: Blocked revisions 72921 via svnmerge ........ r72921 | benjamin.peterson | 2009-05-25 15:13:36 -0500 (Mon, 25 May 2009) | 1 line fix error handling ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Mon May 25 22:36:56 2009 From: python-checkins at python.org (michael.foord) Date: Mon, 25 May 2009 22:36:56 +0200 (CEST) Subject: [Python-checkins] r72923 - python/trunk/Lib/unittest.py Message-ID: <20090525203656.60FFAC449@mail.python.org> Author: michael.foord Date: Mon May 25 22:36:56 2009 New Revision: 72923 Log: Make assertSequenceEqual error messages less cryptic, particularly for nested sequences. Modified: python/trunk/Lib/unittest.py Modified: python/trunk/Lib/unittest.py ============================================================================== --- python/trunk/Lib/unittest.py (original) +++ python/trunk/Lib/unittest.py Mon May 25 22:36:56 2009 @@ -731,23 +731,32 @@ if seq1 == seq2: return + seq1_repr = repr(seq1) + seq2_repr = repr(seq2) + if len(seq1_repr) > 30: + seq1_repr = seq1_repr[:30] + '...' + if len(seq2_repr) > 30: + seq2_repr = seq2_repr[:30] + '...' + elements = (seq_type_name.capitalize(), seq1_repr, seq2_repr) + differing = '%ss differ: %s != %s\n' % elements + for i in xrange(min(len1, len2)): try: item1 = seq1[i] except (TypeError, IndexError, NotImplementedError): - differing = ('Unable to index element %d of first %s\n' % + differing += ('\nUnable to index element %d of first %s\n' % (i, seq_type_name)) break try: item2 = seq2[i] except (TypeError, IndexError, NotImplementedError): - differing = ('Unable to index element %d of second %s\n' % + differing += ('\nUnable to index element %d of second %s\n' % (i, seq_type_name)) break if item1 != item2: - differing = ('First differing element %d:\n%s\n%s\n' % + differing += ('\nFirst differing element %d:\n%s\n%s\n' % (i, item1, item2)) break else: @@ -755,28 +764,26 @@ type(seq1) != type(seq2)): # The sequences are the same, but have differing types. return - # A catch-all message for handling arbitrary user-defined - # sequences. - differing = '%ss differ:\n' % seq_type_name.capitalize() - if len1 > len2: - differing = ('First %s contains %d additional ' - 'elements.\n' % (seq_type_name, len1 - len2)) - try: - differing += ('First extra element %d:\n%s\n' % - (len2, seq1[len2])) - except (TypeError, IndexError, NotImplementedError): - differing += ('Unable to index element %d ' - 'of first %s\n' % (len2, seq_type_name)) - elif len1 < len2: - differing = ('Second %s contains %d additional ' - 'elements.\n' % (seq_type_name, len2 - len1)) - try: - differing += ('First extra element %d:\n%s\n' % - (len1, seq2[len1])) - except (TypeError, IndexError, NotImplementedError): - differing += ('Unable to index element %d ' - 'of second %s\n' % (len1, seq_type_name)) - standardMsg = differing + '\n'.join(difflib.ndiff(pprint.pformat(seq1).splitlines(), + + if len1 > len2: + differing += ('\nFirst %s contains %d additional ' + 'elements.\n' % (seq_type_name, len1 - len2)) + try: + differing += ('First extra element %d:\n%s\n' % + (len2, seq1[len2])) + except (TypeError, IndexError, NotImplementedError): + differing += ('Unable to index element %d ' + 'of first %s\n' % (len2, seq_type_name)) + elif len1 < len2: + differing += ('\nSecond %s contains %d additional ' + 'elements.\n' % (seq_type_name, len2 - len1)) + try: + differing += ('First extra element %d:\n%s\n' % + (len1, seq2[len1])) + except (TypeError, IndexError, NotImplementedError): + differing += ('Unable to index element %d ' + 'of second %s\n' % (len1, seq_type_name)) + standardMsg = differing + '\n' + '\n'.join(difflib.ndiff(pprint.pformat(seq1).splitlines(), pprint.pformat(seq2).splitlines())) msg = self._formatMessage(msg, standardMsg) self.fail(msg) From buildbot at python.org Mon May 25 22:37:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 25 May 2009 20:37:50 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 3.x Message-ID: <20090525203751.13F0CC461@mail.python.org> The Buildbot has detected a new failure of x86 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%203.x/builds/916 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Unknown signal 32 sincerely, -The Buildbot From python-checkins at python.org Mon May 25 23:02:56 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 25 May 2009 23:02:56 +0200 (CEST) Subject: [Python-checkins] r72924 - in python/trunk: Doc/reference/compound_stmts.rst Grammar/Grammar Include/graminit.h Lib/compiler/transformer.py Lib/test/test_compiler.py Lib/test/test_parser.py Lib/test/test_with.py Misc/NEWS Modules/parsermodule.c Python/ast.c Python/graminit.c Message-ID: <20090525210256.A1097D3FB@mail.python.org> Author: georg.brandl Date: Mon May 25 23:02:56 2009 New Revision: 72924 Log: Allow multiple context managers in one with statement, as proposed in http://codereview.appspot.com/53094 and accepted by Guido. The construct is transformed into multiple With AST nodes so that there should be no problems with the semantics. Modified: python/trunk/Doc/reference/compound_stmts.rst python/trunk/Grammar/Grammar python/trunk/Include/graminit.h python/trunk/Lib/compiler/transformer.py python/trunk/Lib/test/test_compiler.py python/trunk/Lib/test/test_parser.py python/trunk/Lib/test/test_with.py python/trunk/Misc/NEWS python/trunk/Modules/parsermodule.c python/trunk/Python/ast.c python/trunk/Python/graminit.c Modified: python/trunk/Doc/reference/compound_stmts.rst ============================================================================== --- python/trunk/Doc/reference/compound_stmts.rst (original) +++ python/trunk/Doc/reference/compound_stmts.rst Mon May 25 23:02:56 2009 @@ -333,9 +333,10 @@ patterns to be encapsulated for convenient reuse. .. productionlist:: - with_stmt: "with" `expression` ["as" `target`] ":" `suite` + with_stmt: "with" with_item ("," with_item)* ":" `suite` + with_item: `expression` ["as" `target`] -The execution of the :keyword:`with` statement proceeds as follows: +The execution of the :keyword:`with` statement with one "item" proceeds as follows: #. The context expression is evaluated to obtain a context manager. @@ -369,12 +370,27 @@ from :meth:`__exit__` is ignored, and execution proceeds at the normal location for the kind of exit that was taken. +With more than one item, the context managers are processed as if multiple +:keyword:`with` statements were nested:: + + with A() as a, B() as b: + suite + +is equivalent to :: + + with A() as a: + with B() as b: + suite + .. note:: In Python 2.5, the :keyword:`with` statement is only allowed when the ``with_statement`` feature has been enabled. It is always enabled in Python 2.6. +.. versionchanged:: 2.7 + Support for multiple context expressions. + .. seealso:: :pep:`0343` - The "with" statement Modified: python/trunk/Grammar/Grammar ============================================================================== --- python/trunk/Grammar/Grammar (original) +++ python/trunk/Grammar/Grammar Mon May 25 23:02:56 2009 @@ -83,8 +83,8 @@ ['else' ':' suite] ['finally' ':' suite] | 'finally' ':' suite)) -with_stmt: 'with' test [ with_var ] ':' suite -with_var: 'as' expr +with_stmt: 'with' with_item (',' with_item)* ':' suite +with_item: test ['as' expr] # NB compile.c makes sure that the default except clause is last except_clause: 'except' [test [('as' | ',') test]] suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT Modified: python/trunk/Include/graminit.h ============================================================================== --- python/trunk/Include/graminit.h (original) +++ python/trunk/Include/graminit.h Mon May 25 23:02:56 2009 @@ -42,7 +42,7 @@ #define for_stmt 295 #define try_stmt 296 #define with_stmt 297 -#define with_var 298 +#define with_item 298 #define except_clause 299 #define suite 300 #define testlist_safe 301 Modified: python/trunk/Lib/compiler/transformer.py ============================================================================== --- python/trunk/Lib/compiler/transformer.py (original) +++ python/trunk/Lib/compiler/transformer.py Mon May 25 23:02:56 2009 @@ -965,18 +965,22 @@ return try_except def com_with(self, nodelist): - # with_stmt: 'with' expr [with_var] ':' suite - expr = self.com_node(nodelist[1]) + # with_stmt: 'with' with_item (',' with_item)* ':' suite body = self.com_node(nodelist[-1]) - if nodelist[2][0] == token.COLON: - var = None + for i in range(len(nodelist) - 3, 0, -2): + ret = self.com_with_item(nodelist[i], body, nodelist[0][2]) + if i == 1: + return ret + body = ret + + def com_with_item(self, nodelist, body, lineno): + # with_item: test ['as' expr] + if len(nodelist) == 4: + var = self.com_assign(nodelist[3], OP_ASSIGN) else: - var = self.com_assign(nodelist[2][2], OP_ASSIGN) - return With(expr, var, body, lineno=nodelist[0][2]) - - def com_with_var(self, nodelist): - # with_var: 'as' expr - return self.com_node(nodelist[1]) + var = None + expr = self.com_node(nodelist[1]) + return With(expr, var, body, lineno=lineno) def com_augassign_op(self, node): assert node[0] == symbol.augassign Modified: python/trunk/Lib/test/test_compiler.py ============================================================================== --- python/trunk/Lib/test/test_compiler.py (original) +++ python/trunk/Lib/test/test_compiler.py Mon May 25 23:02:56 2009 @@ -165,6 +165,27 @@ exec c in dct self.assertEquals(dct.get('result'), 1) + def testWithMult(self): + events = [] + class Ctx: + def __init__(self, n): + self.n = n + def __enter__(self): + events.append(self.n) + def __exit__(self, *args): + pass + c = compiler.compile('from __future__ import with_statement\n' + 'def f():\n' + ' with Ctx(1) as tc, Ctx(2) as tc2:\n' + ' return 1\n' + 'result = f()', + '', + 'exec' ) + dct = {'Ctx': Ctx} + exec c in dct + self.assertEquals(dct.get('result'), 1) + self.assertEquals(events, [1, 2]) + def testGlobal(self): code = compiler.compile('global x\nx=1', '', 'exec') d1 = {'__builtins__': {}} Modified: python/trunk/Lib/test/test_parser.py ============================================================================== --- python/trunk/Lib/test/test_parser.py (original) +++ python/trunk/Lib/test/test_parser.py Mon May 25 23:02:56 2009 @@ -199,6 +199,7 @@ def test_with(self): self.check_suite("with open('x'): pass\n") self.check_suite("with open('x') as f: pass\n") + self.check_suite("with open('x') as f, open('y') as g: pass\n") def test_try_stmt(self): self.check_suite("try: pass\nexcept: pass\n") Modified: python/trunk/Lib/test/test_with.py ============================================================================== --- python/trunk/Lib/test/test_with.py (original) +++ python/trunk/Lib/test/test_with.py Mon May 25 23:02:56 2009 @@ -654,12 +654,88 @@ self.fail("ZeroDivisionError should have been raised") +class NestedWith(unittest.TestCase): + + class Dummy(object): + def __init__(self, value=None, gobble=False): + if value is None: + value = self + self.value = value + self.gobble = gobble + self.enter_called = False + self.exit_called = False + + def __enter__(self): + self.enter_called = True + return self.value + + def __exit__(self, *exc_info): + self.exit_called = True + self.exc_info = exc_info + if self.gobble: + return True + + class CtorRaises(object): + def __init__(self): raise RuntimeError() + + class EnterRaises(object): + def __enter__(self): raise RuntimeError() + def __exit__(self, *exc_info): pass + + class ExitRaises(object): + def __enter__(self): pass + def __exit__(self, *exc_info): raise RuntimeError() + + def testNoExceptions(self): + with self.Dummy() as a, self.Dummy() as b: + self.assertTrue(a.enter_called) + self.assertTrue(b.enter_called) + self.assertTrue(a.exit_called) + self.assertTrue(b.exit_called) + + def testExceptionInExprList(self): + try: + with self.Dummy() as a, self.CtorRaises(): + pass + except: + pass + self.assertTrue(a.enter_called) + self.assertTrue(a.exit_called) + + def testExceptionInEnter(self): + try: + with self.Dummy() as a, self.EnterRaises(): + self.fail('body of bad with executed') + except RuntimeError: + pass + else: + self.fail('RuntimeError not reraised') + self.assertTrue(a.enter_called) + self.assertTrue(a.exit_called) + + def testExceptionInExit(self): + body_executed = False + with self.Dummy(gobble=True) as a, self.ExitRaises(): + body_executed = True + self.assertTrue(a.enter_called) + self.assertTrue(a.exit_called) + self.assertNotEqual(a.exc_info[0], None) + + def testEnterReturnsTuple(self): + with self.Dummy(value=(1,2)) as (a1, a2), \ + self.Dummy(value=(10, 20)) as (b1, b2): + self.assertEquals(1, a1) + self.assertEquals(2, a2) + self.assertEquals(10, b1) + self.assertEquals(20, b2) + def test_main(): run_unittest(FailureTestCase, NonexceptionalTestCase, NestedNonexceptionalTestCase, ExceptionalTestCase, NonLocalFlowControlTestCase, AssignmentTargetTestCase, - ExitSwallowsExceptionTestCase) + ExitSwallowsExceptionTestCase, + NestedWith) if __name__ == '__main__': Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Mon May 25 23:02:56 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Added support for multiple context managers in the same with statement. + - Issue #6101: A new opcode, SETUP_WITH, has been added to speed up the with statement and correctly lookup the __enter__ and __exit__ special methods. Modified: python/trunk/Modules/parsermodule.c ============================================================================== --- python/trunk/Modules/parsermodule.c (original) +++ python/trunk/Modules/parsermodule.c Mon May 25 23:02:56 2009 @@ -2618,36 +2618,39 @@ return ok; } -/* with_var -with_var: 'as' expr +/* with_item: + * test ['as' expr] */ static int -validate_with_var(node *tree) +validate_with_item(node *tree) { int nch = NCH(tree); - int ok = (validate_ntype(tree, with_var) - && (nch == 2) - && validate_name(CHILD(tree, 0), "as") - && validate_expr(CHILD(tree, 1))); - return ok; + int ok = (validate_ntype(tree, with_item) + && (nch == 1 || nch == 3) + && validate_test(CHILD(tree, 0))); + if (ok && nch == 3) + ok = (validate_name(CHILD(tree, 1), "as") + && validate_expr(CHILD(tree, 2))); + return ok; } -/* with_stmt - * 0 1 2 -2 -1 -with_stmt: 'with' test [ with_var ] ':' suite +/* with_stmt: + * 0 1 ... -2 -1 + * 'with' with_item (',' with_item)* ':' suite */ static int validate_with_stmt(node *tree) { + int i; int nch = NCH(tree); int ok = (validate_ntype(tree, with_stmt) - && ((nch == 4) || (nch == 5)) + && (nch % 2 == 0) && validate_name(CHILD(tree, 0), "with") - && validate_test(CHILD(tree, 1)) - && (nch == 4 || validate_with_var(CHILD(tree, 2))) && validate_colon(RCHILD(tree, -2)) && validate_suite(RCHILD(tree, -1))); - return ok; + for (i = 1; ok && i < nch - 2; i += 2) + ok = validate_with_item(CHILD(tree, i)); + return ok; } /* funcdef: Modified: python/trunk/Python/ast.c ============================================================================== --- python/trunk/Python/ast.c (original) +++ python/trunk/Python/ast.c Mon May 25 23:02:56 2009 @@ -3009,27 +3009,18 @@ return TryFinally(body, finally, LINENO(n), n->n_col_offset, c->c_arena); } -static expr_ty -ast_for_with_var(struct compiling *c, const node *n) -{ - REQ(n, with_var); - return ast_for_expr(c, CHILD(n, 1)); -} - -/* with_stmt: 'with' test [ with_var ] ':' suite */ +/* with_item: test ['as' expr] */ static stmt_ty -ast_for_with_stmt(struct compiling *c, const node *n) +ast_for_with_item(struct compiling *c, const node *n, asdl_seq *content) { expr_ty context_expr, optional_vars = NULL; - int suite_index = 3; /* skip 'with', test, and ':' */ - asdl_seq *suite_seq; - assert(TYPE(n) == with_stmt); - context_expr = ast_for_expr(c, CHILD(n, 1)); + REQ(n, with_item); + context_expr = ast_for_expr(c, CHILD(n, 0)); if (!context_expr) return NULL; - if (TYPE(CHILD(n, 2)) == with_var) { - optional_vars = ast_for_with_var(c, CHILD(n, 2)); + if (NCH(n) == 3) { + optional_vars = ast_for_expr(c, CHILD(n, 2)); if (!optional_vars) { return NULL; @@ -3037,15 +3028,45 @@ if (!set_context(c, optional_vars, Store, n)) { return NULL; } - suite_index = 4; } - suite_seq = ast_for_suite(c, CHILD(n, suite_index)); - if (!suite_seq) { + return With(context_expr, optional_vars, content, LINENO(n), + n->n_col_offset, c->c_arena); +} + +/* with_stmt: 'with' with_item (',' with_item)* ':' suite */ +static stmt_ty +ast_for_with_stmt(struct compiling *c, const node *n) +{ + int i; + stmt_ty ret; + asdl_seq *inner; + + REQ(n, with_stmt); + + /* process the with items inside-out */ + i = NCH(n) - 1; + /* the suite of the innermost with item is the suite of the with stmt */ + inner = ast_for_suite(c, CHILD(n, i)); + if (!inner) return NULL; + + for (;;) { + i -= 2; + ret = ast_for_with_item(c, CHILD(n, i), inner); + if (!ret) + return NULL; + /* was this the last item? */ + if (i == 1) + break; + /* if not, wrap the result so far in a new sequence */ + inner = asdl_seq_new(1, c->c_arena); + if (!inner) + return NULL; + asdl_seq_SET(inner, 0, ret); } - return With(context_expr, optional_vars, suite_seq, LINENO(n), - n->n_col_offset, c->c_arena); + + return ret; } static stmt_ty Modified: python/trunk/Python/graminit.c ============================================================================== --- python/trunk/Python/graminit.c (original) +++ python/trunk/Python/graminit.c Mon May 25 23:02:56 2009 @@ -901,42 +901,43 @@ {100, 1}, }; static arc arcs_41_1[1] = { - {28, 2}, + {101, 2}, }; static arc arcs_41_2[2] = { - {101, 3}, - {23, 4}, + {29, 1}, + {23, 3}, }; static arc arcs_41_3[1] = { - {23, 4}, + {24, 4}, }; static arc arcs_41_4[1] = { - {24, 5}, -}; -static arc arcs_41_5[1] = { - {0, 5}, + {0, 4}, }; -static state states_41[6] = { +static state states_41[5] = { {1, arcs_41_0}, {1, arcs_41_1}, {2, arcs_41_2}, {1, arcs_41_3}, {1, arcs_41_4}, - {1, arcs_41_5}, }; static arc arcs_42_0[1] = { - {80, 1}, + {28, 1}, }; -static arc arcs_42_1[1] = { - {84, 2}, +static arc arcs_42_1[2] = { + {80, 2}, + {0, 1}, }; static arc arcs_42_2[1] = { - {0, 2}, + {84, 3}, }; -static state states_42[3] = { +static arc arcs_42_3[1] = { + {0, 3}, +}; +static state states_42[4] = { {1, arcs_42_0}, - {1, arcs_42_1}, + {2, arcs_42_1}, {1, arcs_42_2}, + {1, arcs_42_3}, }; static arc arcs_43_0[1] = { {102, 1}, @@ -1877,10 +1878,10 @@ "\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000"}, {296, "try_stmt", 0, 13, states_40, "\000\000\000\000\000\000\000\000\000\000\000\000\002\000\000\000\000\000\000\000\000\000"}, - {297, "with_stmt", 0, 6, states_41, + {297, "with_stmt", 0, 5, states_41, "\000\000\000\000\000\000\000\000\000\000\000\000\020\000\000\000\000\000\000\000\000\000"}, - {298, "with_var", 0, 3, states_42, - "\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000"}, + {298, "with_item", 0, 4, states_42, + "\000\040\040\000\000\000\000\000\000\000\000\000\000\040\010\000\200\041\044\015\000\000"}, {299, "except_clause", 0, 5, states_43, "\000\000\000\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000"}, {300, "suite", 0, 5, states_44, From python-checkins at python.org Mon May 25 23:10:37 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 25 May 2009 23:10:37 +0200 (CEST) Subject: [Python-checkins] r72925 - in python/branches/py3k: Doc/reference/compound_stmts.rst Grammar/Grammar Include/graminit.h Lib/test/test_parser.py Lib/test/test_with.py Misc/NEWS Modules/parsermodule.c Python/ast.c Python/graminit.c Message-ID: <20090525211037.3A457D477@mail.python.org> Author: georg.brandl Date: Mon May 25 23:10:36 2009 New Revision: 72925 Log: Merged revisions 72924 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72924 | georg.brandl | 2009-05-25 23:02:56 +0200 (Mo, 25 Mai 2009) | 6 lines Allow multiple context managers in one with statement, as proposed in http://codereview.appspot.com/53094 and accepted by Guido. The construct is transformed into multiple With AST nodes so that there should be no problems with the semantics. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/reference/compound_stmts.rst python/branches/py3k/Grammar/Grammar python/branches/py3k/Include/graminit.h python/branches/py3k/Lib/test/test_parser.py python/branches/py3k/Lib/test/test_with.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/parsermodule.c python/branches/py3k/Python/ast.c python/branches/py3k/Python/graminit.c Modified: python/branches/py3k/Doc/reference/compound_stmts.rst ============================================================================== --- python/branches/py3k/Doc/reference/compound_stmts.rst (original) +++ python/branches/py3k/Doc/reference/compound_stmts.rst Mon May 25 23:10:36 2009 @@ -347,9 +347,10 @@ usage patterns to be encapsulated for convenient reuse. .. productionlist:: - with_stmt: "with" `expression` ["as" `target`] ":" `suite` + with_stmt: "with" with_item ("," with_item)* ":" `suite` + with_item: `expression` ["as" `target`] -The execution of the :keyword:`with` statement proceeds as follows: +The execution of the :keyword:`with` statement with one "item" proceeds as follows: #. The context expression is evaluated to obtain a context manager. @@ -382,6 +383,21 @@ value from :meth:`__exit__` is ignored, and execution proceeds at the normal location for the kind of exit that was taken. +With more than one item, the context managers are processed as if multiple +:keyword:`with` statements were nested:: + + with A() as a, B() as b: + suite + +is equivalent to :: + + with A() as a: + with B() as b: + suite + +.. versionchanged:: 3.1 + Support for multiple context expressions. + .. seealso:: :pep:`0343` - The "with" statement Modified: python/branches/py3k/Grammar/Grammar ============================================================================== --- python/branches/py3k/Grammar/Grammar (original) +++ python/branches/py3k/Grammar/Grammar Mon May 25 23:10:36 2009 @@ -73,8 +73,8 @@ ['else' ':' suite] ['finally' ':' suite] | 'finally' ':' suite)) -with_stmt: 'with' test [ with_var ] ':' suite -with_var: 'as' expr +with_stmt: 'with' with_item (',' with_item)* ':' suite +with_item: test ['as' expr] # NB compile.c makes sure that the default except clause is last except_clause: 'except' [test ['as' NAME]] suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT Modified: python/branches/py3k/Include/graminit.h ============================================================================== --- python/branches/py3k/Include/graminit.h (original) +++ python/branches/py3k/Include/graminit.h Mon May 25 23:10:36 2009 @@ -42,7 +42,7 @@ #define for_stmt 295 #define try_stmt 296 #define with_stmt 297 -#define with_var 298 +#define with_item 298 #define except_clause 299 #define suite 300 #define test 301 Modified: python/branches/py3k/Lib/test/test_parser.py ============================================================================== --- python/branches/py3k/Lib/test/test_parser.py (original) +++ python/branches/py3k/Lib/test/test_parser.py Mon May 25 23:10:36 2009 @@ -193,6 +193,7 @@ def test_with(self): self.check_suite("with open('x'): pass\n") self.check_suite("with open('x') as f: pass\n") + self.check_suite("with open('x') as f, open('y') as g: pass\n") def test_try_stmt(self): self.check_suite("try: pass\nexcept: pass\n") Modified: python/branches/py3k/Lib/test/test_with.py ============================================================================== --- python/branches/py3k/Lib/test/test_with.py (original) +++ python/branches/py3k/Lib/test/test_with.py Mon May 25 23:10:36 2009 @@ -656,12 +656,88 @@ self.fail("ZeroDivisionError should have been raised") +class NestedWith(unittest.TestCase): + + class Dummy(object): + def __init__(self, value=None, gobble=False): + if value is None: + value = self + self.value = value + self.gobble = gobble + self.enter_called = False + self.exit_called = False + + def __enter__(self): + self.enter_called = True + return self.value + + def __exit__(self, *exc_info): + self.exit_called = True + self.exc_info = exc_info + if self.gobble: + return True + + class CtorRaises(object): + def __init__(self): raise RuntimeError() + + class EnterRaises(object): + def __enter__(self): raise RuntimeError() + def __exit__(self, *exc_info): pass + + class ExitRaises(object): + def __enter__(self): pass + def __exit__(self, *exc_info): raise RuntimeError() + + def testNoExceptions(self): + with self.Dummy() as a, self.Dummy() as b: + self.assertTrue(a.enter_called) + self.assertTrue(b.enter_called) + self.assertTrue(a.exit_called) + self.assertTrue(b.exit_called) + + def testExceptionInExprList(self): + try: + with self.Dummy() as a, self.CtorRaises(): + pass + except: + pass + self.assertTrue(a.enter_called) + self.assertTrue(a.exit_called) + + def testExceptionInEnter(self): + try: + with self.Dummy() as a, self.EnterRaises(): + self.fail('body of bad with executed') + except RuntimeError: + pass + else: + self.fail('RuntimeError not reraised') + self.assertTrue(a.enter_called) + self.assertTrue(a.exit_called) + + def testExceptionInExit(self): + body_executed = False + with self.Dummy(gobble=True) as a, self.ExitRaises(): + body_executed = True + self.assertTrue(a.enter_called) + self.assertTrue(a.exit_called) + self.assertNotEqual(a.exc_info[0], None) + + def testEnterReturnsTuple(self): + with self.Dummy(value=(1,2)) as (a1, a2), \ + self.Dummy(value=(10, 20)) as (b1, b2): + self.assertEquals(1, a1) + self.assertEquals(2, a2) + self.assertEquals(10, b1) + self.assertEquals(20, b2) + def test_main(): run_unittest(FailureTestCase, NonexceptionalTestCase, NestedNonexceptionalTestCase, ExceptionalTestCase, NonLocalFlowControlTestCase, AssignmentTargetTestCase, - ExitSwallowsExceptionTestCase) + ExitSwallowsExceptionTestCase, + NestedWith) if __name__ == '__main__': Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Mon May 25 23:10:36 2009 @@ -15,6 +15,8 @@ - Issue #6089: Fixed str.format with certain invalid field specifiers that would raise SystemError. +- Added support for multiple context managers in the same with statement. + - Issue #5829: complex("1e500") no longer raises OverflowError. This makes it consistent with float("1e500") and interpretation of real and imaginary literals. Modified: python/branches/py3k/Modules/parsermodule.c ============================================================================== --- python/branches/py3k/Modules/parsermodule.c (original) +++ python/branches/py3k/Modules/parsermodule.c Mon May 25 23:10:36 2009 @@ -2446,36 +2446,39 @@ return ok; } -/* with_var -with_var: 'as' expr +/* with_item: + * test ['as' expr] */ static int -validate_with_var(node *tree) +validate_with_item(node *tree) { int nch = NCH(tree); - int ok = (validate_ntype(tree, with_var) - && (nch == 2) - && validate_name(CHILD(tree, 0), "as") - && validate_expr(CHILD(tree, 1))); - return ok; + int ok = (validate_ntype(tree, with_item) + && (nch == 1 || nch == 3) + && validate_test(CHILD(tree, 0))); + if (ok && nch == 3) + ok = (validate_name(CHILD(tree, 1), "as") + && validate_expr(CHILD(tree, 2))); + return ok; } -/* with_stmt - * 0 1 2 -2 -1 -with_stmt: 'with' test [ with_var ] ':' suite +/* with_stmt: + * 0 1 ... -2 -1 + * 'with' with_item (',' with_item)* ':' suite */ static int validate_with_stmt(node *tree) { + int i; int nch = NCH(tree); int ok = (validate_ntype(tree, with_stmt) - && ((nch == 4) || (nch == 5)) + && (nch % 2 == 0) && validate_name(CHILD(tree, 0), "with") - && validate_test(CHILD(tree, 1)) - && (nch == 4 || validate_with_var(CHILD(tree, 2))) && validate_colon(RCHILD(tree, -2)) && validate_suite(RCHILD(tree, -1))); - return ok; + for (i = 1; ok && i < nch - 2; i += 2) + ok = validate_with_item(CHILD(tree, i)); + return ok; } /* funcdef: Modified: python/branches/py3k/Python/ast.c ============================================================================== --- python/branches/py3k/Python/ast.c (original) +++ python/branches/py3k/Python/ast.c Mon May 25 23:10:36 2009 @@ -2959,25 +2959,16 @@ return TryFinally(body, finally, LINENO(n), n->n_col_offset, c->c_arena); } -static expr_ty -ast_for_with_var(struct compiling *c, const node *n) -{ - REQ(n, with_var); - return ast_for_expr(c, CHILD(n, 1)); -} - -/* with_stmt: 'with' test [ with_var ] ':' suite */ +/* with_item: test ['as' expr] */ static stmt_ty -ast_for_with_stmt(struct compiling *c, const node *n) +ast_for_with_item(struct compiling *c, const node *n, asdl_seq *content) { expr_ty context_expr, optional_vars = NULL; - int suite_index = 3; /* skip 'with', test, and ':' */ - asdl_seq *suite_seq; - assert(TYPE(n) == with_stmt); - context_expr = ast_for_expr(c, CHILD(n, 1)); - if (TYPE(CHILD(n, 2)) == with_var) { - optional_vars = ast_for_with_var(c, CHILD(n, 2)); + REQ(n, with_item); + context_expr = ast_for_expr(c, CHILD(n, 0)); + if (NCH(n) == 3) { + optional_vars = ast_for_expr(c, CHILD(n, 2)); if (!optional_vars) { return NULL; @@ -2985,15 +2976,45 @@ if (!set_context(c, optional_vars, Store, n)) { return NULL; } - suite_index = 4; } - suite_seq = ast_for_suite(c, CHILD(n, suite_index)); - if (!suite_seq) { + return With(context_expr, optional_vars, content, LINENO(n), + n->n_col_offset, c->c_arena); +} + +/* with_stmt: 'with' with_item (',' with_item)* ':' suite */ +static stmt_ty +ast_for_with_stmt(struct compiling *c, const node *n) +{ + int i; + stmt_ty ret; + asdl_seq *inner; + + REQ(n, with_stmt); + + /* process the with items inside-out */ + i = NCH(n) - 1; + /* the suite of the innermost with item is the suite of the with stmt */ + inner = ast_for_suite(c, CHILD(n, i)); + if (!inner) return NULL; + + for (;;) { + i -= 2; + ret = ast_for_with_item(c, CHILD(n, i), inner); + if (!ret) + return NULL; + /* was this the last item? */ + if (i == 1) + break; + /* if not, wrap the result so far in a new sequence */ + inner = asdl_seq_new(1, c->c_arena); + if (!inner) + return NULL; + asdl_seq_SET(inner, 0, ret); } - return With(context_expr, optional_vars, suite_seq, LINENO(n), - n->n_col_offset, c->c_arena); + + return ret; } static stmt_ty Modified: python/branches/py3k/Python/graminit.c ============================================================================== --- python/branches/py3k/Python/graminit.c (original) +++ python/branches/py3k/Python/graminit.c Mon May 25 23:10:36 2009 @@ -911,42 +911,43 @@ {99, 1}, }; static arc arcs_41_1[1] = { - {24, 2}, + {100, 2}, }; static arc arcs_41_2[2] = { - {100, 3}, - {25, 4}, + {30, 1}, + {25, 3}, }; static arc arcs_41_3[1] = { - {25, 4}, + {26, 4}, }; static arc arcs_41_4[1] = { - {26, 5}, -}; -static arc arcs_41_5[1] = { - {0, 5}, + {0, 4}, }; -static state states_41[6] = { +static state states_41[5] = { {1, arcs_41_0}, {1, arcs_41_1}, {2, arcs_41_2}, {1, arcs_41_3}, {1, arcs_41_4}, - {1, arcs_41_5}, }; static arc arcs_42_0[1] = { - {80, 1}, + {24, 1}, }; -static arc arcs_42_1[1] = { - {101, 2}, +static arc arcs_42_1[2] = { + {80, 2}, + {0, 1}, }; static arc arcs_42_2[1] = { - {0, 2}, + {101, 3}, }; -static state states_42[3] = { +static arc arcs_42_3[1] = { + {0, 3}, +}; +static state states_42[4] = { {1, arcs_42_0}, - {1, arcs_42_1}, + {2, arcs_42_1}, {1, arcs_42_2}, + {1, arcs_42_3}, }; static arc arcs_43_0[1] = { {102, 1}, @@ -1810,10 +1811,10 @@ "\000\000\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000\000"}, {296, "try_stmt", 0, 13, states_40, "\000\000\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000"}, - {297, "with_stmt", 0, 6, states_41, + {297, "with_stmt", 0, 5, states_41, "\000\000\000\000\000\000\000\000\000\000\000\000\010\000\000\000\000\000\000\000\000"}, - {298, "with_var", 0, 3, states_42, - "\000\000\000\000\000\000\000\000\000\000\001\000\000\000\000\000\000\000\000\000\000"}, + {298, "with_item", 0, 4, states_42, + "\000\040\040\200\000\000\000\000\000\040\000\000\000\040\004\000\000\103\050\037\000"}, {299, "except_clause", 0, 5, states_43, "\000\000\000\000\000\000\000\000\000\000\000\000\100\000\000\000\000\000\000\000\000"}, {300, "suite", 0, 5, states_44, From python-checkins at python.org Mon May 25 23:13:43 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 25 May 2009 23:13:43 +0200 (CEST) Subject: [Python-checkins] r72926 - in python/branches/py3k: Doc/about.rst Doc/bugs.rst Doc/includes/sqlite3/text_factory.py Doc/library/ctypes.rst Doc/library/optparse.rst Doc/library/sqlite3.rst Doc/library/webbrowser.rst Doc/library/xml.dom.minidom.rst Doc/reference/datamodel.rst Message-ID: <20090525211343.0E21FD492@mail.python.org> Author: georg.brandl Date: Mon May 25 23:13:36 2009 New Revision: 72926 Log: Merged revisions 72661,72675-72677,72679,72712,72801,72820 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72661 | georg.brandl | 2009-05-15 10:03:03 +0200 (Fr, 15 Mai 2009) | 1 line Fix example output for doctest-like demos. ........ r72675 | georg.brandl | 2009-05-16 13:13:21 +0200 (Sa, 16 Mai 2009) | 1 line #6034: clarify __reversed__ doc. ........ r72676 | georg.brandl | 2009-05-16 13:14:46 +0200 (Sa, 16 Mai 2009) | 1 line #6025: fix signature of parse(). ........ r72677 | georg.brandl | 2009-05-16 13:18:55 +0200 (Sa, 16 Mai 2009) | 1 line #6009: undocument default argument of Option as deprecated. ........ r72679 | georg.brandl | 2009-05-16 13:24:41 +0200 (Sa, 16 Mai 2009) | 1 line Fix about and bugs pages to match real workflow. ........ r72712 | georg.brandl | 2009-05-17 10:55:00 +0200 (So, 17 Mai 2009) | 1 line #5935: mention that BROWSER is looked for in PATH. ........ r72801 | georg.brandl | 2009-05-20 20:31:14 +0200 (Mi, 20 Mai 2009) | 1 line #6055: refer to "sqlite3" consistently. ........ r72820 | georg.brandl | 2009-05-22 09:23:32 +0200 (Fr, 22 Mai 2009) | 1 line Use raise X(y). ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/about.rst python/branches/py3k/Doc/bugs.rst python/branches/py3k/Doc/includes/sqlite3/text_factory.py python/branches/py3k/Doc/library/ctypes.rst python/branches/py3k/Doc/library/optparse.rst python/branches/py3k/Doc/library/sqlite3.rst python/branches/py3k/Doc/library/webbrowser.rst python/branches/py3k/Doc/library/xml.dom.minidom.rst python/branches/py3k/Doc/reference/datamodel.rst Modified: python/branches/py3k/Doc/about.rst ============================================================================== --- python/branches/py3k/Doc/about.rst (original) +++ python/branches/py3k/Doc/about.rst Mon May 25 23:13:36 2009 @@ -7,8 +7,8 @@ `_ sources by *Sphinx*, a document processor specifically written for the Python documentation. -In the online version of these documents, you can submit comments and suggest -changes directly on the documentation pages. +.. In the online version of these documents, you can submit comments and suggest + changes directly on the documentation pages. Development of the documentation and its toolchain takes place on the docs at python.org mailing list. We're always looking for volunteers wanting @@ -24,7 +24,8 @@ `_ project from which Sphinx got many good ideas. -See :ref:`reporting-bugs` for information how to report bugs in Python itself. +See :ref:`reporting-bugs` for information how to report bugs in this +documentation, or Python itself. .. including the ACKS file here so that it can be maintained separately .. include:: ACKS.txt Modified: python/branches/py3k/Doc/bugs.rst ============================================================================== --- python/branches/py3k/Doc/bugs.rst (original) +++ python/branches/py3k/Doc/bugs.rst Mon May 25 23:13:36 2009 @@ -19,6 +19,9 @@ information is needed (in which case you are welcome to provide it if you can!). To do this, search the bug database using the search box on the top of the page. +In the case of documentation bugs, look at the most recent development docs at +http://docs.python.org/dev to see if the bug has been fixed. + If the problem you're reporting is not already in the bug tracker, go back to the Python Bug Tracker. If you don't already have a tracker account, select the "Register" link in the sidebar and undergo the registration procedure. Modified: python/branches/py3k/Doc/includes/sqlite3/text_factory.py ============================================================================== --- python/branches/py3k/Doc/includes/sqlite3/text_factory.py (original) +++ python/branches/py3k/Doc/includes/sqlite3/text_factory.py Mon May 25 23:13:36 2009 @@ -13,7 +13,7 @@ row = cur.fetchone() assert row[0] == AUSTRIA -# but we can make pysqlite always return bytestrings ... +# but we can make sqlite3 always return bytestrings ... con.text_factory = str cur.execute("select ?", (AUSTRIA,)) row = cur.fetchone() @@ -26,11 +26,12 @@ # here we implement one that will ignore Unicode characters that cannot be # decoded from UTF-8 con.text_factory = lambda x: str(x, "utf-8", "ignore") -cur.execute("select ?", ("this is latin1 and would normally create errors" + "\xe4\xf6\xfc".encode("latin1"),)) +cur.execute("select ?", ("this is latin1 and would normally create errors" + + "\xe4\xf6\xfc".encode("latin1"),)) row = cur.fetchone() assert type(row[0]) == str -# pysqlite offers a builtin optimized text_factory that will return bytestring +# sqlite3 offers a builtin optimized text_factory that will return bytestring # objects, if the data is in ASCII only, and otherwise return unicode objects con.text_factory = sqlite3.OptimizedUnicode cur.execute("select ?", (AUSTRIA,)) Modified: python/branches/py3k/Doc/library/ctypes.rst ============================================================================== --- python/branches/py3k/Doc/library/ctypes.rst (original) +++ python/branches/py3k/Doc/library/ctypes.rst Mon May 25 23:13:36 2009 @@ -338,9 +338,9 @@ >>> printf("Hello, %s\n", "World!") Hello, World! 14 - >>> printf("Hello, %S", u"World!") + >>> printf("Hello, %S\n", u"World!") Hello, World! - 13 + 14 >>> printf("%d bottles of beer\n", 42) 42 bottles of beer 19 @@ -355,7 +355,7 @@ that they can be converted to the required C data type:: >>> printf("An int %d, a double %f\n", 1234, c_double(3.14)) - Integer 1234, double 3.1400001049 + An int 1234, a double 3.140000 31 >>> @@ -411,9 +411,9 @@ Traceback (most recent call last): File "", line 1, in ? ArgumentError: argument 2: exceptions.TypeError: wrong type - >>> printf("%s %d %f", "X", 2, 3) - X 2 3.00000012 - 12 + >>> printf("%s %d %f\n", "X", 2, 3) + X 2 3.000000 + 13 >>> If you have defined your own classes which you pass to function calls, you have Modified: python/branches/py3k/Doc/library/optparse.rst ============================================================================== --- python/branches/py3k/Doc/library/optparse.rst (original) +++ python/branches/py3k/Doc/library/optparse.rst Mon May 25 23:13:36 2009 @@ -1072,10 +1072,10 @@ tells :mod:`optparse` where to write it: :attr:`dest` names an attribute of the ``options`` object that :mod:`optparse` builds as it parses the command line. -* ``default`` (deprecated) +* ``default`` The value to use for this option's destination if the option is not seen on the - command line. Deprecated; use ``parser.set_defaults()`` instead. + command line. See also ``parser.set_defaults()``. * ``nargs`` (default: 1) Modified: python/branches/py3k/Doc/library/sqlite3.rst ============================================================================== --- python/branches/py3k/Doc/library/sqlite3.rst (original) +++ python/branches/py3k/Doc/library/sqlite3.rst Mon May 25 23:13:36 2009 @@ -13,7 +13,7 @@ application using SQLite and then port the code to a larger database such as PostgreSQL or Oracle. -pysqlite was written by Gerhard H?ring and provides a SQL interface compliant +sqlite3 was written by Gerhard H?ring and provides a SQL interface compliant with the DB-API 2.0 specification described by :pep:`249`. To use the module, you must first create a :class:`Connection` object that @@ -50,8 +50,9 @@ Instead, use the DB-API's parameter substitution. Put ``?`` as a placeholder wherever you want to use a value, and then provide a tuple of values as the -second argument to the cursor's :meth:`~Cursor.execute` method. (Other database modules -may use a different placeholder, such as ``%s`` or ``:1``.) For example:: +second argument to the cursor's :meth:`~Cursor.execute` method. (Other database +modules may use a different placeholder, such as ``%s`` or ``:1``.) For +example:: # Never do this -- insecure! symbol = 'IBM' @@ -90,11 +91,12 @@ .. seealso:: http://www.pysqlite.org - The pysqlite web page. + The pysqlite web page -- sqlite3 is developed externally under the name + "pysqlite". http://www.sqlite.org - The SQLite web page; the documentation describes the syntax and the available - data types for the supported SQL dialect. + The SQLite web page; the documentation describes the syntax and the + available data types for the supported SQL dialect. :pep:`249` - Database API Specification 2.0 PEP written by Marc-Andr? Lemburg. @@ -784,10 +786,10 @@ ...``, ``VACUUM``, ``PRAGMA``, the :mod:`sqlite3` module will commit implicitly before executing that command. There are two reasons for doing that. The first is that some of these commands don't work within transactions. The other reason -is that pysqlite needs to keep track of the transaction state (if a transaction +is that sqlite3 needs to keep track of the transaction state (if a transaction is active or not). -You can control which kind of ``BEGIN`` statements pysqlite implicitly executes +You can control which kind of ``BEGIN`` statements sqlite3 implicitly executes (or none at all) via the *isolation_level* parameter to the :func:`connect` call, or via the :attr:`isolation_level` property of connections. @@ -799,8 +801,8 @@ -Using pysqlite efficiently --------------------------- +Using :mod:`sqlite3` efficiently +-------------------------------- Using shortcut methods Modified: python/branches/py3k/Doc/library/webbrowser.rst ============================================================================== --- python/branches/py3k/Doc/library/webbrowser.rst (original) +++ python/branches/py3k/Doc/library/webbrowser.rst Mon May 25 23:13:36 2009 @@ -22,7 +22,7 @@ of browsers to try in order. When the value of a list part contains the string ``%s``, then it is interpreted as a literal browser command line to be used with the argument URL substituted for ``%s``; if the part does not contain -``%s``, it is simply interpreted as the name of the browser to launch. +``%s``, it is simply interpreted as the name of the browser to launch. [1]_ For non-Unix platforms, or when a remote browser is available on Unix, the controlling process will not wait for the user to finish with the browser, but @@ -193,3 +193,9 @@ Open *url* in a new page ("tab") of the browser handled by this controller, if possible, otherwise equivalent to :func:`open_new`. + + +.. rubric:: Footnotes + +.. [1] Executables named here without a full path will be searched in the + directories given in the :envvar:`PATH` environment variable. Modified: python/branches/py3k/Doc/library/xml.dom.minidom.rst ============================================================================== --- python/branches/py3k/Doc/library/xml.dom.minidom.rst (original) +++ python/branches/py3k/Doc/library/xml.dom.minidom.rst Mon May 25 23:13:36 2009 @@ -28,7 +28,7 @@ The :func:`parse` function can take either a filename or an open file object. -.. function:: parse(filename_or_file, parser) +.. function:: parse(filename_or_file[, parser[, bufsize]]) Return a :class:`Document` from the given input. *filename_or_file* may be either a file name, or a file-like object. *parser*, if given, must be a SAX2 Modified: python/branches/py3k/Doc/reference/datamodel.rst ============================================================================== --- python/branches/py3k/Doc/reference/datamodel.rst (original) +++ python/branches/py3k/Doc/reference/datamodel.rst Mon May 25 23:13:36 2009 @@ -1700,11 +1700,11 @@ reverse iteration. It should return a new iterator object that iterates over all the objects in the container in reverse order. - If the :meth:`__reversed__` method is not provided, the - :func:`reversed` builtin will fall back to using the sequence protocol - (:meth:`__len__` and :meth:`__getitem__`). Objects should normally - only provide :meth:`__reversed__` if they do not support the sequence - protocol and an efficient implementation of reverse iteration is possible. + If the :meth:`__reversed__` method is not provided, the :func:`reversed` + builtin will fall back to using the sequence protocol (:meth:`__len__` and + :meth:`__getitem__`). Objects that support the sequence protocol should + only provide :meth:`__reversed__` if they can provide an implementation + that is more efficient than the one provided by :func:`reversed`. The membership test operators (:keyword:`in` and :keyword:`not in`) are normally From python-checkins at python.org Mon May 25 23:13:54 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 25 May 2009 23:13:54 +0200 (CEST) Subject: [Python-checkins] r72927 - python/branches/py3k Message-ID: <20090525211354.20FD2D4A7@mail.python.org> Author: georg.brandl Date: Mon May 25 23:13:54 2009 New Revision: 72927 Log: Blocked revisions 72678,72710 via svnmerge ........ r72678 | georg.brandl | 2009-05-16 13:21:29 +0200 (Sa, 16 Mai 2009) | 1 line #2856: document 2.x os.listdir() behavior for undecodable filenames. ........ r72710 | georg.brandl | 2009-05-17 10:36:04 +0200 (So, 17 Mai 2009) | 1 line #5942: Copy over flag table from dbm.rst which is clearer. ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Mon May 25 23:15:01 2009 From: python-checkins at python.org (georg.brandl) Date: Mon, 25 May 2009 23:15:01 +0200 (CEST) Subject: [Python-checkins] r72928 - python/branches/py3k/Doc/library/dbm.rst Message-ID: <20090525211501.E1E9ED44E@mail.python.org> Author: georg.brandl Date: Mon May 25 23:15:01 2009 New Revision: 72928 Log: Manual merge of r72710: use table of flags for dbm.open description. Modified: python/branches/py3k/Doc/library/dbm.rst Modified: python/branches/py3k/Doc/library/dbm.rst ============================================================================== --- python/branches/py3k/Doc/library/dbm.rst (original) +++ python/branches/py3k/Doc/library/dbm.rst Mon May 25 23:15:01 2009 @@ -38,11 +38,23 @@ determine its type and the appropriate module is used; if it does not exist, the first module listed above that can be imported is used. - The optional *flag* argument can be ``'r'`` to open an existing database for - reading only, ``'w'`` to open an existing database for reading and writing, - ``'c'`` to create the database if it doesn't exist, or ``'n'``, which will - always create a new empty database. If not specified, the default value is - ``'r'``. + The optional *flag* argument can be: + + +---------+-------------------------------------------+ + | Value | Meaning | + +=========+===========================================+ + | ``'r'`` | Open existing database for reading only | + | | (default) | + +---------+-------------------------------------------+ + | ``'w'`` | Open existing database for reading and | + | | writing | + +---------+-------------------------------------------+ + | ``'c'`` | Open database for reading and writing, | + | | creating it if it doesn't exist | + +---------+-------------------------------------------+ + | ``'n'`` | Always create a new, empty database, open | + | | for reading and writing | + +---------+-------------------------------------------+ The optional *mode* argument is the Unix mode of the file, used only when the database has to be created. It defaults to octal ``0o666`` (and will be From python-checkins at python.org Tue May 26 00:20:44 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 26 May 2009 00:20:44 +0200 (CEST) Subject: [Python-checkins] r72929 - python/branches/py3k/Misc/HISTORY Message-ID: <20090525222044.97546D4DE@mail.python.org> Author: georg.brandl Date: Tue May 26 00:20:44 2009 New Revision: 72929 Log: Replace nonexisting word. Modified: python/branches/py3k/Misc/HISTORY Modified: python/branches/py3k/Misc/HISTORY ============================================================================== --- python/branches/py3k/Misc/HISTORY (original) +++ python/branches/py3k/Misc/HISTORY Tue May 26 00:20:44 2009 @@ -446,7 +446,7 @@ only one-dimensional contiguous buffers are supported and exercised right now. Slicing, slice assignment and comparison (equality and inequality) have been added. Also, the tolist() method has been implemented, but only - for byte buffers. Endly, the API has been updated to return bytes objects + for byte buffers. Finally, the API has been updated to return bytes objects wherever it used to return bytearrays. - Issue #3560: clean up the new C PyMemoryView API so that naming is From buildbot at python.org Tue May 26 00:26:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 25 May 2009 22:26:13 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090525222613.8A614D447@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/746 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_import test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Tue May 26 01:29:27 2009 From: buildbot at python.org (buildbot at python.org) Date: Mon, 25 May 2009 23:29:27 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090525232927.B5A1AD5BE@mail.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/618 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 540, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' 1 test failed: test_import ====================================================================== ERROR: testImport (test.test_import.ImportTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 61, in test_with_extension mod = __import__(TESTFN) ImportError: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 540, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 540, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' sincerely, -The Buildbot From python-checkins at python.org Tue May 26 06:12:39 2009 From: python-checkins at python.org (collin.winter) Date: Tue, 26 May 2009 06:12:39 +0200 (CEST) Subject: [Python-checkins] r72930 - in python/trunk: Lib/test/pickletester.py Lib/test/test_cpickle.py Modules/cPickle.c Message-ID: <20090526041239.41E43D3E1@mail.python.org> Author: collin.winter Date: Tue May 26 06:12:39 2009 New Revision: 72930 Log: Issue 5794: fix cPickle's unpickling of recursive tuples. Modified: python/trunk/Lib/test/pickletester.py python/trunk/Lib/test/test_cpickle.py python/trunk/Modules/cPickle.c Modified: python/trunk/Lib/test/pickletester.py ============================================================================== --- python/trunk/Lib/test/pickletester.py (original) +++ python/trunk/Lib/test/pickletester.py Tue May 26 06:12:39 2009 @@ -463,6 +463,16 @@ self.assertEqual(len(x), 1) self.assert_(x is x[0]) + def test_recursive_tuple(self): + t = ([],) + t[0].append(t) + for proto in protocols: + s = self.dumps(t, proto) + x = self.loads(s) + self.assertEqual(len(x), 1) + self.assertEqual(len(x[0]), 1) + self.assert_(x is x[0][0]) + def test_recursive_dict(self): d = {} d[1] = d Modified: python/trunk/Lib/test/test_cpickle.py ============================================================================== --- python/trunk/Lib/test/test_cpickle.py (original) +++ python/trunk/Lib/test/test_cpickle.py Tue May 26 06:12:39 2009 @@ -65,6 +65,11 @@ AbstractPickleTests.test_recursive_list, self) + def test_recursive_tuple(self): + self.assertRaises(ValueError, + AbstractPickleTests.test_recursive_tuple, + self) + def test_recursive_inst(self): self.assertRaises(ValueError, AbstractPickleTests.test_recursive_inst, Modified: python/trunk/Modules/cPickle.c ============================================================================== --- python/trunk/Modules/cPickle.c (original) +++ python/trunk/Modules/cPickle.c Tue May 26 06:12:39 2009 @@ -4086,25 +4086,24 @@ static int load_pop(Unpicklerobject *self) { - int len; - - if (!( (len=self->stack->length) > 0 )) return stackUnderflow(); + int len = self->stack->length; /* Note that we split the (pickle.py) stack into two stacks, an object stack and a mark stack. We have to be clever and pop the right one. We do this by looking at the top of the - mark stack. + mark stack first, and only signalling a stack underflow if + the object stack is empty and the mark stack doesn't match + our expectations. */ - - if ((self->num_marks > 0) && - (self->marks[self->num_marks - 1] == len)) + if (self->num_marks > 0 && self->marks[self->num_marks - 1] == len) { self->num_marks--; - else { + } else if (len >= 0) { len--; Py_DECREF(self->stack->data[len]); - self->stack->length=len; + self->stack->length = len; + } else { + return stackUnderflow(); } - return 0; } From python-checkins at python.org Tue May 26 07:37:22 2009 From: python-checkins at python.org (collin.winter) Date: Tue, 26 May 2009 07:37:22 +0200 (CEST) Subject: [Python-checkins] r72931 - in python/branches/release26-maint: Lib/test/pickletester.py Lib/test/test_cpickle.py Modules/cPickle.c Message-ID: <20090526053722.E0E30D298@mail.python.org> Author: collin.winter Date: Tue May 26 07:37:22 2009 New Revision: 72931 Log: Merged revisions 72930 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72930 | collin.winter | 2009-05-25 21:12:39 -0700 (Mon, 25 May 2009) | 1 line Issue 5794: fix cPickle's unpickling of recursive tuples. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/pickletester.py python/branches/release26-maint/Lib/test/test_cpickle.py python/branches/release26-maint/Modules/cPickle.c Modified: python/branches/release26-maint/Lib/test/pickletester.py ============================================================================== --- python/branches/release26-maint/Lib/test/pickletester.py (original) +++ python/branches/release26-maint/Lib/test/pickletester.py Tue May 26 07:37:22 2009 @@ -428,6 +428,16 @@ self.assertEqual(len(x), 1) self.assert_(x is x[0]) + def test_recursive_tuple(self): + t = ([],) + t[0].append(t) + for proto in protocols: + s = self.dumps(t, proto) + x = self.loads(s) + self.assertEqual(len(x), 1) + self.assertEqual(len(x[0]), 1) + self.assert_(x is x[0][0]) + def test_recursive_dict(self): d = {} d[1] = d Modified: python/branches/release26-maint/Lib/test/test_cpickle.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_cpickle.py (original) +++ python/branches/release26-maint/Lib/test/test_cpickle.py Tue May 26 07:37:22 2009 @@ -64,6 +64,11 @@ AbstractPickleTests.test_recursive_list, self) + def test_recursive_tuple(self): + self.assertRaises(ValueError, + AbstractPickleTests.test_recursive_tuple, + self) + def test_recursive_inst(self): self.assertRaises(ValueError, AbstractPickleTests.test_recursive_inst, Modified: python/branches/release26-maint/Modules/cPickle.c ============================================================================== --- python/branches/release26-maint/Modules/cPickle.c (original) +++ python/branches/release26-maint/Modules/cPickle.c Tue May 26 07:37:22 2009 @@ -4016,25 +4016,24 @@ static int load_pop(Unpicklerobject *self) { - int len; - - if (!( (len=self->stack->length) > 0 )) return stackUnderflow(); + int len = self->stack->length; /* Note that we split the (pickle.py) stack into two stacks, an object stack and a mark stack. We have to be clever and pop the right one. We do this by looking at the top of the - mark stack. + mark stack first, and only signalling a stack underflow if + the object stack is empty and the mark stack doesn't match + our expectations. */ - - if ((self->num_marks > 0) && - (self->marks[self->num_marks - 1] == len)) + if (self->num_marks > 0 && self->marks[self->num_marks - 1] == len) { self->num_marks--; - else { + } else if (len >= 0) { len--; Py_DECREF(self->stack->data[len]); - self->stack->length=len; + self->stack->length = len; + } else { + return stackUnderflow(); } - return 0; } From python-checkins at python.org Tue May 26 09:50:23 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 26 May 2009 09:50:23 +0200 (CEST) Subject: [Python-checkins] r72932 - in python/trunk: Doc/library/sched.rst Lib/sched.py Message-ID: <20090526075023.A80D5D66D@mail.python.org> Author: georg.brandl Date: Tue May 26 09:50:23 2009 New Revision: 72932 Log: #6112: list.remove raises ValueError, not RuntimeError. Modified: python/trunk/Doc/library/sched.rst python/trunk/Lib/sched.py Modified: python/trunk/Doc/library/sched.rst ============================================================================== --- python/trunk/Doc/library/sched.rst (original) +++ python/trunk/Doc/library/sched.rst Tue May 26 09:50:23 2009 @@ -100,7 +100,7 @@ .. method:: scheduler.cancel(event) Remove the event from the queue. If *event* is not an event currently in the - queue, this method will raise a :exc:`RuntimeError`. + queue, this method will raise a :exc:`ValueError`. .. method:: scheduler.empty() Modified: python/trunk/Lib/sched.py ============================================================================== --- python/trunk/Lib/sched.py (original) +++ python/trunk/Lib/sched.py Tue May 26 09:50:23 2009 @@ -67,7 +67,7 @@ """Remove an event from the queue. This must be presented the ID as returned by enter(). - If the event is not in the queue, this raises RuntimeError. + If the event is not in the queue, this raises ValueError. """ self._queue.remove(event) From python-checkins at python.org Tue May 26 09:50:52 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 26 May 2009 09:50:52 +0200 (CEST) Subject: [Python-checkins] r72933 - in python/branches/release26-maint: Doc/library/sched.rst Lib/sched.py Message-ID: <20090526075052.A7643D5D6@mail.python.org> Author: georg.brandl Date: Tue May 26 09:50:52 2009 New Revision: 72933 Log: Merged revisions 72932 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72932 | georg.brandl | 2009-05-26 09:50:23 +0200 (Di, 26 Mai 2009) | 1 line #6112: list.remove raises ValueError, not RuntimeError. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/library/sched.rst python/branches/release26-maint/Lib/sched.py Modified: python/branches/release26-maint/Doc/library/sched.rst ============================================================================== --- python/branches/release26-maint/Doc/library/sched.rst (original) +++ python/branches/release26-maint/Doc/library/sched.rst Tue May 26 09:50:52 2009 @@ -100,7 +100,7 @@ .. method:: scheduler.cancel(event) Remove the event from the queue. If *event* is not an event currently in the - queue, this method will raise a :exc:`RuntimeError`. + queue, this method will raise a :exc:`ValueError`. .. method:: scheduler.empty() Modified: python/branches/release26-maint/Lib/sched.py ============================================================================== --- python/branches/release26-maint/Lib/sched.py (original) +++ python/branches/release26-maint/Lib/sched.py Tue May 26 09:50:52 2009 @@ -67,7 +67,7 @@ """Remove an event from the queue. This must be presented the ID as returned by enter(). - If the event is not in the queue, this raises RuntimeError. + If the event is not in the queue, this raises ValueError. """ self._queue.remove(event) From python-checkins at python.org Tue May 26 09:51:03 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 26 May 2009 09:51:03 +0200 (CEST) Subject: [Python-checkins] r72934 - in python/branches/py3k: Doc/library/sched.rst Lib/sched.py Message-ID: <20090526075103.5EE51D66F@mail.python.org> Author: georg.brandl Date: Tue May 26 09:51:03 2009 New Revision: 72934 Log: Merged revisions 72932 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72932 | georg.brandl | 2009-05-26 09:50:23 +0200 (Di, 26 Mai 2009) | 1 line #6112: list.remove raises ValueError, not RuntimeError. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/sched.rst python/branches/py3k/Lib/sched.py Modified: python/branches/py3k/Doc/library/sched.rst ============================================================================== --- python/branches/py3k/Doc/library/sched.rst (original) +++ python/branches/py3k/Doc/library/sched.rst Tue May 26 09:51:03 2009 @@ -100,7 +100,7 @@ .. method:: scheduler.cancel(event) Remove the event from the queue. If *event* is not an event currently in the - queue, this method will raise a :exc:`RuntimeError`. + queue, this method will raise a :exc:`ValueError`. .. method:: scheduler.empty() Modified: python/branches/py3k/Lib/sched.py ============================================================================== --- python/branches/py3k/Lib/sched.py (original) +++ python/branches/py3k/Lib/sched.py Tue May 26 09:51:03 2009 @@ -73,7 +73,7 @@ """Remove an event from the queue. This must be presented the ID as returned by enter(). - If the event is not in the queue, this raises RuntimeError. + If the event is not in the queue, this raises ValueError. """ self._queue.remove(event) From buildbot at python.org Tue May 26 10:40:37 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 26 May 2009 08:40:37 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090526084037.55B3ED57E@mail.python.org> The Buildbot has detected a new failure of x86 XP-4 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%202.6/builds/296 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: georg.brandl BUILD FAILED: failed compile sincerely, -The Buildbot From python-checkins at python.org Tue May 26 10:50:50 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 26 May 2009 10:50:50 +0200 (CEST) Subject: [Python-checkins] r72935 - in python/branches/release26-maint: Doc/howto/functional.rst Doc/howto/regex.rst Doc/library/decimal.rst Doc/library/socket.rst Doc/library/xmlrpclib.rst Doc/reference/lexical_analysis.rst Message-ID: <20090526085050.4A48ED6E4@mail.python.org> Author: georg.brandl Date: Tue May 26 10:50:50 2009 New Revision: 72935 Log: Merged revisions 72085,72132,72159,72288,72290,72292 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72085 | georg.brandl | 2009-04-28 23:48:35 +0200 (Di, 28 Apr 2009) | 1 line Make the doctests in the docs pass, except for those in the turtle module. ........ r72132 | georg.brandl | 2009-04-30 00:44:07 +0200 (Do, 30 Apr 2009) | 1 line #5878: fix repr of re object. ........ r72159 | georg.brandl | 2009-05-01 10:51:37 +0200 (Fr, 01 Mai 2009) | 2 lines #5889: remove comma at the end of a list that some C compilers don't like. ........ r72288 | georg.brandl | 2009-05-04 22:42:08 +0200 (Mo, 04 Mai 2009) | 1 line #5925: fix highlighting of keyword table. ........ r72290 | georg.brandl | 2009-05-04 22:45:13 +0200 (Mo, 04 Mai 2009) | 1 line #5927, 5928: typos. ........ r72292 | georg.brandl | 2009-05-04 22:49:17 +0200 (Mo, 04 Mai 2009) | 1 line #5916, 5917: small socket doc improvements. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/howto/functional.rst python/branches/release26-maint/Doc/howto/regex.rst python/branches/release26-maint/Doc/library/decimal.rst python/branches/release26-maint/Doc/library/socket.rst python/branches/release26-maint/Doc/library/xmlrpclib.rst python/branches/release26-maint/Doc/reference/lexical_analysis.rst Modified: python/branches/release26-maint/Doc/howto/functional.rst ============================================================================== --- python/branches/release26-maint/Doc/howto/functional.rst (original) +++ python/branches/release26-maint/Doc/howto/functional.rst Tue May 26 10:50:50 2009 @@ -472,7 +472,7 @@ >>> gen = generate_ints(3) >>> gen - + >>> gen.next() 0 >>> gen.next() Modified: python/branches/release26-maint/Doc/howto/regex.rst ============================================================================== --- python/branches/release26-maint/Doc/howto/regex.rst (original) +++ python/branches/release26-maint/Doc/howto/regex.rst Tue May 26 10:50:50 2009 @@ -264,7 +264,7 @@ >>> import re >>> p = re.compile('ab*') >>> print p - + <_sre.SRE_Pattern object at 80b4150> :func:`re.compile` also accepts an optional *flags* argument, used to enable various special features and syntax variations. We'll go over the available Modified: python/branches/release26-maint/Doc/library/decimal.rst ============================================================================== --- python/branches/release26-maint/Doc/library/decimal.rst (original) +++ python/branches/release26-maint/Doc/library/decimal.rst Tue May 26 10:50:50 2009 @@ -1803,7 +1803,7 @@ >>> Decimal('3.214').quantize(TWOPLACES, context=Context(traps=[Inexact])) Traceback (most recent call last): ... - Inexact + Inexact: None Q. Once I have valid two place inputs, how do I maintain that invariant throughout an application? Modified: python/branches/release26-maint/Doc/library/socket.rst ============================================================================== --- python/branches/release26-maint/Doc/library/socket.rst (original) +++ python/branches/release26-maint/Doc/library/socket.rst Tue May 26 10:50:50 2009 @@ -405,7 +405,7 @@ :exc:`socket.error` will be raised. Note that exactly what is valid depends on the underlying C implementation of :cfunc:`inet_aton`. - :func:`inet_aton` does not support IPv6, and :func:`getnameinfo` should be used + :func:`inet_aton` does not support IPv6, and :func:`inet_pton` should be used instead for IPv4/v6 dual stack support. @@ -419,7 +419,7 @@ If the string passed to this function is not exactly 4 bytes in length, :exc:`socket.error` will be raised. :func:`inet_ntoa` does not support IPv6, and - :func:`getnameinfo` should be used instead for IPv4/v6 dual stack support. + :func:`inet_ntop` should be used instead for IPv4/v6 dual stack support. .. function:: inet_pton(address_family, ip_string) @@ -437,6 +437,11 @@ Availability: Unix (maybe not all platforms). + .. seealso:: + + :func:`ipaddr.BaseIP.packed` + Platform-independent conversion to a packed, binary format. + .. versionadded:: 2.3 Modified: python/branches/release26-maint/Doc/library/xmlrpclib.rst ============================================================================== --- python/branches/release26-maint/Doc/library/xmlrpclib.rst (original) +++ python/branches/release26-maint/Doc/library/xmlrpclib.rst Tue May 26 10:50:50 2009 @@ -160,7 +160,7 @@ .. method:: ServerProxy.system.methodSignature(name) This method takes one parameter, the name of a method implemented by the XML-RPC - server.It returns an array of possible signatures for this method. A signature + server. It returns an array of possible signatures for this method. A signature is an array of types. The first of these types is the return type of the method, the rest are parameters. @@ -174,7 +174,7 @@ If no signature is defined for the method, a non-array value is returned. In Python this means that the type of the returned value will be something other - that list. + than list. .. method:: ServerProxy.system.methodHelp(name) Modified: python/branches/release26-maint/Doc/reference/lexical_analysis.rst ============================================================================== --- python/branches/release26-maint/Doc/reference/lexical_analysis.rst (original) +++ python/branches/release26-maint/Doc/reference/lexical_analysis.rst Tue May 26 10:50:50 2009 @@ -339,7 +339,9 @@ The following identifiers are used as reserved words, or *keywords* of the language, and cannot be used as ordinary identifiers. They must be spelled -exactly as written here:: +exactly as written here: + +.. sourcecode:: text and del from not while as elif global or with From python-checkins at python.org Tue May 26 10:51:04 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 26 May 2009 10:51:04 +0200 (CEST) Subject: [Python-checkins] r72936 - python/branches/release26-maint Message-ID: <20090526085104.E76BBD797@mail.python.org> Author: georg.brandl Date: Tue May 26 10:51:04 2009 New Revision: 72936 Log: Blocked revisions 72183-72184 via svnmerge ........ r72183 | georg.brandl | 2009-05-01 23:28:35 +0200 (Fr, 01 Mai 2009) | 2 lines Review ipaddr docs and add them in the TOC under "Internet protocols". ........ r72184 | georg.brandl | 2009-05-01 23:30:25 +0200 (Fr, 01 Mai 2009) | 1 line Fix directive name. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Tue May 26 11:04:24 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 26 May 2009 11:04:24 +0200 (CEST) Subject: [Python-checkins] r72937 - in python/branches/release26-maint: Doc/about.rst Doc/bugs.rst Doc/howto/doanddont.rst Doc/howto/urllib2.rst Doc/includes/sqlite3/text_factory.py Doc/library/anydbm.rst Doc/library/ctypes.rst Doc/library/email-examples.rst Doc/library/functions.rst Doc/library/optparse.rst Doc/library/os.rst Doc/library/shelve.rst Doc/library/smtplib.rst Doc/library/sqlite3.rst Doc/library/stdtypes.rst Doc/library/webbrowser.rst Doc/library/xml.dom.minidom.rst Doc/reference/datamodel.rst Doc/reference/simple_stmts.rst Doc/tutorial/errors.rst Doc/tutorial/introduction.rst Lib/linecache.py Lib/test/test_linecache.py Misc/NEWS Message-ID: <20090526090424.20710D3BE@mail.python.org> Author: georg.brandl Date: Tue May 26 11:04:23 2009 New Revision: 72937 Log: Merged revisions 72319-72320,72467,72661,72675-72679,72703,72708,72710,72712,72801-72802,72820,72822,72824,72826-72828,72830 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72319 | georg.brandl | 2009-05-05 10:28:49 +0200 (Di, 05 Mai 2009) | 1 line #1309567: fix linecache behavior of stripping subdirectories from paths when looking for relative filename matches. Also add a linecache test suite. ........ r72320 | georg.brandl | 2009-05-05 10:30:28 +0200 (Di, 05 Mai 2009) | 1 line Add a news entry for r72319. ........ r72467 | georg.brandl | 2009-05-08 14:17:34 +0200 (Fr, 08 Mai 2009) | 1 line Fix name. ........ r72661 | georg.brandl | 2009-05-15 10:03:03 +0200 (Fr, 15 Mai 2009) | 1 line Fix example output for doctest-like demos. ........ r72675 | georg.brandl | 2009-05-16 13:13:21 +0200 (Sa, 16 Mai 2009) | 1 line #6034: clarify __reversed__ doc. ........ r72676 | georg.brandl | 2009-05-16 13:14:46 +0200 (Sa, 16 Mai 2009) | 1 line #6025: fix signature of parse(). ........ r72677 | georg.brandl | 2009-05-16 13:18:55 +0200 (Sa, 16 Mai 2009) | 1 line #6009: undocument default argument of Option as deprecated. ........ r72678 | georg.brandl | 2009-05-16 13:21:29 +0200 (Sa, 16 Mai 2009) | 1 line #2856: document 2.x os.listdir() behavior for undecodable filenames. ........ r72679 | georg.brandl | 2009-05-16 13:24:41 +0200 (Sa, 16 Mai 2009) | 1 line Fix about and bugs pages to match real workflow. ........ r72703 | georg.brandl | 2009-05-17 10:10:27 +0200 (So, 17 Mai 2009) | 1 line part of #4144: fix exception message in console session. ........ r72708 | georg.brandl | 2009-05-17 10:24:29 +0200 (So, 17 Mai 2009) | 1 line #6017: better document behavior of dictiterators when the dict is changed. ........ r72710 | georg.brandl | 2009-05-17 10:36:04 +0200 (So, 17 Mai 2009) | 1 line #5942: Copy over flag table from dbm.rst which is clearer. ........ r72712 | georg.brandl | 2009-05-17 10:55:00 +0200 (So, 17 Mai 2009) | 1 line #5935: mention that BROWSER is looked for in PATH. ........ r72801 | georg.brandl | 2009-05-20 20:31:14 +0200 (Mi, 20 Mai 2009) | 1 line #6055: refer to "sqlite3" consistently. ........ r72802 | georg.brandl | 2009-05-20 20:35:27 +0200 (Mi, 20 Mai 2009) | 1 line #6051: refer to email examples for better way to construct email messages. ........ r72820 | georg.brandl | 2009-05-22 09:23:32 +0200 (Fr, 22 Mai 2009) | 1 line Use raise X(y). ........ r72822 | georg.brandl | 2009-05-22 11:33:25 +0200 (Fr, 22 Mai 2009) | 1 line #6084: fix example. ........ r72824 | georg.brandl | 2009-05-22 11:43:17 +0200 (Fr, 22 Mai 2009) | 1 line Fix references to file-related functions and methods (os.* vs file.*). ........ r72826 | georg.brandl | 2009-05-22 11:49:42 +0200 (Fr, 22 Mai 2009) | 1 line Fix confusing wording. ........ r72827 | georg.brandl | 2009-05-22 11:50:30 +0200 (Fr, 22 Mai 2009) | 1 line s/use/call/ ........ r72828 | georg.brandl | 2009-05-22 11:58:48 +0200 (Fr, 22 Mai 2009) | 1 line Correction in softspace behavior description. ........ r72830 | georg.brandl | 2009-05-22 12:40:00 +0200 (Fr, 22 Mai 2009) | 1 line #6086: fix spelling and use a better exception to catch. ........ Added: python/branches/release26-maint/Lib/test/test_linecache.py - copied unchanged from r72320, /python/trunk/Lib/test/test_linecache.py Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/about.rst python/branches/release26-maint/Doc/bugs.rst python/branches/release26-maint/Doc/howto/doanddont.rst python/branches/release26-maint/Doc/howto/urllib2.rst python/branches/release26-maint/Doc/includes/sqlite3/text_factory.py python/branches/release26-maint/Doc/library/anydbm.rst python/branches/release26-maint/Doc/library/ctypes.rst python/branches/release26-maint/Doc/library/email-examples.rst python/branches/release26-maint/Doc/library/functions.rst python/branches/release26-maint/Doc/library/optparse.rst python/branches/release26-maint/Doc/library/os.rst python/branches/release26-maint/Doc/library/shelve.rst python/branches/release26-maint/Doc/library/smtplib.rst python/branches/release26-maint/Doc/library/sqlite3.rst python/branches/release26-maint/Doc/library/stdtypes.rst python/branches/release26-maint/Doc/library/webbrowser.rst python/branches/release26-maint/Doc/library/xml.dom.minidom.rst python/branches/release26-maint/Doc/reference/datamodel.rst python/branches/release26-maint/Doc/reference/simple_stmts.rst python/branches/release26-maint/Doc/tutorial/errors.rst python/branches/release26-maint/Doc/tutorial/introduction.rst python/branches/release26-maint/Lib/linecache.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Doc/about.rst ============================================================================== --- python/branches/release26-maint/Doc/about.rst (original) +++ python/branches/release26-maint/Doc/about.rst Tue May 26 11:04:23 2009 @@ -7,8 +7,8 @@ `_ sources by *Sphinx*, a document processor specifically written for the Python documentation. -In the online version of these documents, you can submit comments and suggest -changes directly on the documentation pages. +.. In the online version of these documents, you can submit comments and suggest + changes directly on the documentation pages. Development of the documentation and its toolchain takes place on the docs at python.org mailing list. We're always looking for volunteers wanting @@ -24,7 +24,8 @@ `_ project from which Sphinx got many good ideas. -See :ref:`reporting-bugs` for information how to report bugs in Python itself. +See :ref:`reporting-bugs` for information how to report bugs in this +documentation, or Python itself. .. including the ACKS file here so that it can be maintained separately .. include:: ACKS.txt Modified: python/branches/release26-maint/Doc/bugs.rst ============================================================================== --- python/branches/release26-maint/Doc/bugs.rst (original) +++ python/branches/release26-maint/Doc/bugs.rst Tue May 26 11:04:23 2009 @@ -19,6 +19,9 @@ information is needed (in which case you are welcome to provide it if you can!). To do this, search the bug database using the search box on the top of the page. +In the case of documentation bugs, look at the most recent development docs at +http://docs.python.org/dev to see if the bug has been fixed. + If the problem you're reporting is not already in the bug tracker, go back to the Python Bug Tracker. If you don't already have a tracker account, select the "Register" link in the sidebar and undergo the registration procedure. Modified: python/branches/release26-maint/Doc/howto/doanddont.rst ============================================================================== --- python/branches/release26-maint/Doc/howto/doanddont.rst (original) +++ python/branches/release26-maint/Doc/howto/doanddont.rst Tue May 26 11:04:23 2009 @@ -30,7 +30,7 @@ ``from module import *`` is *invalid* inside function definitions. While many versions of Python do not check for the invalidity, it does not make it more -valid, no more then having a smart lawyer makes a man innocent. Do not use it +valid, no more than having a smart lawyer makes a man innocent. Do not use it like that ever. Even in versions where it was accepted, it made the function execution slower, because the compiler could not be certain which names are local and which are global. In Python 2.1 this construct causes warnings, and @@ -111,7 +111,7 @@ from module import name1, name2 ------------------------------- -This is a "don't" which is much weaker then the previous "don't"s but is still +This is a "don't" which is much weaker than the previous "don't"s but is still something you should not do if you don't have good reasons to do that. The reason it is usually bad idea is because you suddenly have an object which lives in two separate namespaces. When the binding in one namespace changes, the @@ -245,11 +245,11 @@ Every so often, people seem to be writing stuff in the Python library again, usually poorly. While the occasional module has a poor interface, it is usually much better to use the rich standard library and data types that come with -Python then inventing your own. +Python than inventing your own. A useful module very few people know about is :mod:`os.path`. It always has the correct path arithmetic for your operating system, and will usually be much -better then whatever you come up with yourself. +better than whatever you come up with yourself. Compare:: @@ -284,7 +284,7 @@ ====================================== Since Python treats a newline as a statement terminator, and since statements -are often more then is comfortable to put in one line, many people do:: +are often more than is comfortable to put in one line, many people do:: if foo.bar()['first'][0] == baz.quux(1, 2)[5:9] and \ calculate_number(10, 20) != forbulate(500, 360): Modified: python/branches/release26-maint/Doc/howto/urllib2.rst ============================================================================== --- python/branches/release26-maint/Doc/howto/urllib2.rst (original) +++ python/branches/release26-maint/Doc/howto/urllib2.rst Tue May 26 11:04:23 2009 @@ -311,7 +311,7 @@ >>> req = urllib2.Request('http://www.python.org/fish.html') >>> try: >>> urllib2.urlopen(req) - >>> except URLError, e: + >>> except HTTPError, e: >>> print e.code >>> print e.read() >>> Modified: python/branches/release26-maint/Doc/includes/sqlite3/text_factory.py ============================================================================== --- python/branches/release26-maint/Doc/includes/sqlite3/text_factory.py (original) +++ python/branches/release26-maint/Doc/includes/sqlite3/text_factory.py Tue May 26 11:04:23 2009 @@ -13,7 +13,7 @@ row = cur.fetchone() assert row[0] == AUSTRIA -# but we can make pysqlite always return bytestrings ... +# but we can make sqlite3 always return bytestrings ... con.text_factory = str cur.execute("select ?", (AUSTRIA,)) row = cur.fetchone() @@ -26,11 +26,12 @@ # here we implement one that will ignore Unicode characters that cannot be # decoded from UTF-8 con.text_factory = lambda x: unicode(x, "utf-8", "ignore") -cur.execute("select ?", ("this is latin1 and would normally create errors" + u"\xe4\xf6\xfc".encode("latin1"),)) +cur.execute("select ?", ("this is latin1 and would normally create errors" + + u"\xe4\xf6\xfc".encode("latin1"),)) row = cur.fetchone() assert type(row[0]) == unicode -# pysqlite offers a builtin optimized text_factory that will return bytestring +# sqlite3 offers a builtin optimized text_factory that will return bytestring # objects, if the data is in ASCII only, and otherwise return unicode objects con.text_factory = sqlite3.OptimizedUnicode cur.execute("select ?", (AUSTRIA,)) Modified: python/branches/release26-maint/Doc/library/anydbm.rst ============================================================================== --- python/branches/release26-maint/Doc/library/anydbm.rst (original) +++ python/branches/release26-maint/Doc/library/anydbm.rst Tue May 26 11:04:23 2009 @@ -27,19 +27,33 @@ Open the database file *filename* and return a corresponding object. - If the database file already exists, the :mod:`whichdb` module is used to - determine its type and the appropriate module is used; if it does not exist, the - first module listed above that can be imported is used. - - The optional *flag* argument can be ``'r'`` to open an existing database for - reading only, ``'w'`` to open an existing database for reading and writing, - ``'c'`` to create the database if it doesn't exist, or ``'n'``, which will - always create a new empty database. If not specified, the default value is - ``'r'``. + If the database file already exists, the :mod:`whichdb` module is used to + determine its type and the appropriate module is used; if it does not exist, + the first module listed above that can be imported is used. + + The optional *flag* argument must be one of these values: + + +---------+-------------------------------------------+ + | Value | Meaning | + +=========+===========================================+ + | ``'r'`` | Open existing database for reading only | + | | (default) | + +---------+-------------------------------------------+ + | ``'w'`` | Open existing database for reading and | + | | writing | + +---------+-------------------------------------------+ + | ``'c'`` | Open database for reading and writing, | + | | creating it if it doesn't exist | + +---------+-------------------------------------------+ + | ``'n'`` | Always create a new, empty database, open | + | | for reading and writing | + +---------+-------------------------------------------+ + + If not specified, the default value is ``'r'``. The optional *mode* argument is the Unix mode of the file, used only when the - database has to be created. It defaults to octal ``0666`` (and will be modified - by the prevailing umask). + database has to be created. It defaults to octal ``0666`` (and will be + modified by the prevailing umask). .. exception:: error Modified: python/branches/release26-maint/Doc/library/ctypes.rst ============================================================================== --- python/branches/release26-maint/Doc/library/ctypes.rst (original) +++ python/branches/release26-maint/Doc/library/ctypes.rst Tue May 26 11:04:23 2009 @@ -341,9 +341,9 @@ >>> printf("Hello, %s\n", "World!") Hello, World! 14 - >>> printf("Hello, %S", u"World!") + >>> printf("Hello, %S\n", u"World!") Hello, World! - 13 + 14 >>> printf("%d bottles of beer\n", 42) 42 bottles of beer 19 @@ -358,7 +358,7 @@ that they can be converted to the required C data type:: >>> printf("An int %d, a double %f\n", 1234, c_double(3.14)) - Integer 1234, double 3.1400001049 + An int 1234, a double 3.140000 31 >>> @@ -414,9 +414,9 @@ Traceback (most recent call last): File "", line 1, in ? ArgumentError: argument 2: exceptions.TypeError: wrong type - >>> printf("%s %d %f", "X", 2, 3) - X 2 3.00000012 - 12 + >>> printf("%s %d %f\n", "X", 2, 3) + X 2 3.000000 + 13 >>> If you have defined your own classes which you pass to function calls, you have Modified: python/branches/release26-maint/Doc/library/email-examples.rst ============================================================================== --- python/branches/release26-maint/Doc/library/email-examples.rst (original) +++ python/branches/release26-maint/Doc/library/email-examples.rst Tue May 26 11:04:23 2009 @@ -1,3 +1,5 @@ +.. _email-examples: + :mod:`email`: Examples ---------------------- Modified: python/branches/release26-maint/Doc/library/functions.rst ============================================================================== --- python/branches/release26-maint/Doc/library/functions.rst (original) +++ python/branches/release26-maint/Doc/library/functions.rst Tue May 26 11:04:23 2009 @@ -1398,7 +1398,7 @@ >>> zipped [(1, 4), (2, 5), (3, 6)] >>> x2, y2 = zip(*zipped) - >>> x == x2, y == y2 + >>> x == list(x2) and y == list(y2) True .. versionadded:: 2.0 @@ -1468,7 +1468,7 @@ names. If you simply want to import a module (potentially within a package) by name, - you can get it from :data:`sys.modules`:: + you can call :func:`__import__` and then look it up in :data:`sys.modules`:: >>> import sys >>> name = 'foo.bar.baz' Modified: python/branches/release26-maint/Doc/library/optparse.rst ============================================================================== --- python/branches/release26-maint/Doc/library/optparse.rst (original) +++ python/branches/release26-maint/Doc/library/optparse.rst Tue May 26 11:04:23 2009 @@ -1077,10 +1077,10 @@ tells :mod:`optparse` where to write it: :attr:`dest` names an attribute of the ``options`` object that :mod:`optparse` builds as it parses the command line. -* ``default`` (deprecated) +* ``default`` The value to use for this option's destination if the option is not seen on the - command line. Deprecated; use ``parser.set_defaults()`` instead. + command line. See also ``parser.set_defaults()``. * ``nargs`` (default: 1) Modified: python/branches/release26-maint/Doc/library/os.rst ============================================================================== --- python/branches/release26-maint/Doc/library/os.rst (original) +++ python/branches/release26-maint/Doc/library/os.rst Tue May 26 11:04:23 2009 @@ -354,7 +354,7 @@ is ``'r'`` (default) or ``'w'``. The *bufsize* argument has the same meaning as the corresponding argument to the built-in :func:`open` function. The exit status of the command (encoded in the format specified for :func:`wait`) is - available as the return value of the :meth:`close` method of the file object, + available as the return value of the :meth:`~file.close` method of the file object, except that when the exit status is zero (termination without errors), ``None`` is returned. Availability: Unix, Windows. @@ -475,9 +475,9 @@ .. note:: This function is intended for low-level I/O and must be applied to a file - descriptor as returned by :func:`open` or :func:`pipe`. To close a "file + descriptor as returned by :func:`os.open` or :func:`pipe`. To close a "file object" returned by the built-in function :func:`open` or by :func:`popen` or - :func:`fdopen`, use its :meth:`close` method. + :func:`fdopen`, use its :meth:`~file.close` method. .. function:: closerange(fd_low, fd_high) @@ -604,8 +604,8 @@ .. note:: This function is intended for low-level I/O. For normal usage, use the built-in - function :func:`open`, which returns a "file object" with :meth:`read` and - :meth:`write` methods (and many more). To wrap a file descriptor in a "file + function :func:`open`, which returns a "file object" with :meth:`~file.read` and + :meth:`~file.write` methods (and many more). To wrap a file descriptor in a "file object", use :func:`fdopen`. @@ -634,22 +634,22 @@ .. note:: This function is intended for low-level I/O and must be applied to a file - descriptor as returned by :func:`open` or :func:`pipe`. To read a "file object" + descriptor as returned by :func:`os.open` or :func:`pipe`. To read a "file object" returned by the built-in function :func:`open` or by :func:`popen` or - :func:`fdopen`, or :data:`sys.stdin`, use its :meth:`read` or :meth:`readline` - methods. + :func:`fdopen`, or :data:`sys.stdin`, use its :meth:`~file.read` or + :meth:`~file.readline` methods. .. function:: tcgetpgrp(fd) Return the process group associated with the terminal given by *fd* (an open - file descriptor as returned by :func:`open`). Availability: Unix. + file descriptor as returned by :func:`os.open`). Availability: Unix. .. function:: tcsetpgrp(fd, pg) Set the process group associated with the terminal given by *fd* (an open file - descriptor as returned by :func:`open`) to *pg*. Availability: Unix. + descriptor as returned by :func:`os.open`) to *pg*. Availability: Unix. .. function:: ttyname(fd) @@ -667,13 +667,13 @@ .. note:: This function is intended for low-level I/O and must be applied to a file - descriptor as returned by :func:`open` or :func:`pipe`. To write a "file + descriptor as returned by :func:`os.open` or :func:`pipe`. To write a "file object" returned by the built-in function :func:`open` or by :func:`popen` or - :func:`fdopen`, or :data:`sys.stdout` or :data:`sys.stderr`, use its :meth:`write` - method. + :func:`fdopen`, or :data:`sys.stdout` or :data:`sys.stderr`, use its + :meth:`~file.write` method. The following constants are options for the *flags* parameter to the -:func:`open` function. They can be combined using the bitwise OR operator +:func:`~os.open` function. They can be combined using the bitwise OR operator ``|``. Some of them are not available on all platforms. For descriptions of their availability and use, consult the :manpage:`open(2)` manual page on Unix or `the MSDN ` on Windows. @@ -752,7 +752,7 @@ .. note:: Using :func:`access` to check if a user is authorized to e.g. open a file before - actually doing so using :func:`open` creates a security hole, because the user + actually doing so using :func:`open` creates a security hole, because the user might exploit the short time interval between checking and opening the file to manipulate it. @@ -929,7 +929,8 @@ .. versionchanged:: 2.3 On Windows NT/2k/XP and Unix, if *path* is a Unicode object, the result will be - a list of Unicode objects. + a list of Unicode objects. Undecodable filenames will still be returned as + string objects. .. function:: lstat(path) Modified: python/branches/release26-maint/Doc/library/shelve.rst ============================================================================== --- python/branches/release26-maint/Doc/library/shelve.rst (original) +++ python/branches/release26-maint/Doc/library/shelve.rst Tue May 26 11:04:23 2009 @@ -1,4 +1,3 @@ - :mod:`shelve` --- Python object persistence =========================================== @@ -40,7 +39,7 @@ entries are written back (there is no way to determine which accessed entries are mutable, nor which ones were actually mutated). -Shelve objects support all methods supported by dictionaries. This eases the +Shelf objects support all methods supported by dictionaries. This eases the transition from dictionary based scripts to those requiring persistent storage. One additional method is supported: Modified: python/branches/release26-maint/Doc/library/smtplib.rst ============================================================================== --- python/branches/release26-maint/Doc/library/smtplib.rst (original) +++ python/branches/release26-maint/Doc/library/smtplib.rst Tue May 26 11:04:23 2009 @@ -380,3 +380,8 @@ server.sendmail(fromaddr, toaddrs, msg) server.quit() +.. note:: + + In general, you will want to use the :mod:`email` package's features to + construct an email message, which you can then convert to a string and send + via :meth:`sendmail`; see :ref:`email-examples`. Modified: python/branches/release26-maint/Doc/library/sqlite3.rst ============================================================================== --- python/branches/release26-maint/Doc/library/sqlite3.rst (original) +++ python/branches/release26-maint/Doc/library/sqlite3.rst Tue May 26 11:04:23 2009 @@ -15,7 +15,7 @@ application using SQLite and then port the code to a larger database such as PostgreSQL or Oracle. -pysqlite was written by Gerhard H?ring and provides a SQL interface compliant +sqlite3 was written by Gerhard H?ring and provides a SQL interface compliant with the DB-API 2.0 specification described by :pep:`249`. To use the module, you must first create a :class:`Connection` object that @@ -52,8 +52,9 @@ Instead, use the DB-API's parameter substitution. Put ``?`` as a placeholder wherever you want to use a value, and then provide a tuple of values as the -second argument to the cursor's :meth:`~Cursor.execute` method. (Other database modules -may use a different placeholder, such as ``%s`` or ``:1``.) For example:: +second argument to the cursor's :meth:`~Cursor.execute` method. (Other database +modules may use a different placeholder, such as ``%s`` or ``:1``.) For +example:: # Never do this -- insecure! symbol = 'IBM' @@ -92,11 +93,12 @@ .. seealso:: http://www.pysqlite.org - The pysqlite web page. + The pysqlite web page -- sqlite3 is developed externally under the name + "pysqlite". http://www.sqlite.org - The SQLite web page; the documentation describes the syntax and the available - data types for the supported SQL dialect. + The SQLite web page; the documentation describes the syntax and the + available data types for the supported SQL dialect. :pep:`249` - Database API Specification 2.0 PEP written by Marc-Andr? Lemburg. @@ -802,10 +804,10 @@ ...``, ``VACUUM``, ``PRAGMA``, the :mod:`sqlite3` module will commit implicitly before executing that command. There are two reasons for doing that. The first is that some of these commands don't work within transactions. The other reason -is that pysqlite needs to keep track of the transaction state (if a transaction +is that sqlite3 needs to keep track of the transaction state (if a transaction is active or not). -You can control which kind of ``BEGIN`` statements pysqlite implicitly executes +You can control which kind of ``BEGIN`` statements sqlite3 implicitly executes (or none at all) via the *isolation_level* parameter to the :func:`connect` call, or via the :attr:`isolation_level` property of connections. @@ -817,8 +819,8 @@ -Using pysqlite efficiently --------------------------- +Using :mod:`sqlite3` efficiently +-------------------------------- Using shortcut methods Modified: python/branches/release26-maint/Doc/library/stdtypes.rst ============================================================================== --- python/branches/release26-maint/Doc/library/stdtypes.rst (original) +++ python/branches/release26-maint/Doc/library/stdtypes.rst Tue May 26 11:04:23 2009 @@ -1955,7 +1955,7 @@ note for :meth:`dict.items`. Using :meth:`iteritems` while adding or deleting entries in the dictionary - will raise a :exc:`RuntimeError`. + may raise a :exc:`RuntimeError` or fail to iterate over all entries. .. versionadded:: 2.2 @@ -1965,7 +1965,7 @@ :meth:`dict.items`. Using :meth:`iterkeys` while adding or deleting entries in the dictionary - will raise a :exc:`RuntimeError`. + may raise a :exc:`RuntimeError` or fail to iterate over all entries. .. versionadded:: 2.2 @@ -1975,7 +1975,8 @@ :meth:`dict.items`. Using :meth:`itervalues` while adding or deleting entries in the - dictionary will raise a :exc:`RuntimeError`. + dictionary may raise a :exc:`RuntimeError` or fail to iterate over all + entries. .. versionadded:: 2.2 Modified: python/branches/release26-maint/Doc/library/webbrowser.rst ============================================================================== --- python/branches/release26-maint/Doc/library/webbrowser.rst (original) +++ python/branches/release26-maint/Doc/library/webbrowser.rst Tue May 26 11:04:23 2009 @@ -22,7 +22,7 @@ of browsers to try in order. When the value of a list part contains the string ``%s``, then it is interpreted as a literal browser command line to be used with the argument URL substituted for ``%s``; if the part does not contain -``%s``, it is simply interpreted as the name of the browser to launch. +``%s``, it is simply interpreted as the name of the browser to launch. [1]_ For non-Unix platforms, or when a remote browser is available on Unix, the controlling process will not wait for the user to finish with the browser, but @@ -201,3 +201,8 @@ .. versionadded:: 2.5 + +.. rubric:: Footnotes + +.. [1] Executables named here without a full path will be searched in the + directories given in the :envvar:`PATH` environment variable. Modified: python/branches/release26-maint/Doc/library/xml.dom.minidom.rst ============================================================================== --- python/branches/release26-maint/Doc/library/xml.dom.minidom.rst (original) +++ python/branches/release26-maint/Doc/library/xml.dom.minidom.rst Tue May 26 11:04:23 2009 @@ -30,7 +30,7 @@ The :func:`parse` function can take either a filename or an open file object. -.. function:: parse(filename_or_file, parser) +.. function:: parse(filename_or_file[, parser[, bufsize]]) Return a :class:`Document` from the given input. *filename_or_file* may be either a file name, or a file-like object. *parser*, if given, must be a SAX2 Modified: python/branches/release26-maint/Doc/reference/datamodel.rst ============================================================================== --- python/branches/release26-maint/Doc/reference/datamodel.rst (original) +++ python/branches/release26-maint/Doc/reference/datamodel.rst Tue May 26 11:04:23 2009 @@ -1858,11 +1858,11 @@ reverse iteration. It should return a new iterator object that iterates over all the objects in the container in reverse order. - If the :meth:`__reversed__` method is not provided, the - :func:`reversed` builtin will fall back to using the sequence protocol - (:meth:`__len__` and :meth:`__getitem__`). Objects should normally - only provide :meth:`__reversed__` if they do not support the sequence - protocol and an efficient implementation of reverse iteration is possible. + If the :meth:`__reversed__` method is not provided, the :func:`reversed` + builtin will fall back to using the sequence protocol (:meth:`__len__` and + :meth:`__getitem__`). Objects that support the sequence protocol should + only provide :meth:`__reversed__` if they can provide an implementation + that is more efficient than the one provided by :func:`reversed`. .. versionadded:: 2.6 Modified: python/branches/release26-maint/Doc/reference/simple_stmts.rst ============================================================================== --- python/branches/release26-maint/Doc/reference/simple_stmts.rst (original) +++ python/branches/release26-maint/Doc/reference/simple_stmts.rst Tue May 26 11:04:23 2009 @@ -386,9 +386,10 @@ object is (converted and) written, unless the output system believes it is positioned at the beginning of a line. This is the case (1) when no characters have yet been written to standard output, (2) when the last character written to -standard output is ``'\n'``, or (3) when the last write operation on standard -output was not a :keyword:`print` statement. (In some cases it may be -functional to write an empty string to standard output for this reason.) +standard output is a whitespace character except ``' '``, or (3) when the last +write operation on standard output was not a :keyword:`print` statement. +(In some cases it may be functional to write an empty string to standard output +for this reason.) .. note:: Modified: python/branches/release26-maint/Doc/tutorial/errors.rst ============================================================================== --- python/branches/release26-maint/Doc/tutorial/errors.rst (original) +++ python/branches/release26-maint/Doc/tutorial/errors.rst Tue May 26 11:04:23 2009 @@ -216,7 +216,7 @@ The :keyword:`raise` statement allows the programmer to force a specified exception to occur. For example:: - >>> raise NameError, 'HiThere' + >>> raise NameError('HiThere') Traceback (most recent call last): File "", line 1, in ? NameError: HiThere @@ -231,7 +231,7 @@ re-raise the exception:: >>> try: - ... raise NameError, 'HiThere' + ... raise NameError('HiThere') ... except NameError: ... print 'An exception flew by!' ... raise @@ -263,7 +263,7 @@ ... print 'My exception occurred, value:', e.value ... My exception occurred, value: 4 - >>> raise MyError, 'oops!' + >>> raise MyError('oops!') Traceback (most recent call last): File "", line 1, in ? __main__.MyError: 'oops!' Modified: python/branches/release26-maint/Doc/tutorial/introduction.rst ============================================================================== --- python/branches/release26-maint/Doc/tutorial/introduction.rst (original) +++ python/branches/release26-maint/Doc/tutorial/introduction.rst Tue May 26 11:04:23 2009 @@ -285,11 +285,11 @@ >>> word[0] = 'x' Traceback (most recent call last): File "", line 1, in ? - TypeError: object doesn't support item assignment + TypeError: object does not support item assignment >>> word[:1] = 'Splat' Traceback (most recent call last): File "", line 1, in ? - TypeError: object doesn't support slice assignment + TypeError: object does not support slice assignment However, creating a new string with the combined content is easy and efficient:: Modified: python/branches/release26-maint/Lib/linecache.py ============================================================================== --- python/branches/release26-maint/Lib/linecache.py (original) +++ python/branches/release26-maint/Lib/linecache.py Tue May 26 11:04:23 2009 @@ -79,7 +79,7 @@ try: stat = os.stat(fullname) except os.error, msg: - basename = os.path.split(filename)[1] + basename = filename # Try for a __loader__, if available if module_globals and '__loader__' in module_globals: @@ -103,7 +103,10 @@ ) return cache[filename][2] - # Try looking through the module search path. + # Try looking through the module search path, which is only useful + # when handling a relative filename. + if os.path.isabs(filename): + return [] for dirname in sys.path: # When using imputil, sys.path may contain things other than Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Tue May 26 11:04:23 2009 @@ -220,6 +220,9 @@ - Issue #6062: In distutils, fixed the package option of build_ext. Feedback and tests on pywin32 by Tim Golden. +- Issue #1309567: Fix linecache behavior of stripping subdirectories when + looking for files given by a relative filename. + - Issue #6046: Fixed the library extension when distutils build_ext is used inplace. Initial patch by Roumen Petrov. From python-checkins at python.org Tue May 26 11:04:34 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 26 May 2009 11:04:34 +0200 (CEST) Subject: [Python-checkins] r72938 - python/branches/release26-maint Message-ID: <20090526090434.A386BC2C2@mail.python.org> Author: georg.brandl Date: Tue May 26 11:04:34 2009 New Revision: 72938 Log: Blocked revisions 72322,72324,72326,72328,72799,72924 via svnmerge ........ r72322 | georg.brandl | 2009-05-05 10:54:11 +0200 (Di, 05 Mai 2009) | 1 line #5142: add module skipping feature to pdb. ........ r72324 | georg.brandl | 2009-05-05 11:06:02 +0200 (Di, 05 Mai 2009) | 1 line Fix overlong lines. ........ r72326 | georg.brandl | 2009-05-05 11:19:43 +0200 (Di, 05 Mai 2009) | 1 line #5929: fix signedness warning. ........ r72328 | georg.brandl | 2009-05-05 11:20:52 +0200 (Di, 05 Mai 2009) | 1 line Remove unused variable. ........ r72799 | georg.brandl | 2009-05-20 20:24:08 +0200 (Mi, 20 Mai 2009) | 1 line Update bug tracker URL. ........ r72924 | georg.brandl | 2009-05-25 23:02:56 +0200 (Mo, 25 Mai 2009) | 6 lines Allow multiple context managers in one with statement, as proposed in http://codereview.appspot.com/53094 and accepted by Guido. The construct is transformed into multiple With AST nodes so that there should be no problems with the semantics. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Tue May 26 11:04:59 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 26 May 2009 11:04:59 +0200 (CEST) Subject: [Python-checkins] r72939 - python/branches/release26-maint Message-ID: <20090526090459.1E365D260@mail.python.org> Author: georg.brandl Date: Tue May 26 11:04:58 2009 New Revision: 72939 Log: Blocked revisions 72833 via svnmerge ........ r72833 | georg.brandl | 2009-05-22 19:00:17 +0200 (Fr, 22 Mai 2009) | 1 line #6078: _warnings is a builtin module and has no standard init_warnings function. ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Tue May 26 14:50:03 2009 From: python-checkins at python.org (benjamin.peterson) Date: Tue, 26 May 2009 14:50:03 +0200 (CEST) Subject: [Python-checkins] r72940 - python/trunk/Python/peephole.c Message-ID: <20090526125003.19A0ED60F@mail.python.org> Author: benjamin.peterson Date: Tue May 26 14:49:59 2009 New Revision: 72940 Log: teach the peepholer about SETUP_WITH Modified: python/trunk/Python/peephole.c Modified: python/trunk/Python/peephole.c ============================================================================== --- python/trunk/Python/peephole.c (original) +++ python/trunk/Python/peephole.c Tue May 26 14:49:59 2009 @@ -259,6 +259,7 @@ case SETUP_LOOP: case SETUP_EXCEPT: case SETUP_FINALLY: + case SETUP_WITH: j = GETJUMPTGT(code, i); blocks[j] = 1; break; @@ -550,6 +551,7 @@ case SETUP_LOOP: case SETUP_EXCEPT: case SETUP_FINALLY: + case SETUP_WITH: tgt = GETJUMPTGT(codestr, i); /* Replace JUMP_* to a RETURN into just a RETURN */ if (UNCONDITIONAL_JUMP(opcode) && @@ -628,6 +630,7 @@ case SETUP_LOOP: case SETUP_EXCEPT: case SETUP_FINALLY: + case SETUP_WITH: j = addrmap[GETARG(codestr, i) + i + 3] - addrmap[i] - 3; SETARG(codestr, i, j); break; From python-checkins at python.org Tue May 26 18:43:14 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 26 May 2009 18:43:14 +0200 (CEST) Subject: [Python-checkins] r72941 - in python/branches/py3k: Doc/c-api/number.rst Include/abstract.h Message-ID: <20090526164314.1F5C6D914@mail.python.org> Author: georg.brandl Date: Tue May 26 18:43:13 2009 New Revision: 72941 Log: #6115: remove entries for the already removed PyNumber_Divide and PyNumber_InPlaceDivide from the header and the docs. Modified: python/branches/py3k/Doc/c-api/number.rst python/branches/py3k/Include/abstract.h Modified: python/branches/py3k/Doc/c-api/number.rst ============================================================================== --- python/branches/py3k/Doc/c-api/number.rst (original) +++ python/branches/py3k/Doc/c-api/number.rst Tue May 26 18:43:13 2009 @@ -30,12 +30,6 @@ the equivalent of the Python expression ``o1 * o2``. -.. cfunction:: PyObject* PyNumber_Divide(PyObject *o1, PyObject *o2) - - Returns the result of dividing *o1* by *o2*, or *NULL* on failure. This is the - equivalent of the Python expression ``o1 / o2``. - - .. cfunction:: PyObject* PyNumber_FloorDivide(PyObject *o1, PyObject *o2) Return the floor of *o1* divided by *o2*, or *NULL* on failure. This is @@ -152,13 +146,6 @@ the Python statement ``o1 *= o2``. -.. cfunction:: PyObject* PyNumber_InPlaceDivide(PyObject *o1, PyObject *o2) - - Returns the result of dividing *o1* by *o2*, or *NULL* on failure. The - operation is done *in-place* when *o1* supports it. This is the equivalent of - the Python statement ``o1 /= o2``. - - .. cfunction:: PyObject* PyNumber_InPlaceFloorDivide(PyObject *o1, PyObject *o2) Returns the mathematical floor of dividing *o1* by *o2*, or *NULL* on failure. Modified: python/branches/py3k/Include/abstract.h ============================================================================== --- python/branches/py3k/Include/abstract.h (original) +++ python/branches/py3k/Include/abstract.h Tue May 26 18:43:13 2009 @@ -632,13 +632,6 @@ o1*o2. */ - PyAPI_FUNC(PyObject *) PyNumber_Divide(PyObject *o1, PyObject *o2); - - /* - Returns the result of dividing o1 by o2, or null on failure. - This is the equivalent of the Python expression: o1/o2. - */ - PyAPI_FUNC(PyObject *) PyNumber_FloorDivide(PyObject *o1, PyObject *o2); /* @@ -832,14 +825,6 @@ o1 *= o2. */ - PyAPI_FUNC(PyObject *) PyNumber_InPlaceDivide(PyObject *o1, PyObject *o2); - - /* - Returns the result of dividing o1 by o2, possibly in-place, or null - on failure. This is the equivalent of the Python expression: - o1 /= o2. - */ - PyAPI_FUNC(PyObject *) PyNumber_InPlaceFloorDivide(PyObject *o1, PyObject *o2); From python-checkins at python.org Tue May 26 18:53:41 2009 From: python-checkins at python.org (collin.winter) Date: Tue, 26 May 2009 18:53:41 +0200 (CEST) Subject: [Python-checkins] r72942 - in python/branches/py3k: Lib/test/pickletester.py Modules/_pickle.c Message-ID: <20090526165341.CAB01D931@mail.python.org> Author: collin.winter Date: Tue May 26 18:53:41 2009 New Revision: 72942 Log: Merged revisions 72930 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72930 | collin.winter | 2009-05-25 21:12:39 -0700 (Mon, 25 May 2009) | 1 line Issue 5794: fix cPickle's unpickling of recursive tuples. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/pickletester.py python/branches/py3k/Modules/_pickle.c Modified: python/branches/py3k/Lib/test/pickletester.py ============================================================================== --- python/branches/py3k/Lib/test/pickletester.py (original) +++ python/branches/py3k/Lib/test/pickletester.py Tue May 26 18:53:41 2009 @@ -432,6 +432,16 @@ self.assertEqual(len(x), 1) self.assert_(x is x[0]) + def test_recursive_tuple(self): + t = ([],) + t[0].append(t) + for proto in protocols: + s = self.dumps(t, proto) + x = self.loads(s) + self.assertEqual(len(x), 1) + self.assertEqual(len(x[0]), 1) + self.assert_(x is x[0][0]) + def test_recursive_dict(self): d = {} d[1] = d Modified: python/branches/py3k/Modules/_pickle.c ============================================================================== --- python/branches/py3k/Modules/_pickle.c (original) +++ python/branches/py3k/Modules/_pickle.c Tue May 26 18:53:41 2009 @@ -3639,25 +3639,24 @@ static int load_pop(UnpicklerObject *self) { - int len; - - if ((len = self->stack->length) <= 0) - return stack_underflow(); + int len = self->stack->length; /* Note that we split the (pickle.py) stack into two stacks, * an object stack and a mark stack. We have to be clever and * pop the right one. We do this by looking at the top of the - * mark stack. + * mark stack first, and only signalling a stack underflow if + * the object stack is empty and the mark stack doesn't match + * our expectations. */ - - if ((self->num_marks > 0) && (self->marks[self->num_marks - 1] == len)) + if (self->num_marks > 0 && self->marks[self->num_marks - 1] == len) { self->num_marks--; - else { + } else if (len >= 0) { len--; Py_DECREF(self->stack->data[len]); self->stack->length = len; + } else { + return stack_underflow(); } - return 0; } From buildbot at python.org Tue May 26 19:28:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 26 May 2009 17:28:30 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090526172830.3CA6BDA4F@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/807 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue May 26 19:29:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 26 May 2009 17:29:56 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090526172957.0BFADC4BA@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/748 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Tue May 26 20:31:11 2009 From: python-checkins at python.org (georg.brandl) Date: Tue, 26 May 2009 20:31:11 +0200 (CEST) Subject: [Python-checkins] r72943 - in python/branches/py3k: Lib/test/test_urllib.py Lib/urllib/parse.py Misc/NEWS Message-ID: <20090526183111.CBE7CD5E7@mail.python.org> Author: georg.brandl Date: Tue May 26 20:31:11 2009 New Revision: 72943 Log: #6118: dont ignore encoding arguments for arguments with spaces in quote_plus(). Modified: python/branches/py3k/Lib/test/test_urllib.py python/branches/py3k/Lib/urllib/parse.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/test/test_urllib.py ============================================================================== --- python/branches/py3k/Lib/test/test_urllib.py (original) +++ python/branches/py3k/Lib/test/test_urllib.py Tue May 26 20:31:11 2009 @@ -510,6 +510,21 @@ self.assertEqual(expect, result, "using quote(): %r != %r" % (expect, result)) + def test_quote_plus_with_unicode(self): + # Encoding (latin-1) test for quote_plus + given = "\xa2\xd8 \xff" + expect = "%A2%D8+%FF" + result = urllib.parse.quote_plus(given, encoding="latin-1") + self.assertEqual(expect, result, + "using quote_plus(): %r != %r" % (expect, result)) + # Errors test for quote_plus + given = "ab\u6f22\u5b57 cd" + expect = "ab%3F%3F+cd" + result = urllib.parse.quote_plus(given, encoding="latin-1", + errors="replace") + self.assertEqual(expect, result, + "using quote_plus(): %r != %r" % (expect, result)) + class UnquotingTests(unittest.TestCase): """Tests for unquote() and unquote_plus() Modified: python/branches/py3k/Lib/urllib/parse.py ============================================================================== --- python/branches/py3k/Lib/urllib/parse.py (original) +++ python/branches/py3k/Lib/urllib/parse.py Tue May 26 20:31:11 2009 @@ -488,7 +488,7 @@ space = ' ' else: space = b' ' - string = quote(string, safe + space) + string = quote(string, safe + space, encoding, errors) return string.replace(' ', '+') def quote_from_bytes(bs, safe='/'): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue May 26 20:31:11 2009 @@ -34,6 +34,9 @@ Library ------- +- Issue #6118: urllib.parse.quote_plus ignored the encoding and errors + arguments for strings with a space in them. + - In unittest, using a skipping decorator on a class is now equivalent to skipping every test on the class. The ClassTestSuite class has been removed. From python-checkins at python.org Tue May 26 20:40:45 2009 From: python-checkins at python.org (martin.v.loewis) Date: Tue, 26 May 2009 20:40:45 +0200 (CEST) Subject: [Python-checkins] r72944 - peps/trunk/pep-0384.txt Message-ID: <20090526184045.EC3D8D943@mail.python.org> Author: martin.v.loewis Date: Tue May 26 20:40:45 2009 New Revision: 72944 Log: As proposed by MAL, provide Py_FatalError and PyTraceBack_Print. Modified: peps/trunk/pep-0384.txt Modified: peps/trunk/pep-0384.txt ============================================================================== --- peps/trunk/pep-0384.txt (original) +++ peps/trunk/pep-0384.txt Tue May 26 20:40:45 2009 @@ -212,12 +212,14 @@ - pydebug.h - symtable.h - token.h -- traceback.h In addition, functions expecting ``FILE*`` are not part of the ABI, to avoid depending on a specific version of the Microsoft C runtime DLL on Windows. +Py_FatalError will be moved from pydebug.h into some other +header file (e.g. pyerrors.h). + Global Variables ---------------- From python-checkins at python.org Tue May 26 20:41:00 2009 From: python-checkins at python.org (ronald.oussoren) Date: Tue, 26 May 2009 20:41:00 +0200 (CEST) Subject: [Python-checkins] r72945 - python/branches/py3k/Lib/idlelib/macosxSupport.py Message-ID: <20090526184100.574F8D9A4@mail.python.org> Author: ronald.oussoren Date: Tue May 26 20:41:00 2009 New Revision: 72945 Log: Fix for Issue6111. Modified: python/branches/py3k/Lib/idlelib/macosxSupport.py Modified: python/branches/py3k/Lib/idlelib/macosxSupport.py ============================================================================== --- python/branches/py3k/Lib/idlelib/macosxSupport.py (original) +++ python/branches/py3k/Lib/idlelib/macosxSupport.py Tue May 26 20:41:00 2009 @@ -82,6 +82,12 @@ def config_dialog(event=None): from idlelib import configDialog + + # Ensure that the root object has an instance_dict attribute, + # mirrors code in EditorWindow (although that sets the attribute + # on an EditorWindow instance that is then passed as the first + # argument to ConfigDialog) + root.instance_dict = flist.inversedict configDialog.ConfigDialog(root, 'Settings') From python-checkins at python.org Tue May 26 20:44:48 2009 From: python-checkins at python.org (ronald.oussoren) Date: Tue, 26 May 2009 20:44:48 +0200 (CEST) Subject: [Python-checkins] r72946 - python/trunk/Lib/idlelib/macosxSupport.py Message-ID: <20090526184448.86E08D984@mail.python.org> Author: ronald.oussoren Date: Tue May 26 20:44:48 2009 New Revision: 72946 Log: Fixes issue 6110 Modified: python/trunk/Lib/idlelib/macosxSupport.py Modified: python/trunk/Lib/idlelib/macosxSupport.py ============================================================================== --- python/trunk/Lib/idlelib/macosxSupport.py (original) +++ python/trunk/Lib/idlelib/macosxSupport.py Tue May 26 20:44:48 2009 @@ -82,6 +82,7 @@ def config_dialog(event=None): import configDialog + root.instance_dict = flist.inversedict configDialog.ConfigDialog(root, 'Settings') @@ -95,7 +96,7 @@ tkversion = root.tk.eval('info patchlevel') # Note: we cannot check if the string tkversion >= '8.4.14', because # the string '8.4.7' is greater than the string '8.4.14'. - if map(int, tkversion.split('.')) >= (8, 4, 14): + if tuple(map(int, tkversion.split('.'))) >= (8, 4, 14): Bindings.menudefs[0] = ('application', [ ('About IDLE', '<>'), None, From buildbot at python.org Tue May 26 20:55:49 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 26 May 2009 18:55:49 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090526185549.27E77D93F@mail.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/5065 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: ronald.oussoren BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Killed sincerely, -The Buildbot From buildbot at python.org Tue May 26 20:55:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 26 May 2009 18:55:57 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090526185557.79E97D87B@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/691 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_codecs ====================================================================== ERROR: test_basics (test.test_codecs.BasicUnicodeTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_codecs.py", line 1360, in test_basics encodedresult += encoder.encode(c) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 22, in encode return codecs.ascii_encode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_encode' ====================================================================== ERROR: test_decoder_state (test.test_codecs.BasicUnicodeTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_codecs.py", line 1445, in test_decoder_state self.check_state_handling_decode(encoding, u, u.encode(encoding)) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_codecs.py", line 30, in check_state_handling_decode part1 = d.decode(s[:i]) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] AttributeError: 'NoneType' object has no attribute 'ascii_decode' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Tue May 26 21:18:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 26 May 2009 19:18:23 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090526191823.92847D337@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/750 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Tue May 26 23:18:59 2009 From: python-checkins at python.org (ronald.oussoren) Date: Tue, 26 May 2009 23:18:59 +0200 (CEST) Subject: [Python-checkins] r72947 - in python/branches/py3k: Lib/idlelib/configDialog.py Mac/BuildScript/build-installer.py Mac/Makefile.in Message-ID: <20090526211859.AD7F5D641@mail.python.org> Author: ronald.oussoren Date: Tue May 26 23:18:59 2009 New Revision: 72947 Log: * Adapt framework install makefiles to 2to3 tool * Re-enable installation of files in /usr/local/bin in the OSX installer because those files no longer clash with a 2.x install. Modified: python/branches/py3k/Lib/idlelib/configDialog.py python/branches/py3k/Mac/BuildScript/build-installer.py python/branches/py3k/Mac/Makefile.in Modified: python/branches/py3k/Lib/idlelib/configDialog.py ============================================================================== --- python/branches/py3k/Lib/idlelib/configDialog.py (original) +++ python/branches/py3k/Lib/idlelib/configDialog.py Tue May 26 23:18:59 2009 @@ -1104,6 +1104,7 @@ def DeactivateCurrentConfig(self): #Before a config is saved, some cleanup of current #config must be done - remove the previous keybindings + print self.parent, type(self.parent) winInstances = self.parent.instance_dict.keys() for instance in winInstances: instance.RemoveKeybindings() Modified: python/branches/py3k/Mac/BuildScript/build-installer.py ============================================================================== --- python/branches/py3k/Mac/BuildScript/build-installer.py (original) +++ python/branches/py3k/Mac/BuildScript/build-installer.py Tue May 26 23:18:59 2009 @@ -225,7 +225,7 @@ is not necessary to use Python. """, required=False, - selected='unselected', + selected='selected', ), dict( name="PythonDocumentation", Modified: python/branches/py3k/Mac/Makefile.in ============================================================================== --- python/branches/py3k/Mac/Makefile.in (original) +++ python/branches/py3k/Mac/Makefile.in Tue May 26 23:18:59 2009 @@ -91,7 +91,8 @@ fi for fn in python3 pythonw3 idle3 pydoc3 python3-config \ python$(VERSION) pythonw$(VERSION) idle$(VERSION) \ - pydoc$(VERSION) python$(VERSION)-config ;\ + pydoc$(VERSION) python$(VERSION)-config 2to3 \ + 2to3-$(VERSION) ;\ do \ ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\ done @@ -109,7 +110,7 @@ $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\ fi for fn in python$(VERSION) pythonw$(VERSION) idle$(VERSION) \ - pydoc$(VERSION) python$(VERSION)-config ;\ + pydoc$(VERSION) python$(VERSION)-config 2to3-$(VERSION);\ do \ ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\ done @@ -130,6 +131,8 @@ mv "$(DESTDIR)$(prefix)/bin/$${fn}3" "$(DESTDIR)$(prefix)/bin/$${fn}$(VERSION)" ;\ ln -sf "$${fn}$(VERSION)" "$(DESTDIR)$(prefix)/bin/$${fn}3" ;\ done + mv "$(DESTDIR)$(prefix)/bin/2to3" "$(DESTDIR)$(prefix)/bin/2to3-$(VERSION)" + ln -sf "$(DESTDIR)$(prefix)/bin/2to3-$(VERSION)" "$(DESTDIR)$(prefix)/bin/2to3" if [ ! -h "$(DESTDIR)$(prefix)/bin/python3-config" ]; then \ mv "$(DESTDIR)$(prefix)/bin/python3-config" "$(DESTDIR)$(prefix)/bin/python$(VERSION)-config" ;\ ln -sf "python$(VERSION)-config" "$(DESTDIR)$(prefix)/bin/python3-config" ; \ From nnorwitz at gmail.com Tue May 26 23:29:16 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Tue, 26 May 2009 17:29:16 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090526212916.GA28760@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 Less important issues: ---------------------- test_smtplib leaked [-82, 206, -9] references, sum=115 test_socketserver leaked [80, -80, 0] references, sum=0 test_sys leaked [21, 0, -21] references, sum=0 test_threading leaked [48, 48, 48] references, sum=144 From python-checkins at python.org Tue May 26 23:39:08 2009 From: python-checkins at python.org (ronald.oussoren) Date: Tue, 26 May 2009 23:39:08 +0200 (CEST) Subject: [Python-checkins] r72948 - python/branches/py3k/Misc/NEWS Message-ID: <20090526213908.24FCED55D@mail.python.org> Author: ronald.oussoren Date: Tue May 26 23:39:08 2009 New Revision: 72948 Log: Add note to NEWS about not installing smtpd.py Modified: python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Tue May 26 23:39:08 2009 @@ -87,6 +87,8 @@ - Issue #6047: fullinstall has been removed because Python 3's executable will now be known as python3. +- Lib/smtpd.py is no longer installed as a script. + Extension Modules ----------------- From python-checkins at python.org Tue May 26 23:44:57 2009 From: python-checkins at python.org (ronald.oussoren) Date: Tue, 26 May 2009 23:44:57 +0200 (CEST) Subject: [Python-checkins] r72949 - python/branches/py3k/Lib/idlelib/configDialog.py Message-ID: <20090526214457.876A7D57A@mail.python.org> Author: ronald.oussoren Date: Tue May 26 23:44:57 2009 New Revision: 72949 Log: Remove debug statement that leaked into the repository. Modified: python/branches/py3k/Lib/idlelib/configDialog.py Modified: python/branches/py3k/Lib/idlelib/configDialog.py ============================================================================== --- python/branches/py3k/Lib/idlelib/configDialog.py (original) +++ python/branches/py3k/Lib/idlelib/configDialog.py Tue May 26 23:44:57 2009 @@ -1104,7 +1104,6 @@ def DeactivateCurrentConfig(self): #Before a config is saved, some cleanup of current #config must be done - remove the previous keybindings - print self.parent, type(self.parent) winInstances = self.parent.instance_dict.keys() for instance in winInstances: instance.RemoveKeybindings() From buildbot at python.org Wed May 27 00:05:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Tue, 26 May 2009 22:05:22 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090526220522.B7E5AD337@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/752 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: ronald.oussoren BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Wed May 27 01:19:45 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 27 May 2009 01:19:45 +0200 (CEST) Subject: [Python-checkins] r72950 - sandbox/trunk/2to3/lib2to3/refactor.py Message-ID: <20090526231945.B123CC46E@mail.python.org> Author: benjamin.peterson Date: Wed May 27 01:19:45 2009 New Revision: 72950 Log: remove unused imports Modified: sandbox/trunk/2to3/lib2to3/refactor.py Modified: sandbox/trunk/2to3/lib2to3/refactor.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/refactor.py (original) +++ sandbox/trunk/2to3/lib2to3/refactor.py Wed May 27 01:19:45 2009 @@ -23,11 +23,7 @@ # Local imports from .pgen2 import driver, tokenize - -from . import pytree -from . import patcomp -from . import fixes -from . import pygram +from . import pytree, pygram def get_all_fix_names(fixer_pkg, remove_prefix=True): From python-checkins at python.org Wed May 27 01:27:00 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 27 May 2009 01:27:00 +0200 (CEST) Subject: [Python-checkins] r72951 - sandbox/trunk/2to3/lib2to3/refactor.py Message-ID: <20090526232700.A7FADD4EC@mail.python.org> Author: benjamin.peterson Date: Wed May 27 01:27:00 2009 New Revision: 72951 Log: this is no longer executable Modified: sandbox/trunk/2to3/lib2to3/refactor.py Modified: sandbox/trunk/2to3/lib2to3/refactor.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/refactor.py (original) +++ sandbox/trunk/2to3/lib2to3/refactor.py Wed May 27 01:27:00 2009 @@ -1,4 +1,3 @@ -#!/usr/bin/env python2.5 # Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. From python-checkins at python.org Wed May 27 02:38:24 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 27 May 2009 02:38:24 +0200 (CEST) Subject: [Python-checkins] r72952 - in python/branches/py3k: Doc/library/collections.rst Lib/collections.py Lib/test/test_collections.py Misc/NEWS Message-ID: <20090527003824.D1842D40F@mail.python.org> Author: raymond.hettinger Date: Wed May 27 02:38:24 2009 New Revision: 72952 Log: Fix field name conflicts for named tuples. Modified: python/branches/py3k/Doc/library/collections.rst python/branches/py3k/Lib/collections.py python/branches/py3k/Lib/test/test_collections.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Doc/library/collections.rst ============================================================================== --- python/branches/py3k/Doc/library/collections.rst (original) +++ python/branches/py3k/Doc/library/collections.rst Wed May 27 02:38:24 2009 @@ -647,8 +647,8 @@ _fields = ('x', 'y') - def __new__(cls, x, y): - return tuple.__new__(cls, (x, y)) + def __new__(_cls, x, y): + return _tuple.__new__(_cls, (x, y)) @classmethod def _make(cls, iterable, new=tuple.__new__, len=len): @@ -665,9 +665,9 @@ 'Return a new OrderedDict which maps field names to their values' return OrderedDict(zip(self._fields, self)) - def _replace(self, **kwds): + def _replace(_self, **kwds): 'Return a new Point object replacing specified fields with new values' - result = self._make(map(kwds.pop, ('x', 'y'), self)) + result = _self._make(map(kwds.pop, ('x', 'y'), _self)) if kwds: raise ValueError('Got unexpected field names: %r' % kwds.keys()) return result @@ -675,8 +675,8 @@ def __getnewargs__(self): return tuple(self) - x = property(itemgetter(0)) - y = property(itemgetter(1)) + x = _property(_itemgetter(0)) + y = _property(_itemgetter(1)) >>> p = Point(11, y=22) # instantiate with positional or keyword arguments >>> p[0] + p[1] # indexable like the plain tuple (11, 22) Modified: python/branches/py3k/Lib/collections.py ============================================================================== --- python/branches/py3k/Lib/collections.py (original) +++ python/branches/py3k/Lib/collections.py Wed May 27 02:38:24 2009 @@ -232,8 +232,8 @@ '%(typename)s(%(argtxt)s)' \n __slots__ = () \n _fields = %(field_names)r \n - def __new__(cls, %(argtxt)s): - return tuple.__new__(cls, (%(argtxt)s)) \n + def __new__(_cls, %(argtxt)s): + return _tuple.__new__(_cls, (%(argtxt)s)) \n @classmethod def _make(cls, iterable, new=tuple.__new__, len=len): 'Make a new %(typename)s object from a sequence or iterable' @@ -246,23 +246,23 @@ def _asdict(self): 'Return a new OrderedDict which maps field names to their values' return OrderedDict(zip(self._fields, self)) \n - def _replace(self, **kwds): + def _replace(_self, **kwds): 'Return a new %(typename)s object replacing specified fields with new values' - result = self._make(map(kwds.pop, %(field_names)r, self)) + result = _self._make(map(kwds.pop, %(field_names)r, _self)) if kwds: raise ValueError('Got unexpected field names: %%r' %% kwds.keys()) return result \n def __getnewargs__(self): return tuple(self) \n\n''' % locals() for i, name in enumerate(field_names): - template += ' %s = property(itemgetter(%d))\n' % (name, i) + template += ' %s = _property(_itemgetter(%d))\n' % (name, i) if verbose: print(template) # Execute the template string in a temporary namespace and # support tracing utilities by setting a value for frame.f_globals['__name__'] - namespace = dict(itemgetter=_itemgetter, __name__='namedtuple_%s' % typename, - OrderedDict=OrderedDict) + namespace = dict(_itemgetter=_itemgetter, __name__='namedtuple_%s' % typename, + OrderedDict=OrderedDict, _property=property, _tuple=tuple) try: exec(template, namespace) except SyntaxError as e: Modified: python/branches/py3k/Lib/test/test_collections.py ============================================================================== --- python/branches/py3k/Lib/test/test_collections.py (original) +++ python/branches/py3k/Lib/test/test_collections.py Wed May 27 02:38:24 2009 @@ -173,6 +173,15 @@ self.assertEqual(p, q) self.assertEqual(p._fields, q._fields) + def test_name_conflicts(self): + # Some names like "self", "cls", "tuple", "itemgetter", and "property" + # failed when used as field names. Test to make sure these now work. + T = namedtuple('T', 'itemgetter property self cls tuple') + t = T(1, 2, 3, 4, 5) + self.assertEqual(t, (1,2,3,4,5)) + newt = t._replace(itemgetter=10, property=20, self=30, cls=40, tuple=50) + self.assertEqual(newt, (10,20,30,40,50)) + class ABCTestCase(unittest.TestCase): def validate_abstract_methods(self, abc, *names): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed May 27 02:38:24 2009 @@ -37,6 +37,9 @@ - Issue #6118: urllib.parse.quote_plus ignored the encoding and errors arguments for strings with a space in them. +- collections.namedtuple() was not working with the following field + names: cls, self, tuple, itemgetter, and property. + - In unittest, using a skipping decorator on a class is now equivalent to skipping every test on the class. The ClassTestSuite class has been removed. From buildbot at python.org Wed May 27 03:25:58 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 27 May 2009 01:25:58 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090527012558.EA7A4D270@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/754 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Wed May 27 03:53:46 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 27 May 2009 03:53:46 +0200 (CEST) Subject: [Python-checkins] r72953 - python/branches/py3k/Lib/test/test_collections.py Message-ID: <20090527015346.98BF5C4D3@mail.python.org> Author: raymond.hettinger Date: Wed May 27 03:53:46 2009 New Revision: 72953 Log: Stronger tests for namedtuple() to prevent future name conflict errors. Modified: python/branches/py3k/Lib/test/test_collections.py Modified: python/branches/py3k/Lib/test/test_collections.py ============================================================================== --- python/branches/py3k/Lib/test/test_collections.py (original) +++ python/branches/py3k/Lib/test/test_collections.py Wed May 27 03:53:46 2009 @@ -8,6 +8,8 @@ import pickle, copy from random import randrange, shuffle import operator +import keyword +import re from collections import Hashable, Iterable, Iterator from collections import Sized, Container, Callable from collections import Set, MutableSet @@ -182,6 +184,35 @@ newt = t._replace(itemgetter=10, property=20, self=30, cls=40, tuple=50) self.assertEqual(newt, (10,20,30,40,50)) + # Broader test of all interesting names in a template + with support.captured_stdout() as template: + T = namedtuple('T', 'x', verbose=True) + words = set(re.findall('[A-Za-z]+', template.getvalue())) + words -= set(keyword.kwlist) + T = namedtuple('T', words) + # test __new__ + values = tuple(range(len(words))) + t = T(*values) + self.assertEqual(t, values) + t = T(**dict(zip(T._fields, values))) + self.assertEqual(t, values) + # test _make + t = T._make(values) + self.assertEqual(t, values) + # exercise __repr__ + repr(t) + # test _asdict + self.assertEqual(t._asdict(), dict(zip(T._fields, values))) + # test _replace + t = T._make(values) + newvalues = tuple(v*10 for v in values) + newt = t._replace(**dict(zip(T._fields, newvalues))) + self.assertEqual(newt, newvalues) + # test _fields + self.assertEqual(T._fields, tuple(words)) + # test __getnewargs__ + self.assertEqual(t.__getnewargs__(), values) + class ABCTestCase(unittest.TestCase): def validate_abstract_methods(self, abc, *names): From python-checkins at python.org Wed May 27 04:09:59 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 27 May 2009 04:09:59 +0200 (CEST) Subject: [Python-checkins] r72954 - in python/branches/release30-maint: Doc/library/collections.rst Lib/collections.py Lib/test/test_collections.py Misc/NEWS Message-ID: <20090527020959.0BA6CD3E2@mail.python.org> Author: raymond.hettinger Date: Wed May 27 04:09:58 2009 New Revision: 72954 Log: Fix field name conflicts for named tuples. Modified: python/branches/release30-maint/Doc/library/collections.rst python/branches/release30-maint/Lib/collections.py python/branches/release30-maint/Lib/test/test_collections.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Doc/library/collections.rst ============================================================================== --- python/branches/release30-maint/Doc/library/collections.rst (original) +++ python/branches/release30-maint/Doc/library/collections.rst Wed May 27 04:09:58 2009 @@ -502,8 +502,8 @@ _fields = ('x', 'y') - def __new__(cls, x, y): - return tuple.__new__(cls, (x, y)) + def __new__(_cls, x, y): + return _tuple.__new__(_cls, (x, y)) @classmethod def _make(cls, iterable, new=tuple.__new__, len=len): @@ -520,9 +520,9 @@ 'Return a new dict which maps field names to their values' return {'x': t[0], 'y': t[1]} - def _replace(self, **kwds): + def _replace(_self, **kwds): 'Return a new Point object replacing specified fields with new values' - result = self._make(map(kwds.pop, ('x', 'y'), self)) + result = _self._make(map(kwds.pop, ('x', 'y'), _self)) if kwds: raise ValueError('Got unexpected field names: %r' % kwds.keys()) return result @@ -530,8 +530,8 @@ def __getnewargs__(self): return tuple(self) - x = property(itemgetter(0)) - y = property(itemgetter(1)) + x = _property(_itemgetter(0)) + y = _property(_itemgetter(1)) >>> p = Point(11, y=22) # instantiate with positional or keyword arguments >>> p[0] + p[1] # indexable like the plain tuple (11, 22) Modified: python/branches/release30-maint/Lib/collections.py ============================================================================== --- python/branches/release30-maint/Lib/collections.py (original) +++ python/branches/release30-maint/Lib/collections.py Wed May 27 04:09:58 2009 @@ -68,8 +68,8 @@ '%(typename)s(%(argtxt)s)' \n __slots__ = () \n _fields = %(field_names)r \n - def __new__(cls, %(argtxt)s): - return tuple.__new__(cls, (%(argtxt)s)) \n + def __new__(_cls, %(argtxt)s): + return _tuple.__new__(_cls, (%(argtxt)s)) \n @classmethod def _make(cls, iterable, new=tuple.__new__, len=len): 'Make a new %(typename)s object from a sequence or iterable' @@ -82,22 +82,23 @@ def _asdict(t): 'Return a new dict which maps field names to their values' return {%(dicttxt)s} \n - def _replace(self, **kwds): + def _replace(_self, **kwds): 'Return a new %(typename)s object replacing specified fields with new values' - result = self._make(map(kwds.pop, %(field_names)r, self)) + result = _self._make(map(kwds.pop, %(field_names)r, _self)) if kwds: raise ValueError('Got unexpected field names: %%r' %% kwds.keys()) return result \n def __getnewargs__(self): return tuple(self) \n\n''' % locals() for i, name in enumerate(field_names): - template += ' %s = property(itemgetter(%d))\n' % (name, i) + template += ' %s = _property(_itemgetter(%d))\n' % (name, i) if verbose: print(template) # Execute the template string in a temporary namespace and # support tracing utilities by setting a value for frame.f_globals['__name__'] - namespace = dict(itemgetter=_itemgetter, __name__='namedtuple_%s' % typename) + namespace = dict(_itemgetter=_itemgetter, __name__='namedtuple_%s' % typename, + _property=property, _tuple=tuple) try: exec(template, namespace) except SyntaxError as e: Modified: python/branches/release30-maint/Lib/test/test_collections.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_collections.py (original) +++ python/branches/release30-maint/Lib/test/test_collections.py Wed May 27 04:09:58 2009 @@ -4,6 +4,8 @@ from test import support from collections import namedtuple import pickle, copy +import keyword +import re from collections import Hashable, Iterable, Iterator from collections import Sized, Container, Callable from collections import Set, MutableSet @@ -158,6 +160,44 @@ self.assertEqual(p, q) self.assertEqual(p._fields, q._fields) + def test_name_conflicts(self): + # Some names like "self", "cls", "tuple", "itemgetter", and "property" + # failed when used as field names. Test to make sure these now work. + T = namedtuple('T', 'itemgetter property self cls tuple') + t = T(1, 2, 3, 4, 5) + self.assertEqual(t, (1,2,3,4,5)) + newt = t._replace(itemgetter=10, property=20, self=30, cls=40, tuple=50) + self.assertEqual(newt, (10,20,30,40,50)) + + # Broader test of all interesting names in a template + with support.captured_stdout() as template: + T = namedtuple('T', 'x', verbose=True) + words = set(re.findall('[A-Za-z]+', template.getvalue())) + words -= set(keyword.kwlist) + T = namedtuple('T', words) + # test __new__ + values = tuple(range(len(words))) + t = T(*values) + self.assertEqual(t, values) + t = T(**dict(zip(T._fields, values))) + self.assertEqual(t, values) + # test _make + t = T._make(values) + self.assertEqual(t, values) + # exercise __repr__ + repr(t) + # test _asdict + self.assertEqual(t._asdict(), dict(zip(T._fields, values))) + # test _replace + t = T._make(values) + newvalues = tuple(v*10 for v in values) + newt = t._replace(**dict(zip(T._fields, newvalues))) + self.assertEqual(newt, newvalues) + # test _fields + self.assertEqual(T._fields, tuple(words)) + # test __getnewargs__ + self.assertEqual(t.__getnewargs__(), values) + class ABCTestCase(unittest.TestCase): def validate_abstract_methods(self, abc, *names): Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Wed May 27 04:09:58 2009 @@ -68,6 +68,9 @@ - Issue #6050: Don't fail extracting a directory from a zipfile if the directory already exists. +- collections.namedtuple() was not working with the following field + names: cls, self, tuple, itemgetter, and property. + - Issue #5259: smtplib plain auth login no longer gives a traceback. Fix by Musashi Tamura, tests by Marcin Bachry. From python-checkins at python.org Wed May 27 04:17:26 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 27 May 2009 04:17:26 +0200 (CEST) Subject: [Python-checkins] r72955 - in python/branches/release26-maint: Doc/library/collections.rst Lib/collections.py Lib/test/test_collections.py Misc/NEWS Message-ID: <20090527021726.E0D2AD3ED@mail.python.org> Author: raymond.hettinger Date: Wed May 27 04:17:26 2009 New Revision: 72955 Log: Fix field name conflicts for named tuples. Modified: python/branches/release26-maint/Doc/library/collections.rst python/branches/release26-maint/Lib/collections.py python/branches/release26-maint/Lib/test/test_collections.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Doc/library/collections.rst ============================================================================== --- python/branches/release26-maint/Doc/library/collections.rst (original) +++ python/branches/release26-maint/Doc/library/collections.rst Wed May 27 04:17:26 2009 @@ -524,8 +524,8 @@ _fields = ('x', 'y') - def __new__(cls, x, y): - return tuple.__new__(cls, (x, y)) + def __new__(_cls, x, y): + return _tuple.__new__(_cls, (x, y)) @classmethod def _make(cls, iterable, new=tuple.__new__, len=len): @@ -542,9 +542,9 @@ 'Return a new dict which maps field names to their values' return {'x': t[0], 'y': t[1]} - def _replace(self, **kwds): + def _replace(_self, **kwds): 'Return a new Point object replacing specified fields with new values' - result = self._make(map(kwds.pop, ('x', 'y'), self)) + result = _self._make(map(kwds.pop, ('x', 'y'), _self)) if kwds: raise ValueError('Got unexpected field names: %r' % kwds.keys()) return result @@ -552,8 +552,8 @@ def __getnewargs__(self): return tuple(self) - x = property(itemgetter(0)) - y = property(itemgetter(1)) + x = _property(_itemgetter(0)) + y = _property(_itemgetter(1)) >>> p = Point(11, y=22) # instantiate with positional or keyword arguments >>> p[0] + p[1] # indexable like the plain tuple (11, 22) Modified: python/branches/release26-maint/Lib/collections.py ============================================================================== --- python/branches/release26-maint/Lib/collections.py (original) +++ python/branches/release26-maint/Lib/collections.py Wed May 27 04:17:26 2009 @@ -63,8 +63,8 @@ '%(typename)s(%(argtxt)s)' \n __slots__ = () \n _fields = %(field_names)r \n - def __new__(cls, %(argtxt)s): - return tuple.__new__(cls, (%(argtxt)s)) \n + def __new__(_cls, %(argtxt)s): + return _tuple.__new__(_cls, (%(argtxt)s)) \n @classmethod def _make(cls, iterable, new=tuple.__new__, len=len): 'Make a new %(typename)s object from a sequence or iterable' @@ -77,22 +77,23 @@ def _asdict(t): 'Return a new dict which maps field names to their values' return {%(dicttxt)s} \n - def _replace(self, **kwds): + def _replace(_self, **kwds): 'Return a new %(typename)s object replacing specified fields with new values' - result = self._make(map(kwds.pop, %(field_names)r, self)) + result = _self._make(map(kwds.pop, %(field_names)r, _self)) if kwds: raise ValueError('Got unexpected field names: %%r' %% kwds.keys()) return result \n def __getnewargs__(self): return tuple(self) \n\n''' % locals() for i, name in enumerate(field_names): - template += ' %s = property(itemgetter(%d))\n' % (name, i) + template += ' %s = _property(_itemgetter(%d))\n' % (name, i) if verbose: print template # Execute the template string in a temporary namespace and # support tracing utilities by setting a value for frame.f_globals['__name__'] - namespace = dict(itemgetter=_itemgetter, __name__='namedtuple_%s' % typename) + namespace = dict(_itemgetter=_itemgetter, __name__='namedtuple_%s' % typename, + _property=property, _tuple=tuple) try: exec template in namespace except SyntaxError, e: Modified: python/branches/release26-maint/Lib/test/test_collections.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_collections.py (original) +++ python/branches/release26-maint/Lib/test/test_collections.py Wed May 27 04:17:26 2009 @@ -2,6 +2,8 @@ from test import test_support from collections import namedtuple import pickle, cPickle, copy +import keyword +import re from collections import Hashable, Iterable, Iterator from collections import Sized, Container, Callable from collections import Set, MutableSet @@ -154,6 +156,44 @@ self.assertEqual(p, q) self.assertEqual(p._fields, q._fields) + def test_name_conflicts(self): + # Some names like "self", "cls", "tuple", "itemgetter", and "property" + # failed when used as field names. Test to make sure these now work. + T = namedtuple('T', 'itemgetter property self cls tuple') + t = T(1, 2, 3, 4, 5) + self.assertEqual(t, (1,2,3,4,5)) + newt = t._replace(itemgetter=10, property=20, self=30, cls=40, tuple=50) + self.assertEqual(newt, (10,20,30,40,50)) + + # Broader test of all interesting names in a template + with test_support.captured_stdout() as template: + T = namedtuple('T', 'x', verbose=True) + words = set(re.findall('[A-Za-z]+', template.getvalue())) + words -= set(keyword.kwlist) + T = namedtuple('T', words) + # test __new__ + values = tuple(range(len(words))) + t = T(*values) + self.assertEqual(t, values) + t = T(**dict(zip(T._fields, values))) + self.assertEqual(t, values) + # test _make + t = T._make(values) + self.assertEqual(t, values) + # exercise __repr__ + repr(t) + # test _asdict + self.assertEqual(t._asdict(), dict(zip(T._fields, values))) + # test _replace + t = T._make(values) + newvalues = tuple(v*10 for v in values) + newt = t._replace(**dict(zip(T._fields, newvalues))) + self.assertEqual(newt, newvalues) + # test _fields + self.assertEqual(T._fields, tuple(words)) + # test __getnewargs__ + self.assertEqual(t.__getnewargs__(), values) + class ABCTestCase(unittest.TestCase): def validate_abstract_methods(self, abc, *names): Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Wed May 27 04:17:26 2009 @@ -53,6 +53,9 @@ - Issue #6050: Don't fail extracting a directory from a zipfile if the directory already exists. +- collections.namedtuple() was not working with the following field + names: cls, self, tuple, itemgetter, and property. + - Issue #1309352: fcntl now converts its third arguments to a C `long` rather than an int, which makes some operations possible under 64-bit Linux (e.g. DN_MULTISHOT with F_NOTIFY). From python-checkins at python.org Wed May 27 04:24:45 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 27 May 2009 04:24:45 +0200 (CEST) Subject: [Python-checkins] r72956 - in python/trunk: Doc/library/collections.rst Lib/collections.py Lib/test/test_collections.py Message-ID: <20090527022445.4635BC401@mail.python.org> Author: raymond.hettinger Date: Wed May 27 04:24:45 2009 New Revision: 72956 Log: Fix field name conflicts for named tuples. Modified: python/trunk/Doc/library/collections.rst python/trunk/Lib/collections.py python/trunk/Lib/test/test_collections.py Modified: python/trunk/Doc/library/collections.rst ============================================================================== --- python/trunk/Doc/library/collections.rst (original) +++ python/trunk/Doc/library/collections.rst Wed May 27 04:24:45 2009 @@ -673,8 +673,8 @@ _fields = ('x', 'y') - def __new__(cls, x, y): - return tuple.__new__(cls, (x, y)) + def __new__(_cls, x, y): + return _tuple.__new__(_cls, (x, y)) @classmethod def _make(cls, iterable, new=tuple.__new__, len=len): @@ -691,9 +691,9 @@ 'Return a new OrderedDict which maps field names to their values' return OrderedDict(zip(self._fields, self)) - def _replace(self, **kwds): + def _replace(_self, **kwds): 'Return a new Point object replacing specified fields with new values' - result = self._make(map(kwds.pop, ('x', 'y'), self)) + result = _self._make(map(kwds.pop, ('x', 'y'), _self)) if kwds: raise ValueError('Got unexpected field names: %r' % kwds.keys()) return result @@ -701,8 +701,8 @@ def __getnewargs__(self): return tuple(self) - x = property(itemgetter(0)) - y = property(itemgetter(1)) + x = _property(_itemgetter(0)) + y = _property(_itemgetter(1)) >>> p = Point(11, y=22) # instantiate with positional or keyword arguments >>> p[0] + p[1] # indexable like the plain tuple (11, 22) Modified: python/trunk/Lib/collections.py ============================================================================== --- python/trunk/Lib/collections.py (original) +++ python/trunk/Lib/collections.py Wed May 27 04:24:45 2009 @@ -229,8 +229,8 @@ '%(typename)s(%(argtxt)s)' \n __slots__ = () \n _fields = %(field_names)r \n - def __new__(cls, %(argtxt)s): - return tuple.__new__(cls, (%(argtxt)s)) \n + def __new__(_cls, %(argtxt)s): + return _tuple.__new__(_cls, (%(argtxt)s)) \n @classmethod def _make(cls, iterable, new=tuple.__new__, len=len): 'Make a new %(typename)s object from a sequence or iterable' @@ -243,23 +243,23 @@ def _asdict(self): 'Return a new OrderedDict which maps field names to their values' return OrderedDict(zip(self._fields, self)) \n - def _replace(self, **kwds): + def _replace(_self, **kwds): 'Return a new %(typename)s object replacing specified fields with new values' - result = self._make(map(kwds.pop, %(field_names)r, self)) + result = _self._make(map(kwds.pop, %(field_names)r, _self)) if kwds: raise ValueError('Got unexpected field names: %%r' %% kwds.keys()) return result \n def __getnewargs__(self): return tuple(self) \n\n''' % locals() for i, name in enumerate(field_names): - template += ' %s = property(itemgetter(%d))\n' % (name, i) + template += ' %s = _property(_itemgetter(%d))\n' % (name, i) if verbose: print template # Execute the template string in a temporary namespace and # support tracing utilities by setting a value for frame.f_globals['__name__'] - namespace = dict(itemgetter=_itemgetter, __name__='namedtuple_%s' % typename, - OrderedDict=OrderedDict) + namespace = dict(_itemgetter=_itemgetter, __name__='namedtuple_%s' % typename, + OrderedDict=OrderedDict, _property=property, _tuple=tuple) try: exec template in namespace except SyntaxError, e: Modified: python/trunk/Lib/test/test_collections.py ============================================================================== --- python/trunk/Lib/test/test_collections.py (original) +++ python/trunk/Lib/test/test_collections.py Wed May 27 04:24:45 2009 @@ -7,6 +7,8 @@ import pickle, cPickle, copy from random import randrange, shuffle import operator +import keyword +import re from collections import Hashable, Iterable, Iterator from collections import Sized, Container, Callable from collections import Set, MutableSet @@ -170,6 +172,44 @@ self.assertEqual(p, q) self.assertEqual(p._fields, q._fields) + def test_name_conflicts(self): + # Some names like "self", "cls", "tuple", "itemgetter", and "property" + # failed when used as field names. Test to make sure these now work. + T = namedtuple('T', 'itemgetter property self cls tuple') + t = T(1, 2, 3, 4, 5) + self.assertEqual(t, (1,2,3,4,5)) + newt = t._replace(itemgetter=10, property=20, self=30, cls=40, tuple=50) + self.assertEqual(newt, (10,20,30,40,50)) + + # Broader test of all interesting names in a template + with test_support.captured_stdout() as template: + T = namedtuple('T', 'x', verbose=True) + words = set(re.findall('[A-Za-z]+', template.getvalue())) + words -= set(keyword.kwlist) + T = namedtuple('T', words) + # test __new__ + values = tuple(range(len(words))) + t = T(*values) + self.assertEqual(t, values) + t = T(**dict(zip(T._fields, values))) + self.assertEqual(t, values) + # test _make + t = T._make(values) + self.assertEqual(t, values) + # exercise __repr__ + repr(t) + # test _asdict + self.assertEqual(t._asdict(), dict(zip(T._fields, values))) + # test _replace + t = T._make(values) + newvalues = tuple(v*10 for v in values) + newt = t._replace(**dict(zip(T._fields, newvalues))) + self.assertEqual(newt, newvalues) + # test _fields + self.assertEqual(T._fields, tuple(words)) + # test __getnewargs__ + self.assertEqual(t.__getnewargs__(), values) + class ABCTestCase(unittest.TestCase): def validate_abstract_methods(self, abc, *names): From buildbot at python.org Wed May 27 04:36:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 27 May 2009 02:36:25 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090527023625.CD9A1C379@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/814 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Wed May 27 04:43:46 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 27 May 2009 04:43:46 +0200 (CEST) Subject: [Python-checkins] r72957 - in python/trunk: Lib/test/test_descr.py Objects/dictobject.c Message-ID: <20090527024346.462F7C46B@mail.python.org> Author: benjamin.peterson Date: Wed May 27 04:43:46 2009 New Revision: 72957 Log: correctly handle descrs with __missing__ Modified: python/trunk/Lib/test/test_descr.py python/trunk/Objects/dictobject.c Modified: python/trunk/Lib/test/test_descr.py ============================================================================== --- python/trunk/Lib/test/test_descr.py (original) +++ python/trunk/Lib/test/test_descr.py Wed May 27 04:43:46 2009 @@ -1689,7 +1689,15 @@ return isinstance(int, obj) def do_issubclass(obj): return issubclass(int, obj) - def swallow(*args): pass + def swallow(*args): + pass + def do_dict_missing(checker): + class DictSub(checker.__class__, dict): + pass + self.assertEqual(DictSub()["hi"], 4) + def some_number(self_, key): + self.assertEqual(key, "hi") + return 4 # It would be nice to have every special method tested here, but I'm # only listing the ones I can remember outside of typeobject.c, since it @@ -1701,6 +1709,8 @@ {"__iter__" : iden, "next" : stop}), ("__sizeof__", sys.getsizeof, zero, set(), {}), ("__instancecheck__", do_isinstance, return_true, set(), {}), + ("__missing__", do_dict_missing, some_number, + set(("__class__",)), {}), ("__subclasscheck__", do_issubclass, return_true, set(("__bases__",)), {}), ("__enter__", run_context, iden, set(), {"__exit__" : swallow}), @@ -1713,7 +1723,7 @@ def __getattribute__(self, attr, test=self): if attr not in ok: test.fail("__getattribute__ called with {0}".format(attr)) - return object.__getattribute__(attr) + return object.__getattribute__(self, attr) class SpecialDescr(object): def __init__(self, impl): self.impl = impl Modified: python/trunk/Objects/dictobject.c ============================================================================== --- python/trunk/Objects/dictobject.c (original) +++ python/trunk/Objects/dictobject.c Wed May 27 04:43:46 2009 @@ -1155,13 +1155,14 @@ /* Look up __missing__ method if we're a subclass. */ PyObject *missing; static PyObject *missing_str = NULL; - if (missing_str == NULL) - missing_str = - PyString_InternFromString("__missing__"); - missing = _PyType_Lookup(Py_TYPE(mp), missing_str); + missing = _PyObject_LookupSpecial((PyObject *)mp, + "__missing__", + &missing_str); if (missing != NULL) return PyObject_CallFunctionObjArgs(missing, - (PyObject *)mp, key, NULL); + key, NULL); + else if (PyErr_Occurred()) + return NULL; } set_key_error(key); return NULL; From python-checkins at python.org Wed May 27 05:08:44 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 27 May 2009 05:08:44 +0200 (CEST) Subject: [Python-checkins] r72958 - python/trunk/Objects/dictobject.c Message-ID: <20090527030844.81065C4DE@mail.python.org> Author: benjamin.peterson Date: Wed May 27 05:08:44 2009 New Revision: 72958 Log: plug ref leak Modified: python/trunk/Objects/dictobject.c Modified: python/trunk/Objects/dictobject.c ============================================================================== --- python/trunk/Objects/dictobject.c (original) +++ python/trunk/Objects/dictobject.c Wed May 27 05:08:44 2009 @@ -1153,14 +1153,17 @@ if (v == NULL) { if (!PyDict_CheckExact(mp)) { /* Look up __missing__ method if we're a subclass. */ - PyObject *missing; + PyObject *missing, *res; static PyObject *missing_str = NULL; missing = _PyObject_LookupSpecial((PyObject *)mp, "__missing__", &missing_str); - if (missing != NULL) - return PyObject_CallFunctionObjArgs(missing, - key, NULL); + if (missing != NULL) { + res = PyObject_CallFunctionObjArgs(missing, + key, NULL); + Py_DECREF(missing); + return res; + } else if (PyErr_Occurred()) return NULL; } From python-checkins at python.org Wed May 27 05:08:59 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 27 May 2009 05:08:59 +0200 (CEST) Subject: [Python-checkins] r72959 - in python/branches/py3k: Lib/test/test_descr.py Objects/dictobject.c Message-ID: <20090527030859.50DF2D275@mail.python.org> Author: benjamin.peterson Date: Wed May 27 05:08:59 2009 New Revision: 72959 Log: Merged revisions 72957 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72957 | benjamin.peterson | 2009-05-26 21:43:46 -0500 (Tue, 26 May 2009) | 1 line correctly handle descrs with __missing__ ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_descr.py python/branches/py3k/Objects/dictobject.c Modified: python/branches/py3k/Lib/test/test_descr.py ============================================================================== --- python/branches/py3k/Lib/test/test_descr.py (original) +++ python/branches/py3k/Lib/test/test_descr.py Wed May 27 05:08:59 2009 @@ -1562,6 +1562,13 @@ return isinstance(int, obj) def do_issubclass(obj): return issubclass(int, obj) + def do_dict_missing(checker): + class DictSub(checker.__class__, dict): + pass + self.assertEqual(DictSub()["hi"], 4) + def some_number(self_, key): + self.assertEqual(key, "hi") + return 4 # It would be nice to have every special method tested here, but I'm # only listing the ones I can remember outside of typeobject.c, since it @@ -1573,6 +1580,8 @@ {"__iter__" : iden, "__next__" : stop}), ("__sizeof__", sys.getsizeof, zero, set(), {}), ("__instancecheck__", do_isinstance, return_true, set(), {}), + ("__missing__", do_dict_missing, some_number, + set(("__class__",)), {}), ("__subclasscheck__", do_issubclass, return_true, set(("__bases__",)), {}), # These two fail because the compiler generates LOAD_ATTR to look @@ -1588,7 +1597,7 @@ def __getattribute__(self, attr, test=self): if attr not in ok: test.fail("__getattribute__ called with {0}".format(attr)) - return object.__getattribute__(attr) + return object.__getattribute__(self, attr) class SpecialDescr(object): def __init__(self, impl): self.impl = impl Modified: python/branches/py3k/Objects/dictobject.c ============================================================================== --- python/branches/py3k/Objects/dictobject.c (original) +++ python/branches/py3k/Objects/dictobject.c Wed May 27 05:08:59 2009 @@ -1128,13 +1128,14 @@ /* Look up __missing__ method if we're a subclass. */ PyObject *missing; static PyObject *missing_str = NULL; - if (missing_str == NULL) - missing_str = - PyUnicode_InternFromString("__missing__"); - missing = _PyType_Lookup(Py_TYPE(mp), missing_str); + missing = _PyObject_LookupSpecial((PyObject *)mp, + "__missing__", + &missing_str); if (missing != NULL) return PyObject_CallFunctionObjArgs(missing, - (PyObject *)mp, key, NULL); + key, NULL); + else if (PyErr_Occurred()) + return NULL; } set_key_error(key); return NULL; From python-checkins at python.org Wed May 27 05:18:39 2009 From: python-checkins at python.org (benjamin.peterson) Date: Wed, 27 May 2009 05:18:39 +0200 (CEST) Subject: [Python-checkins] r72960 - in python/branches/py3k: Objects/dictobject.c Message-ID: <20090527031839.EB672C464@mail.python.org> Author: benjamin.peterson Date: Wed May 27 05:18:19 2009 New Revision: 72960 Log: Merged revisions 72958 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72958 | benjamin.peterson | 2009-05-26 22:08:44 -0500 (Tue, 26 May 2009) | 1 line plug ref leak ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Objects/dictobject.c Modified: python/branches/py3k/Objects/dictobject.c ============================================================================== --- python/branches/py3k/Objects/dictobject.c (original) +++ python/branches/py3k/Objects/dictobject.c Wed May 27 05:18:19 2009 @@ -1126,14 +1126,17 @@ if (v == NULL) { if (!PyDict_CheckExact(mp)) { /* Look up __missing__ method if we're a subclass. */ - PyObject *missing; + PyObject *missing, *res; static PyObject *missing_str = NULL; missing = _PyObject_LookupSpecial((PyObject *)mp, "__missing__", &missing_str); - if (missing != NULL) - return PyObject_CallFunctionObjArgs(missing, - key, NULL); + if (missing != NULL) { + res = PyObject_CallFunctionObjArgs(missing, + key, NULL); + Py_DECREF(missing); + return res; + } else if (PyErr_Occurred()) return NULL; } From buildbot at python.org Wed May 27 06:28:45 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 27 May 2009 04:28:45 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo trunk Message-ID: <20090527042845.48A5CC462@mail.python.org> The Buildbot has detected a new failure of x86 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%20trunk/builds/5068 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed May 27 08:04:54 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 27 May 2009 06:04:54 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090527060454.74B4AC369@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/756 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Wed May 27 08:50:33 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 27 May 2009 08:50:33 +0200 (CEST) Subject: [Python-checkins] r72961 - in python/branches/py3k: Lib/json/tests/test_encode_basestring_ascii.py Modules/_json.c Message-ID: <20090527065033.60DFDC4DC@mail.python.org> Author: raymond.hettinger Date: Wed May 27 08:50:31 2009 New Revision: 72961 Log: Issue 6105: json encoder to respect iteration order of its inputs. Modified: python/branches/py3k/Lib/json/tests/test_encode_basestring_ascii.py python/branches/py3k/Modules/_json.c Modified: python/branches/py3k/Lib/json/tests/test_encode_basestring_ascii.py ============================================================================== --- python/branches/py3k/Lib/json/tests/test_encode_basestring_ascii.py (original) +++ python/branches/py3k/Lib/json/tests/test_encode_basestring_ascii.py Wed May 27 08:50:31 2009 @@ -1,6 +1,8 @@ from unittest import TestCase import json.encoder +from json import dumps +from collections import OrderedDict CASES = [ ('/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'), @@ -35,3 +37,9 @@ self.assertEquals(result, expect, '{0!r} != {1!r} for {2}({3!r})'.format( result, expect, fname, input_string)) + + def test_ordered_dict(self): + # See issue 6105 + items = [('one', 1), ('two', 2), ('three', 3), ('four', 4), ('five', 5)] + s = json.dumps(OrderedDict(items)) + self.assertEqual(s, '{"one": 1, "two": 2, "three": 3, "four": 4, "five": 5}') Modified: python/branches/py3k/Modules/_json.c ============================================================================== --- python/branches/py3k/Modules/_json.c (original) +++ python/branches/py3k/Modules/_json.c Wed May 27 08:50:31 2009 @@ -1334,8 +1334,9 @@ static PyObject *empty_dict = NULL; PyObject *kstr = NULL; PyObject *ident = NULL; - PyObject *key, *value; - Py_ssize_t pos; + PyObject *key = NULL; + PyObject *value = NULL; + PyObject *it = NULL; int skipkeys; Py_ssize_t idx; @@ -1346,7 +1347,7 @@ if (open_dict == NULL || close_dict == NULL || empty_dict == NULL) return -1; } - if (PyDict_Size(dct) == 0) + if (Py_SIZE(dct) == 0) return PyList_Append(rval, empty_dict); if (s->markers != Py_None) { @@ -1380,10 +1381,12 @@ /* TODO: C speedup not implemented for sort_keys */ - pos = 0; + it = PyObject_GetIter(dct); + if (it == NULL) + goto bail; skipkeys = PyObject_IsTrue(s->skipkeys); idx = 0; - while (PyDict_Next(dct, &pos, &key, &value)) { + while ((key = PyIter_Next(it)) != NULL) { PyObject *encoded; if (PyUnicode_Check(key)) { @@ -1406,6 +1409,7 @@ goto bail; } else if (skipkeys) { + Py_DECREF(key); continue; } else { @@ -1430,10 +1434,20 @@ Py_DECREF(encoded); if (PyList_Append(rval, s->key_separator)) goto bail; + + value = PyObject_GetItem(dct, key); + if (value == NULL) + goto bail; if (encoder_listencode_obj(s, rval, value, indent_level)) goto bail; idx += 1; + Py_CLEAR(value); + Py_DECREF(key); } + if (PyErr_Occurred()) + goto bail; + Py_CLEAR(it); + if (ident != NULL) { if (PyDict_DelItem(s->markers, ident)) goto bail; @@ -1451,6 +1465,9 @@ return 0; bail: + Py_XDECREF(it); + Py_XDECREF(key); + Py_XDECREF(value); Py_XDECREF(kstr); Py_XDECREF(ident); return -1; From buildbot at python.org Wed May 27 10:28:10 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 27 May 2009 08:28:10 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090527082811.33910C449@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/758 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 4 tests failed: test_coding test_posix test_smtplib test_telnetlib ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Wed May 27 11:12:20 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 27 May 2009 11:12:20 +0200 (CEST) Subject: [Python-checkins] r72962 - python/branches/py3k/Doc/whatsnew/3.1.rst Message-ID: <20090527091220.6E954D29B@mail.python.org> Author: raymond.hettinger Date: Wed May 27 11:12:18 2009 New Revision: 72962 Log: Update whatsnew for compound with-statements. Modified: python/branches/py3k/Doc/whatsnew/3.1.rst Modified: python/branches/py3k/Doc/whatsnew/3.1.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/3.1.rst (original) +++ python/branches/py3k/Doc/whatsnew/3.1.rst Wed May 27 11:12:18 2009 @@ -156,6 +156,17 @@ (Contributed by Georg Brandl; :issue:`5675`.) +* The syntax of the :keyword:`with` statement now allows multiple context + managers in a single statement:: + + >>> with open('mylog.txt') as infile, open('a.out', 'w') as outfile: + ... for line in infile: + ... if '' in line: + ... outfile.write(line) + + (Contributed by Georg Brandl; + `appspot issue 53094 `_.) + * ``round(x, n)`` now returns an integer if *x* is an integer. Previously it returned a float:: From nnorwitz at gmail.com Wed May 27 11:28:16 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 27 May 2009 05:28:16 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090527092816.GA23700@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 Less important issues: ---------------------- test_asynchat leaked [0, 0, 126] references, sum=126 test_cmd_line leaked [-25, 50, 0] references, sum=25 test_file leaked [91, -14, -77] references, sum=0 test_smtplib leaked [88, 118, -9] references, sum=197 test_socketserver leaked [84, -84, 0] references, sum=0 test_ssl leaked [-322, 322, 0] references, sum=0 test_sys leaked [0, 42, -21] references, sum=21 test_threading leaked [48, 48, 48] references, sum=144 From python-checkins at python.org Wed May 27 11:58:36 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 27 May 2009 11:58:36 +0200 (CEST) Subject: [Python-checkins] r72963 - in python/branches/py3k: Lib/json/encoder.py Lib/json/tests/test_encode_basestring_ascii.py Modules/_json.c Message-ID: <20090527095836.E4BE8C4D6@mail.python.org> Author: raymond.hettinger Date: Wed May 27 11:58:34 2009 New Revision: 72963 Log: * Fix-up a TODO (support the sort_key option). * Fix an error where True/False were being written-out as title-cased strings when used a dictionary keys. * Speed-up iteration over dicts by looping over items() rather than keys() followed by value lookups. * TODO: sort only by keys, not keys and values. Modified: python/branches/py3k/Lib/json/encoder.py python/branches/py3k/Lib/json/tests/test_encode_basestring_ascii.py python/branches/py3k/Modules/_json.c Modified: python/branches/py3k/Lib/json/encoder.py ============================================================================== --- python/branches/py3k/Lib/json/encoder.py (original) +++ python/branches/py3k/Lib/json/encoder.py Wed May 27 11:58:34 2009 @@ -233,7 +233,7 @@ if (_one_shot and c_make_encoder is not None - and not self.indent and not self.sort_keys): + and not self.indent): _iterencode = c_make_encoder( markers, self.default, _encoder, self.indent, self.key_separator, self.item_separator, self.sort_keys, Modified: python/branches/py3k/Lib/json/tests/test_encode_basestring_ascii.py ============================================================================== --- python/branches/py3k/Lib/json/tests/test_encode_basestring_ascii.py (original) +++ python/branches/py3k/Lib/json/tests/test_encode_basestring_ascii.py Wed May 27 11:58:34 2009 @@ -43,3 +43,8 @@ items = [('one', 1), ('two', 2), ('three', 3), ('four', 4), ('five', 5)] s = json.dumps(OrderedDict(items)) self.assertEqual(s, '{"one": 1, "two": 2, "three": 3, "four": 4, "five": 5}') + + def test_sorted_dict(self): + items = [('one', 1), ('two', 2), ('three', 3), ('four', 4), ('five', 5)] + s = json.dumps(dict(items), sort_keys=True) + self.assertEqual(s, '{"five": 5, "four": 4, "one": 1, "three": 3, "two": 2}') Modified: python/branches/py3k/Modules/_json.c ============================================================================== --- python/branches/py3k/Modules/_json.c (original) +++ python/branches/py3k/Modules/_json.c Wed May 27 11:58:34 2009 @@ -1334,9 +1334,9 @@ static PyObject *empty_dict = NULL; PyObject *kstr = NULL; PyObject *ident = NULL; - PyObject *key = NULL; - PyObject *value = NULL; PyObject *it = NULL; + PyObject *items; + PyObject *item = NULL; int skipkeys; Py_ssize_t idx; @@ -1379,16 +1379,38 @@ */ } - /* TODO: C speedup not implemented for sort_keys */ + items = PyObject_CallMethod(dct, "items", ""); /* XXX key=itemgetter(0) */ + if (items == NULL) + goto bail; + if (PyObject_IsTrue(s->sort_keys)) { + PyObject *rv; + PyObject *itemlist; + + itemlist = PySequence_List(items); + Py_DECREF(items); + if (itemlist == NULL) + goto bail; - it = PyObject_GetIter(dct); - if (it == NULL) + rv = PyObject_CallMethod(itemlist, "sort", ""); + if (rv == NULL) { + Py_DECREF(itemlist); + goto bail; + } + items = itemlist; + } + it = PyObject_GetIter(items); + Py_DECREF(items); + if (it == NULL) goto bail; skipkeys = PyObject_IsTrue(s->skipkeys); idx = 0; - while ((key = PyIter_Next(it)) != NULL) { - PyObject *encoded; - + while ((item = PyIter_Next(it)) != NULL) { + PyObject *encoded, *key, *value; + if (!PyTuple_Check(item) || Py_SIZE(item) != 2) { + PyErr_SetString(PyExc_ValueError, "items must return 2-tuples"); + goto bail; + } + key = PyTuple_GET_ITEM(item, 0); if (PyUnicode_Check(key)) { Py_INCREF(key); kstr = key; @@ -1398,18 +1420,20 @@ if (kstr == NULL) goto bail; } - else if (PyLong_Check(key)) { - kstr = PyObject_Str(key); + else if (key == Py_True || key == Py_False || key == Py_None) { + /* This must come before the PyLong_Check because + True and False are also 1 and 0.*/ + kstr = _encoded_const(key); if (kstr == NULL) goto bail; } - else if (key == Py_True || key == Py_False || key == Py_None) { - kstr = _encoded_const(key); + else if (PyLong_Check(key)) { + kstr = PyObject_Str(key); if (kstr == NULL) goto bail; } else if (skipkeys) { - Py_DECREF(key); + Py_DECREF(item); continue; } else { @@ -1435,14 +1459,11 @@ if (PyList_Append(rval, s->key_separator)) goto bail; - value = PyObject_GetItem(dct, key); - if (value == NULL) - goto bail; + value = PyTuple_GET_ITEM(item, 1); if (encoder_listencode_obj(s, rval, value, indent_level)) goto bail; idx += 1; - Py_CLEAR(value); - Py_DECREF(key); + Py_DECREF(item); } if (PyErr_Occurred()) goto bail; @@ -1466,8 +1487,7 @@ bail: Py_XDECREF(it); - Py_XDECREF(key); - Py_XDECREF(value); + Py_XDECREF(item); Py_XDECREF(kstr); Py_XDECREF(ident); return -1; From python-checkins at python.org Wed May 27 13:19:04 2009 From: python-checkins at python.org (raymond.hettinger) Date: Wed, 27 May 2009 13:19:04 +0200 (CEST) Subject: [Python-checkins] r72964 - python/branches/py3k/Modules/_json.c Message-ID: <20090527111904.12AF4D569@mail.python.org> Author: raymond.hettinger Date: Wed May 27 13:19:02 2009 New Revision: 72964 Log: Fix TODO: do the sort by just the key, not the key/value pair. Modified: python/branches/py3k/Modules/_json.c Modified: python/branches/py3k/Modules/_json.c ============================================================================== --- python/branches/py3k/Modules/_json.c (original) +++ python/branches/py3k/Modules/_json.c Wed May 27 13:19:02 2009 @@ -1339,6 +1339,8 @@ PyObject *item = NULL; int skipkeys; Py_ssize_t idx; + PyObject *mapping; + static PyObject *code = NULL; if (open_dict == NULL || close_dict == NULL || empty_dict == NULL) { open_dict = PyUnicode_InternFromString("{"); @@ -1379,25 +1381,28 @@ */ } - items = PyObject_CallMethod(dct, "items", ""); /* XXX key=itemgetter(0) */ - if (items == NULL) - goto bail; if (PyObject_IsTrue(s->sort_keys)) { - PyObject *rv; - PyObject *itemlist; - - itemlist = PySequence_List(items); - Py_DECREF(items); - if (itemlist == NULL) - goto bail; + if (code == NULL) { + code = Py_CompileString("sorted(d.items(), key=lambda kv: kv[0])", + "_json.c", Py_eval_input); + if (code == NULL) + goto bail; + } - rv = PyObject_CallMethod(itemlist, "sort", ""); - if (rv == NULL) { - Py_DECREF(itemlist); + mapping = PyDict_New(); + if (mapping == NULL) + goto bail; + if (PyDict_SetItemString(mapping, "d", dct) == -1) { + Py_DECREF(mapping); goto bail; } - items = itemlist; - } + items = PyEval_EvalCode((PyCodeObject *)code, PyEval_GetGlobals(), mapping); + Py_DECREF(mapping); + } else { + items = PyMapping_Items(dct); + } + if (items == NULL) + goto bail; it = PyObject_GetIter(items); Py_DECREF(items); if (it == NULL) From python-checkins at python.org Wed May 27 21:46:38 2009 From: python-checkins at python.org (georg.brandl) Date: Wed, 27 May 2009 21:46:38 +0200 (CEST) Subject: [Python-checkins] r72965 - python/branches/py3k/Doc/whatsnew/3.1.rst Message-ID: <20090527194638.E4751C3FA@mail.python.org> Author: georg.brandl Date: Wed May 27 21:46:38 2009 New Revision: 72965 Log: Add attribution for patch co-author. Modified: python/branches/py3k/Doc/whatsnew/3.1.rst Modified: python/branches/py3k/Doc/whatsnew/3.1.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/3.1.rst (original) +++ python/branches/py3k/Doc/whatsnew/3.1.rst Wed May 27 21:46:38 2009 @@ -164,7 +164,7 @@ ... if '' in line: ... outfile.write(line) - (Contributed by Georg Brandl; + (Contributed by Georg Brandl and Mattias Br?ndstr?m; `appspot issue 53094 `_.) * ``round(x, n)`` now returns an integer if *x* is an integer. From python-checkins at python.org Wed May 27 22:07:22 2009 From: python-checkins at python.org (r.david.murray) Date: Wed, 27 May 2009 22:07:22 +0200 (CEST) Subject: [Python-checkins] r72966 - in python/trunk: Lib/pydoc.py Lib/test/test_pydoc.py Misc/NEWS Message-ID: <20090527200722.24925D2BA@mail.python.org> Author: r.david.murray Date: Wed May 27 22:07:21 2009 New Revision: 72966 Log: fix issue #6121 by stripping spaces from the argument in the 'help' function. Modified: python/trunk/Lib/pydoc.py python/trunk/Lib/test/test_pydoc.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/pydoc.py ============================================================================== --- python/trunk/Lib/pydoc.py (original) +++ python/trunk/Lib/pydoc.py Wed May 27 22:07:21 2009 @@ -1751,6 +1751,7 @@ def help(self, request): if type(request) is type(''): + request = request.strip() if request == 'help': self.intro() elif request == 'keywords': self.listkeywords() elif request == 'symbols': self.listsymbols() Modified: python/trunk/Lib/test/test_pydoc.py ============================================================================== --- python/trunk/Lib/test/test_pydoc.py (original) +++ python/trunk/Lib/test/test_pydoc.py Wed May 27 22:07:21 2009 @@ -237,6 +237,14 @@ self.assertEqual(expected, result, "documentation for missing module found") + def test_input_strip(self): + missing_module = " test.i_am_not_here " + result = run_pydoc(missing_module) + expected = missing_pattern % missing_module.strip() + self.assertEqual(expected, result, + "white space was not stripped from module name " + "or other error output mismatch") + class TestDescriptions(unittest.TestCase): Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Wed May 27 22:07:21 2009 @@ -307,6 +307,9 @@ Library ------- +- Issue #6121: pydoc now ignores leading and trailing spaces in the + argument to the 'help' function. + - In unittest, using a skipping decorator on a class is now equivalent to skipping every test on the class. The ClassTestSuite class has been removed. From python-checkins at python.org Wed May 27 22:16:24 2009 From: python-checkins at python.org (r.david.murray) Date: Wed, 27 May 2009 22:16:24 +0200 (CEST) Subject: [Python-checkins] r72967 - in python/branches/release26-maint: Lib/pydoc.py Lib/test/test_pydoc.py Misc/NEWS Message-ID: <20090527201624.63605D357@mail.python.org> Author: r.david.murray Date: Wed May 27 22:16:24 2009 New Revision: 72967 Log: Merged revisions 72966 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72966 | r.david.murray | 2009-05-27 16:07:21 -0400 (Wed, 27 May 2009) | 4 lines fix issue #6121 by stripping spaces from the argument in the 'help' function. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/pydoc.py python/branches/release26-maint/Lib/test/test_pydoc.py python/branches/release26-maint/Misc/NEWS Modified: python/branches/release26-maint/Lib/pydoc.py ============================================================================== --- python/branches/release26-maint/Lib/pydoc.py (original) +++ python/branches/release26-maint/Lib/pydoc.py Wed May 27 22:16:24 2009 @@ -1751,6 +1751,7 @@ def help(self, request): if type(request) is type(''): + request = request.strip() if request == 'help': self.intro() elif request == 'keywords': self.listkeywords() elif request == 'symbols': self.listsymbols() Modified: python/branches/release26-maint/Lib/test/test_pydoc.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_pydoc.py (original) +++ python/branches/release26-maint/Lib/test/test_pydoc.py Wed May 27 22:16:24 2009 @@ -237,6 +237,14 @@ self.assertEqual(expected, result, "documentation for missing module found") + def test_input_strip(self): + missing_module = " test.i_am_not_here " + result = run_pydoc(missing_module) + expected = missing_pattern % missing_module.strip() + self.assertEqual(expected, result, + "white space was not stripped from module name " + "or other error output mismatch") + class TestDescriptions(unittest.TestCase): Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Wed May 27 22:16:24 2009 @@ -50,6 +50,9 @@ Library ------- +- Issue #6121: pydoc now ignores leading and trailing spaces in the + argument to the 'help' function. + - Issue #6050: Don't fail extracting a directory from a zipfile if the directory already exists. From python-checkins at python.org Wed May 27 22:57:00 2009 From: python-checkins at python.org (r.david.murray) Date: Wed, 27 May 2009 22:57:00 +0200 (CEST) Subject: [Python-checkins] r72968 - in python/branches/py3k: Lib/pydoc.py Lib/test/test_pydoc.py Misc/NEWS Message-ID: <20090527205700.1035FC4E8@mail.python.org> Author: r.david.murray Date: Wed May 27 22:56:59 2009 New Revision: 72968 Log: Merged revisions 72966 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72966 | r.david.murray | 2009-05-27 16:07:21 -0400 (Wed, 27 May 2009) | 4 lines fix issue #6121 by stripping spaces from the argument in the 'help' function. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/pydoc.py python/branches/py3k/Lib/test/test_pydoc.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/pydoc.py ============================================================================== --- python/branches/py3k/Lib/pydoc.py (original) +++ python/branches/py3k/Lib/pydoc.py Wed May 27 22:56:59 2009 @@ -1740,6 +1740,7 @@ def help(self, request): if type(request) is type(''): + request = request.strip() if request == 'help': self.intro() elif request == 'keywords': self.listkeywords() elif request == 'symbols': self.listsymbols() Modified: python/branches/py3k/Lib/test/test_pydoc.py ============================================================================== --- python/branches/py3k/Lib/test/test_pydoc.py (original) +++ python/branches/py3k/Lib/test/test_pydoc.py Wed May 27 22:56:59 2009 @@ -254,6 +254,12 @@ self.assertEqual(expected, result, "documentation for missing module found") + def test_input_strip(self): + missing_module = " test.i_am_not_here " + result = str(run_pydoc(missing_module), 'ascii') + expected = missing_pattern % missing_module.strip() + self.assertEqual(expected, result) + class TestDescriptions(unittest.TestCase): Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Wed May 27 22:56:59 2009 @@ -34,6 +34,9 @@ Library ------- +- Issue #6121: pydoc now ignores leading and trailing spaces in the + argument to the 'help' function. + - Issue #6118: urllib.parse.quote_plus ignored the encoding and errors arguments for strings with a space in them. From buildbot at python.org Wed May 27 23:26:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 27 May 2009 21:26:35 +0000 Subject: [Python-checkins] buildbot failure in alpha Debian 3.x Message-ID: <20090527212635.2B6E6D404@mail.python.org> The Buildbot has detected a new failure of alpha Debian 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/alpha%20Debian%203.x/builds/114 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-alpha Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson,georg.brandl,raymond.hettinger,ronald.oussoren BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Wed May 27 23:40:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 27 May 2009 21:40:31 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 2.6 Message-ID: <20090527214031.8F041C44F@mail.python.org> The Buildbot has detected a new failure of x86 gentoo 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%202.6/builds/366 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From nnorwitz at gmail.com Wed May 27 23:49:06 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Wed, 27 May 2009 17:49:06 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (3) Message-ID: <20090527214906.GA538@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 test_ssl leaked [0, -322, -81] references, sum=-403 test_urllib2_localnet leaked [0, 0, 279] references, sum=279 Less important issues: ---------------------- test_asynchat leaked [0, 0, 126] references, sum=126 test_cmd_line leaked [0, -25, 0] references, sum=-25 test_smtplib leaked [-82, 88, 120] references, sum=126 test_threading leaked [48, 48, 48] references, sum=144 test_xmlrpc leaked [91, -85, 0] references, sum=6 From python-checkins at python.org Wed May 27 23:50:13 2009 From: python-checkins at python.org (antoine.pitrou) Date: Wed, 27 May 2009 23:50:13 +0200 (CEST) Subject: [Python-checkins] r72969 - python/branches/py3k/Lib/test/test_modulefinder.py Message-ID: <20090527215013.2BDCBC464@mail.python.org> Author: antoine.pitrou Date: Wed May 27 23:50:13 2009 New Revision: 72969 Log: Remove useless compatibility statements Modified: python/branches/py3k/Lib/test/test_modulefinder.py Modified: python/branches/py3k/Lib/test/test_modulefinder.py ============================================================================== --- python/branches/py3k/Lib/test/test_modulefinder.py (original) +++ python/branches/py3k/Lib/test/test_modulefinder.py Wed May 27 23:50:13 2009 @@ -6,15 +6,8 @@ from test import support -try: set -except NameError: from sets import Set as set - import modulefinder -# Note: To test modulefinder with Python 2.2, sets.py and -# modulefinder.py must be available - they are not in the standard -# library. - TEST_DIR = tempfile.mkdtemp() TEST_PATH = [TEST_DIR, os.path.dirname(__future__.__file__)] From python-checkins at python.org Thu May 28 00:11:32 2009 From: python-checkins at python.org (r.david.murray) Date: Thu, 28 May 2009 00:11:32 +0200 (CEST) Subject: [Python-checkins] r72970 - in python/branches/release30-maint: Lib/pydoc.py Lib/test/test_pydoc.py Misc/NEWS Message-ID: <20090527221132.B44DFC448@mail.python.org> Author: r.david.murray Date: Thu May 28 00:11:32 2009 New Revision: 72970 Log: Merged revisions 72968 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72968 | r.david.murray | 2009-05-27 16:56:59 -0400 (Wed, 27 May 2009) | 10 lines Merged revisions 72966 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72966 | r.david.murray | 2009-05-27 16:07:21 -0400 (Wed, 27 May 2009) | 4 lines fix issue #6121 by stripping spaces from the argument in the 'help' function. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/pydoc.py python/branches/release30-maint/Lib/test/test_pydoc.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/pydoc.py ============================================================================== --- python/branches/release30-maint/Lib/pydoc.py (original) +++ python/branches/release30-maint/Lib/pydoc.py Thu May 28 00:11:32 2009 @@ -1739,6 +1739,7 @@ def help(self, request): if type(request) is type(''): + request = request.strip() if request == 'help': self.intro() elif request == 'keywords': self.listkeywords() elif request == 'symbols': self.listsymbols() Modified: python/branches/release30-maint/Lib/test/test_pydoc.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_pydoc.py (original) +++ python/branches/release30-maint/Lib/test/test_pydoc.py Thu May 28 00:11:32 2009 @@ -254,6 +254,12 @@ self.assertEqual(expected, result, "documentation for missing module found") + def test_input_strip(self): + missing_module = " test.i_am_not_here " + result = str(run_pydoc(missing_module), 'ascii') + expected = missing_pattern % missing_module.strip() + self.assertEqual(expected, result) + class TestDescriptions(unittest.TestCase): Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Thu May 28 00:11:32 2009 @@ -65,6 +65,9 @@ Library ------- +- Issue #6121: pydoc now ignores leading and trailing spaces in the + argument to the 'help' function. + - Issue #6050: Don't fail extracting a directory from a zipfile if the directory already exists. From buildbot at python.org Thu May 28 01:54:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Wed, 27 May 2009 23:54:25 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090527235425.55E18C448@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/389 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 45, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/Include ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Thu May 28 05:02:13 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 28 May 2009 05:02:13 +0200 (CEST) Subject: [Python-checkins] r72971 - python/trunk/Doc/tools/sphinxext/indexcontent.html Message-ID: <20090528030213.69773C358@mail.python.org> Author: benjamin.peterson Date: Thu May 28 05:02:13 2009 New Revision: 72971 Log: switch library reference and language reference Modified: python/trunk/Doc/tools/sphinxext/indexcontent.html Modified: python/trunk/Doc/tools/sphinxext/indexcontent.html ============================================================================== --- python/trunk/Doc/tools/sphinxext/indexcontent.html (original) +++ python/trunk/Doc/tools/sphinxext/indexcontent.html Thu May 28 05:02:13 2009 @@ -9,10 +9,10 @@ start here

        - + From python-checkins at python.org Thu May 28 05:10:59 2009 From: python-checkins at python.org (philip.jenvey) Date: Thu, 28 May 2009 05:10:59 +0200 (CEST) Subject: [Python-checkins] r72972 - python/trunk/Lib/netrc.py Message-ID: <20090528031059.628C0C4B9@mail.python.org> Author: philip.jenvey Date: Thu May 28 05:10:59 2009 New Revision: 72972 Log: explicitly close the file, merged from py3k Modified: python/trunk/Lib/netrc.py Modified: python/trunk/Lib/netrc.py ============================================================================== --- python/trunk/Lib/netrc.py (original) +++ python/trunk/Lib/netrc.py Thu May 28 05:10:59 2009 @@ -26,9 +26,12 @@ file = os.path.join(os.environ['HOME'], ".netrc") except KeyError: raise IOError("Could not find .netrc: $HOME is not set") - fp = open(file) self.hosts = {} self.macros = {} + with open(file) as fp: + self._parse(file, fp) + + def _parse(self, file, fp): lexer = shlex.shlex(fp) lexer.wordchars += r"""!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~""" while 1: From python-checkins at python.org Thu May 28 05:12:17 2009 From: python-checkins at python.org (philip.jenvey) Date: Thu, 28 May 2009 05:12:17 +0200 (CEST) Subject: [Python-checkins] r72973 - python/trunk/Python/bltinmodule.c Message-ID: <20090528031217.0C874C4CD@mail.python.org> Author: philip.jenvey Date: Thu May 28 05:12:16 2009 New Revision: 72973 Log: further hint to where the open docs really are Modified: python/trunk/Python/bltinmodule.c Modified: python/trunk/Python/bltinmodule.c ============================================================================== --- python/trunk/Python/bltinmodule.c (original) +++ python/trunk/Python/bltinmodule.c Thu May 28 05:12:16 2009 @@ -1485,7 +1485,7 @@ "open(name[, mode[, buffering]]) -> file object\n\ \n\ Open a file using the file() type, returns a file object. This is the\n\ -preferred way to open a file."); +preferred way to open a file. See file.__doc__ for further information."); static PyObject * From python-checkins at python.org Thu May 28 05:14:52 2009 From: python-checkins at python.org (philip.jenvey) Date: Thu, 28 May 2009 05:14:52 +0200 (CEST) Subject: [Python-checkins] r72974 - python/branches/release26-maint Message-ID: <20090528031452.7FD2DC411@mail.python.org> Author: philip.jenvey Date: Thu May 28 05:14:52 2009 New Revision: 72974 Log: Blocked revisions 72972-72973 via svnmerge ........ r72972 | philip.jenvey | 2009-05-27 20:10:59 -0700 (Wed, 27 May 2009) | 2 lines explicitly close the file, merged from py3k ........ r72973 | philip.jenvey | 2009-05-27 20:12:16 -0700 (Wed, 27 May 2009) | 2 lines further hint to where the open docs really are ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Thu May 28 05:16:06 2009 From: python-checkins at python.org (philip.jenvey) Date: Thu, 28 May 2009 05:16:06 +0200 (CEST) Subject: [Python-checkins] r72975 - python/branches/py3k Message-ID: <20090528031606.0975DC49B@mail.python.org> Author: philip.jenvey Date: Thu May 28 05:16:05 2009 New Revision: 72975 Log: Blocked revisions 72972-72973 via svnmerge ........ r72972 | philip.jenvey | 2009-05-27 20:10:59 -0700 (Wed, 27 May 2009) | 2 lines explicitly close the file, merged from py3k ........ r72973 | philip.jenvey | 2009-05-27 20:12:16 -0700 (Wed, 27 May 2009) | 2 lines further hint to where the open docs really are ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Thu May 28 05:27:58 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 28 May 2009 05:27:58 +0200 (CEST) Subject: [Python-checkins] r72976 - in python/branches/release26-maint: Doc/tools/sphinxext/indexcontent.html Message-ID: <20090528032758.892F9C446@mail.python.org> Author: benjamin.peterson Date: Thu May 28 05:27:58 2009 New Revision: 72976 Log: Merged revisions 72971 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72971 | benjamin.peterson | 2009-05-27 22:02:13 -0500 (Wed, 27 May 2009) | 1 line switch library reference and language reference ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/tools/sphinxext/indexcontent.html Modified: python/branches/release26-maint/Doc/tools/sphinxext/indexcontent.html ============================================================================== --- python/branches/release26-maint/Doc/tools/sphinxext/indexcontent.html (original) +++ python/branches/release26-maint/Doc/tools/sphinxext/indexcontent.html Thu May 28 05:27:58 2009 @@ -9,10 +9,10 @@ start here

        - + From python-checkins at python.org Thu May 28 05:30:13 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 28 May 2009 05:30:13 +0200 (CEST) Subject: [Python-checkins] r72977 - in python/branches/py3k: Doc/tools/sphinxext/indexcontent.html Message-ID: <20090528033013.88DE6C446@mail.python.org> Author: benjamin.peterson Date: Thu May 28 05:30:13 2009 New Revision: 72977 Log: Merged revisions 72971 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72971 | benjamin.peterson | 2009-05-27 22:02:13 -0500 (Wed, 27 May 2009) | 1 line switch library reference and language reference ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/tools/sphinxext/indexcontent.html Modified: python/branches/py3k/Doc/tools/sphinxext/indexcontent.html ============================================================================== --- python/branches/py3k/Doc/tools/sphinxext/indexcontent.html (original) +++ python/branches/py3k/Doc/tools/sphinxext/indexcontent.html Thu May 28 05:30:13 2009 @@ -9,10 +9,10 @@ start here

        - + From python-checkins at python.org Thu May 28 05:32:08 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 28 May 2009 05:32:08 +0200 (CEST) Subject: [Python-checkins] r72978 - in python/branches/release30-maint: Doc/tools/sphinxext/indexcontent.html Message-ID: <20090528033208.E2567C448@mail.python.org> Author: benjamin.peterson Date: Thu May 28 05:32:08 2009 New Revision: 72978 Log: Merged revisions 72977 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r72977 | benjamin.peterson | 2009-05-27 22:30:13 -0500 (Wed, 27 May 2009) | 9 lines Merged revisions 72971 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72971 | benjamin.peterson | 2009-05-27 22:02:13 -0500 (Wed, 27 May 2009) | 1 line switch library reference and language reference ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/tools/sphinxext/indexcontent.html Modified: python/branches/release30-maint/Doc/tools/sphinxext/indexcontent.html ============================================================================== --- python/branches/release30-maint/Doc/tools/sphinxext/indexcontent.html (original) +++ python/branches/release30-maint/Doc/tools/sphinxext/indexcontent.html Thu May 28 05:32:08 2009 @@ -9,10 +9,10 @@ start here

        - + From buildbot at python.org Thu May 28 05:52:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 28 May 2009 03:52:50 +0000 Subject: [Python-checkins] buildbot failure in i386 Ubuntu 2.6 Message-ID: <20090528035250.D9642C4D8@mail.python.org> The Buildbot has detected a new failure of i386 Ubuntu 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/i386%20Ubuntu%202.6/builds/399 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-ubuntu-i386 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: philip.jenvey BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "/home/pybot/buildarea/2.6.klose-ubuntu-i386/build/Lib/test/test_signal.py", line 165, in test_main pickle.dump(None, done_w) File "/home/pybot/buildarea/2.6.klose-ubuntu-i386/build/Lib/contextlib.py", line 153, in __exit__ self.thing.close() IOError: [Errno 9] Bad file descriptor 1 test failed: test_signal make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Thu May 28 07:02:13 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 28 May 2009 05:02:13 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 2.6 Message-ID: <20090528050214.1A13BC468@mail.python.org> The Buildbot has detected a new failure of x86 gentoo 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%202.6/builds/368 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Thu May 28 07:58:44 2009 From: python-checkins at python.org (philip.jenvey) Date: Thu, 28 May 2009 07:58:44 +0200 (CEST) Subject: [Python-checkins] r72979 - in python/trunk/Lib/test: test_difflib.py test_inspect.py test_univnewlines.py Message-ID: <20090528055844.4EFCBC3CD@mail.python.org> Author: philip.jenvey Date: Thu May 28 07:58:44 2009 New Revision: 72979 Log: explicitly close files Modified: python/trunk/Lib/test/test_difflib.py python/trunk/Lib/test/test_inspect.py python/trunk/Lib/test/test_univnewlines.py Modified: python/trunk/Lib/test/test_difflib.py ============================================================================== --- python/trunk/Lib/test/test_difflib.py (original) +++ python/trunk/Lib/test/test_difflib.py Thu May 28 07:58:44 2009 @@ -135,14 +135,13 @@ k.make_table(f3.splitlines(True),t3.splitlines(True)), ]) actual = full.replace('','\n%s\n' % tables) - # temporarily uncomment next three lines to baseline this test - #f = open('test_difflib_expect.html','w') - #f.write(actual) - #f.close() - expect = open(findfile('test_difflib_expect.html')).read() + # temporarily uncomment next two lines to baseline this test + #with open('test_difflib_expect.html','w') as fp: + # fp.write(actual) - self.assertEqual(actual,expect) + with open(findfile('test_difflib_expect.html')) as fp: + self.assertEqual(actual, fp.read()) def test_recursion_limit(self): # Check if the problem described in patch #1413711 exists. Modified: python/trunk/Lib/test/test_inspect.py ============================================================================== --- python/trunk/Lib/test/test_inspect.py (original) +++ python/trunk/Lib/test/test_inspect.py Thu May 28 07:58:44 2009 @@ -170,7 +170,8 @@ def __init__(self, *args, **kwargs): unittest.TestCase.__init__(self, *args, **kwargs) - self.source = file(inspect.getsourcefile(self.fodderFile)).read() + with open(inspect.getsourcefile(self.fodderFile)) as fp: + self.source = fp.read() def sourcerange(self, top, bottom): lines = self.source.split("\n") Modified: python/trunk/Lib/test/test_univnewlines.py ============================================================================== --- python/trunk/Lib/test/test_univnewlines.py (original) +++ python/trunk/Lib/test/test_univnewlines.py Thu May 28 07:58:44 2009 @@ -37,9 +37,8 @@ WRITEMODE = 'wb' def setUp(self): - fp = open(test_support.TESTFN, self.WRITEMODE) - fp.write(self.DATA) - fp.close() + with open(test_support.TESTFN, self.WRITEMODE) as fp: + fp.write(self.DATA) def tearDown(self): try: @@ -48,35 +47,35 @@ pass def test_read(self): - fp = open(test_support.TESTFN, self.READMODE) - data = fp.read() + with open(test_support.TESTFN, self.READMODE) as fp: + data = fp.read() self.assertEqual(data, DATA_LF) self.assertEqual(repr(fp.newlines), repr(self.NEWLINE)) def test_readlines(self): - fp = open(test_support.TESTFN, self.READMODE) - data = fp.readlines() + with open(test_support.TESTFN, self.READMODE) as fp: + data = fp.readlines() self.assertEqual(data, DATA_SPLIT) self.assertEqual(repr(fp.newlines), repr(self.NEWLINE)) def test_readline(self): - fp = open(test_support.TESTFN, self.READMODE) - data = [] - d = fp.readline() - while d: - data.append(d) + with open(test_support.TESTFN, self.READMODE) as fp: + data = [] d = fp.readline() + while d: + data.append(d) + d = fp.readline() self.assertEqual(data, DATA_SPLIT) self.assertEqual(repr(fp.newlines), repr(self.NEWLINE)) def test_seek(self): - fp = open(test_support.TESTFN, self.READMODE) - fp.readline() - pos = fp.tell() - data = fp.readlines() - self.assertEqual(data, DATA_SPLIT[1:]) - fp.seek(pos) - data = fp.readlines() + with open(test_support.TESTFN, self.READMODE) as fp: + fp.readline() + pos = fp.tell() + data = fp.readlines() + self.assertEqual(data, DATA_SPLIT[1:]) + fp.seek(pos) + data = fp.readlines() self.assertEqual(data, DATA_SPLIT[1:]) def test_execfile(self): @@ -106,10 +105,10 @@ DATA = DATA_CRLF def test_tell(self): - fp = open(test_support.TESTFN, self.READMODE) - self.assertEqual(repr(fp.newlines), repr(None)) - data = fp.readline() - pos = fp.tell() + with open(test_support.TESTFN, self.READMODE) as fp: + self.assertEqual(repr(fp.newlines), repr(None)) + data = fp.readline() + pos = fp.tell() self.assertEqual(repr(fp.newlines), repr(self.NEWLINE)) class TestMixedNewlines(TestGenericUnivNewlines): From python-checkins at python.org Thu May 28 08:09:08 2009 From: python-checkins at python.org (philip.jenvey) Date: Thu, 28 May 2009 08:09:08 +0200 (CEST) Subject: [Python-checkins] r72980 - in python/branches/py3k: Lib/test/test_difflib.py Lib/test/test_inspect.py Lib/test/test_univnewlines.py Message-ID: <20090528060908.A86DDC436@mail.python.org> Author: philip.jenvey Date: Thu May 28 08:09:08 2009 New Revision: 72980 Log: Merged revisions 72979 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72979 | philip.jenvey | 2009-05-27 22:58:44 -0700 (Wed, 27 May 2009) | 2 lines explicitly close files ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_difflib.py python/branches/py3k/Lib/test/test_inspect.py python/branches/py3k/Lib/test/test_univnewlines.py Modified: python/branches/py3k/Lib/test/test_difflib.py ============================================================================== --- python/branches/py3k/Lib/test/test_difflib.py (original) +++ python/branches/py3k/Lib/test/test_difflib.py Thu May 28 08:09:08 2009 @@ -135,14 +135,13 @@ k.make_table(f3.splitlines(True),t3.splitlines(True)), ]) actual = full.replace('','\n%s\n' % tables) - # temporarily uncomment next three lines to baseline this test - #f = open('test_difflib_expect.html','w') - #f.write(actual) - #f.close() - expect = open(findfile('test_difflib_expect.html')).read() + # temporarily uncomment next two lines to baseline this test + #with open('test_difflib_expect.html','w') as fp: + # fp.write(actual) - self.assertEqual(actual,expect) + with open(findfile('test_difflib_expect.html')) as fp: + self.assertEqual(actual, fp.read()) def test_recursion_limit(self): # Check if the problem described in patch #1413711 exists. Modified: python/branches/py3k/Lib/test/test_inspect.py ============================================================================== --- python/branches/py3k/Lib/test/test_inspect.py (original) +++ python/branches/py3k/Lib/test/test_inspect.py Thu May 28 08:09:08 2009 @@ -175,7 +175,8 @@ def __init__(self, *args, **kwargs): unittest.TestCase.__init__(self, *args, **kwargs) - self.source = open(inspect.getsourcefile(self.fodderFile)).read() + with open(inspect.getsourcefile(self.fodderFile)) as fp: + self.source = fp.read() def sourcerange(self, top, bottom): lines = self.source.split("\n") Modified: python/branches/py3k/Lib/test/test_univnewlines.py ============================================================================== --- python/branches/py3k/Lib/test/test_univnewlines.py (original) +++ python/branches/py3k/Lib/test/test_univnewlines.py Thu May 28 08:09:08 2009 @@ -37,12 +37,11 @@ WRITEMODE = 'wb' def setUp(self): - fp = self.open(support.TESTFN, self.WRITEMODE) data = self.DATA if "b" in self.WRITEMODE: data = data.encode("ascii") - fp.write(data) - fp.close() + with self.open(support.TESTFN, self.WRITEMODE) as fp: + fp.write(data) def tearDown(self): try: @@ -51,35 +50,35 @@ pass def test_read(self): - fp = self.open(support.TESTFN, self.READMODE) - data = fp.read() + with self.open(support.TESTFN, self.READMODE) as fp: + data = fp.read() self.assertEqual(data, DATA_LF) self.assertEqual(repr(fp.newlines), repr(self.NEWLINE)) def test_readlines(self): - fp = self.open(support.TESTFN, self.READMODE) - data = fp.readlines() + with self.open(support.TESTFN, self.READMODE) as fp: + data = fp.readlines() self.assertEqual(data, DATA_SPLIT) self.assertEqual(repr(fp.newlines), repr(self.NEWLINE)) def test_readline(self): - fp = self.open(support.TESTFN, self.READMODE) - data = [] - d = fp.readline() - while d: - data.append(d) + with self.open(support.TESTFN, self.READMODE) as fp: + data = [] d = fp.readline() + while d: + data.append(d) + d = fp.readline() self.assertEqual(data, DATA_SPLIT) self.assertEqual(repr(fp.newlines), repr(self.NEWLINE)) def test_seek(self): - fp = self.open(support.TESTFN, self.READMODE) - fp.readline() - pos = fp.tell() - data = fp.readlines() - self.assertEqual(data, DATA_SPLIT[1:]) - fp.seek(pos) - data = fp.readlines() + with self.open(support.TESTFN, self.READMODE) as fp: + fp.readline() + pos = fp.tell() + data = fp.readlines() + self.assertEqual(data, DATA_SPLIT[1:]) + fp.seek(pos) + data = fp.readlines() self.assertEqual(data, DATA_SPLIT[1:]) @@ -96,10 +95,10 @@ DATA = DATA_CRLF def test_tell(self): - fp = self.open(support.TESTFN, self.READMODE) - self.assertEqual(repr(fp.newlines), repr(None)) - data = fp.readline() - pos = fp.tell() + with self.open(support.TESTFN, self.READMODE) as fp: + self.assertEqual(repr(fp.newlines), repr(None)) + data = fp.readline() + pos = fp.tell() self.assertEqual(repr(fp.newlines), repr(self.NEWLINE)) class TestMixedNewlines(TestGenericUnivNewlines): From python-checkins at python.org Thu May 28 14:53:55 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 28 May 2009 14:53:55 +0200 (CEST) Subject: [Python-checkins] r72981 - in python/trunk: Lib/distutils/archive_util.py Lib/distutils/tests/test_archive_util.py Misc/NEWS Message-ID: <20090528125355.25CD8D691@mail.python.org> Author: tarek.ziade Date: Thu May 28 14:53:54 2009 New Revision: 72981 Log: Fixed #6048: Distutils uses the tarfile module instead of the tar command now Modified: python/trunk/Lib/distutils/archive_util.py python/trunk/Lib/distutils/tests/test_archive_util.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/archive_util.py ============================================================================== --- python/trunk/Lib/distutils/archive_util.py (original) +++ python/trunk/Lib/distutils/archive_util.py Thu May 28 14:53:54 2009 @@ -6,6 +6,9 @@ __revision__ = "$Id$" import os +from warnings import warn +import sys + from distutils.errors import DistutilsExecError from distutils.spawn import spawn from distutils.dir_util import mkpath @@ -22,36 +25,45 @@ the appropriate compression extension (".gz", ".bz2" or ".Z"). Returns the output filename. """ - # XXX GNU tar 1.13 has a nifty option to add a prefix directory. - # It's pretty new, though, so we certainly can't require it -- - # but it would be nice to take advantage of it to skip the - # "create a tree of hardlinks" step! (Would also be nice to - # detect GNU tar to use its 'z' option and save a step.) - - compress_ext = {'gzip': ".gz", - 'bzip2': '.bz2', - 'compress': ".Z" } + tar_compression = {'gzip': 'gz', 'bzip2': 'bz2', None: '', 'compress': ''} + compress_ext = {'gzip': '.gz', 'bzip2': '.bz2', 'compress': '.Z'} # flags for compression program, each element of list will be an argument - compress_flags = {'gzip': ["-f9"], - 'compress': ["-f"], - 'bzip2': ['-f9']} - if compress is not None and compress not in compress_ext.keys(): raise ValueError, \ - "bad value for 'compress': must be None, 'gzip', or 'compress'" + ("bad value for 'compress': must be None, 'gzip', 'bzip2' " + "or 'compress'") + + archive_name = base_name + '.tar' + if compress != 'compress': + archive_name += compress_ext.get(compress, '') - archive_name = base_name + ".tar" mkpath(os.path.dirname(archive_name), dry_run=dry_run) - cmd = ["tar", "-cf", archive_name, base_dir] - spawn(cmd, dry_run=dry_run) - if compress: - spawn([compress] + compress_flags[compress] + [archive_name], - dry_run=dry_run) - return archive_name + compress_ext[compress] - else: - return archive_name + # creating the tarball + import tarfile # late import so Python build itself doesn't break + + log.info('Creating tar archive') + if not dry_run: + tar = tarfile.open(archive_name, 'w|%s' % tar_compression[compress]) + try: + tar.add(base_dir) + finally: + tar.close() + + # compression using `compress` + if compress == 'compress': + warn("'compress' will be deprecated.", PendingDeprecationWarning) + # the option varies depending on the platform + compressed_name = archive_name + compress_ext[compress] + if sys.platform == 'win32': + cmd = [compress, archive_name, compressed_name] + else: + cmd = [compress, '-f', archive_name] + spawn(cmd, dry_run=dry_run) + return compressed_name + + return archive_name def make_zipfile(base_name, base_dir, verbose=0, dry_run=0): """Create a zip file from all the files under 'base_dir'. Modified: python/trunk/Lib/distutils/tests/test_archive_util.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_archive_util.py (original) +++ python/trunk/Lib/distutils/tests/test_archive_util.py Thu May 28 14:53:54 2009 @@ -3,12 +3,15 @@ import unittest import os +import tarfile from os.path import splitdrive +import warnings from distutils.archive_util import (check_archive_formats, make_tarball, make_zipfile, make_archive) -from distutils.spawn import find_executable +from distutils.spawn import find_executable, spawn from distutils.tests import support +from test.test_support import check_warnings try: import zipfile @@ -19,12 +22,13 @@ class ArchiveUtilTestCase(support.TempdirManager, unittest.TestCase): - @unittest.skipUnless(find_executable('tar'), 'Need the tar command to run') def test_make_tarball(self): # creating something to tar tmpdir = self.mkdtemp() self.write_file([tmpdir, 'file1'], 'xxx') self.write_file([tmpdir, 'file2'], 'xxx') + os.mkdir(os.path.join(tmpdir, 'sub')) + self.write_file([tmpdir, 'sub', 'file3'], 'xxx') tmpdir2 = self.mkdtemp() unittest.skipUnless(splitdrive(tmpdir)[0] == splitdrive(tmpdir2)[0], @@ -55,6 +59,111 @@ tarball = base_name + '.tar' self.assert_(os.path.exists(tarball)) + def _tarinfo(self, path): + tar = tarfile.open(path) + try: + names = tar.getnames() + names.sort() + return tuple(names) + finally: + tar.close() + + def _create_files(self): + # creating something to tar + tmpdir = self.mkdtemp() + dist = os.path.join(tmpdir, 'dist') + os.mkdir(dist) + self.write_file([dist, 'file1'], 'xxx') + self.write_file([dist, 'file2'], 'xxx') + os.mkdir(os.path.join(dist, 'sub')) + self.write_file([dist, 'sub', 'file3'], 'xxx') + os.mkdir(os.path.join(dist, 'sub2')) + tmpdir2 = self.mkdtemp() + base_name = os.path.join(tmpdir2, 'archive') + return tmpdir, tmpdir2, base_name + + @unittest.skipUnless(find_executable('tar'), 'Need the tar command to run') + def test_tarfile_vs_tar(self): + tmpdir, tmpdir2, base_name = self._create_files() + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + make_tarball(base_name, 'dist') + finally: + os.chdir(old_dir) + + # check if the compressed tarball was created + tarball = base_name + '.tar.gz' + self.assert_(os.path.exists(tarball)) + + # now create another tarball using `tar` + tarball2 = os.path.join(tmpdir, 'archive2.tar.gz') + cmd = ['tar', '-czf', 'archive2.tar.gz', 'dist'] + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + spawn(cmd) + finally: + os.chdir(old_dir) + + self.assert_(os.path.exists(tarball2)) + # let's compare both tarballs + self.assertEquals(self._tarinfo(tarball), self._tarinfo(tarball2)) + + # trying an uncompressed one + base_name = os.path.join(tmpdir2, 'archive') + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + make_tarball(base_name, 'dist', compress=None) + finally: + os.chdir(old_dir) + tarball = base_name + '.tar' + self.assert_(os.path.exists(tarball)) + + # now for a dry_run + base_name = os.path.join(tmpdir2, 'archive') + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + make_tarball(base_name, 'dist', compress=None, dry_run=True) + finally: + os.chdir(old_dir) + tarball = base_name + '.tar' + self.assert_(os.path.exists(tarball)) + + @unittest.skipUnless(find_executable('compress'), + 'The compress program is required') + def test_compress_deprecated(self): + tmpdir, tmpdir2, base_name = self._create_files() + + # using compress and testing the PendingDeprecationWarning + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + with check_warnings() as w: + warnings.simplefilter("always") + make_tarball(base_name, 'dist', compress='compress') + finally: + os.chdir(old_dir) + tarball = base_name + '.tar.Z' + self.assert_(os.path.exists(tarball)) + self.assertEquals(len(w.warnings), 1) + + # same test with dry_run + os.remove(tarball) + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + with check_warnings() as w: + warnings.simplefilter("always") + make_tarball(base_name, 'dist', compress='compress', + dry_run=True) + finally: + os.chdir(old_dir) + self.assert_(not os.path.exists(tarball)) + self.assertEquals(len(w.warnings), 1) + @unittest.skipUnless(ZIP_SUPPORT, 'Need zip support to run') def test_make_zipfile(self): # creating something to tar Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Thu May 28 14:53:54 2009 @@ -307,6 +307,8 @@ Library ------- +- Issue #6048: Now Distutils uses the tarfile module in archive_util. + - Issue #6121: pydoc now ignores leading and trailing spaces in the argument to the 'help' function. From python-checkins at python.org Thu May 28 14:54:54 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 28 May 2009 14:54:54 +0200 (CEST) Subject: [Python-checkins] r72982 - python/branches/release26-maint Message-ID: <20090528125454.5D76AC48F@mail.python.org> Author: tarek.ziade Date: Thu May 28 14:54:54 2009 New Revision: 72982 Log: Blocked revisions 72981 via svnmerge ........ r72981 | tarek.ziade | 2009-05-28 14:53:54 +0200 (Thu, 28 May 2009) | 1 line Fixed #6048: Distutils uses the tarfile module instead of the tar command now ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Thu May 28 14:57:09 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 28 May 2009 14:57:09 +0200 (CEST) Subject: [Python-checkins] r72983 - python/branches/py3k Message-ID: <20090528125709.68504D3A5@mail.python.org> Author: tarek.ziade Date: Thu May 28 14:57:09 2009 New Revision: 72983 Log: Blocked revisions 72823 via svnmerge ........ r72823 | tarek.ziade | 2009-05-22 11:42:43 +0200 (Fri, 22 May 2009) | 1 line fixed encoding ........ Modified: python/branches/py3k/ (props changed) From python-checkins at python.org Thu May 28 15:01:13 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 28 May 2009 15:01:13 +0200 (CEST) Subject: [Python-checkins] r72984 - in python/branches/py3k: Lib/distutils/archive_util.py Lib/distutils/tests/test_archive_util.py Misc/NEWS Message-ID: <20090528130113.80CE0D3A5@mail.python.org> Author: tarek.ziade Date: Thu May 28 15:01:13 2009 New Revision: 72984 Log: Merged revisions 72981 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72981 | tarek.ziade | 2009-05-28 14:53:54 +0200 (Thu, 28 May 2009) | 1 line Fixed #6048: Distutils uses the tarfile module instead of the tar command now ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/archive_util.py python/branches/py3k/Lib/distutils/tests/test_archive_util.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/distutils/archive_util.py ============================================================================== --- python/branches/py3k/Lib/distutils/archive_util.py (original) +++ python/branches/py3k/Lib/distutils/archive_util.py Thu May 28 15:01:13 2009 @@ -6,6 +6,9 @@ __revision__ = "$Id$" import os +from warnings import warn +import sys + from distutils.errors import DistutilsExecError from distutils.spawn import spawn from distutils.dir_util import mkpath @@ -22,36 +25,45 @@ the appropriate compression extension (".gz", ".bz2" or ".Z"). Returns the output filename. """ - # XXX GNU tar 1.13 has a nifty option to add a prefix directory. - # It's pretty new, though, so we certainly can't require it -- - # but it would be nice to take advantage of it to skip the - # "create a tree of hardlinks" step! (Would also be nice to - # detect GNU tar to use its 'z' option and save a step.) - - compress_ext = {'gzip': ".gz", - 'bzip2': '.bz2', - 'compress': ".Z" } + tar_compression = {'gzip': 'gz', 'bzip2': 'bz2', None: '', 'compress': ''} + compress_ext = {'gzip': '.gz', 'bzip2': '.bz2', 'compress': '.Z'} # flags for compression program, each element of list will be an argument - compress_flags = {'gzip': ["-f9"], - 'compress': ["-f"], - 'bzip2': ['-f9']} - if compress is not None and compress not in compress_ext.keys(): raise ValueError( - "bad value for 'compress': must be None, 'gzip', or 'compress'") + "bad value for 'compress': must be None, 'gzip', 'bzip2' " + "or 'compress'") + + archive_name = base_name + '.tar' + if compress != 'compress': + archive_name += compress_ext.get(compress, '') - archive_name = base_name + ".tar" mkpath(os.path.dirname(archive_name), dry_run=dry_run) - cmd = ["tar", "-cf", archive_name, base_dir] - spawn(cmd, dry_run=dry_run) - if compress: - spawn([compress] + compress_flags[compress] + [archive_name], - dry_run=dry_run) - return archive_name + compress_ext[compress] - else: - return archive_name + # creating the tarball + import tarfile # late import so Python build itself doesn't break + + log.info('Creating tar archive') + if not dry_run: + tar = tarfile.open(archive_name, 'w|%s' % tar_compression[compress]) + try: + tar.add(base_dir) + finally: + tar.close() + + # compression using `compress` + if compress == 'compress': + warn("'compress' will be deprecated.", PendingDeprecationWarning) + # the option varies depending on the platform + compressed_name = archive_name + compress_ext[compress] + if sys.platform == 'win32': + cmd = [compress, archive_name, compressed_name] + else: + cmd = [compress, '-f', archive_name] + spawn(cmd, dry_run=dry_run) + return compressed_name + + return archive_name def make_zipfile(base_name, base_dir, verbose=0, dry_run=0): """Create a zip file from all the files under 'base_dir'. Modified: python/branches/py3k/Lib/distutils/tests/test_archive_util.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_archive_util.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_archive_util.py Thu May 28 15:01:13 2009 @@ -3,12 +3,15 @@ import unittest import os +import tarfile from os.path import splitdrive +import warnings from distutils.archive_util import (check_archive_formats, make_tarball, make_zipfile, make_archive) -from distutils.spawn import find_executable +from distutils.spawn import find_executable, spawn from distutils.tests import support +from test.support import check_warnings try: import zipfile @@ -19,12 +22,13 @@ class ArchiveUtilTestCase(support.TempdirManager, unittest.TestCase): - @unittest.skipUnless(find_executable('tar'), 'Need the tar command to run') def test_make_tarball(self): # creating something to tar tmpdir = self.mkdtemp() self.write_file([tmpdir, 'file1'], 'xxx') self.write_file([tmpdir, 'file2'], 'xxx') + os.mkdir(os.path.join(tmpdir, 'sub')) + self.write_file([tmpdir, 'sub', 'file3'], 'xxx') tmpdir2 = self.mkdtemp() unittest.skipUnless(splitdrive(tmpdir)[0] == splitdrive(tmpdir2)[0], @@ -55,6 +59,111 @@ tarball = base_name + '.tar' self.assert_(os.path.exists(tarball)) + def _tarinfo(self, path): + tar = tarfile.open(path) + try: + names = tar.getnames() + names.sort() + return tuple(names) + finally: + tar.close() + + def _create_files(self): + # creating something to tar + tmpdir = self.mkdtemp() + dist = os.path.join(tmpdir, 'dist') + os.mkdir(dist) + self.write_file([dist, 'file1'], 'xxx') + self.write_file([dist, 'file2'], 'xxx') + os.mkdir(os.path.join(dist, 'sub')) + self.write_file([dist, 'sub', 'file3'], 'xxx') + os.mkdir(os.path.join(dist, 'sub2')) + tmpdir2 = self.mkdtemp() + base_name = os.path.join(tmpdir2, 'archive') + return tmpdir, tmpdir2, base_name + + @unittest.skipUnless(find_executable('tar'), 'Need the tar command to run') + def test_tarfile_vs_tar(self): + tmpdir, tmpdir2, base_name = self._create_files() + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + make_tarball(base_name, 'dist') + finally: + os.chdir(old_dir) + + # check if the compressed tarball was created + tarball = base_name + '.tar.gz' + self.assert_(os.path.exists(tarball)) + + # now create another tarball using `tar` + tarball2 = os.path.join(tmpdir, 'archive2.tar.gz') + cmd = ['tar', '-czf', 'archive2.tar.gz', 'dist'] + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + spawn(cmd) + finally: + os.chdir(old_dir) + + self.assert_(os.path.exists(tarball2)) + # let's compare both tarballs + self.assertEquals(self._tarinfo(tarball), self._tarinfo(tarball2)) + + # trying an uncompressed one + base_name = os.path.join(tmpdir2, 'archive') + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + make_tarball(base_name, 'dist', compress=None) + finally: + os.chdir(old_dir) + tarball = base_name + '.tar' + self.assert_(os.path.exists(tarball)) + + # now for a dry_run + base_name = os.path.join(tmpdir2, 'archive') + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + make_tarball(base_name, 'dist', compress=None, dry_run=True) + finally: + os.chdir(old_dir) + tarball = base_name + '.tar' + self.assert_(os.path.exists(tarball)) + + @unittest.skipUnless(find_executable('compress'), + 'The compress program is required') + def test_compress_deprecated(self): + tmpdir, tmpdir2, base_name = self._create_files() + + # using compress and testing the PendingDeprecationWarning + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + with check_warnings() as w: + warnings.simplefilter("always") + make_tarball(base_name, 'dist', compress='compress') + finally: + os.chdir(old_dir) + tarball = base_name + '.tar.Z' + self.assert_(os.path.exists(tarball)) + self.assertEquals(len(w.warnings), 1) + + # same test with dry_run + os.remove(tarball) + old_dir = os.getcwd() + os.chdir(tmpdir) + try: + with check_warnings() as w: + warnings.simplefilter("always") + make_tarball(base_name, 'dist', compress='compress', + dry_run=True) + finally: + os.chdir(old_dir) + self.assert_(not os.path.exists(tarball)) + self.assertEquals(len(w.warnings), 1) + @unittest.skipUnless(ZIP_SUPPORT, 'Need zip support to run') def test_make_zipfile(self): # creating something to tar Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu May 28 15:01:13 2009 @@ -684,6 +684,8 @@ Library ------- +- Issue #6048: Now Distutils uses the tarfile module in archive_util. + - Issue #6062: In distutils, fixed the package option of build_ext. Feedback and tests on pywin32 by Tim Golden. From python-checkins at python.org Thu May 28 15:02:53 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 28 May 2009 15:02:53 +0200 (CEST) Subject: [Python-checkins] r72985 - python/branches/release30-maint Message-ID: <20090528130253.37C96D6A2@mail.python.org> Author: tarek.ziade Date: Thu May 28 15:02:53 2009 New Revision: 72985 Log: Blocked revisions 72984 via svnmerge ................ r72984 | tarek.ziade | 2009-05-28 15:01:13 +0200 (Thu, 28 May 2009) | 9 lines Merged revisions 72981 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72981 | tarek.ziade | 2009-05-28 14:53:54 +0200 (Thu, 28 May 2009) | 1 line Fixed #6048: Distutils uses the tarfile module instead of the tar command now ........ ................ Modified: python/branches/release30-maint/ (props changed) From python-checkins at python.org Thu May 28 15:55:51 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 28 May 2009 15:55:51 +0200 (CEST) Subject: [Python-checkins] r72986 - python/trunk/Lib/distutils/tests/test_archive_util.py Message-ID: <20090528135551.8DBAFD416@mail.python.org> Author: tarek.ziade Date: Thu May 28 15:55:51 2009 New Revision: 72986 Log: using 'tar' then 'gzip' in the test, because 'tar -czf' is not supported under some platforms Modified: python/trunk/Lib/distutils/tests/test_archive_util.py Modified: python/trunk/Lib/distutils/tests/test_archive_util.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_archive_util.py (original) +++ python/trunk/Lib/distutils/tests/test_archive_util.py Thu May 28 15:55:51 2009 @@ -20,6 +20,7 @@ ZIP_SUPPORT = find_executable('zip') class ArchiveUtilTestCase(support.TempdirManager, + support.LoggingSilencer, unittest.TestCase): def test_make_tarball(self): @@ -82,7 +83,8 @@ base_name = os.path.join(tmpdir2, 'archive') return tmpdir, tmpdir2, base_name - @unittest.skipUnless(find_executable('tar'), 'Need the tar command to run') + @unittest.skipUnless(find_executable('tar') and find_executable('gzip'), + 'Need the tar command to run') def test_tarfile_vs_tar(self): tmpdir, tmpdir2, base_name = self._create_files() old_dir = os.getcwd() @@ -98,11 +100,13 @@ # now create another tarball using `tar` tarball2 = os.path.join(tmpdir, 'archive2.tar.gz') - cmd = ['tar', '-czf', 'archive2.tar.gz', 'dist'] + tar_cmd = ['tar', '-cf', 'archive2.tar', 'dist'] + gzip_cmd = ['gzip', '-f9', 'archive2.tar'] old_dir = os.getcwd() os.chdir(tmpdir) try: - spawn(cmd) + spawn(tar_cmd) + spawn(gzip_cmd) finally: os.chdir(old_dir) From python-checkins at python.org Thu May 28 16:01:23 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 28 May 2009 16:01:23 +0200 (CEST) Subject: [Python-checkins] r72987 - python/branches/release26-maint Message-ID: <20090528140123.81D45D323@mail.python.org> Author: tarek.ziade Date: Thu May 28 16:01:23 2009 New Revision: 72987 Log: Blocked revisions 72986 via svnmerge ........ r72986 | tarek.ziade | 2009-05-28 15:55:51 +0200 (Thu, 28 May 2009) | 1 line using 'tar' then 'gzip' in the test, because 'tar -czf' is not supported under some platforms ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Thu May 28 16:03:00 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 28 May 2009 16:03:00 +0200 (CEST) Subject: [Python-checkins] r72988 - in python/branches/py3k: Lib/distutils/tests/test_archive_util.py Message-ID: <20090528140300.249ABD38D@mail.python.org> Author: tarek.ziade Date: Thu May 28 16:02:58 2009 New Revision: 72988 Log: Merged revisions 72986 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72986 | tarek.ziade | 2009-05-28 15:55:51 +0200 (Thu, 28 May 2009) | 1 line using 'tar' then 'gzip' in the test, because 'tar -czf' is not supported under some platforms ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_archive_util.py Modified: python/branches/py3k/Lib/distutils/tests/test_archive_util.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_archive_util.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_archive_util.py Thu May 28 16:02:58 2009 @@ -20,6 +20,7 @@ ZIP_SUPPORT = find_executable('zip') class ArchiveUtilTestCase(support.TempdirManager, + support.LoggingSilencer, unittest.TestCase): def test_make_tarball(self): @@ -82,7 +83,8 @@ base_name = os.path.join(tmpdir2, 'archive') return tmpdir, tmpdir2, base_name - @unittest.skipUnless(find_executable('tar'), 'Need the tar command to run') + @unittest.skipUnless(find_executable('tar') and find_executable('gzip'), + 'Need the tar command to run') def test_tarfile_vs_tar(self): tmpdir, tmpdir2, base_name = self._create_files() old_dir = os.getcwd() @@ -98,11 +100,13 @@ # now create another tarball using `tar` tarball2 = os.path.join(tmpdir, 'archive2.tar.gz') - cmd = ['tar', '-czf', 'archive2.tar.gz', 'dist'] + tar_cmd = ['tar', '-cf', 'archive2.tar', 'dist'] + gzip_cmd = ['gzip', '-f9', 'archive2.tar'] old_dir = os.getcwd() os.chdir(tmpdir) try: - spawn(cmd) + spawn(tar_cmd) + spawn(gzip_cmd) finally: os.chdir(old_dir) From python-checkins at python.org Thu May 28 16:07:36 2009 From: python-checkins at python.org (tarek.ziade) Date: Thu, 28 May 2009 16:07:36 +0200 (CEST) Subject: [Python-checkins] r72989 - python/branches/release30-maint Message-ID: <20090528140736.C518DD434@mail.python.org> Author: tarek.ziade Date: Thu May 28 16:07:36 2009 New Revision: 72989 Log: Blocked revisions 72988 via svnmerge ................ r72988 | tarek.ziade | 2009-05-28 16:02:58 +0200 (Thu, 28 May 2009) | 9 lines Merged revisions 72986 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72986 | tarek.ziade | 2009-05-28 15:55:51 +0200 (Thu, 28 May 2009) | 1 line using 'tar' then 'gzip' in the test, because 'tar -czf' is not supported under some platforms ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Thu May 28 16:58:40 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 28 May 2009 14:58:40 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 2.6 Message-ID: <20090528145840.BCC86D36F@mail.python.org> The Buildbot has detected a new failure of x86 gentoo 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%202.6/builds/370 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From buildbot at python.org Thu May 28 18:22:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 28 May 2009 16:22:11 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090528162211.CCD73C4C8@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/391 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Thu May 28 20:19:00 2009 From: python-checkins at python.org (r.david.murray) Date: Thu, 28 May 2009 20:19:00 +0200 (CEST) Subject: [Python-checkins] r72990 - in python/branches/py3k: Lib/smtplib.py Lib/test/test_smtplib.py Misc/NEWS Message-ID: <20090528181900.CB68AD75F@mail.python.org> Author: r.david.murray Date: Thu May 28 20:19:00 2009 New Revision: 72990 Log: Finish issue 5259 by adding tests and fixes for the 'login' and 'cram-md5' auth methods. Modified: python/branches/py3k/Lib/smtplib.py python/branches/py3k/Lib/test/test_smtplib.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/smtplib.py ============================================================================== --- python/branches/py3k/Lib/smtplib.py (original) +++ python/branches/py3k/Lib/smtplib.py Thu May 28 20:19:00 2009 @@ -541,8 +541,9 @@ def encode_cram_md5(challenge, user, password): challenge = base64.decodestring(challenge) - response = user + " " + hmac.HMAC(password, challenge).hexdigest() - return encode_base64(response) + response = user + " " + hmac.HMAC(password.encode('ascii'), + challenge).hexdigest() + return encode_base64(response.encode('ascii'), eol='') def encode_plain(user, password): s = "\0%s\0%s" % (user, password) @@ -584,10 +585,10 @@ AUTH_PLAIN + " " + encode_plain(user, password)) elif authmethod == AUTH_LOGIN: (code, resp) = self.docmd("AUTH", - "%s %s" % (AUTH_LOGIN, encode_base64(user))) + "%s %s" % (AUTH_LOGIN, encode_base64(user.encode('ascii'), eol=''))) if code != 334: raise SMTPAuthenticationError(code, resp) - (code, resp) = self.docmd(encode_base64(password)) + (code, resp) = self.docmd(encode_base64(password.encode('ascii'), eol='')) elif authmethod is None: raise SMTPException("No suitable authentication method found.") if code not in (235, 503): Modified: python/branches/py3k/Lib/test/test_smtplib.py ============================================================================== --- python/branches/py3k/Lib/test/test_smtplib.py (original) +++ python/branches/py3k/Lib/test/test_smtplib.py Thu May 28 20:19:00 2009 @@ -285,7 +285,15 @@ } sim_auth = ('Mr.A at somewhere.com', 'somepassword') -sim_auth_b64encoded = 'AE1yLkFAc29tZXdoZXJlLmNvbQBzb21lcGFzc3dvcmQ=' +sim_cram_md5_challenge = ('PENCeUxFREJoU0NnbmhNWitOMjNGNn' + 'dAZWx3b29kLmlubm9zb2Z0LmNvbT4=') +sim_auth_credentials = { + 'login': 'TXIuQUBzb21ld2hlcmUuY29t', + 'plain': 'AE1yLkFAc29tZXdoZXJlLmNvbQBzb21lcGFzc3dvcmQ=', + 'cram-md5': ('TXIUQUBZB21LD2HLCMUUY29TIDG4OWQ0MJ' + 'KWZGQ4ODNMNDA4NTGXMDRLZWMYZJDMODG1'), + } +sim_auth_login_password = 'C29TZXBHC3N3B3JK' sim_lists = {'list-1':['Mr.A at somewhere.com','Mrs.C at somewhereesle.com'], 'list-2':['Ms.B at somewhere.com',], @@ -293,19 +301,28 @@ # Simulated SMTP channel & server class SimSMTPChannel(smtpd.SMTPChannel): + + def __init__(self, *args, **kw): + self.__extrafeatures = [] + super(SimSMTPChannel, self).__init__(*args, **kw) + + @property + def _extrafeatures(self): + return ''.join([ "250-{}\r\n".format(x) for x in self.__extrafeatures ]) + + def add_feature(self, feature): + self.__extrafeatures.append(feature) + def smtp_EHLO(self, arg): - resp = '250-testhost\r\n' \ - '250-EXPN\r\n' \ - '250-SIZE 20000000\r\n' \ - '250-STARTTLS\r\n' \ - '250-DELIVERBY\r\n' \ - '250-AUTH PLAIN\r\n' \ - '250 HELP' + resp = ('250-testhost\r\n' + '250-EXPN\r\n' + '250-SIZE 20000000\r\n' + '250-STARTTLS\r\n' + '250-DELIVERBY\r\n') + resp = resp + self._extrafeatures + '250 HELP' self.push(resp) def smtp_VRFY(self, arg): -# print '\nsmtp_VRFY(%r)\n' % arg - raw_addr = email.utils.parseaddr(arg)[1] quoted_addr = smtplib.quoteaddr(arg) if raw_addr in sim_users: @@ -314,8 +331,6 @@ self.push('550 No such user: %s' % arg) def smtp_EXPN(self, arg): -# print '\nsmtp_EXPN(%r)\n' % arg - list_name = email.utils.parseaddr(arg)[1].lower() if list_name in sim_lists: user_list = sim_lists[list_name] @@ -329,24 +344,34 @@ self.push('550 No access for you!') def smtp_AUTH(self, arg): + if arg.strip().lower()=='cram-md5': + self.push('334 {}'.format(sim_cram_md5_challenge)) + return mech, auth = arg.split() - if mech.lower() == 'plain': - if auth == sim_auth_b64encoded: - self.push('235 ok, go ahead') - else: - self.push('550 No access for you!') - else: + mech = mech.lower() + if mech not in sim_auth_credentials: self.push('504 auth type unimplemented') + return + if mech == 'plain' and auth==sim_auth_credentials['plain']: + self.push('235 plain auth ok') + elif mech=='login' and auth==sim_auth_credentials['login']: + self.push('334 Password:') + else: + self.push('550 No access for you!') class SimSMTPServer(smtpd.SMTPServer): + def handle_accept(self): conn, addr = self.accept() - channel = SimSMTPChannel(self, conn, addr) + self._SMTPchannel = SimSMTPChannel(self, conn, addr) def process_message(self, peer, mailfrom, rcpttos, data): pass + def add_feature(self, feature): + self._SMTPchannel.add_feature(feature) + # Test various SMTP & ESMTP commands/behaviors that require a simulated server # (i.e., something with more features than DebuggingServer) @@ -386,7 +411,6 @@ 'size': '20000000', 'starttls': '', 'deliverby': '', - 'auth': ' PLAIN', 'help': '', } @@ -427,12 +451,41 @@ self.assertEqual(smtp.expn(u), expected_unknown) smtp.quit() - def testAUTH(self): + def testAUTH_PLAIN(self): smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + self.serv.add_feature("AUTH PLAIN") - expected_auth_ok = (235, b'ok, go ahead') + expected_auth_ok = (235, b'plain auth ok') self.assertEqual(smtp.login(sim_auth[0], sim_auth[1]), expected_auth_ok) + # SimSMTPChannel doesn't fully support LOGIN or CRAM-MD5 auth because they + # require a synchronous read to obtain the credentials...so instead smtpd + # sees the credential sent by smtplib's login method as an unknown command, + # which results in smtplib raising an auth error. Fortunately the error + # message contains the encoded credential, so we can partially check that it + # was generated correctly (partially, because the 'word' is uppercased in + # the error message). + + def testAUTH_LOGIN(self): + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + self.serv.add_feature("AUTH LOGIN") + try: smtp.login(sim_auth[0], sim_auth[1]) + except smtplib.SMTPAuthenticationError as err: + if sim_auth_login_password not in str(err): + raise "expected encoded password not found in error message" + + def testAUTH_CRAM_MD5(self): + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + self.serv.add_feature("AUTH CRAM-MD5") + + try: smtp.login(sim_auth[0], sim_auth[1]) + except smtplib.SMTPAuthenticationError as err: + if sim_auth_credentials['cram-md5'] not in str(err): + raise "expected encoded credentials not found in error message" + + #TODO: add tests for correct AUTH method fallback now that the + #test infrastructure can support it. + def test_main(verbose=None): support.run_unittest(GeneralTests, DebuggingServerTests, Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Thu May 28 20:19:00 2009 @@ -34,6 +34,8 @@ Library ------- +- smtplib 'login' and 'cram-md5' login are also fixed (see Issue #5259). + - Issue #6121: pydoc now ignores leading and trailing spaces in the argument to the 'help' function. From python-checkins at python.org Thu May 28 20:33:47 2009 From: python-checkins at python.org (r.david.murray) Date: Thu, 28 May 2009 20:33:47 +0200 (CEST) Subject: [Python-checkins] r72991 - in python/branches/release30-maint: Lib/smtplib.py Lib/test/test_smtplib.py Misc/NEWS Message-ID: <20090528183347.42E4BD654@mail.python.org> Author: r.david.murray Date: Thu May 28 20:33:47 2009 New Revision: 72991 Log: Merged revisions 72990 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r72990 | r.david.murray | 2009-05-28 14:19:00 -0400 (Thu, 28 May 2009) | 3 lines Finish issue 5259 by adding tests and fixes for the 'login' and 'cram-md5' auth methods. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/smtplib.py python/branches/release30-maint/Lib/test/test_smtplib.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/smtplib.py ============================================================================== --- python/branches/release30-maint/Lib/smtplib.py (original) +++ python/branches/release30-maint/Lib/smtplib.py Thu May 28 20:33:47 2009 @@ -538,8 +538,9 @@ def encode_cram_md5(challenge, user, password): challenge = base64.decodestring(challenge) - response = user + " " + hmac.HMAC(password, challenge).hexdigest() - return encode_base64(response) + response = user + " " + hmac.HMAC(password.encode('ascii'), + challenge).hexdigest() + return encode_base64(response.encode('ascii'), eol='') def encode_plain(user, password): s = "\0%s\0%s" % (user, password) @@ -581,10 +582,10 @@ AUTH_PLAIN + " " + encode_plain(user, password)) elif authmethod == AUTH_LOGIN: (code, resp) = self.docmd("AUTH", - "%s %s" % (AUTH_LOGIN, encode_base64(user))) + "%s %s" % (AUTH_LOGIN, encode_base64(user.encode('ascii'), eol=''))) if code != 334: raise SMTPAuthenticationError(code, resp) - (code, resp) = self.docmd(encode_base64(password)) + (code, resp) = self.docmd(encode_base64(password.encode('ascii'), eol='')) elif authmethod is None: raise SMTPException("No suitable authentication method found.") if code not in (235, 503): Modified: python/branches/release30-maint/Lib/test/test_smtplib.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_smtplib.py (original) +++ python/branches/release30-maint/Lib/test/test_smtplib.py Thu May 28 20:33:47 2009 @@ -285,7 +285,15 @@ } sim_auth = ('Mr.A at somewhere.com', 'somepassword') -sim_auth_b64encoded = 'AE1yLkFAc29tZXdoZXJlLmNvbQBzb21lcGFzc3dvcmQ=' +sim_cram_md5_challenge = ('PENCeUxFREJoU0NnbmhNWitOMjNGNn' + 'dAZWx3b29kLmlubm9zb2Z0LmNvbT4=') +sim_auth_credentials = { + 'login': 'TXIuQUBzb21ld2hlcmUuY29t', + 'plain': 'AE1yLkFAc29tZXdoZXJlLmNvbQBzb21lcGFzc3dvcmQ=', + 'cram-md5': ('TXIUQUBZB21LD2HLCMUUY29TIDG4OWQ0MJ' + 'KWZGQ4ODNMNDA4NTGXMDRLZWMYZJDMODG1'), + } +sim_auth_login_password = 'C29TZXBHC3N3B3JK' sim_lists = {'list-1':['Mr.A at somewhere.com','Mrs.C at somewhereesle.com'], 'list-2':['Ms.B at somewhere.com',], @@ -293,19 +301,28 @@ # Simulated SMTP channel & server class SimSMTPChannel(smtpd.SMTPChannel): + + def __init__(self, *args, **kw): + self.__extrafeatures = [] + super(SimSMTPChannel, self).__init__(*args, **kw) + + @property + def _extrafeatures(self): + return ''.join([ "250-{0}\r\n".format(x) for x in self.__extrafeatures ]) + + def add_feature(self, feature): + self.__extrafeatures.append(feature) + def smtp_EHLO(self, arg): - resp = '250-testhost\r\n' \ - '250-EXPN\r\n' \ - '250-SIZE 20000000\r\n' \ - '250-STARTTLS\r\n' \ - '250-DELIVERBY\r\n' \ - '250-AUTH PLAIN\r\n' \ - '250 HELP' + resp = ('250-testhost\r\n' + '250-EXPN\r\n' + '250-SIZE 20000000\r\n' + '250-STARTTLS\r\n' + '250-DELIVERBY\r\n') + resp = resp + self._extrafeatures + '250 HELP' self.push(resp) def smtp_VRFY(self, arg): -# print '\nsmtp_VRFY(%r)\n' % arg - raw_addr = email.utils.parseaddr(arg)[1] quoted_addr = smtplib.quoteaddr(arg) if raw_addr in sim_users: @@ -314,8 +331,6 @@ self.push('550 No such user: %s' % arg) def smtp_EXPN(self, arg): -# print '\nsmtp_EXPN(%r)\n' % arg - list_name = email.utils.parseaddr(arg)[1].lower() if list_name in sim_lists: user_list = sim_lists[list_name] @@ -329,24 +344,34 @@ self.push('550 No access for you!') def smtp_AUTH(self, arg): + if arg.strip().lower()=='cram-md5': + self.push('334 {0}'.format(sim_cram_md5_challenge)) + return mech, auth = arg.split() - if mech.lower() == 'plain': - if auth == sim_auth_b64encoded: - self.push('235 ok, go ahead') - else: - self.push('550 No access for you!') - else: + mech = mech.lower() + if mech not in sim_auth_credentials: self.push('504 auth type unimplemented') + return + if mech == 'plain' and auth==sim_auth_credentials['plain']: + self.push('235 plain auth ok') + elif mech=='login' and auth==sim_auth_credentials['login']: + self.push('334 Password:') + else: + self.push('550 No access for you!') class SimSMTPServer(smtpd.SMTPServer): + def handle_accept(self): conn, addr = self.accept() - channel = SimSMTPChannel(self, conn, addr) + self._SMTPchannel = SimSMTPChannel(self, conn, addr) def process_message(self, peer, mailfrom, rcpttos, data): pass + def add_feature(self, feature): + self._SMTPchannel.add_feature(feature) + # Test various SMTP & ESMTP commands/behaviors that require a simulated server # (i.e., something with more features than DebuggingServer) @@ -386,7 +411,6 @@ 'size': '20000000', 'starttls': '', 'deliverby': '', - 'auth': ' PLAIN', 'help': '', } @@ -427,12 +451,41 @@ self.assertEqual(smtp.expn(u), expected_unknown) smtp.quit() - def testAUTH(self): + def testAUTH_PLAIN(self): smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + self.serv.add_feature("AUTH PLAIN") - expected_auth_ok = (235, b'ok, go ahead') + expected_auth_ok = (235, b'plain auth ok') self.assertEqual(smtp.login(sim_auth[0], sim_auth[1]), expected_auth_ok) + # SimSMTPChannel doesn't fully support LOGIN or CRAM-MD5 auth because they + # require a synchronous read to obtain the credentials...so instead smtpd + # sees the credential sent by smtplib's login method as an unknown command, + # which results in smtplib raising an auth error. Fortunately the error + # message contains the encoded credential, so we can partially check that it + # was generated correctly (partially, because the 'word' is uppercased in + # the error message). + + def testAUTH_LOGIN(self): + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + self.serv.add_feature("AUTH LOGIN") + try: smtp.login(sim_auth[0], sim_auth[1]) + except smtplib.SMTPAuthenticationError as err: + if sim_auth_login_password not in str(err): + raise "expected encoded password not found in error message" + + def testAUTH_CRAM_MD5(self): + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + self.serv.add_feature("AUTH CRAM-MD5") + + try: smtp.login(sim_auth[0], sim_auth[1]) + except smtplib.SMTPAuthenticationError as err: + if sim_auth_credentials['cram-md5'] not in str(err): + raise "expected encoded credentials not found in error message" + + #TODO: add tests for correct AUTH method fallback now that the + #test infrastructure can support it. + def test_main(verbose=None): support.run_unittest(GeneralTests, DebuggingServerTests, Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Thu May 28 20:33:47 2009 @@ -65,6 +65,8 @@ Library ------- +- smtplib 'login' and 'cram-md5' login are also fixed (see Issue #5259). + - Issue #6121: pydoc now ignores leading and trailing spaces in the argument to the 'help' function. From buildbot at python.org Thu May 28 20:44:30 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 28 May 2009 18:44:30 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090528184430.67361D3C6@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/709 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu May 28 20:49:24 2009 From: python-checkins at python.org (r.david.murray) Date: Thu, 28 May 2009 20:49:24 +0200 (CEST) Subject: [Python-checkins] r72992 - python/trunk/Lib/test/test_smtplib.py Message-ID: <20090528184924.0D417D5AC@mail.python.org> Author: r.david.murray Date: Thu May 28 20:49:23 2009 New Revision: 72992 Log: Backport smtplib auth tests from r72990. Modified: python/trunk/Lib/test/test_smtplib.py Modified: python/trunk/Lib/test/test_smtplib.py ============================================================================== --- python/trunk/Lib/test/test_smtplib.py (original) +++ python/trunk/Lib/test/test_smtplib.py Thu May 28 20:49:23 2009 @@ -277,7 +277,15 @@ } sim_auth = ('Mr.A at somewhere.com', 'somepassword') -sim_auth_b64encoded = 'AE1yLkFAc29tZXdoZXJlLmNvbQBzb21lcGFzc3dvcmQ=' +sim_cram_md5_challenge = ('PENCeUxFREJoU0NnbmhNWitOMjNGNn' + 'dAZWx3b29kLmlubm9zb2Z0LmNvbT4=') +sim_auth_credentials = { + 'login': 'TXIuQUBzb21ld2hlcmUuY29t', + 'plain': 'AE1yLkFAc29tZXdoZXJlLmNvbQBzb21lcGFzc3dvcmQ=', + 'cram-md5': ('TXIUQUBZB21LD2HLCMUUY29TIDG4OWQ0MJ' + 'KWZGQ4ODNMNDA4NTGXMDRLZWMYZJDMODG1'), + } +sim_auth_login_password = 'C29TZXBHC3N3B3JK' sim_lists = {'list-1':['Mr.A at somewhere.com','Mrs.C at somewhereesle.com'], 'list-2':['Ms.B at somewhere.com',], @@ -285,19 +293,28 @@ # Simulated SMTP channel & server class SimSMTPChannel(smtpd.SMTPChannel): + + def __init__(self, *args, **kw): + self.__extrafeatures = [] + smtpd.SMTPChannel.__init__(self, *args, **kw) + + @property + def _extrafeatures(self): + return ''.join([ "250-{0}\r\n".format(x) for x in self.__extrafeatures ]) + + def add_feature(self, feature): + self.__extrafeatures.append(feature) + def smtp_EHLO(self, arg): - resp = '250-testhost\r\n' \ - '250-EXPN\r\n' \ - '250-SIZE 20000000\r\n' \ - '250-STARTTLS\r\n' \ - '250-DELIVERBY\r\n' \ - '250-AUTH PLAIN\r\n' \ - '250 HELP' + resp = ('250-testhost\r\n' + '250-EXPN\r\n' + '250-SIZE 20000000\r\n' + '250-STARTTLS\r\n' + '250-DELIVERBY\r\n') + resp = resp + self._extrafeatures + '250 HELP' self.push(resp) def smtp_VRFY(self, arg): -# print '\nsmtp_VRFY(%r)\n' % arg - raw_addr = email.utils.parseaddr(arg)[1] quoted_addr = smtplib.quoteaddr(arg) if raw_addr in sim_users: @@ -306,8 +323,6 @@ self.push('550 No such user: %s' % arg) def smtp_EXPN(self, arg): -# print '\nsmtp_EXPN(%r)\n' % arg - list_name = email.utils.parseaddr(arg)[1].lower() if list_name in sim_lists: user_list = sim_lists[list_name] @@ -321,24 +336,34 @@ self.push('550 No access for you!') def smtp_AUTH(self, arg): + if arg.strip().lower()=='cram-md5': + self.push('334 {0}'.format(sim_cram_md5_challenge)) + return mech, auth = arg.split() - if mech.lower() == 'plain': - if auth == sim_auth_b64encoded: - self.push('235 ok, go ahead') - else: - self.push('550 No access for you!') - else: + mech = mech.lower() + if mech not in sim_auth_credentials: self.push('504 auth type unimplemented') + return + if mech == 'plain' and auth==sim_auth_credentials['plain']: + self.push('235 plain auth ok') + elif mech=='login' and auth==sim_auth_credentials['login']: + self.push('334 Password:') + else: + self.push('550 No access for you!') class SimSMTPServer(smtpd.SMTPServer): + def handle_accept(self): conn, addr = self.accept() - channel = SimSMTPChannel(self, conn, addr) + self._SMTPchannel = SimSMTPChannel(self, conn, addr) def process_message(self, peer, mailfrom, rcpttos, data): pass + def add_feature(self, feature): + self._SMTPchannel.add_feature(feature) + # Test various SMTP & ESMTP commands/behaviors that require a simulated server # (i.e., something with more features than DebuggingServer) @@ -378,7 +403,6 @@ 'size': '20000000', 'starttls': '', 'deliverby': '', - 'auth': ' PLAIN', 'help': '', } @@ -416,12 +440,41 @@ self.assertEqual(smtp.expn(u), expected_unknown) smtp.quit() - def testAUTH(self): + def testAUTH_PLAIN(self): smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + self.serv.add_feature("AUTH PLAIN") - expected_auth_ok = (235, b'ok, go ahead') + expected_auth_ok = (235, b'plain auth ok') self.assertEqual(smtp.login(sim_auth[0], sim_auth[1]), expected_auth_ok) + # SimSMTPChannel doesn't fully support LOGIN or CRAM-MD5 auth because they + # require a synchronous read to obtain the credentials...so instead smtpd + # sees the credential sent by smtplib's login method as an unknown command, + # which results in smtplib raising an auth error. Fortunately the error + # message contains the encoded credential, so we can partially check that it + # was generated correctly (partially, because the 'word' is uppercased in + # the error message). + + def testAUTH_LOGIN(self): + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + self.serv.add_feature("AUTH LOGIN") + try: smtp.login(sim_auth[0], sim_auth[1]) + except smtplib.SMTPAuthenticationError as err: + if sim_auth_login_password not in str(err): + raise "expected encoded password not found in error message" + + def testAUTH_CRAM_MD5(self): + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + self.serv.add_feature("AUTH CRAM-MD5") + + try: smtp.login(sim_auth[0], sim_auth[1]) + except smtplib.SMTPAuthenticationError as err: + if sim_auth_credentials['cram-md5'] not in str(err): + raise "expected encoded credentials not found in error message" + + #TODO: add tests for correct AUTH method fallback now that the + #test infrastructure can support it. + def test_main(verbose=None): test_support.run_unittest(GeneralTests, DebuggingServerTests, From buildbot at python.org Thu May 28 20:56:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 28 May 2009 18:56:17 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 3.0 Message-ID: <20090528185618.03439C465@mail.python.org> The Buildbot has detected a new failure of x86 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%203.0/builds/428 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Unknown signal 32 sincerely, -The Buildbot From buildbot at python.org Thu May 28 21:02:26 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 28 May 2009 19:02:26 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090528190226.5D38BD769@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/826 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Thu May 28 21:20:59 2009 From: python-checkins at python.org (r.david.murray) Date: Thu, 28 May 2009 21:20:59 +0200 (CEST) Subject: [Python-checkins] r72993 - in python/branches/release26-maint: Lib/test/test_smtplib.py Message-ID: <20090528192059.174EFD4E3@mail.python.org> Author: r.david.murray Date: Thu May 28 21:20:58 2009 New Revision: 72993 Log: Merged revisions 72992 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r72992 | r.david.murray | 2009-05-28 14:49:23 -0400 (Thu, 28 May 2009) | 2 lines Backport smtplib auth tests from r72990. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_smtplib.py Modified: python/branches/release26-maint/Lib/test/test_smtplib.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_smtplib.py (original) +++ python/branches/release26-maint/Lib/test/test_smtplib.py Thu May 28 21:20:58 2009 @@ -277,7 +277,15 @@ } sim_auth = ('Mr.A at somewhere.com', 'somepassword') -sim_auth_b64encoded = 'AE1yLkFAc29tZXdoZXJlLmNvbQBzb21lcGFzc3dvcmQ=' +sim_cram_md5_challenge = ('PENCeUxFREJoU0NnbmhNWitOMjNGNn' + 'dAZWx3b29kLmlubm9zb2Z0LmNvbT4=') +sim_auth_credentials = { + 'login': 'TXIuQUBzb21ld2hlcmUuY29t', + 'plain': 'AE1yLkFAc29tZXdoZXJlLmNvbQBzb21lcGFzc3dvcmQ=', + 'cram-md5': ('TXIUQUBZB21LD2HLCMUUY29TIDG4OWQ0MJ' + 'KWZGQ4ODNMNDA4NTGXMDRLZWMYZJDMODG1'), + } +sim_auth_login_password = 'C29TZXBHC3N3B3JK' sim_lists = {'list-1':['Mr.A at somewhere.com','Mrs.C at somewhereesle.com'], 'list-2':['Ms.B at somewhere.com',], @@ -285,19 +293,28 @@ # Simulated SMTP channel & server class SimSMTPChannel(smtpd.SMTPChannel): + + def __init__(self, *args, **kw): + self.__extrafeatures = [] + smtpd.SMTPChannel.__init__(self, *args, **kw) + + @property + def _extrafeatures(self): + return ''.join([ "250-{0}\r\n".format(x) for x in self.__extrafeatures ]) + + def add_feature(self, feature): + self.__extrafeatures.append(feature) + def smtp_EHLO(self, arg): - resp = '250-testhost\r\n' \ - '250-EXPN\r\n' \ - '250-SIZE 20000000\r\n' \ - '250-STARTTLS\r\n' \ - '250-DELIVERBY\r\n' \ - '250-AUTH PLAIN\r\n' \ - '250 HELP' + resp = ('250-testhost\r\n' + '250-EXPN\r\n' + '250-SIZE 20000000\r\n' + '250-STARTTLS\r\n' + '250-DELIVERBY\r\n') + resp = resp + self._extrafeatures + '250 HELP' self.push(resp) def smtp_VRFY(self, arg): -# print '\nsmtp_VRFY(%r)\n' % arg - raw_addr = email.utils.parseaddr(arg)[1] quoted_addr = smtplib.quoteaddr(arg) if raw_addr in sim_users: @@ -306,8 +323,6 @@ self.push('550 No such user: %s' % arg) def smtp_EXPN(self, arg): -# print '\nsmtp_EXPN(%r)\n' % arg - list_name = email.utils.parseaddr(arg)[1].lower() if list_name in sim_lists: user_list = sim_lists[list_name] @@ -321,24 +336,34 @@ self.push('550 No access for you!') def smtp_AUTH(self, arg): + if arg.strip().lower()=='cram-md5': + self.push('334 {0}'.format(sim_cram_md5_challenge)) + return mech, auth = arg.split() - if mech.lower() == 'plain': - if auth == sim_auth_b64encoded: - self.push('235 ok, go ahead') - else: - self.push('550 No access for you!') - else: + mech = mech.lower() + if mech not in sim_auth_credentials: self.push('504 auth type unimplemented') + return + if mech == 'plain' and auth==sim_auth_credentials['plain']: + self.push('235 plain auth ok') + elif mech=='login' and auth==sim_auth_credentials['login']: + self.push('334 Password:') + else: + self.push('550 No access for you!') class SimSMTPServer(smtpd.SMTPServer): + def handle_accept(self): conn, addr = self.accept() - channel = SimSMTPChannel(self, conn, addr) + self._SMTPchannel = SimSMTPChannel(self, conn, addr) def process_message(self, peer, mailfrom, rcpttos, data): pass + def add_feature(self, feature): + self._SMTPchannel.add_feature(feature) + # Test various SMTP & ESMTP commands/behaviors that require a simulated server # (i.e., something with more features than DebuggingServer) @@ -378,7 +403,6 @@ 'size': '20000000', 'starttls': '', 'deliverby': '', - 'auth': ' PLAIN', 'help': '', } @@ -416,12 +440,41 @@ self.assertEqual(smtp.expn(u), expected_unknown) smtp.quit() - def testAUTH(self): + def testAUTH_PLAIN(self): smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + self.serv.add_feature("AUTH PLAIN") - expected_auth_ok = (235, b'ok, go ahead') + expected_auth_ok = (235, b'plain auth ok') self.assertEqual(smtp.login(sim_auth[0], sim_auth[1]), expected_auth_ok) + # SimSMTPChannel doesn't fully support LOGIN or CRAM-MD5 auth because they + # require a synchronous read to obtain the credentials...so instead smtpd + # sees the credential sent by smtplib's login method as an unknown command, + # which results in smtplib raising an auth error. Fortunately the error + # message contains the encoded credential, so we can partially check that it + # was generated correctly (partially, because the 'word' is uppercased in + # the error message). + + def testAUTH_LOGIN(self): + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + self.serv.add_feature("AUTH LOGIN") + try: smtp.login(sim_auth[0], sim_auth[1]) + except smtplib.SMTPAuthenticationError as err: + if sim_auth_login_password not in str(err): + raise "expected encoded password not found in error message" + + def testAUTH_CRAM_MD5(self): + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) + self.serv.add_feature("AUTH CRAM-MD5") + + try: smtp.login(sim_auth[0], sim_auth[1]) + except smtplib.SMTPAuthenticationError as err: + if sim_auth_credentials['cram-md5'] not in str(err): + raise "expected encoded credentials not found in error message" + + #TODO: add tests for correct AUTH method fallback now that the + #test infrastructure can support it. + def test_main(verbose=None): test_support.run_unittest(GeneralTests, DebuggingServerTests, From nnorwitz at gmail.com Thu May 28 22:11:20 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 28 May 2009 16:11:20 -0400 Subject: [Python-checkins] Python Regression Test Failures basics (1) Message-ID: <20090528201120.GA18828@python.psfb.org> 337 tests OK. 1 test failed: test_smtplib 36 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_smtpnet test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 6 skips unexpected on linux2: test_multiprocessing test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aetypes test_aifc test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named MacOS test_array test_ascii_formatd test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 test_bsddb3 skipped -- Use of the `bsddb' resource not enabled test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compileall test_compiler test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_curses test_curses skipped -- Use of the `curses' resource not enabled test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils [19513 refs] test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future5 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [15401 refs] [15401 refs] [15401 refs] [25387 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_importlib test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_ipaddr test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_linecache test_linuxaudiodev test_linuxaudiodev skipped -- Use of the `audio' resource not enabled test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named MacOS test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_memoryview test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os test_ossaudiodev test_ossaudiodev skipped -- Use of the `audio' resource not enabled test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_pdb test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 /tmp/python-test/local/lib/python2.7/test/test_pep352.py:31: PendingDeprecationWarning: Please use assertTrue instead. (ins.__class__.__name__, attr)) /tmp/python-test/local/lib/python2.7/test/test_pep352.py:92: PendingDeprecationWarning: Please use assertEqual instead. given, expected)) test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [16991 refs] [16991 refs] test_plistlib test_poll test_popen [15406 refs] [15406 refs] [15406 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [20890 refs] [20890 refs] test_pyexpat test_queue test_quopri [17926 refs] [17926 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [15401 refs] [15401 refs] [15404 refs] [15401 refs] test_slice test_smtplib test test_smtplib failed -- errors occurred; run in verbose mode for details test_smtpnet test_smtpnet skipped -- Use of the `network' resource not enabled test_socket test_socketserver test_socketserver skipped -- Use of the `network' resource not enabled test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- module os has no attribute startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [17236 refs] [15616 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] . [15401 refs] [15401 refs] this bit of output is from a test of stdout in a different process ... [15401 refs] [15401 refs] [15616 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry test_symtable test_syntax test_sys [15401 refs] [15401 refs] [15630 refs] [15424 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [15404 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [18716 refs] [20269 refs] [20083 refs] [20083 refs] [20083 refs] [20083 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tk test_tk skipped -- No module named _tkinter test_tokenize test_trace test_traceback test_transformer test_ttk_guionly test_ttk_guionly skipped -- No module named _tkinter test_ttk_textonly test_ttk_textonly skipped -- No module named _tkinter test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllib2net skipped -- Use of the `network' resource not enabled test_urllibnet test_urllibnet skipped -- Use of the `network' resource not enabled test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib /tmp/python-test/local/lib/python2.7/test/test_xmllib.py:24: DeprecationWarning: The xmllib module is obsolete. Use xml.sax instead. import xmllib test_xmlrpc test_xpickle test_xpickle -- skipping backwards compat tests. Use 'regrtest.py -u xpickle' to run them. test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zipimport_support test_zlib 337 tests OK. 1 test failed: test_smtplib 36 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_smtpnet test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 6 skips unexpected on linux2: test_multiprocessing test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [760196 refs] From nnorwitz at gmail.com Thu May 28 22:19:15 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 28 May 2009 16:19:15 -0400 Subject: [Python-checkins] Python Regression Test Failures opt (1) Message-ID: <20090528201915.GA21284@python.psfb.org> 337 tests OK. 1 test failed: test_smtplib 36 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_smtpnet test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 6 skips unexpected on linux2: test_multiprocessing test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aetypes test_aifc test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named MacOS test_array test_ascii_formatd test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 test_bsddb3 skipped -- Use of the `bsddb' resource not enabled test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compileall test_compiler test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_curses test_curses skipped -- Use of the `curses' resource not enabled test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils [19516 refs] [19516 refs] [19516 refs] [19513 refs] test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future5 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [15401 refs] [15401 refs] [15401 refs] [25387 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_importlib test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_ipaddr test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_linecache test_linuxaudiodev test_linuxaudiodev skipped -- Use of the `audio' resource not enabled test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named MacOS test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_memoryview test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os test_ossaudiodev test_ossaudiodev skipped -- Use of the `audio' resource not enabled test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_pdb test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 /tmp/python-test/local/lib/python2.7/test/test_pep352.py:31: PendingDeprecationWarning: Please use assertTrue instead. (ins.__class__.__name__, attr)) /tmp/python-test/local/lib/python2.7/test/test_pep352.py:92: PendingDeprecationWarning: Please use assertEqual instead. given, expected)) test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [16991 refs] [16991 refs] test_plistlib test_poll test_popen [15406 refs] [15406 refs] [15406 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [20890 refs] [20890 refs] test_pyexpat test_queue test_quopri [17926 refs] [17926 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [15401 refs] [15401 refs] [15404 refs] [15401 refs] test_slice test_smtplib test test_smtplib failed -- errors occurred; run in verbose mode for details test_smtpnet test_smtpnet skipped -- Use of the `network' resource not enabled test_socket test_socketserver test_socketserver skipped -- Use of the `network' resource not enabled test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- module os has no attribute startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [17236 refs] [15616 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] . [15401 refs] [15401 refs] this bit of output is from a test of stdout in a different process ... [15401 refs] [15401 refs] [15616 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry test_symtable test_syntax test_sys [15401 refs] [15401 refs] [15630 refs] [15424 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [15404 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [18716 refs] [21106 refs] [20083 refs] [20083 refs] [20083 refs] [20083 refs] test_threading_local test_threadsignals test_time test_timeout test_timeout skipped -- Use of the `network' resource not enabled test_tk test_tk skipped -- No module named _tkinter test_tokenize test_trace test_traceback test_transformer test_ttk_guionly test_ttk_guionly skipped -- No module named _tkinter test_ttk_textonly test_ttk_textonly skipped -- No module named _tkinter test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllib2net skipped -- Use of the `network' resource not enabled test_urllibnet test_urllibnet skipped -- Use of the `network' resource not enabled test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib /tmp/python-test/local/lib/python2.7/test/test_xmllib.py:24: DeprecationWarning: The xmllib module is obsolete. Use xml.sax instead. import xmllib test_xmlrpc test_xpickle test_xpickle -- skipping backwards compat tests. Use 'regrtest.py -u xpickle' to run them. test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zipimport_support test_zlib 337 tests OK. 1 test failed: test_smtplib 36 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_bsddb3 test_cd test_cl test_curses test_epoll test_gl test_imgfile test_ioctl test_kqueue test_linuxaudiodev test_macos test_macostools test_multiprocessing test_ossaudiodev test_pep277 test_py3kwarn test_scriptpackages test_smtpnet test_socketserver test_startfile test_sunaudiodev test_tcl test_timeout test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_urllib2net test_urllibnet test_winreg test_winsound test_zipfile64 6 skips unexpected on linux2: test_multiprocessing test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [759435 refs] From python-checkins at python.org Thu May 28 22:32:54 2009 From: python-checkins at python.org (benjamin.peterson) Date: Thu, 28 May 2009 22:32:54 +0200 (CEST) Subject: [Python-checkins] r72994 - in sandbox/trunk/2to3: 2to3 lib2to3/fixes/fix_isinstance.py lib2to3/fixes/fix_reduce.py lib2to3/tests/data/README lib2to3/tests/test_parser.py Message-ID: <20090528203254.AEF74D345@mail.python.org> Author: benjamin.peterson Date: Thu May 28 22:32:54 2009 New Revision: 72994 Log: fix test_all_fixers on Windows #6134 Modified: sandbox/trunk/2to3/2to3 (props changed) sandbox/trunk/2to3/lib2to3/fixes/fix_isinstance.py (props changed) sandbox/trunk/2to3/lib2to3/fixes/fix_reduce.py (props changed) sandbox/trunk/2to3/lib2to3/tests/data/README (props changed) sandbox/trunk/2to3/lib2to3/tests/test_parser.py Modified: sandbox/trunk/2to3/lib2to3/tests/test_parser.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/test_parser.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/test_parser.py Thu May 28 22:32:54 2009 @@ -198,7 +198,7 @@ def diff(fn, result): - f = open("@", "w") + f = open("@", "wb") try: f.write(result) finally: From nnorwitz at gmail.com Thu May 28 23:26:50 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 28 May 2009 17:26:50 -0400 Subject: [Python-checkins] Python Regression Test Failures refleak (1) Message-ID: <20090528212650.GA7744@python.psfb.org> More important issues: ---------------------- test_modulefinder leaked [145, 145, 145] references, sum=435 Less important issues: ---------------------- test_cmd_line leaked [-25, 0, 0] references, sum=-25 test_socketserver leaked [0, 78, -78] references, sum=0 test_sys leaked [0, 42, -42] references, sum=0 test_threading leaked [48, 48, 48] references, sum=144 From nnorwitz at gmail.com Thu May 28 23:47:11 2009 From: nnorwitz at gmail.com (Neal Norwitz) Date: Thu, 28 May 2009 17:47:11 -0400 Subject: [Python-checkins] Python Regression Test Failures all (1) Message-ID: <20090528214711.GA12502@python.psfb.org> 343 tests OK. 1 test failed: test_smtplib 27 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_cd test_cl test_epoll test_gl test_imgfile test_ioctl test_kqueue test_macos test_macostools test_multiprocessing test_pep277 test_py3kwarn test_scriptpackages test_startfile test_sunaudiodev test_tcl test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_winreg test_winsound test_zipfile64 6 skips unexpected on linux2: test_multiprocessing test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly test_grammar test_opcodes test_dict test_builtin test_exceptions test_types test_unittest test_doctest test_doctest2 test_MimeWriter test_SimpleHTTPServer test_StringIO test___all__ test___future__ test__locale test_abc test_abstract_numbers test_aepack test_aepack skipped -- No module named aetypes test_aifc test_al test_al skipped -- No module named al test_anydbm test_applesingle test_applesingle skipped -- No module named MacOS test_array test_ascii_formatd test_ast test_asynchat test_asyncore test_atexit test_audioop test_augassign test_base64 test_bastion test_bigaddrspace test_bigmem test_binascii test_binhex test_binop test_bisect test_bool test_bsddb test_bsddb185 test_bsddb185 skipped -- No module named bsddb185 test_bsddb3 Sleepycat Software: Berkeley DB 4.1.25: (December 19, 2002) Test path prefix: /tmp/z-test_bsddb3-7752 test_buffer test_bufio test_bytes test_bz2 test_calendar test_call test_capi test_cd test_cd skipped -- No module named cd test_cfgparser test_cgi test_charmapcodec test_cl test_cl skipped -- No module named cl test_class test_cmath test_cmd test_cmd_line test_cmd_line_script test_code test_codeccallbacks test_codecencodings_cn test_codecencodings_hk test_codecencodings_jp test_codecencodings_kr test_codecencodings_tw test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw test_codecs test_codeop test_coding test_coercion test_collections test_colorsys test_commands test_compare test_compile test_compileall test_compiler testCompileLibrary still working, be patient... test_complex test_complex_args test_contains test_contextlib test_cookie test_cookielib test_copy test_copy_reg test_cpickle test_cprofile test_crypt test_csv test_ctypes test_datetime test_dbm test_decimal test_decorators test_defaultdict test_deque test_descr test_descrtut test_difflib test_dircache test_dis test_distutils [19513 refs] test_dl test_docxmlrpc test_dumbdbm test_dummy_thread test_dummy_threading test_email test_email_codecs test_email_renamed test_enumerate test_eof test_epoll test_epoll skipped -- kernel doesn't support epoll() test_errno test_exception_variations test_extcall test_fcntl test_file test_filecmp test_fileinput test_fileio test_float test_fnmatch test_fork1 test_format test_fpformat test_fractions test_frozen test_ftplib test_funcattrs test_functools test_future test_future3 test_future4 test_future5 test_future_builtins test_gc test_gdbm test_generators test_genericpath test_genexps test_getargs test_getargs2 test_getopt test_gettext test_gl test_gl skipped -- No module named gl test_glob test_global test_grp test_gzip test_hash test_hashlib test_heapq test_hmac test_hotshot test_htmllib test_htmlparser test_httplib test_httpservers [15401 refs] [15401 refs] [15401 refs] [25387 refs] test_imageop test_imaplib test_imgfile test_imgfile skipped -- No module named imgfile test_imp test_import test_importhooks test_importlib test_index test_inspect test_int test_int_literal test_io test_ioctl test_ioctl skipped -- Unable to open /dev/tty test_ipaddr test_isinstance test_iter test_iterlen test_itertools test_json test_kqueue test_kqueue skipped -- test works only on BSD test_largefile test_lib2to3 test_linecache test_list test_locale test_logging test_long test_long_future test_longexp test_macos test_macos skipped -- No module named MacOS test_macostools test_macostools skipped -- No module named MacOS test_macpath test_mailbox test_marshal test_math test_md5 test_memoryio test_memoryview test_mhlib test_mimetools test_mimetypes test_minidom test_mmap test_module test_modulefinder test_multibytecodec test_multibytecodec_support test_multifile test_multiprocessing test_multiprocessing skipped -- OSError raises on RLock creation, see issue 3111! test_mutants test_mutex test_netrc test_new test_nis test_normalization test_ntpath test_old_mailbox test_openpty test_operator test_optparse test_os test_parser Expecting 's_push: parser stack overflow' in next line s_push: parser stack overflow test_pdb test_peepholer test_pep247 test_pep263 test_pep277 test_pep277 skipped -- test works only on NT+ test_pep292 test_pep352 /tmp/python-test/local/lib/python2.7/test/test_pep352.py:31: PendingDeprecationWarning: Please use assertTrue instead. (ins.__class__.__name__, attr)) /tmp/python-test/local/lib/python2.7/test/test_pep352.py:92: PendingDeprecationWarning: Please use assertEqual instead. given, expected)) test_pickle test_pickletools test_pipes test_pkg test_pkgimport test_pkgutil test_platform [16991 refs] [16991 refs] test_plistlib test_poll test_popen [15406 refs] [15406 refs] [15406 refs] test_popen2 test_poplib test_posix test_posixpath test_pow test_pprint test_print test_profile test_profilehooks test_property test_pstats test_pty test_pwd test_py3kwarn test_py3kwarn skipped -- test.test_py3kwarn must be run with the -3 flag test_pyclbr test_pydoc [20890 refs] [20890 refs] test_pyexpat test_queue test_quopri [17926 refs] [17926 refs] test_random test_re test_repr test_resource test_rfc822 test_richcmp test_robotparser test_runpy test_sax test_scope test_scriptpackages test_scriptpackages skipped -- No module named aetools test_select test_set test_sets test_sgmllib test_sha test_shelve test_shlex test_shutil test_signal test_site [15401 refs] [15401 refs] [15404 refs] [15401 refs] test_slice test_smtplib test test_smtplib failed -- errors occurred; run in verbose mode for details test_smtpnet test_socket test_socketserver test_softspace test_sort test_sqlite test_ssl test_startfile test_startfile skipped -- module os has no attribute startfile test_str test_strftime test_string test_stringprep test_strop test_strptime test_struct test_structmembers test_structseq test_subprocess [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [17236 refs] [15616 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] [15401 refs] . [15401 refs] [15401 refs] this bit of output is from a test of stdout in a different process ... [15401 refs] [15401 refs] [15616 refs] test_sunaudiodev test_sunaudiodev skipped -- No module named sunaudiodev test_sundry test_symtable test_syntax test_sys [15401 refs] [15401 refs] [15630 refs] [15424 refs] test_tarfile test_tcl test_tcl skipped -- No module named _tkinter test_telnetlib test_tempfile [15404 refs] test_textwrap test_thread test_threaded_import test_threadedtempfile test_threading [18716 refs] [21106 refs] [20083 refs] [20083 refs] [20083 refs] [20083 refs] test_threading_local test_threadsignals test_time test_timeout test_tk test_tk skipped -- No module named _tkinter test_tokenize test_trace test_traceback test_transformer test_ttk_guionly test_ttk_guionly skipped -- No module named _tkinter test_ttk_textonly test_ttk_textonly skipped -- No module named _tkinter test_tuple test_typechecks test_ucn test_unary test_undocumented_details test_unicode test_unicode_file test_unicode_file skipped -- No Unicode filesystem semantics on this platform. test_unicodedata test_univnewlines test_unpack test_urllib test_urllib2 test_urllib2_localnet test_urllib2net test_urllibnet test_urlparse test_userdict test_userlist test_userstring test_uu test_uuid WARNING: uuid.getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._ifconfig_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. WARNING: uuid._unixdll_getnode is unreliable on many platforms. It is disabled until the code and/or test can be fixed properly. test_wait3 test_wait4 test_warnings test_wave test_weakref test_whichdb test_winreg test_winreg skipped -- No module named _winreg test_winsound test_winsound skipped -- No module named winsound test_with test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c test_xmllib /tmp/python-test/local/lib/python2.7/test/test_xmllib.py:24: DeprecationWarning: The xmllib module is obsolete. Use xml.sax instead. import xmllib test_xmlrpc test_xpickle sh: line 1: python2.4: command not found sh: line 1: python2.6: command not found test_xrange test_zipfile test_zipfile64 test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run test_zipimport test_zipimport_support test_zlib 343 tests OK. 1 test failed: test_smtplib 27 tests skipped: test_aepack test_al test_applesingle test_bsddb185 test_cd test_cl test_epoll test_gl test_imgfile test_ioctl test_kqueue test_macos test_macostools test_multiprocessing test_pep277 test_py3kwarn test_scriptpackages test_startfile test_sunaudiodev test_tcl test_tk test_ttk_guionly test_ttk_textonly test_unicode_file test_winreg test_winsound test_zipfile64 6 skips unexpected on linux2: test_multiprocessing test_ttk_guionly test_epoll test_tk test_ioctl test_ttk_textonly [775350 refs] From python-checkins at python.org Fri May 29 00:20:03 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 29 May 2009 00:20:03 +0200 (CEST) Subject: [Python-checkins] r72995 - in python/branches/py3k: Doc/library/contextlib.rst Doc/whatsnew/3.1.rst Lib/contextlib.py Lib/test/test_contextlib.py Misc/NEWS Message-ID: <20090528222003.D1096D569@mail.python.org> Author: raymond.hettinger Date: Fri May 29 00:20:03 2009 New Revision: 72995 Log: Deprecate contextlib.nested(). The with-statement now provides this functionality directly. Modified: python/branches/py3k/Doc/library/contextlib.rst python/branches/py3k/Doc/whatsnew/3.1.rst python/branches/py3k/Lib/contextlib.py python/branches/py3k/Lib/test/test_contextlib.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Doc/library/contextlib.rst ============================================================================== --- python/branches/py3k/Doc/library/contextlib.rst (original) +++ python/branches/py3k/Doc/library/contextlib.rst Fri May 29 00:20:03 2009 @@ -80,6 +80,8 @@ :meth:`__exit__` methods should avoid raising exceptions, and in particular they should not re-raise a passed-in exception. + .. deprecated:: 3.1 + The with-statement now supports this functionality directly. .. function:: closing(thing) Modified: python/branches/py3k/Doc/whatsnew/3.1.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/3.1.rst (original) +++ python/branches/py3k/Doc/whatsnew/3.1.rst Fri May 29 00:20:03 2009 @@ -164,6 +164,9 @@ ... if '' in line: ... outfile.write(line) + With the new syntax, the :func:`contextlib.nested` function is no longer + needed and is not deprecated. + (Contributed by Georg Brandl and Mattias Br?ndstr?m; `appspot issue 53094 `_.) Modified: python/branches/py3k/Lib/contextlib.py ============================================================================== --- python/branches/py3k/Lib/contextlib.py (original) +++ python/branches/py3k/Lib/contextlib.py Fri May 29 00:20:03 2009 @@ -2,6 +2,7 @@ import sys from functools import wraps +from warnings import warn __all__ = ["contextmanager", "nested", "closing"] @@ -101,6 +102,8 @@ """ + warn("With-statements now directly support multiple context managers", + DeprecationWarning, 2) exits = [] vars = [] exc = (None, None, None) Modified: python/branches/py3k/Lib/test/test_contextlib.py ============================================================================== --- python/branches/py3k/Lib/test/test_contextlib.py (original) +++ python/branches/py3k/Lib/test/test_contextlib.py Fri May 29 00:20:03 2009 @@ -100,128 +100,6 @@ self.assertEqual(baz.foo, 'bar') self.assertEqual(baz.__doc__, "Whee!") -class NestedTestCase(unittest.TestCase): - - # XXX This needs more work - - def test_nested(self): - @contextmanager - def a(): - yield 1 - @contextmanager - def b(): - yield 2 - @contextmanager - def c(): - yield 3 - with nested(a(), b(), c()) as (x, y, z): - self.assertEqual(x, 1) - self.assertEqual(y, 2) - self.assertEqual(z, 3) - - def test_nested_cleanup(self): - state = [] - @contextmanager - def a(): - state.append(1) - try: - yield 2 - finally: - state.append(3) - @contextmanager - def b(): - state.append(4) - try: - yield 5 - finally: - state.append(6) - try: - with nested(a(), b()) as (x, y): - state.append(x) - state.append(y) - 1/0 - except ZeroDivisionError: - self.assertEqual(state, [1, 4, 2, 5, 6, 3]) - else: - self.fail("Didn't raise ZeroDivisionError") - - def test_nested_right_exception(self): - state = [] - @contextmanager - def a(): - yield 1 - class b(object): - def __enter__(self): - return 2 - def __exit__(self, *exc_info): - try: - raise Exception() - except: - pass - try: - with nested(a(), b()) as (x, y): - 1/0 - except ZeroDivisionError: - self.assertEqual((x, y), (1, 2)) - except Exception: - self.fail("Reraised wrong exception") - else: - self.fail("Didn't raise ZeroDivisionError") - - def test_nested_b_swallows(self): - @contextmanager - def a(): - yield - @contextmanager - def b(): - try: - yield - except: - # Swallow the exception - pass - try: - with nested(a(), b()): - 1/0 - except ZeroDivisionError: - self.fail("Didn't swallow ZeroDivisionError") - - def test_nested_break(self): - @contextmanager - def a(): - yield - state = 0 - while True: - state += 1 - with nested(a(), a()): - break - state += 10 - self.assertEqual(state, 1) - - def test_nested_continue(self): - @contextmanager - def a(): - yield - state = 0 - while state < 3: - state += 1 - with nested(a(), a()): - continue - state += 10 - self.assertEqual(state, 3) - - def test_nested_return(self): - @contextmanager - def a(): - try: - yield - except: - pass - def foo(): - with nested(a(), a()): - return 1 - return 10 - self.assertEqual(foo(), 1) - class ClosingTestCase(unittest.TestCase): # XXX This needs more work Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri May 29 00:20:03 2009 @@ -15,7 +15,8 @@ - Issue #6089: Fixed str.format with certain invalid field specifiers that would raise SystemError. -- Added support for multiple context managers in the same with statement. +- Added support for multiple context managers in the same with-statement. + Deprecated contextlib.nested() which is no longer needed. - Issue #5829: complex("1e500") no longer raises OverflowError. This makes it consistent with float("1e500") and interpretation of real From python-checkins at python.org Fri May 29 00:42:20 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 29 May 2009 00:42:20 +0200 (CEST) Subject: [Python-checkins] r72996 - python/branches/py3k/Lib/test/test_contextlib.py Message-ID: <20090528224220.A69A1D615@mail.python.org> Author: raymond.hettinger Date: Fri May 29 00:42:20 2009 New Revision: 72996 Log: Restore tests until the code is actually removed. Modified: python/branches/py3k/Lib/test/test_contextlib.py Modified: python/branches/py3k/Lib/test/test_contextlib.py ============================================================================== --- python/branches/py3k/Lib/test/test_contextlib.py (original) +++ python/branches/py3k/Lib/test/test_contextlib.py Fri May 29 00:42:20 2009 @@ -100,6 +100,128 @@ self.assertEqual(baz.foo, 'bar') self.assertEqual(baz.__doc__, "Whee!") +class NestedTestCase(unittest.TestCase): + + # XXX This needs more work + + def test_nested(self): + @contextmanager + def a(): + yield 1 + @contextmanager + def b(): + yield 2 + @contextmanager + def c(): + yield 3 + with nested(a(), b(), c()) as (x, y, z): + self.assertEqual(x, 1) + self.assertEqual(y, 2) + self.assertEqual(z, 3) + + def test_nested_cleanup(self): + state = [] + @contextmanager + def a(): + state.append(1) + try: + yield 2 + finally: + state.append(3) + @contextmanager + def b(): + state.append(4) + try: + yield 5 + finally: + state.append(6) + try: + with nested(a(), b()) as (x, y): + state.append(x) + state.append(y) + 1/0 + except ZeroDivisionError: + self.assertEqual(state, [1, 4, 2, 5, 6, 3]) + else: + self.fail("Didn't raise ZeroDivisionError") + + def test_nested_right_exception(self): + state = [] + @contextmanager + def a(): + yield 1 + class b(object): + def __enter__(self): + return 2 + def __exit__(self, *exc_info): + try: + raise Exception() + except: + pass + try: + with nested(a(), b()) as (x, y): + 1/0 + except ZeroDivisionError: + self.assertEqual((x, y), (1, 2)) + except Exception: + self.fail("Reraised wrong exception") + else: + self.fail("Didn't raise ZeroDivisionError") + + def test_nested_b_swallows(self): + @contextmanager + def a(): + yield + @contextmanager + def b(): + try: + yield + except: + # Swallow the exception + pass + try: + with nested(a(), b()): + 1/0 + except ZeroDivisionError: + self.fail("Didn't swallow ZeroDivisionError") + + def test_nested_break(self): + @contextmanager + def a(): + yield + state = 0 + while True: + state += 1 + with nested(a(), a()): + break + state += 10 + self.assertEqual(state, 1) + + def test_nested_continue(self): + @contextmanager + def a(): + yield + state = 0 + while state < 3: + state += 1 + with nested(a(), a()): + continue + state += 10 + self.assertEqual(state, 3) + + def test_nested_return(self): + @contextmanager + def a(): + try: + yield + except: + pass + def foo(): + with nested(a(), a()): + return 1 + return 10 + self.assertEqual(foo(), 1) + class ClosingTestCase(unittest.TestCase): # XXX This needs more work From python-checkins at python.org Fri May 29 00:46:29 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 29 May 2009 00:46:29 +0200 (CEST) Subject: [Python-checkins] r72997 - python/branches/py3k/Lib/test/test_contextlib.py Message-ID: <20090528224629.CC81CD718@mail.python.org> Author: raymond.hettinger Date: Fri May 29 00:46:29 2009 New Revision: 72997 Log: Suppress deprecation warnings. Modified: python/branches/py3k/Lib/test/test_contextlib.py Modified: python/branches/py3k/Lib/test/test_contextlib.py ============================================================================== --- python/branches/py3k/Lib/test/test_contextlib.py (original) +++ python/branches/py3k/Lib/test/test_contextlib.py Fri May 29 00:46:29 2009 @@ -9,6 +9,7 @@ import threading from contextlib import * # Tests __all__ from test import support +import warnings class ContextManagerTestCase(unittest.TestCase): @@ -331,7 +332,9 @@ # This is needed to make the test actually run under regrtest.py! def test_main(): - support.run_unittest(__name__) + with warnings.catch_warnings(): + warnings.simplefilter('ignore') + support.run_unittest(__name__) if __name__ == "__main__": test_main() From python-checkins at python.org Fri May 29 00:49:33 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 29 May 2009 00:49:33 +0200 (CEST) Subject: [Python-checkins] r72998 - python/branches/py3k/Doc/whatsnew/3.1.rst Message-ID: <20090528224933.5F922C48B@mail.python.org> Author: raymond.hettinger Date: Fri May 29 00:49:33 2009 New Revision: 72998 Log: fix typo Modified: python/branches/py3k/Doc/whatsnew/3.1.rst Modified: python/branches/py3k/Doc/whatsnew/3.1.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/3.1.rst (original) +++ python/branches/py3k/Doc/whatsnew/3.1.rst Fri May 29 00:49:33 2009 @@ -165,7 +165,7 @@ ... outfile.write(line) With the new syntax, the :func:`contextlib.nested` function is no longer - needed and is not deprecated. + needed and is now deprecated. (Contributed by Georg Brandl and Mattias Br?ndstr?m; `appspot issue 53094 `_.) From buildbot at python.org Fri May 29 01:15:00 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 28 May 2009 23:15:00 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090528231500.B53B8D5BD@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/393 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_distutils test_posix test_subprocess ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 45, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/Include ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From buildbot at python.org Fri May 29 01:46:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 28 May 2009 23:46:31 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090528234631.1DBABC2B8@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/828 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Fri May 29 01:59:23 2009 From: buildbot at python.org (buildbot at python.org) Date: Thu, 28 May 2009 23:59:23 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090528235923.4AD02D638@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/770 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Fri May 29 03:22:18 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 29 May 2009 03:22:18 +0200 (CEST) Subject: [Python-checkins] r72999 - in python/branches/py3k: Doc/whatsnew/3.1.rst Lib/idlelib/RstripExtension.py Lib/idlelib/config-extensions.def Misc/ACKS Misc/NEWS Message-ID: <20090529012218.5DCB9D629@mail.python.org> Author: raymond.hettinger Date: Fri May 29 03:22:18 2009 New Revision: 72999 Log: Issue 5150: Add rstrip() menu option to IDLE. Added: python/branches/py3k/Lib/idlelib/RstripExtension.py (contents, props changed) Modified: python/branches/py3k/Doc/whatsnew/3.1.rst python/branches/py3k/Lib/idlelib/config-extensions.def python/branches/py3k/Misc/ACKS python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Doc/whatsnew/3.1.rst ============================================================================== --- python/branches/py3k/Doc/whatsnew/3.1.rst (original) +++ python/branches/py3k/Doc/whatsnew/3.1.rst Fri May 29 03:22:18 2009 @@ -470,6 +470,14 @@ (Contributed by Jake McGuire and Antoine Pitrou; :issue:`5084`.) +IDLE +==== + +* IDLE's format menu now provides an option to strip trailing whitespace + from a source file. + + (Contributed by Roger D. Serwy; :issue:`5150`.) + Build and C API Changes ======================= Added: python/branches/py3k/Lib/idlelib/RstripExtension.py ============================================================================== --- (empty file) +++ python/branches/py3k/Lib/idlelib/RstripExtension.py Fri May 29 03:22:18 2009 @@ -0,0 +1,29 @@ +'Provides "Strip trailing whitespace" under the "Format" menu.' + +__author__ = "Roger D. Serwy " + +class RstripExtension: + + menudefs = [ + ('format', [None, + ('Strip trailing whitespace', '<>'), + ]),] + + def __init__(self, editwin): + self.editwin = editwin + self.editwin.text.bind("<>", self.do_rstrip) + + def do_rstrip(self, event=None): + + text = self.editwin.text + undo = self.editwin.undo + + undo.undo_block_start() + + end_line = int(float(text.index('end'))) + 1 + for cur in range(1, end_line): + txt = text.get('%i.0' % cur, '%i.0 lineend' % cur) + cut = len(txt.rstrip()) + text.delete('%i.%i' % (cur, cut), '%i.0 lineend' % cur) + + undo.undo_block_stop() Modified: python/branches/py3k/Lib/idlelib/config-extensions.def ============================================================================== --- python/branches/py3k/Lib/idlelib/config-extensions.def (original) +++ python/branches/py3k/Lib/idlelib/config-extensions.def Fri May 29 03:22:18 2009 @@ -86,3 +86,9 @@ fgcolor=Black [CodeContext_bindings] toggle-code-context= + +[RstripExtension] +enable=1 +enable_shell=0 +enable_editor=1 + Modified: python/branches/py3k/Misc/ACKS ============================================================================== --- python/branches/py3k/Misc/ACKS (original) +++ python/branches/py3k/Misc/ACKS Fri May 29 03:22:18 2009 @@ -658,6 +658,7 @@ ?iga Seilnach Fred Sells Jiwon Seo +Roger D, Serwy Jerry Seutter Denis Severson Ian Seyer Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri May 29 03:22:18 2009 @@ -262,6 +262,9 @@ - Issue #5311: bdist_msi can now build packages that do not depend on a specific Python version. +- Issue #5150: IDLE's format menu now has an option to strip trailing + whitespace. + - Issue #5940: distutils.command.build_clib.check_library_list was not doing the right type checkings anymore. From python-checkins at python.org Fri May 29 03:32:59 2009 From: python-checkins at python.org (r.david.murray) Date: Fri, 29 May 2009 03:32:59 +0200 (CEST) Subject: [Python-checkins] r73000 - python/branches/py3k/Misc/ACKS Message-ID: <20090529013259.B0F48D6C2@mail.python.org> Author: r.david.murray Date: Fri May 29 03:32:59 2009 New Revision: 73000 Log: Fix typo. Modified: python/branches/py3k/Misc/ACKS Modified: python/branches/py3k/Misc/ACKS ============================================================================== --- python/branches/py3k/Misc/ACKS (original) +++ python/branches/py3k/Misc/ACKS Fri May 29 03:32:59 2009 @@ -658,7 +658,7 @@ ?iga Seilnach Fred Sells Jiwon Seo -Roger D, Serwy +Roger D. Serwy Jerry Seutter Denis Severson Ian Seyer From python-checkins at python.org Fri May 29 03:36:26 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 29 May 2009 03:36:26 +0200 (CEST) Subject: [Python-checkins] r73001 - in python/trunk: Lib/idlelib/RstripExtension.py Lib/idlelib/config-extensions.def Misc/NEWS Message-ID: <20090529013626.E4E8CD6C9@mail.python.org> Author: raymond.hettinger Date: Fri May 29 03:36:26 2009 New Revision: 73001 Log: Issue 5150: Add rstrip() option to IDLE's format menu. Added: python/trunk/Lib/idlelib/RstripExtension.py - copied unchanged from r72999, /python/branches/py3k/Lib/idlelib/RstripExtension.py Modified: python/trunk/Lib/idlelib/config-extensions.def python/trunk/Misc/NEWS Modified: python/trunk/Lib/idlelib/config-extensions.def ============================================================================== --- python/trunk/Lib/idlelib/config-extensions.def (original) +++ python/trunk/Lib/idlelib/config-extensions.def Fri May 29 03:36:26 2009 @@ -86,3 +86,9 @@ fgcolor=Black [CodeContext_bindings] toggle-code-context= + +[RstripExtension] +enable=1 +enable_shell=0 +enable_editor=1 + Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri May 29 03:36:26 2009 @@ -309,6 +309,9 @@ - Issue #6048: Now Distutils uses the tarfile module in archive_util. +- Issue #5150: IDLE's format menu now has an option to strip trailing + whitespace. + - Issue #6121: pydoc now ignores leading and trailing spaces in the argument to the 'help' function. From python-checkins at python.org Fri May 29 03:46:49 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 29 May 2009 03:46:49 +0200 (CEST) Subject: [Python-checkins] r73002 - in python/trunk: Doc/library/contextlib.rst Lib/contextlib.py Lib/test/test_contextlib.py Misc/NEWS Message-ID: <20090529014649.27C74D680@mail.python.org> Author: raymond.hettinger Date: Fri May 29 03:46:48 2009 New Revision: 73002 Log: Deprecate contextlib.nested(). The with-statement now provides this functionality directly. Modified: python/trunk/Doc/library/contextlib.rst python/trunk/Lib/contextlib.py python/trunk/Lib/test/test_contextlib.py python/trunk/Misc/NEWS Modified: python/trunk/Doc/library/contextlib.rst ============================================================================== --- python/trunk/Doc/library/contextlib.rst (original) +++ python/trunk/Doc/library/contextlib.rst Fri May 29 03:46:48 2009 @@ -83,6 +83,8 @@ :meth:`__exit__` methods should avoid raising exceptions, and in particular they should not re-raise a passed-in exception. + .. deprecated:: 2.7 + The with-statement now supports this functionality directly. .. function:: closing(thing) Modified: python/trunk/Lib/contextlib.py ============================================================================== --- python/trunk/Lib/contextlib.py (original) +++ python/trunk/Lib/contextlib.py Fri May 29 03:46:48 2009 @@ -2,6 +2,7 @@ import sys from functools import wraps +from warnings import warn __all__ = ["contextmanager", "nested", "closing"] @@ -101,6 +102,8 @@ """ + warn("With-statements now directly support multiple context managers", + DeprecationWarning, 2) exits = [] vars = [] exc = (None, None, None) Modified: python/trunk/Lib/test/test_contextlib.py ============================================================================== --- python/trunk/Lib/test/test_contextlib.py (original) +++ python/trunk/Lib/test/test_contextlib.py Fri May 29 03:46:48 2009 @@ -9,6 +9,7 @@ import threading from contextlib import * # Tests __all__ from test import test_support +import warnings class ContextManagerTestCase(unittest.TestCase): @@ -331,7 +332,9 @@ # This is needed to make the test actually run under regrtest.py! def test_main(): - test_support.run_unittest(__name__) + with warnings.catch_warnings(): + warnings.simplefilter('ignore') + test_support.run_unittest(__name__) if __name__ == "__main__": test_main() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri May 29 03:46:48 2009 @@ -12,7 +12,8 @@ Core and Builtins ----------------- -- Added support for multiple context managers in the same with statement. +- Added support for multiple context managers in the same with-statement. + Deprecated contextlib.nested() which is no longer needed. - Issue #6101: A new opcode, SETUP_WITH, has been added to speed up the with statement and correctly lookup the __enter__ and __exit__ special methods. From buildbot at python.org Fri May 29 04:11:42 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 29 May 2009 02:11:42 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090529021142.76A5DD5DC@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/772 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Fri May 29 04:57:28 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 29 May 2009 04:57:28 +0200 (CEST) Subject: [Python-checkins] r73003 - in sandbox/trunk/2to3/lib2to3/tests: support.py test_fixers.py Message-ID: <20090529025728.6D9D2D6CD@mail.python.org> Author: benjamin.peterson Date: Fri May 29 04:57:28 2009 New Revision: 73003 Log: make 2to3 test utilities easier to use with other applications (3to2) Patch by Joe Amenta Modified: sandbox/trunk/2to3/lib2to3/tests/support.py sandbox/trunk/2to3/lib2to3/tests/test_fixers.py Modified: sandbox/trunk/2to3/lib2to3/tests/support.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/support.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/support.py Fri May 29 04:57:28 2009 @@ -30,7 +30,7 @@ def reformat(string): return dedent(string) + u"\n\n" -def get_refactorer(fixers=None, options=None): +def get_refactorer(fixer_pkg="lib2to3", fixers=None, options=None): """ A convenience function for creating a RefactoringTool for tests. @@ -39,9 +39,9 @@ be passed to the RefactoringTool. """ if fixers is not None: - fixers = ["lib2to3.fixes.fix_" + fix for fix in fixers] + fixers = [fixer_pkg + ".fixes.fix_" + fix for fix in fixers] else: - fixers = refactor.get_fixers_from_package("lib2to3.fixes") + fixers = refactor.get_fixers_from_package(fixer_pkg + ".fixes") options = options or {} return refactor.RefactoringTool(fixers, options, explicit=True) Modified: sandbox/trunk/2to3/lib2to3/tests/test_fixers.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/test_fixers.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/test_fixers.py Fri May 29 04:57:28 2009 @@ -19,11 +19,14 @@ class FixerTestCase(support.TestCase): - def setUp(self, fix_list=None): + + # Other test cases can subclass this class and replace "fixer_pkg" with + # their own. + def setUp(self, fix_list=None, fixer_pkg="lib2to3"): if fix_list is None: fix_list = [self.fixer] options = {"print_function" : False} - self.refactor = support.get_refactorer(fix_list, options) + self.refactor = support.get_refactorer(fixer_pkg, fix_list, options) self.fixer_log = [] self.filename = u"" @@ -62,7 +65,7 @@ fixes = [self.fixer] fixes.extend(names) options = {"print_function" : False} - r = support.get_refactorer(fixes, options) + r = support.get_refactorer("lib2to3", fixes, options) (pre, post) = r.get_fixers() n = "fix_" + self.fixer if post and post[-1].__class__.__module__.endswith(n): From python-checkins at python.org Fri May 29 05:44:31 2009 From: python-checkins at python.org (jeffrey.yasskin) Date: Fri, 29 May 2009 05:44:31 +0200 (CEST) Subject: [Python-checkins] r73004 - in python/trunk: Mac/Modules/carbonevt/_CarbonEvtmodule.c Mac/Modules/ctl/_Ctlmodule.c Modules/_ssl.c Modules/_struct.c Python/compile.c Message-ID: <20090529034431.9DD67D671@mail.python.org> Author: jeffrey.yasskin Date: Fri May 29 05:44:31 2009 New Revision: 73004 Log: Fix nearly all compilation warnings under Apple gcc-4.0. Tested with OPT="-g -Wall -Wstrict-prototypes -Werror" in both --with-pydebug mode and --without. There's still a batch of non-prototype warnings in Xlib.h that I don't know how to fix. Modified: python/trunk/Mac/Modules/carbonevt/_CarbonEvtmodule.c python/trunk/Mac/Modules/ctl/_Ctlmodule.c python/trunk/Modules/_ssl.c python/trunk/Modules/_struct.c python/trunk/Python/compile.c Modified: python/trunk/Mac/Modules/carbonevt/_CarbonEvtmodule.c ============================================================================== --- python/trunk/Mac/Modules/carbonevt/_CarbonEvtmodule.c (original) +++ python/trunk/Mac/Modules/carbonevt/_CarbonEvtmodule.c Fri May 29 05:44:31 2009 @@ -27,12 +27,6 @@ PyObject *EventRef_New(EventRef itself); /********** EventTypeSpec *******/ -static PyObject* -EventTypeSpec_New(EventTypeSpec *in) -{ - return Py_BuildValue("ll", in->eventClass, in->eventKind); -} - static int EventTypeSpec_Convert(PyObject *v, EventTypeSpec *out) { @@ -67,12 +61,6 @@ /********** EventHotKeyID *******/ -static PyObject* -EventHotKeyID_New(EventHotKeyID *in) -{ - return Py_BuildValue("ll", in->signature, in->id); -} - static int EventHotKeyID_Convert(PyObject *v, EventHotKeyID *out) { Modified: python/trunk/Mac/Modules/ctl/_Ctlmodule.c ============================================================================== --- python/trunk/Mac/Modules/ctl/_Ctlmodule.c (original) +++ python/trunk/Mac/Modules/ctl/_Ctlmodule.c Fri May 29 05:44:31 2009 @@ -1598,7 +1598,7 @@ { PyObject *_res = NULL; OSErr _err; - SInt16 outValue; + UInt16 outValue; #ifndef GetBevelButtonMenuValue PyMac_PRECHECK(GetBevelButtonMenuValue); #endif Modified: python/trunk/Modules/_ssl.c ============================================================================== --- python/trunk/Modules/_ssl.c (original) +++ python/trunk/Modules/_ssl.c Fri May 29 05:44:31 2009 @@ -667,7 +667,7 @@ char buf[2048]; char *vptr; int len; - const unsigned char *p; + unsigned char *p; if (certificate == NULL) return peer_alt_names; Modified: python/trunk/Modules/_struct.c ============================================================================== --- python/trunk/Modules/_struct.c (original) +++ python/trunk/Modules/_struct.c Fri May 29 05:44:31 2009 @@ -182,6 +182,7 @@ /* Same, but handling unsigned long */ +#ifndef PY_STRUCT_OVERFLOW_MASKING static int get_ulong(PyObject *v, unsigned long *p) { @@ -201,6 +202,7 @@ } return 0; } +#endif /* PY_STRUCT_OVERFLOW_MASKING */ #ifdef HAVE_LONG_LONG Modified: python/trunk/Python/compile.c ============================================================================== --- python/trunk/Python/compile.c (original) +++ python/trunk/Python/compile.c Fri May 29 05:44:31 2009 @@ -535,18 +535,6 @@ } -/* Allocate a new "anonymous" local variable. - Used by list comprehensions and with statements. -*/ - -static PyObject * -compiler_new_tmpname(struct compiler *c) -{ - char tmpname[256]; - PyOS_snprintf(tmpname, sizeof(tmpname), "_[%d]", ++c->u->u_tmpname); - return PyString_FromString(tmpname); -} - /* Allocate a new block and return a pointer to it. Returns NULL on error. */ From python-checkins at python.org Fri May 29 06:52:28 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 29 May 2009 06:52:28 +0200 (CEST) Subject: [Python-checkins] r73005 - in python/branches/py3k: Lib/test/test_funcattrs.py Misc/NEWS Objects/funcobject.c Message-ID: <20090529045228.1C071D70C@mail.python.org> Author: raymond.hettinger Date: Fri May 29 06:52:27 2009 New Revision: 73005 Log: Issue 5982: Classmethod and staticmethod expose wrapped function with __func__. Modified: python/branches/py3k/Lib/test/test_funcattrs.py python/branches/py3k/Misc/NEWS python/branches/py3k/Objects/funcobject.c Modified: python/branches/py3k/Lib/test/test_funcattrs.py ============================================================================== --- python/branches/py3k/Lib/test/test_funcattrs.py (original) +++ python/branches/py3k/Lib/test/test_funcattrs.py Fri May 29 06:52:27 2009 @@ -254,11 +254,23 @@ self.assert_(cell(-36) == cell(-36.0)) self.assert_(cell(True) > empty_cell()) +class StaticMethodAttrsTest(unittest.TestCase): + def test_func_attribute(self): + def f(): + pass + + c = classmethod(f) + self.assert_(c.__func__ is f) + + s = staticmethod(f) + self.assert_(s.__func__ is f) + def test_main(): support.run_unittest(FunctionPropertiesTest, ImplicitReferencesTest, ArbitraryFunctionAttrTest, FunctionDictsTest, - FunctionDocstringTest, CellTest) + FunctionDocstringTest, CellTest, + StaticMethodAttrsTest) if __name__ == "__main__": test_main() Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri May 29 06:52:27 2009 @@ -15,6 +15,9 @@ - Issue #6089: Fixed str.format with certain invalid field specifiers that would raise SystemError. +- Issue #5982: staticmethod and classmethod now expose the wrapped + function with __func__. + - Added support for multiple context managers in the same with-statement. Deprecated contextlib.nested() which is no longer needed. Modified: python/branches/py3k/Objects/funcobject.c ============================================================================== --- python/branches/py3k/Objects/funcobject.c (original) +++ python/branches/py3k/Objects/funcobject.c Fri May 29 06:52:27 2009 @@ -775,6 +775,11 @@ return 0; } +static PyMemberDef cm_memberlist[] = { + {"__func__", T_OBJECT, offsetof(classmethod, cm_callable), READONLY}, + {NULL} /* Sentinel */ +}; + PyDoc_STRVAR(classmethod_doc, "classmethod(function) -> method\n\ \n\ @@ -825,7 +830,7 @@ 0, /* tp_iter */ 0, /* tp_iternext */ 0, /* tp_methods */ - 0, /* tp_members */ + cm_memberlist, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ @@ -925,6 +930,11 @@ return 0; } +static PyMemberDef sm_memberlist[] = { + {"__func__", T_OBJECT, offsetof(staticmethod, sm_callable), READONLY}, + {NULL} /* Sentinel */ +}; + PyDoc_STRVAR(staticmethod_doc, "staticmethod(function) -> method\n\ \n\ @@ -972,7 +982,7 @@ 0, /* tp_iter */ 0, /* tp_iternext */ 0, /* tp_methods */ - 0, /* tp_members */ + sm_memberlist, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ From python-checkins at python.org Fri May 29 06:58:53 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 29 May 2009 06:58:53 +0200 (CEST) Subject: [Python-checkins] r73006 - in python/trunk: Lib/test/test_funcattrs.py Misc/NEWS Objects/funcobject.c Message-ID: <20090529045853.0BFE9D83A@mail.python.org> Author: raymond.hettinger Date: Fri May 29 06:58:52 2009 New Revision: 73006 Log: Issue 5982: Classmethod and staticmethod expose wrapped function with __func__. Modified: python/trunk/Lib/test/test_funcattrs.py python/trunk/Misc/NEWS python/trunk/Objects/funcobject.c Modified: python/trunk/Lib/test/test_funcattrs.py ============================================================================== --- python/trunk/Lib/test/test_funcattrs.py (original) +++ python/trunk/Lib/test/test_funcattrs.py Fri May 29 06:58:52 2009 @@ -273,10 +273,23 @@ self.assertEqual(self.b.__doc__, None) self.assertEqual(self.b.func_doc, None) +class StaticMethodAttrsTest(unittest.TestCase): + def test_func_attribute(self): + def f(): + pass + + c = classmethod(f) + self.assert_(c.__func__ is f) + + s = staticmethod(f) + self.assert_(s.__func__ is f) + + def test_main(): test_support.run_unittest(FunctionPropertiesTest, ImplicitReferencesTest, ArbitraryFunctionAttrTest, FunctionDictsTest, - FunctionDocstringTest) + FunctionDocstringTest, + StaticMethodAttrsTest) if __name__ == "__main__": test_main() Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri May 29 06:58:52 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #5982: staticmethod and classmethod now expose the wrapped + function with __func__. + - Added support for multiple context managers in the same with-statement. Deprecated contextlib.nested() which is no longer needed. Modified: python/trunk/Objects/funcobject.c ============================================================================== --- python/trunk/Objects/funcobject.c (original) +++ python/trunk/Objects/funcobject.c Fri May 29 06:58:52 2009 @@ -669,6 +669,11 @@ return 0; } +static PyMemberDef cm_memberlist[] = { + {"__func__", T_OBJECT, offsetof(classmethod, cm_callable), READONLY}, + {NULL} /* Sentinel */ +}; + PyDoc_STRVAR(classmethod_doc, "classmethod(function) -> method\n\ \n\ @@ -719,7 +724,7 @@ 0, /* tp_iter */ 0, /* tp_iternext */ 0, /* tp_methods */ - 0, /* tp_members */ + cm_memberlist, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ @@ -819,6 +824,11 @@ return 0; } +static PyMemberDef sm_memberlist[] = { + {"__func__", T_OBJECT, offsetof(staticmethod, sm_callable), READONLY}, + {NULL} /* Sentinel */ +}; + PyDoc_STRVAR(staticmethod_doc, "staticmethod(function) -> method\n\ \n\ @@ -866,7 +876,7 @@ 0, /* tp_iter */ 0, /* tp_iternext */ 0, /* tp_methods */ - 0, /* tp_members */ + sm_memberlist, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ From buildbot at python.org Fri May 29 07:18:50 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 29 May 2009 05:18:50 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090529051850.E5F9DD7FC@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/713 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: r.david.murray,raymond.hettinger BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_mailbox make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri May 29 09:02:19 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 29 May 2009 09:02:19 +0200 (CEST) Subject: [Python-checkins] r73007 - peps/trunk/pep-0315.txt Message-ID: <20090529070219.04211D8CA@mail.python.org> Author: raymond.hettinger Date: Fri May 29 09:02:18 2009 New Revision: 73007 Log: Defer PEP 315. Modified: peps/trunk/pep-0315.txt Modified: peps/trunk/pep-0315.txt ============================================================================== --- peps/trunk/pep-0315.txt (original) +++ peps/trunk/pep-0315.txt Fri May 29 09:02:18 2009 @@ -4,7 +4,7 @@ Last-Modified: $Date$ Author: Raymond Hettinger W Isaac Carroll -Status: Draft +Status: Deferred Type: Standards Track Content-Type: text/plain Created: 25-Apr-2003 @@ -24,6 +24,16 @@ Deferred; see http://mail.python.org/pipermail/python-dev/2006-February/060718.html + Subsequent efforts to revive the PEP in April 2009 did not + meet with success because no syntax emerged that could + compete with a while-True and an inner if-break. + + A syntax was found for a basic do-while loop but it found + had little support because the condition was at the top: + + do ... while : + + Motivation From python-checkins at python.org Fri May 29 10:08:07 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 29 May 2009 10:08:07 +0200 (CEST) Subject: [Python-checkins] r73008 - in python/trunk: Lib/distutils/tests/test_bdist_dumb.py Lib/distutils/tests/test_dir_util.py Lib/distutils/tests/test_file_util.py Lib/distutils/tests/test_register.py Misc/NEWS Message-ID: <20090529080807.4EE49D8C9@mail.python.org> Author: tarek.ziade Date: Fri May 29 10:08:07 2009 New Revision: 73008 Log: Fixed #6131: test_modulefinder leaked when run after test_distutils Modified: python/trunk/Lib/distutils/tests/test_bdist_dumb.py python/trunk/Lib/distutils/tests/test_dir_util.py python/trunk/Lib/distutils/tests/test_file_util.py python/trunk/Lib/distutils/tests/test_register.py python/trunk/Misc/NEWS Modified: python/trunk/Lib/distutils/tests/test_bdist_dumb.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_bdist_dumb.py (original) +++ python/trunk/Lib/distutils/tests/test_bdist_dumb.py Fri May 29 10:08:07 2009 @@ -22,16 +22,14 @@ unittest.TestCase): def setUp(self): - support.TempdirManager.setUp(self) - support.LoggingSilencer.setUp(self) + super(BuildDumbTestCase, self).setUp() self.old_location = os.getcwd() self.old_sys_argv = sys.argv[:] def tearDown(self): os.chdir(self.old_location) sys.argv = self.old_sys_argv[:] - support.LoggingSilencer.tearDown(self) - support.TempdirManager.tearDown(self) + super(BuildDumbTestCase, self).tearDown() def test_simple_built(self): Modified: python/trunk/Lib/distutils/tests/test_dir_util.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_dir_util.py (original) +++ python/trunk/Lib/distutils/tests/test_dir_util.py Fri May 29 10:08:07 2009 @@ -18,7 +18,7 @@ self._logs.append(msg) def setUp(self): - support.TempdirManager.setUp(self) + super(DirUtilTestCase, self).setUp() self._logs = [] tmp_dir = self.mkdtemp() self.root_target = os.path.join(tmp_dir, 'deep') @@ -29,7 +29,7 @@ def tearDown(self): log.info = self.old_log - support.TempdirManager.tearDown(self) + super(DirUtilTestCase, self).tearDown() def test_mkpath_remove_tree_verbosity(self): Modified: python/trunk/Lib/distutils/tests/test_file_util.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_file_util.py (original) +++ python/trunk/Lib/distutils/tests/test_file_util.py Fri May 29 10:08:07 2009 @@ -16,7 +16,7 @@ self._logs.append(msg) def setUp(self): - support.TempdirManager.setUp(self) + super(FileUtilTestCase, self).setUp() self._logs = [] self.old_log = log.info log.info = self._log @@ -27,7 +27,7 @@ def tearDown(self): log.info = self.old_log - support.TempdirManager.tearDown(self) + super(FileUtilTestCase, self).tearDown() def test_move_file_verbosity(self): f = open(self.source, 'w') Modified: python/trunk/Lib/distutils/tests/test_register.py ============================================================================== --- python/trunk/Lib/distutils/tests/test_register.py (original) +++ python/trunk/Lib/distutils/tests/test_register.py Fri May 29 10:08:07 2009 @@ -66,7 +66,7 @@ class RegisterTestCase(PyPIRCCommandTestCase): def setUp(self): - PyPIRCCommandTestCase.setUp(self) + super(RegisterTestCase, self).setUp() # patching the password prompt self._old_getpass = getpass.getpass def _getpass(prompt): @@ -78,7 +78,7 @@ def tearDown(self): getpass.getpass = self._old_getpass urllib2.build_opener = self.old_opener - PyPIRCCommandTestCase.tearDown(self) + super(RegisterTestCase, self).tearDown() def _get_cmd(self, metadata=None): if metadata is None: Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri May 29 10:08:07 2009 @@ -311,6 +311,9 @@ Library ------- +- Issue #6131: test_modulefinder leaked when run after test_distutils. + Patch by Hirokazu Yamamoto. + - Issue #6048: Now Distutils uses the tarfile module in archive_util. - Issue #5150: IDLE's format menu now has an option to strip trailing From python-checkins at python.org Fri May 29 10:12:38 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 29 May 2009 10:12:38 +0200 (CEST) Subject: [Python-checkins] r73009 - python/branches/release26-maint Message-ID: <20090529081238.65A54D804@mail.python.org> Author: tarek.ziade Date: Fri May 29 10:12:38 2009 New Revision: 73009 Log: Blocked revisions 73008 via svnmerge ........ r73008 | tarek.ziade | 2009-05-29 10:08:07 +0200 (Fri, 29 May 2009) | 1 line Fixed #6131: test_modulefinder leaked when run after test_distutils ........ Modified: python/branches/release26-maint/ (props changed) From python-checkins at python.org Fri May 29 11:14:04 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Fri, 29 May 2009 11:14:04 +0200 (CEST) Subject: [Python-checkins] r73010 - in python/branches/py3k: Lib/distutils/tests/test_bdist_dumb.py Lib/distutils/tests/test_dir_util.py Lib/distutils/tests/test_file_util.py Lib/distutils/tests/test_register.py Misc/NEWS Message-ID: <20090529091404.EF499D717@mail.python.org> Author: hirokazu.yamamoto Date: Fri May 29 11:14:04 2009 New Revision: 73010 Log: Merged revisions 73008 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r73008 | tarek.ziade | 2009-05-29 17:08:07 +0900 | 1 line Fixed #6131: test_modulefinder leaked when run after test_distutils ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/distutils/tests/test_bdist_dumb.py python/branches/py3k/Lib/distutils/tests/test_dir_util.py python/branches/py3k/Lib/distutils/tests/test_file_util.py python/branches/py3k/Lib/distutils/tests/test_register.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/distutils/tests/test_bdist_dumb.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_bdist_dumb.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_bdist_dumb.py Fri May 29 11:14:04 2009 @@ -22,16 +22,14 @@ unittest.TestCase): def setUp(self): - support.TempdirManager.setUp(self) - support.LoggingSilencer.setUp(self) + super(BuildDumbTestCase, self).setUp() self.old_location = os.getcwd() self.old_sys_argv = sys.argv[:] def tearDown(self): os.chdir(self.old_location) sys.argv = self.old_sys_argv[:] - support.LoggingSilencer.tearDown(self) - support.TempdirManager.tearDown(self) + super(BuildDumbTestCase, self).tearDown() def test_simple_built(self): Modified: python/branches/py3k/Lib/distutils/tests/test_dir_util.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_dir_util.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_dir_util.py Fri May 29 11:14:04 2009 @@ -18,7 +18,7 @@ self._logs.append(msg) def setUp(self): - support.TempdirManager.setUp(self) + super(DirUtilTestCase, self).setUp() self._logs = [] tmp_dir = self.mkdtemp() self.root_target = os.path.join(tmp_dir, 'deep') @@ -29,7 +29,7 @@ def tearDown(self): log.info = self.old_log - support.TempdirManager.tearDown(self) + super(DirUtilTestCase, self).tearDown() def test_mkpath_remove_tree_verbosity(self): Modified: python/branches/py3k/Lib/distutils/tests/test_file_util.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_file_util.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_file_util.py Fri May 29 11:14:04 2009 @@ -16,7 +16,7 @@ self._logs.append(msg) def setUp(self): - support.TempdirManager.setUp(self) + super(FileUtilTestCase, self).setUp() self._logs = [] self.old_log = log.info log.info = self._log @@ -27,7 +27,7 @@ def tearDown(self): log.info = self.old_log - support.TempdirManager.tearDown(self) + super(FileUtilTestCase, self).tearDown() def test_move_file_verbosity(self): f = open(self.source, 'w') Modified: python/branches/py3k/Lib/distutils/tests/test_register.py ============================================================================== --- python/branches/py3k/Lib/distutils/tests/test_register.py (original) +++ python/branches/py3k/Lib/distutils/tests/test_register.py Fri May 29 11:14:04 2009 @@ -66,7 +66,7 @@ class RegisterTestCase(PyPIRCCommandTestCase): def setUp(self): - PyPIRCCommandTestCase.setUp(self) + super(RegisterTestCase, self).setUp() # patching the password prompt self._old_getpass = getpass.getpass def _getpass(prompt): @@ -78,7 +78,7 @@ def tearDown(self): getpass.getpass = self._old_getpass urllib.request.build_opener = self.old_opener - PyPIRCCommandTestCase.tearDown(self) + super(RegisterTestCase, self).tearDown() def _get_cmd(self, metadata=None): if metadata is None: Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri May 29 11:14:04 2009 @@ -693,6 +693,9 @@ Library ------- +- Issue #6131: test_modulefinder leaked when run after test_distutils. + Patch by Hirokazu Yamamoto. + - Issue #6048: Now Distutils uses the tarfile module in archive_util. - Issue #6062: In distutils, fixed the package option of build_ext. Feedback From python-checkins at python.org Fri May 29 11:19:53 2009 From: python-checkins at python.org (hirokazu.yamamoto) Date: Fri, 29 May 2009 11:19:53 +0200 (CEST) Subject: [Python-checkins] r73011 - python/branches/release30-maint Message-ID: <20090529091953.A415BD68F@mail.python.org> Author: hirokazu.yamamoto Date: Fri May 29 11:19:53 2009 New Revision: 73011 Log: Blocked revisions 73010 via svnmerge ................ r73010 | hirokazu.yamamoto | 2009-05-29 18:14:04 +0900 | 9 lines Merged revisions 73008 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r73008 | tarek.ziade | 2009-05-29 17:08:07 +0900 | 1 line Fixed #6131: test_modulefinder leaked when run after test_distutils ........ ................ Modified: python/branches/release30-maint/ (props changed) From buildbot at python.org Fri May 29 12:01:17 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 29 May 2009 10:01:17 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.0 Message-ID: <20090529100117.ED0D3D8CC@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.0/builds/40 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib ====================================================================== ERROR: testAUTH_CRAM_MD5 (test.test_smtplib.SMTPSimTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_smtplib.py", line 479, in testAUTH_CRAM_MD5 self.serv.add_feature("AUTH CRAM-MD5") File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/test/test_smtplib.py", line 373, in add_feature self._SMTPchannel.add_feature(feature) File "/home/buildbot/slave/py-build/3.0.norwitz-amd64/build/Lib/asyncore.py", line 393, in __getattr__ return getattr(self.socket, attr) AttributeError: 'socket' object has no attribute '_SMTPchannel' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri May 29 12:04:52 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 29 May 2009 12:04:52 +0200 (CEST) Subject: [Python-checkins] r73012 - python/branches/release26-maint/Lib/distutils/tests/test_sdist.py Message-ID: <20090529100452.D66A6D84F@mail.python.org> Author: tarek.ziade Date: Fri May 29 12:04:06 2009 New Revision: 73012 Log: using super in distutils' sdistTestCase Modified: python/branches/release26-maint/Lib/distutils/tests/test_sdist.py Modified: python/branches/release26-maint/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/branches/release26-maint/Lib/distutils/tests/test_sdist.py (original) +++ python/branches/release26-maint/Lib/distutils/tests/test_sdist.py Fri May 29 12:04:06 2009 @@ -29,14 +29,14 @@ class sdistTestCase(PyPIRCCommandTestCase): def setUp(self): - PyPIRCCommandTestCase.setUp(self) + super(sdistTestCase, self).setUp() self.old_path = os.getcwd() def tearDown(self): os.chdir(self.old_path) if os.path.exists(TEMP_PKG): shutil.rmtree(TEMP_PKG) - PyPIRCCommandTestCase.tearDown(self) + super(sdistTestCase, self).tearDown() def _init_tmp_pkg(self): if os.path.exists(TEMP_PKG): From python-checkins at python.org Fri May 29 12:23:42 2009 From: python-checkins at python.org (tarek.ziade) Date: Fri, 29 May 2009 12:23:42 +0200 (CEST) Subject: [Python-checkins] r73013 - python/branches/release30-maint/Lib/distutils/tests/test_sdist.py Message-ID: <20090529102342.13585D75D@mail.python.org> Author: tarek.ziade Date: Fri May 29 12:23:41 2009 New Revision: 73013 Log: using super in distutils' sdistTestCase Modified: python/branches/release30-maint/Lib/distutils/tests/test_sdist.py Modified: python/branches/release30-maint/Lib/distutils/tests/test_sdist.py ============================================================================== --- python/branches/release30-maint/Lib/distutils/tests/test_sdist.py (original) +++ python/branches/release30-maint/Lib/distutils/tests/test_sdist.py Fri May 29 12:23:41 2009 @@ -29,14 +29,14 @@ class sdistTestCase(PyPIRCCommandTestCase): def setUp(self): - PyPIRCCommandTestCase.setUp(self) + super(sdistTestCase, self).setUp() self.old_path = os.getcwd() def tearDown(self): os.chdir(self.old_path) if os.path.exists(TEMP_PKG): shutil.rmtree(TEMP_PKG) - PyPIRCCommandTestCase.tearDown(self) + super(sdistTestCase, self).tearDown() def _init_tmp_pkg(self): if os.path.exists(TEMP_PKG): From buildbot at python.org Fri May 29 12:39:58 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 29 May 2009 10:39:58 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090529103958.8DEAAD6E7@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/774 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: hirokazu.yamamoto BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From buildbot at python.org Fri May 29 15:29:18 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 29 May 2009 13:29:18 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090529132918.EE4FBC4F6@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/395 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: tarek.ziade BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_posix test_subprocess ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' ====================================================================== FAIL: test_executable (test.test_subprocess.ProcessTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_subprocess.py", line 115, in test_executable self.assertEqual(p.returncode, 47) AssertionError: -6 != 47 sincerely, -The Buildbot From python-checkins at python.org Fri May 29 16:47:46 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 29 May 2009 16:47:46 +0200 (CEST) Subject: [Python-checkins] r73014 - in python/branches/py3k: Doc/c-api/arg.rst Doc/c-api/unicode.rst Include/modsupport.h Lib/test/test_capi.py Misc/NEWS Modules/_testcapimodule.c Modules/posixmodule.c Objects/unicodeobject.c Python/getargs.c Message-ID: <20090529144746.C0CABD587@mail.python.org> Author: martin.v.loewis Date: Fri May 29 16:47:46 2009 New Revision: 73014 Log: Issue #6012: Add cleanup support to O& argument parsing. Modified: python/branches/py3k/Doc/c-api/arg.rst python/branches/py3k/Doc/c-api/unicode.rst python/branches/py3k/Include/modsupport.h python/branches/py3k/Lib/test/test_capi.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/_testcapimodule.c python/branches/py3k/Modules/posixmodule.c python/branches/py3k/Objects/unicodeobject.c python/branches/py3k/Python/getargs.c Modified: python/branches/py3k/Doc/c-api/arg.rst ============================================================================== --- python/branches/py3k/Doc/c-api/arg.rst (original) +++ python/branches/py3k/Doc/c-api/arg.rst Fri May 29 16:47:46 2009 @@ -250,6 +250,14 @@ the conversion has failed. When the conversion fails, the *converter* function should raise an exception and leave the content of *address* unmodified. + If the *converter* returns Py_CLEANUP_SUPPORTED, it may get called a second time + if the argument parsing eventually fails, giving the converter a chance to release + any memory that it had already allocated. In this second call, the *object* parameter + will be NULL; *address* will have the same value as in the original call. + + .. versionchanged:: 3.1 + Py_CLEANUP_SUPPORTED was added. + ``S`` (string) [PyStringObject \*] Like ``O`` but requires that the Python object is a string object. Raises :exc:`TypeError` if the object is not a string object. The C variable may also Modified: python/branches/py3k/Doc/c-api/unicode.rst ============================================================================== --- python/branches/py3k/Doc/c-api/unicode.rst (original) +++ python/branches/py3k/Doc/c-api/unicode.rst Fri May 29 16:47:46 2009 @@ -379,11 +379,13 @@ parameters encoding and errors have the same semantics as the ones of the builtin unicode() Unicode object constructor. -Setting encoding to *NULL* causes the default encoding to be used which is -ASCII. The file system calls should use :cdata:`Py_FileSystemDefaultEncoding` -as the encoding for file names. This variable should be treated as read-only: On -some systems, it will be a pointer to a static string, on others, it will change -at run-time (such as when the application invokes setlocale). +Setting encoding to *NULL* causes the default encoding to be used +which is ASCII. The file system calls should use +:cfunc:`PyUnicode_FSConverter` for encoding file names. This uses the +variable :cdata:`Py_FileSystemDefaultEncoding` internally. This +variable should be treated as read-only: On some systems, it will be a +pointer to a static string, on others, it will change at run-time +(such as when the application invokes setlocale). Error handling is set by errors which may also be set to *NULL* meaning to use the default handling defined for the codec. Default error handling for all @@ -782,6 +784,19 @@ object. Error handling is "strict". Return *NULL* if an exception was raised by the codec. +For decoding file names and other environment strings, :cdata:`Py_FileSystemEncoding` +should be used as the encoding, and ``"surrogateescape"`` should be used as the error +handler. For encoding file names during argument parsing, the ``O&`` converter should +be used, passsing PyUnicode_FSConverter as the conversion function: + +.. cfunction:: int PyUnicode_FSConverter(PyObject* obj, void* result) + + Convert *obj* into *result*, using the file system encoding, and the ``surrogateescape`` + error handler. *result* must be a ``PyObject*``, yielding a bytes or bytearray object + which must be released if it is no longer used. + + .. versionadded:: 3.1 + .. % --- Methods & Slots ---------------------------------------------------- Modified: python/branches/py3k/Include/modsupport.h ============================================================================== --- python/branches/py3k/Include/modsupport.h (original) +++ python/branches/py3k/Include/modsupport.h Fri May 29 16:47:46 2009 @@ -43,6 +43,8 @@ #define PyModule_AddIntMacro(m, c) PyModule_AddIntConstant(m, #c, c) #define PyModule_AddStringMacro(m, c) PyModule_AddStringConstant(m, #c, c) +#define Py_CLEANUP_SUPPORTED 0x20000 + #define PYTHON_API_VERSION 1013 #define PYTHON_API_STRING "1013" /* The API version is maintained (independently from the Python version) Modified: python/branches/py3k/Lib/test/test_capi.py ============================================================================== --- python/branches/py3k/Lib/test/test_capi.py (original) +++ python/branches/py3k/Lib/test/test_capi.py Fri May 29 16:47:46 2009 @@ -115,6 +115,10 @@ self.pendingcalls_submit(l, n) self.pendingcalls_wait(l, n) +# Bug #6012 +class Test6012(unittest.TestCase): + def test(self): + self.assertEqual(_testcapi.argparsing("Hello", "World"), 1) def test_main(): support.run_unittest(CAPITest) @@ -159,7 +163,7 @@ t.start() t.join() - support.run_unittest(TestPendingCalls) + support.run_unittest(TestPendingCalls, Test6012) if __name__ == "__main__": Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri May 29 16:47:46 2009 @@ -12,6 +12,8 @@ Core and Builtins ----------------- +- Issue #6012: Add cleanup support to O& argument parsing. + - Issue #6089: Fixed str.format with certain invalid field specifiers that would raise SystemError. Modified: python/branches/py3k/Modules/_testcapimodule.c ============================================================================== --- python/branches/py3k/Modules/_testcapimodule.c (original) +++ python/branches/py3k/Modules/_testcapimodule.c Fri May 29 16:47:46 2009 @@ -1415,6 +1415,36 @@ return NULL; } +/* Issue 6012 */ +static PyObject *str1, *str2; +static int +failing_converter(PyObject *obj, void *arg) +{ + /* Clone str1, then let the conversion fail. */ + assert(str1); + str2 = str1; + Py_INCREF(str2); + return 0; +} +static PyObject* +argparsing(PyObject *o, PyObject *args) +{ + PyObject *res; + str1 = str2 = NULL; + if (!PyArg_ParseTuple(args, "O&O&", + PyUnicode_FSConverter, &str1, + failing_converter, &str2)) { + if (!str2) + /* argument converter not called? */ + return NULL; + /* Should be 1 */ + res = PyLong_FromLong(Py_REFCNT(str2)); + Py_DECREF(str2); + PyErr_Clear(); + return res; + } + Py_RETURN_NONE; +} static PyMethodDef TestMethods[] = { {"raise_exception", raise_exception, METH_VARARGS}, @@ -1433,7 +1463,6 @@ PyDoc_STR("This is a pretty normal docstring.")}, {"test_string_to_double", (PyCFunction)test_string_to_double, METH_NOARGS}, {"test_capsule", (PyCFunction)test_capsule, METH_NOARGS}, - {"getargs_tuple", getargs_tuple, METH_VARARGS}, {"getargs_keywords", (PyCFunction)getargs_keywords, METH_VARARGS|METH_KEYWORDS}, @@ -1468,6 +1497,7 @@ #endif {"traceback_print", traceback_print, METH_VARARGS}, {"exception_print", exception_print, METH_VARARGS}, + {"argparsing", argparsing, METH_VARARGS}, {NULL, NULL} /* sentinel */ }; Modified: python/branches/py3k/Modules/posixmodule.c ============================================================================== --- python/branches/py3k/Modules/posixmodule.c (original) +++ python/branches/py3k/Modules/posixmodule.c Fri May 29 16:47:46 2009 @@ -804,8 +804,6 @@ if (!PyArg_ParseTuple(args, format, PyUnicode_FSConverter, &opath1, PyUnicode_FSConverter, &opath2)) { - Py_XDECREF(opath1); - Py_XDECREF(opath2); return NULL; } path1 = bytes2str(opath1, 1); Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Fri May 29 16:47:46 2009 @@ -1539,6 +1539,10 @@ PyObject *output = NULL; Py_ssize_t size; void *data; + if (arg == NULL) { + Py_DECREF(*(PyObject**)addr); + return 1; + } if (PyBytes_Check(arg) || PyByteArray_Check(arg)) { output = arg; Py_INCREF(output); @@ -1573,7 +1577,7 @@ return 0; } *(PyObject**)addr = output; - return 1; + return Py_CLEANUP_SUPPORTED; } Modified: python/branches/py3k/Python/getargs.c ============================================================================== --- python/branches/py3k/Python/getargs.c (original) +++ python/branches/py3k/Python/getargs.c Fri May 29 16:47:46 2009 @@ -141,6 +141,7 @@ #define GETARGS_CAPSULE_NAME_CLEANUP_PTR "getargs.cleanup_ptr" #define GETARGS_CAPSULE_NAME_CLEANUP_BUFFER "getargs.cleanup_buffer" +#define GETARGS_CAPSULE_NAME_CLEANUP_CONVERT "getargs.cleanup_convert" static void cleanup_ptr(PyObject *self) @@ -194,6 +195,46 @@ return 0; } +static void +cleanup_convert(PyObject *self) +{ + typedef int (*destr_t)(PyObject *, void *); + destr_t destr = (destr_t)PyCapsule_GetContext(self); + void *ptr = PyCapsule_GetPointer(self, + GETARGS_CAPSULE_NAME_CLEANUP_CONVERT); + if (ptr && destr) + destr(NULL, ptr); +} + +static int +addcleanup_convert(void *ptr, PyObject **freelist, int (*destr)(PyObject*,void*)) +{ + PyObject *cobj; + if (!*freelist) { + *freelist = PyList_New(0); + if (!*freelist) { + destr(NULL, ptr); + return -1; + } + } + cobj = PyCapsule_New(ptr, GETARGS_CAPSULE_NAME_CLEANUP_CONVERT, + cleanup_convert); + if (!cobj) { + destr(NULL, ptr); + return -1; + } + if (PyCapsule_SetContext(cobj, destr) == -1) { + /* This really should not happen. */ + Py_FatalError("capsule refused setting of context."); + } + if (PyList_Append(*freelist, cobj)) { + Py_DECREF(cobj); /* This will also call destr. */ + return -1; + } + Py_DECREF(cobj); + return 0; +} + static int cleanreturn(int retval, PyObject *freelist) { @@ -1253,10 +1294,15 @@ typedef int (*converter)(PyObject *, void *); converter convert = va_arg(*p_va, converter); void *addr = va_arg(*p_va, void *); + int res; format++; - if (! (*convert)(arg, addr)) + if (! (res = (*convert)(arg, addr))) return converterr("(unspecified)", arg, msgbuf, bufsize); + if (res == Py_CLEANUP_SUPPORTED && + addcleanup_convert(addr, freelist, convert) == -1) + return converterr("(cleanup problem)", + arg, msgbuf, bufsize); } else { p = va_arg(*p_va, PyObject **); From buildbot at python.org Fri May 29 17:12:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 29 May 2009 15:12:34 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090529151234.89850D6D4@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/715 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib ====================================================================== ERROR: testAUTH_CRAM_MD5 (test.test_smtplib.SMTPSimTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_smtplib.py", line 479, in testAUTH_CRAM_MD5 self.serv.add_feature("AUTH CRAM-MD5") File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_smtplib.py", line 373, in add_feature self._SMTPchannel.add_feature(feature) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/asyncore.py", line 393, in __getattr__ return getattr(self.socket, attr) AttributeError: 'socket' object has no attribute '_SMTPchannel' ====================================================================== ERROR: testAUTH_LOGIN (test.test_smtplib.SMTPSimTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_smtplib.py", line 471, in testAUTH_LOGIN self.serv.add_feature("AUTH LOGIN") File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_smtplib.py", line 373, in add_feature self._SMTPchannel.add_feature(feature) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/asyncore.py", line 393, in __getattr__ return getattr(self.socket, attr) AttributeError: 'socket' object has no attribute '_SMTPchannel' ====================================================================== ERROR: testAUTH_PLAIN (test.test_smtplib.SMTPSimTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_smtplib.py", line 456, in testAUTH_PLAIN self.serv.add_feature("AUTH PLAIN") File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/test/test_smtplib.py", line 373, in add_feature self._SMTPchannel.add_feature(feature) File "/home/buildbot/slave/py-build/3.x.norwitz-amd64/build/Lib/asyncore.py", line 393, in __getattr__ return getattr(self.socket, attr) AttributeError: 'socket' object has no attribute '_SMTPchannel' make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri May 29 17:23:18 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 29 May 2009 17:23:18 +0200 (CEST) Subject: [Python-checkins] r73015 - in python/branches/py3k: Misc/ACKS Misc/NEWS Modules/grpmodule.c Modules/pwdmodule.c Modules/spwdmodule.c Message-ID: <20090529152318.28B30D881@mail.python.org> Author: martin.v.loewis Date: Fri May 29 17:23:17 2009 New Revision: 73015 Log: Issue #4859: Implement PEP 383 for pwd, spwd, and grp. Modified: python/branches/py3k/Misc/ACKS python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/grpmodule.c python/branches/py3k/Modules/pwdmodule.c python/branches/py3k/Modules/spwdmodule.c Modified: python/branches/py3k/Misc/ACKS ============================================================================== --- python/branches/py3k/Misc/ACKS (original) +++ python/branches/py3k/Misc/ACKS Fri May 29 17:23:17 2009 @@ -766,6 +766,7 @@ Barry Warsaw Steve Waterbury Bob Watson +David Watson Aaron Watters Henrik Weber Corran Webster Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri May 29 17:23:17 2009 @@ -40,6 +40,8 @@ Library ------- +- Issue #4859: Implement PEP 383 for pwd, spwd, and grp. + - smtplib 'login' and 'cram-md5' login are also fixed (see Issue #5259). - Issue #6121: pydoc now ignores leading and trailing spaces in the Modified: python/branches/py3k/Modules/grpmodule.c ============================================================================== --- python/branches/py3k/Modules/grpmodule.c (original) +++ python/branches/py3k/Modules/grpmodule.c Fri May 29 17:23:17 2009 @@ -46,8 +46,11 @@ Py_DECREF(v); return NULL; } +#define FSDECODE(val) PyUnicode_Decode(val, strlen(val),\ + Py_FileSystemDefaultEncoding,\ + "surrogateescape") for (member = p->gr_mem; *member != NULL; member++) { - PyObject *x = PyUnicode_FromString(*member); + PyObject *x = FSDECODE(*member); if (x == NULL || PyList_Append(w, x) != 0) { Py_XDECREF(x); Py_DECREF(w); @@ -58,13 +61,13 @@ } #define SET(i,val) PyStructSequence_SET_ITEM(v, i, val) - SET(setIndex++, PyUnicode_FromString(p->gr_name)); + SET(setIndex++, FSDECODE(p->gr_name)); #ifdef __VMS SET(setIndex++, Py_None); Py_INCREF(Py_None); #else if (p->gr_passwd) - SET(setIndex++, PyUnicode_FromString(p->gr_passwd)); + SET(setIndex++, FSDECODE(p->gr_passwd)); else { SET(setIndex++, Py_None); Py_INCREF(Py_None); @@ -104,25 +107,28 @@ } static PyObject * -grp_getgrnam(PyObject *self, PyObject *pyo_name) +grp_getgrnam(PyObject *self, PyObject *args) { - PyObject *py_str_name; char *name; struct group *p; + PyObject *arg, *bytes, *retval = NULL; - py_str_name = PyObject_Str(pyo_name); - if (!py_str_name) - return NULL; - name = _PyUnicode_AsString(py_str_name); + if (!PyArg_ParseTuple(args, "U:getgrnam", &arg)) + return NULL; + if ((bytes = PyUnicode_AsEncodedString(arg, Py_FileSystemDefaultEncoding, + "surrogateescape")) == NULL) + return NULL; + if (PyBytes_AsStringAndSize(bytes, &name, NULL) == -1) + goto out; if ((p = getgrnam(name)) == NULL) { PyErr_Format(PyExc_KeyError, "getgrnam(): name not found: %s", name); - Py_DECREF(py_str_name); - return NULL; + goto out; } - - Py_DECREF(py_str_name); - return mkgrent(p); + retval = mkgrent(p); +out: + Py_DECREF(bytes); + return retval; } static PyObject * @@ -152,7 +158,7 @@ "getgrgid(id) -> tuple\n\ Return the group database entry for the given numeric group ID. If\n\ id is not valid, raise KeyError."}, - {"getgrnam", grp_getgrnam, METH_O, + {"getgrnam", grp_getgrnam, METH_VARARGS, "getgrnam(name) -> tuple\n\ Return the group database entry for the given group name. If\n\ name is not valid, raise KeyError."}, Modified: python/branches/py3k/Modules/pwdmodule.c ============================================================================== --- python/branches/py3k/Modules/pwdmodule.c (original) +++ python/branches/py3k/Modules/pwdmodule.c Fri May 29 17:23:17 2009 @@ -49,8 +49,9 @@ sets(PyObject *v, int i, const char* val) { if (val) { - PyObject *o = - PyUnicode_DecodeUnicodeEscape(val, strlen(val), "strict"); + PyObject *o = PyUnicode_Decode(val, strlen(val), + Py_FileSystemDefaultEncoding, + "surrogateescape"); PyStructSequence_SET_ITEM(v, i, o); } else { @@ -129,14 +130,25 @@ { char *name; struct passwd *p; - if (!PyArg_ParseTuple(args, "s:getpwnam", &name)) + PyObject *arg, *bytes, *retval = NULL; + + if (!PyArg_ParseTuple(args, "U:getpwnam", &arg)) + return NULL; + if ((bytes = PyUnicode_AsEncodedString(arg, + Py_FileSystemDefaultEncoding, + "surrogateescape")) == NULL) return NULL; + if (PyBytes_AsStringAndSize(bytes, &name, NULL) == -1) + goto out; if ((p = getpwnam(name)) == NULL) { PyErr_Format(PyExc_KeyError, "getpwnam(): name not found: %s", name); - return NULL; + goto out; } - return mkpwent(p); + retval = mkpwent(p); +out: + Py_DECREF(bytes); + return retval; } #ifdef HAVE_GETPWENT Modified: python/branches/py3k/Modules/spwdmodule.c ============================================================================== --- python/branches/py3k/Modules/spwdmodule.c (original) +++ python/branches/py3k/Modules/spwdmodule.c Fri May 29 17:23:17 2009 @@ -59,9 +59,12 @@ static void sets(PyObject *v, int i, const char* val) { - if (val) - PyStructSequence_SET_ITEM(v, i, PyUnicode_FromString(val)); - else { + if (val) { + PyObject *o = PyUnicode_Decode(val, strlen(val), + Py_FileSystemDefaultEncoding, + "surrogateescape"); + PyStructSequence_SET_ITEM(v, i, o); + } else { PyStructSequence_SET_ITEM(v, i, Py_None); Py_INCREF(Py_None); } @@ -113,13 +116,24 @@ { char *name; struct spwd *p; - if (!PyArg_ParseTuple(args, "s:getspnam", &name)) + PyObject *arg, *bytes, *retval = NULL; + + if (!PyArg_ParseTuple(args, "U:getspnam", &arg)) + return NULL; + if ((bytes = PyUnicode_AsEncodedString(arg, + Py_FileSystemDefaultEncoding, + "surrogateescape")) == NULL) return NULL; + if (PyBytes_AsStringAndSize(bytes, &name, NULL) == -1) + goto out; if ((p = getspnam(name)) == NULL) { PyErr_SetString(PyExc_KeyError, "getspnam(): name not found"); - return NULL; + goto out; } - return mkspent(p); + retval = mkspent(p); +out: + Py_DECREF(bytes); + return retval; } #endif /* HAVE_GETSPNAM */ From buildbot at python.org Fri May 29 17:36:19 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 29 May 2009 15:36:19 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090529153619.52671D6EC@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/833 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Fri May 29 17:58:08 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 29 May 2009 17:58:08 +0200 (CEST) Subject: [Python-checkins] r73016 - in python/trunk: Misc/NEWS Modules/grpmodule.c Modules/pwdmodule.c Message-ID: <20090529155808.56356D6D8@mail.python.org> Author: martin.v.loewis Date: Fri May 29 17:58:08 2009 New Revision: 73016 Log: Issue #4873: Fix resource leaks in error cases of pwd and grp. Modified: python/trunk/Misc/NEWS python/trunk/Modules/grpmodule.c python/trunk/Modules/pwdmodule.c Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri May 29 17:58:08 2009 @@ -1067,6 +1067,8 @@ Extension Modules ----------------- +- Issue #4873: Fix resource leaks in error cases of pwd and grp. + - Issue #4751: For hashlib algorithms provided by OpenSSL, the Python GIL is now released during computation on data lengths >= 2048 bytes. Modified: python/trunk/Modules/grpmodule.c ============================================================================== --- python/trunk/Modules/grpmodule.c (original) +++ python/trunk/Modules/grpmodule.c Fri May 29 17:58:08 2009 @@ -76,7 +76,6 @@ if (PyErr_Occurred()) { Py_DECREF(v); - Py_DECREF(w); return NULL; } @@ -139,6 +138,7 @@ if (v == NULL || PyList_Append(d, v) != 0) { Py_XDECREF(v); Py_DECREF(d); + endgrent(); return NULL; } Py_DECREF(v); Modified: python/trunk/Modules/pwdmodule.c ============================================================================== --- python/trunk/Modules/pwdmodule.c (original) +++ python/trunk/Modules/pwdmodule.c Fri May 29 17:58:08 2009 @@ -160,6 +160,7 @@ if (v == NULL || PyList_Append(d, v) != 0) { Py_XDECREF(v); Py_DECREF(d); + endpwent(); return NULL; } Py_DECREF(v); From python-checkins at python.org Fri May 29 18:00:23 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 29 May 2009 18:00:23 +0200 (CEST) Subject: [Python-checkins] r73017 - in python/branches/release26-maint: Misc/NEWS Modules/grpmodule.c Modules/pwdmodule.c Message-ID: <20090529160023.EC25FD7E2@mail.python.org> Author: martin.v.loewis Date: Fri May 29 18:00:23 2009 New Revision: 73017 Log: Merged revisions 73016 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r73016 | martin.v.loewis | 2009-05-29 17:58:08 +0200 (Fr, 29 Mai 2009) | 2 lines Issue #4873: Fix resource leaks in error cases of pwd and grp. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Modules/grpmodule.c python/branches/release26-maint/Modules/pwdmodule.c Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Fri May 29 18:00:23 2009 @@ -108,6 +108,11 @@ makeunicodedata.py and regenerated the Unicode database (This fixes u'\u1d79'.lower() == '\x00'). +Extension Modules +----------------- + +- Issue #4873: Fix resource leaks in error cases of pwd and grp. + Build ----- Modified: python/branches/release26-maint/Modules/grpmodule.c ============================================================================== --- python/branches/release26-maint/Modules/grpmodule.c (original) +++ python/branches/release26-maint/Modules/grpmodule.c Fri May 29 18:00:23 2009 @@ -76,7 +76,6 @@ if (PyErr_Occurred()) { Py_DECREF(v); - Py_DECREF(w); return NULL; } @@ -139,6 +138,7 @@ if (v == NULL || PyList_Append(d, v) != 0) { Py_XDECREF(v); Py_DECREF(d); + endgrent(); return NULL; } Py_DECREF(v); Modified: python/branches/release26-maint/Modules/pwdmodule.c ============================================================================== --- python/branches/release26-maint/Modules/pwdmodule.c (original) +++ python/branches/release26-maint/Modules/pwdmodule.c Fri May 29 18:00:23 2009 @@ -160,6 +160,7 @@ if (v == NULL || PyList_Append(d, v) != 0) { Py_XDECREF(v); Py_DECREF(d); + endpwent(); return NULL; } Py_DECREF(v); From python-checkins at python.org Fri May 29 18:01:34 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 29 May 2009 18:01:34 +0200 (CEST) Subject: [Python-checkins] r73018 - in python/branches/py3k: Misc/NEWS Modules/grpmodule.c Modules/pwdmodule.c Message-ID: <20090529160134.D635AD78F@mail.python.org> Author: martin.v.loewis Date: Fri May 29 18:01:34 2009 New Revision: 73018 Log: Merged revisions 73016 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r73016 | martin.v.loewis | 2009-05-29 17:58:08 +0200 (Fr, 29 Mai 2009) | 2 lines Issue #4873: Fix resource leaks in error cases of pwd and grp. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/grpmodule.c python/branches/py3k/Modules/pwdmodule.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri May 29 18:01:34 2009 @@ -108,6 +108,8 @@ Extension Modules ----------------- +- Issue #4873: Fix resource leaks in error cases of pwd and grp. + - Issue #6093: Fix off-by-one error in locale.strxfrm. - The _functools and _locale modules are now built into the libpython shared Modified: python/branches/py3k/Modules/grpmodule.c ============================================================================== --- python/branches/py3k/Modules/grpmodule.c (original) +++ python/branches/py3k/Modules/grpmodule.c Fri May 29 18:01:34 2009 @@ -79,7 +79,6 @@ if (PyErr_Occurred()) { Py_DECREF(v); - Py_DECREF(w); return NULL; } @@ -145,6 +144,7 @@ if (v == NULL || PyList_Append(d, v) != 0) { Py_XDECREF(v); Py_DECREF(d); + endgrent(); return NULL; } Py_DECREF(v); Modified: python/branches/py3k/Modules/pwdmodule.c ============================================================================== --- python/branches/py3k/Modules/pwdmodule.c (original) +++ python/branches/py3k/Modules/pwdmodule.c Fri May 29 18:01:34 2009 @@ -175,6 +175,7 @@ if (v == NULL || PyList_Append(d, v) != 0) { Py_XDECREF(v); Py_DECREF(d); + endpwent(); return NULL; } Py_DECREF(v); From python-checkins at python.org Fri May 29 18:05:09 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 29 May 2009 18:05:09 +0200 (CEST) Subject: [Python-checkins] r73019 - in python/branches/release30-maint: Misc/NEWS Modules/grpmodule.c Modules/pwdmodule.c Message-ID: <20090529160509.0C023D427@mail.python.org> Author: martin.v.loewis Date: Fri May 29 18:05:08 2009 New Revision: 73019 Log: Merged revisions 73018 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r73018 | martin.v.loewis | 2009-05-29 18:01:34 +0200 (Fr, 29 Mai 2009) | 9 lines Merged revisions 73016 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r73016 | martin.v.loewis | 2009-05-29 17:58:08 +0200 (Fr, 29 Mai 2009) | 2 lines Issue #4873: Fix resource leaks in error cases of pwd and grp. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Misc/NEWS python/branches/release30-maint/Modules/grpmodule.c python/branches/release30-maint/Modules/pwdmodule.c Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Fri May 29 18:05:08 2009 @@ -180,6 +180,8 @@ Extension Modules ----------------- +- Issue #4873: Fix resource leaks in error cases of pwd and grp. + - Issue #6093: Fix off-by-one error in locale.strxfrm. Build Modified: python/branches/release30-maint/Modules/grpmodule.c ============================================================================== --- python/branches/release30-maint/Modules/grpmodule.c (original) +++ python/branches/release30-maint/Modules/grpmodule.c Fri May 29 18:05:08 2009 @@ -76,7 +76,6 @@ if (PyErr_Occurred()) { Py_DECREF(v); - Py_DECREF(w); return NULL; } @@ -139,6 +138,7 @@ if (v == NULL || PyList_Append(d, v) != 0) { Py_XDECREF(v); Py_DECREF(d); + endgrent(); return NULL; } Py_DECREF(v); Modified: python/branches/release30-maint/Modules/pwdmodule.c ============================================================================== --- python/branches/release30-maint/Modules/pwdmodule.c (original) +++ python/branches/release30-maint/Modules/pwdmodule.c Fri May 29 18:05:08 2009 @@ -163,6 +163,7 @@ if (v == NULL || PyList_Append(d, v) != 0) { Py_XDECREF(v); Py_DECREF(d); + endpwent(); return NULL; } Py_DECREF(v); From buildbot at python.org Fri May 29 18:17:31 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 29 May 2009 16:17:31 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090529161731.52A25D7AE@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/776 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_capi test_import test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Fri May 29 18:22:26 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 29 May 2009 18:22:26 +0200 (CEST) Subject: [Python-checkins] r73020 - in python/branches/py3k: Misc/NEWS Modules/python.c Message-ID: <20090529162226.31397D6B2@mail.python.org> Author: martin.v.loewis Date: Fri May 29 18:22:26 2009 New Revision: 73020 Log: Issue #6097: Escape UTF-8 surrogates resulting from mbstocs conversion of the command line. Modified: python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/python.c Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Fri May 29 18:22:26 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #6097: Escape UTF-8 surrogates resulting from mbstocs conversion + of the command line. + - Issue #6012: Add cleanup support to O& argument parsing. - Issue #6089: Fixed str.format with certain invalid field specifiers Modified: python/branches/py3k/Modules/python.c ============================================================================== --- python/branches/py3k/Modules/python.c (original) +++ python/branches/py3k/Modules/python.c Fri May 29 18:22:26 2009 @@ -38,8 +38,16 @@ if (!res) goto oom; count = mbstowcs(res, arg, argsize+1); - if (count != (size_t)-1) - return res; + if (count != (size_t)-1) { + wchar_t *tmp; + /* Only use the result if it contains no + surrogate characters. */ + for (tmp = res; *tmp != 0 && + (*tmp < 0xd800 || *tmp > 0xdfff); tmp++) + ; + if (*tmp == 0) + return res; + } PyMem_Free(res); } /* Conversion failed. Fall back to escaping with surrogateescape. */ @@ -75,6 +83,14 @@ memset(&mbs, 0, sizeof mbs); continue; } + if (*out >= 0xd800 && *out <= 0xdfff) { + /* Surrogate character. Escape the original + byte sequence with surrogateescape. */ + argsize -= converted; + while (converted--) + *out++ = 0xdc00 + *in++; + continue; + } /* successfully converted some bytes */ in += converted; argsize -= converted; From buildbot at python.org Fri May 29 18:47:25 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 29 May 2009 16:47:25 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo 3.x Message-ID: <20090529164725.3284ED6EA@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%203.x/builds/718 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_smtplib make: *** [buildbottest] Error 1 sincerely, -The Buildbot From python-checkins at python.org Fri May 29 19:25:40 2009 From: python-checkins at python.org (martin.v.loewis) Date: Fri, 29 May 2009 19:25:40 +0200 (CEST) Subject: [Python-checkins] r73021 - in python/branches/py3k: configure configure.in pyconfig.h.in Message-ID: <20090529172540.70074D7B5@mail.python.org> Author: martin.v.loewis Date: Fri May 29 19:25:39 2009 New Revision: 73021 Log: Issue 5562: check for wcsftime. Modified: python/branches/py3k/configure python/branches/py3k/configure.in python/branches/py3k/pyconfig.h.in Modified: python/branches/py3k/configure ============================================================================== --- python/branches/py3k/configure (original) +++ python/branches/py3k/configure Fri May 29 19:25:39 2009 @@ -1,12 +1,12 @@ #! /bin/sh -# From configure.in Revision: 72874 . +# From configure.in Revision: 72899 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for python 3.1. +# Generated by GNU Autoconf 2.61 for python 3.1. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -18,7 +18,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -40,45 +40,17 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. @@ -94,6 +66,8 @@ # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) +as_nl=' +' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -116,7 +90,7 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -129,10 +103,17 @@ PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -154,7 +135,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -180,7 +161,7 @@ as_have_required=no fi - if test $as_have_required = yes && (eval ": + if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } @@ -262,7 +243,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -283,7 +264,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -363,10 +344,10 @@ if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi @@ -435,10 +416,9 @@ test \$exitcode = 0") || { echo No shell found that supports shell functions. - echo Please tell bug-autoconf at gnu.org about your system, - echo including any error possibly output before this message. - echo This can help us improve future autoconf versions. - echo Configuration will now proceed without shell functions. + echo Please tell autoconf at gnu.org about your system, + echo including any error possibly output before this + echo message } @@ -474,7 +454,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -502,6 +482,7 @@ *) ECHO_N='-n';; esac + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -514,22 +495,19 @@ rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null + mkdir conf$$.dir fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln else as_ln_s='cp -p' fi @@ -554,10 +532,10 @@ as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -638,157 +616,125 @@ # include #endif" -ac_subst_vars='LTLIBOBJS -SRCDIRS -THREADHEADERS -LIBC -LIBM -HAVE_GETHOSTBYNAME -HAVE_GETHOSTBYNAME_R -HAVE_GETHOSTBYNAME_R_3_ARG -HAVE_GETHOSTBYNAME_R_5_ARG -HAVE_GETHOSTBYNAME_R_6_ARG -LIBOBJS -TRUE -MACHDEP_OBJS -DYNLOADFILE -DLINCLDIR -THREADOBJ -LDLAST -USE_THREAD_MODULE -SIGNAL_OBJS -USE_SIGNAL_MODULE -SHLIBS -CFLAGSFORSHARED -LINKFORSHARED -CCSHARED -BLDSHARED -LDSHARED -SO -LIBTOOL_CRUFT -OTHER_LIBTOOL_OPT -UNIVERSAL_ARCH_FLAGS -BASECFLAGS -OPT -LN -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -SVNVERSION -ARFLAGS -AR -RANLIB -GNULD -LINKCC -RUNSHARED -INSTSONAME -LDLIBRARYDIR -BLDLIBRARY -DLLLIBRARY -LDLIBRARY -LIBRARY -BUILDEXEEXT -EGREP -GREP -CPP -MAINCC -CXX -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -EXPORT_MACOSX_DEPLOYMENT_TARGET -CONFIGURE_MACOSX_DEPLOYMENT_TARGET -SGI_ABI -MACHDEP -FRAMEWORKUNIXTOOLSPREFIX -FRAMEWORKALTINSTALLLAST -FRAMEWORKALTINSTALLFIRST -FRAMEWORKINSTALLLAST -FRAMEWORKINSTALLFIRST -PYTHONFRAMEWORKINSTALLDIR -PYTHONFRAMEWORKPREFIX -PYTHONFRAMEWORKDIR -PYTHONFRAMEWORKIDENTIFIER -PYTHONFRAMEWORK -ARCH_RUN_32BIT -UNIVERSALSDK -CONFIG_ARGS -SOVERSION -VERSION -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME +ac_subst_vars='SHELL PATH_SEPARATOR -SHELL' +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +VERSION +SOVERSION +CONFIG_ARGS +UNIVERSALSDK +ARCH_RUN_32BIT +PYTHONFRAMEWORK +PYTHONFRAMEWORKIDENTIFIER +PYTHONFRAMEWORKDIR +PYTHONFRAMEWORKPREFIX +PYTHONFRAMEWORKINSTALLDIR +FRAMEWORKINSTALLFIRST +FRAMEWORKINSTALLLAST +FRAMEWORKALTINSTALLFIRST +FRAMEWORKALTINSTALLLAST +FRAMEWORKUNIXTOOLSPREFIX +MACHDEP +SGI_ABI +CONFIGURE_MACOSX_DEPLOYMENT_TARGET +EXPORT_MACOSX_DEPLOYMENT_TARGET +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +CXX +MAINCC +CPP +GREP +EGREP +BUILDEXEEXT +LIBRARY +LDLIBRARY +DLLLIBRARY +BLDLIBRARY +LDLIBRARYDIR +INSTSONAME +RUNSHARED +LINKCC +GNULD +RANLIB +AR +ARFLAGS +SVNVERSION +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +LN +OPT +BASECFLAGS +UNIVERSAL_ARCH_FLAGS +OTHER_LIBTOOL_OPT +LIBTOOL_CRUFT +SO +LDSHARED +BLDSHARED +CCSHARED +LINKFORSHARED +CFLAGSFORSHARED +SHLIBS +USE_SIGNAL_MODULE +SIGNAL_OBJS +USE_THREAD_MODULE +LDLAST +THREADOBJ +DLINCLDIR +DYNLOADFILE +MACHDEP_OBJS +TRUE +LIBOBJS +HAVE_GETHOSTBYNAME_R_6_ARG +HAVE_GETHOSTBYNAME_R_5_ARG +HAVE_GETHOSTBYNAME_R_3_ARG +HAVE_GETHOSTBYNAME_R +HAVE_GETHOSTBYNAME +LIBM +LIBC +THREADHEADERS +SRCDIRS +LTLIBOBJS' ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_universalsdk -with_universal_archs -with_framework_name -enable_framework -with_gcc -with_cxx_main -with_suffix -enable_shared -enable_profiling -with_pydebug -with_libs -with_system_ffi -with_dbmliborder -with_signal_module -with_dec_threads -with_threads -with_thread -with_pth -enable_ipv6 -with_doc_strings -with_tsc -with_pymalloc -with_wctype_functions -with_fpectl -with_libm -with_libc -enable_big_digits -with_wide_unicode -with_computed_gotos -' ac_precious_vars='build_alias host_alias target_alias @@ -803,8 +749,6 @@ # Initialize some variables set by options. ac_init_help= ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -903,21 +847,13 @@ datarootdir=$ac_optarg ;; -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; @@ -930,21 +866,13 @@ dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -1135,38 +1063,22 @@ ac_init_version=: ;; -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -1186,7 +1098,7 @@ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { $as_echo "$as_me: error: unrecognized option: $ac_option + -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -1195,16 +1107,16 @@ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -1213,38 +1125,22 @@ if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { $as_echo "$as_me: error: missing argument to $ac_option" >&2 + { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 - { (exit 1); exit 1; }; } ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. +# Be sure to have absolute directory names. 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 do eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done @@ -1259,7 +1155,7 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -1275,10 +1171,10 @@ ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { $as_echo "$as_me: error: working directory cannot be determined" >&2 + { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 + { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } @@ -1286,12 +1182,12 @@ if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | + ac_confdir=`$as_dirname -- "$0" || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1318,12 +1214,12 @@ fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. @@ -1372,9 +1268,9 @@ Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -1384,25 +1280,25 @@ For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --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] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/python] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --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] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/python] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1416,7 +1312,6 @@ cat <<\_ACEOF Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-universalsdk[=SDKDIR] @@ -1490,17 +1385,15 @@ if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue + test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1536,7 +1429,7 @@ echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1546,10 +1439,10 @@ if $ac_init_version; then cat <<\_ACEOF python configure 3.1 -generated by GNU Autoconf 2.63 +generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1560,7 +1453,7 @@ running configure, to aid debugging if configure makes a mistake. It was created by python $as_me 3.1, which was -generated by GNU Autoconf 2.63. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1596,7 +1489,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + echo "PATH: $as_dir" done IFS=$as_save_IFS @@ -1631,7 +1524,7 @@ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; @@ -1683,12 +1576,11 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -1718,9 +1610,9 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + echo "$ac_var='\''$ac_val'\''" done | sort echo @@ -1735,9 +1627,9 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1753,8 +1645,8 @@ echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -1796,24 +1688,21 @@ # Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE +# Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + set x "$prefix/share/config.site" "$prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" +shift +for ac_site_file do - test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then - { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi @@ -1823,16 +1712,16 @@ # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1846,38 +1735,29 @@ eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1887,12 +1767,10 @@ fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi @@ -2034,20 +1912,20 @@ UNIVERSAL_ARCHS="32-bit" -{ $as_echo "$as_me:$LINENO: checking for --with-universal-archs" >&5 -$as_echo_n "checking for --with-universal-archs... " >&6; } +{ echo "$as_me:$LINENO: checking for --with-universal-archs" >&5 +echo $ECHO_N "checking for --with-universal-archs... $ECHO_C" >&6; } # Check whether --with-universal-archs was given. if test "${with_universal_archs+set}" = set; then withval=$with_universal_archs; - { $as_echo "$as_me:$LINENO: result: $withval" >&5 -$as_echo "$withval" >&6; } + { echo "$as_me:$LINENO: result: $withval" >&5 +echo "${ECHO_T}$withval" >&6; } UNIVERSAL_ARCHS="$withval" else - { $as_echo "$as_me:$LINENO: result: 32-bit" >&5 -$as_echo "32-bit" >&6; } + { echo "$as_me:$LINENO: result: 32-bit" >&5 +echo "${ECHO_T}32-bit" >&6; } fi @@ -2169,8 +2047,8 @@ ## # Set name for machine-dependent library files -{ $as_echo "$as_me:$LINENO: checking MACHDEP" >&5 -$as_echo_n "checking MACHDEP... " >&6; } +{ echo "$as_me:$LINENO: checking MACHDEP" >&5 +echo $ECHO_N "checking MACHDEP... $ECHO_C" >&6; } if test -z "$MACHDEP" then ac_sys_system=`uname -s` @@ -2333,8 +2211,8 @@ LDFLAGS="$SGI_ABI $LDFLAGS" MACHDEP=`echo "${MACHDEP}${SGI_ABI}" | sed 's/ *//g'` fi -{ $as_echo "$as_me:$LINENO: result: $MACHDEP" >&5 -$as_echo "$MACHDEP" >&6; } +{ echo "$as_me:$LINENO: result: $MACHDEP" >&5 +echo "${ECHO_T}$MACHDEP" >&6; } # Record the configure-time value of MACOSX_DEPLOYMENT_TARGET, # it may influence the way we can build extensions, so distutils @@ -2344,11 +2222,11 @@ CONFIGURE_MACOSX_DEPLOYMENT_TARGET= EXPORT_MACOSX_DEPLOYMENT_TARGET='#' -{ $as_echo "$as_me:$LINENO: checking machine type as reported by uname -m" >&5 -$as_echo_n "checking machine type as reported by uname -m... " >&6; } +{ echo "$as_me:$LINENO: checking machine type as reported by uname -m" >&5 +echo $ECHO_N "checking machine type as reported by uname -m... $ECHO_C" >&6; } ac_sys_machine=`uname -m` -{ $as_echo "$as_me:$LINENO: result: $ac_sys_machine" >&5 -$as_echo "$ac_sys_machine" >&6; } +{ echo "$as_me:$LINENO: result: $ac_sys_machine" >&5 +echo "${ECHO_T}$ac_sys_machine" >&6; } # checks for alternative programs @@ -2360,8 +2238,8 @@ # XXX shouldn't some/most/all of this code be merged with the stuff later # on that fiddles with OPT and BASECFLAGS? -{ $as_echo "$as_me:$LINENO: checking for --without-gcc" >&5 -$as_echo_n "checking for --without-gcc... " >&6; } +{ echo "$as_me:$LINENO: checking for --without-gcc" >&5 +echo $ECHO_N "checking for --without-gcc... $ECHO_C" >&6; } # Check whether --with-gcc was given. if test "${with_gcc+set}" = set; then @@ -2386,15 +2264,15 @@ esac fi -{ $as_echo "$as_me:$LINENO: result: $without_gcc" >&5 -$as_echo "$without_gcc" >&6; } +{ echo "$as_me:$LINENO: result: $without_gcc" >&5 +echo "${ECHO_T}$without_gcc" >&6; } # If the user switches compilers, we can't believe the cache if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC" then - { { $as_echo "$as_me:$LINENO: error: cached CC is different -- throw away $cache_file + { { echo "$as_me:$LINENO: error: cached CC is different -- throw away $cache_file (it is also a good idea to do 'make clean' before compiling)" >&5 -$as_echo "$as_me: error: cached CC is different -- throw away $cache_file +echo "$as_me: error: cached CC is different -- throw away $cache_file (it is also a good idea to do 'make clean' before compiling)" >&2;} { (exit 1); exit 1; }; } fi @@ -2407,10 +2285,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2423,7 +2301,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2434,11 +2312,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2447,10 +2325,10 @@ ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2463,7 +2341,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2474,11 +2352,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2486,8 +2364,12 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$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;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2500,10 +2382,10 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2516,7 +2398,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2527,11 +2409,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2540,10 +2422,10 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2561,7 +2443,7 @@ continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2584,11 +2466,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2599,10 +2481,10 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2615,7 +2497,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2626,11 +2508,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2643,10 +2525,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2659,7 +2541,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2670,11 +2552,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2686,8 +2568,12 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$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;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2697,50 +2583,44 @@ fi -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 -$as_echo "$as_me: error: no acceptable C compiler found in \$PATH +echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } # Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF @@ -2759,22 +2639,27 @@ } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done @@ -2785,11 +2670,10 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' @@ -2800,7 +2684,7 @@ do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most @@ -2827,27 +2711,25 @@ ac_file='' fi -{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C compiler cannot create executables +echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then @@ -2856,53 +2738,49 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run C compiled programs. +echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi fi fi -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } -{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will @@ -2911,33 +2789,31 @@ for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext -{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2960,43 +2836,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile +echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3022,21 +2895,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -3046,19 +2918,15 @@ ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes @@ -3085,21 +2953,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" @@ -3124,21 +2991,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag @@ -3164,21 +3030,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3193,8 +3058,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3210,10 +3075,10 @@ CFLAGS= fi fi -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC @@ -3284,21 +3149,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3314,15 +3178,15 @@ # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac @@ -3335,8 +3199,8 @@ -{ $as_echo "$as_me:$LINENO: checking for --with-cxx-main=" >&5 -$as_echo_n "checking for --with-cxx-main=... " >&6; } +{ echo "$as_me:$LINENO: checking for --with-cxx-main=" >&5 +echo $ECHO_N "checking for --with-cxx-main=... $ECHO_C" >&6; } # Check whether --with-cxx_main was given. if test "${with_cxx_main+set}" = set; then @@ -3361,8 +3225,8 @@ fi -{ $as_echo "$as_me:$LINENO: result: $with_cxx_main" >&5 -$as_echo "$with_cxx_main" >&6; } +{ echo "$as_me:$LINENO: result: $with_cxx_main" >&5 +echo "${ECHO_T}$with_cxx_main" >&6; } preset_cxx="$CXX" if test -z "$CXX" @@ -3370,10 +3234,10 @@ case "$CC" in gcc) # Extract the first word of "g++", so it can be a program name with args. set dummy g++; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_CXX+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CXX in [\\/]* | ?:[\\/]*) @@ -3388,7 +3252,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3401,20 +3265,20 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { $as_echo "$as_me:$LINENO: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi ;; cc) # Extract the first word of "c++", so it can be a program name with args. set dummy c++; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_CXX+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CXX in [\\/]* | ?:[\\/]*) @@ -3429,7 +3293,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CXX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3442,11 +3306,11 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - { $as_echo "$as_me:$LINENO: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi ;; @@ -3462,10 +3326,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CXX+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. @@ -3478,7 +3342,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3489,11 +3353,11 @@ fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:$LINENO: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + { echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -3508,12 +3372,12 @@ fi if test "$preset_cxx" != "$CXX" then - { $as_echo "$as_me:$LINENO: WARNING: + { echo "$as_me:$LINENO: WARNING: By default, distutils will build C++ extension modules with \"$CXX\". If this is not intended, then set CXX on the configure command line. " >&5 -$as_echo "$as_me: WARNING: +echo "$as_me: WARNING: By default, distutils will build C++ extension modules with \"$CXX\". If this is not intended, then set CXX on the configure command line. @@ -3528,15 +3392,15 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -3568,21 +3432,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3606,14 +3469,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3621,7 +3483,7 @@ # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3646,8 +3508,8 @@ else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3675,21 +3537,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3713,14 +3574,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3728,7 +3588,7 @@ # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3744,13 +3604,11 @@ if $ac_preproc_ok; then : else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi ac_ext=c @@ -3760,37 +3618,42 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 if test "${ac_cv_path_GREP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -z "$GREP"; then ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" + echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3805,60 +3668,74 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - $ac_path_GREP_found && break 3 - done + + $ac_path_GREP_found && break 3 done done + +done IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } - fi +fi + else ac_cv_path_GREP=$GREP fi + fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else - if test -z "$EGREP"; then + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" + echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3873,510 +3750,63 @@ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - $ac_path_EGREP_found && break 3 - done + + $ac_path_EGREP_found && break 3 done done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi done +IFS=$as_save_IFS - - if test "${ac_cv_header_minix_config_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 -$as_echo_n "checking for minix/config.h... " >&6; } -if test "${ac_cv_header_minix_config_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -$as_echo "$ac_cv_header_minix_config_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5 -$as_echo_n "checking minix/config.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5 -$as_echo_n "checking minix/config.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## -------------------------------------- ## -## Report this to http://bugs.python.org/ ## -## -------------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 -$as_echo_n "checking for minix/config.h... " >&6; } -if test "${ac_cv_header_minix_config_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_minix_config_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -$as_echo "$ac_cv_header_minix_config_h" >&6; } - -fi -if test "x$ac_cv_header_minix_config_h" = x""yes; then - MINIX=yes -else - MINIX= -fi - - - if test "$MINIX" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_SOURCE 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_1_SOURCE 2 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _MINIX 1 -_ACEOF - - fi - - - - { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 -$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if test "${ac_cv_safe_to_define___extensions__+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -# define __EXTENSIONS__ 1 - $ac_includes_default -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_safe_to_define___extensions__=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_safe_to_define___extensions__=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 -$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } - test $ac_cv_safe_to_define___extensions__ = yes && - cat >>confdefs.h <<\_ACEOF -#define __EXTENSIONS__ 1 -_ACEOF - cat >>confdefs.h <<\_ACEOF -#define _ALL_SOURCE 1 -_ACEOF +else + ac_cv_path_EGREP=$EGREP +fi - cat >>confdefs.h <<\_ACEOF -#define _GNU_SOURCE 1 -_ACEOF - cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + + +{ echo "$as_me:$LINENO: checking for AIX" >&5 +echo $ECHO_N "checking for AIX... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef _AIX + yes +#endif - cat >>confdefs.h <<\_ACEOF -#define _TANDEM_SOURCE 1 _ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +cat >>confdefs.h <<\_ACEOF +#define _ALL_SOURCE 1 +_ACEOF + +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +rm -f conftest* @@ -4389,8 +3819,8 @@ esac -{ $as_echo "$as_me:$LINENO: checking for --with-suffix" >&5 -$as_echo_n "checking for --with-suffix... " >&6; } +{ echo "$as_me:$LINENO: checking for --with-suffix" >&5 +echo $ECHO_N "checking for --with-suffix... $ECHO_C" >&6; } # Check whether --with-suffix was given. if test "${with_suffix+set}" = set; then @@ -4402,26 +3832,26 @@ esac fi -{ $as_echo "$as_me:$LINENO: result: $EXEEXT" >&5 -$as_echo "$EXEEXT" >&6; } +{ echo "$as_me:$LINENO: result: $EXEEXT" >&5 +echo "${ECHO_T}$EXEEXT" >&6; } # Test whether we're running on a non-case-sensitive system, in which # case we give a warning if no ext is given -{ $as_echo "$as_me:$LINENO: checking for case-insensitive build directory" >&5 -$as_echo_n "checking for case-insensitive build directory... " >&6; } +{ echo "$as_me:$LINENO: checking for case-insensitive build directory" >&5 +echo $ECHO_N "checking for case-insensitive build directory... $ECHO_C" >&6; } if test ! -d CaseSensitiveTestDir; then mkdir CaseSensitiveTestDir fi if test -d casesensitivetestdir then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } BUILDEXEEXT=.exe else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } BUILDEXEEXT=$EXEEXT fi rmdir CaseSensitiveTestDir @@ -4454,14 +3884,14 @@ -{ $as_echo "$as_me:$LINENO: checking LIBRARY" >&5 -$as_echo_n "checking LIBRARY... " >&6; } +{ echo "$as_me:$LINENO: checking LIBRARY" >&5 +echo $ECHO_N "checking LIBRARY... $ECHO_C" >&6; } if test -z "$LIBRARY" then LIBRARY='libpython$(VERSION).a' fi -{ $as_echo "$as_me:$LINENO: result: $LIBRARY" >&5 -$as_echo "$LIBRARY" >&6; } +{ echo "$as_me:$LINENO: result: $LIBRARY" >&5 +echo "${ECHO_T}$LIBRARY" >&6; } # LDLIBRARY is the name of the library to link against (as opposed to the # name of the library into which to insert object files). BLDLIBRARY is also @@ -4496,8 +3926,8 @@ # This is altered for AIX in order to build the export list before # linking. -{ $as_echo "$as_me:$LINENO: checking LINKCC" >&5 -$as_echo_n "checking LINKCC... " >&6; } +{ echo "$as_me:$LINENO: checking LINKCC" >&5 +echo $ECHO_N "checking LINKCC... $ECHO_C" >&6; } if test -z "$LINKCC" then LINKCC='$(PURIFY) $(MAINCC)' @@ -4517,8 +3947,8 @@ LINKCC=qcc;; esac fi -{ $as_echo "$as_me:$LINENO: result: $LINKCC" >&5 -$as_echo "$LINKCC" >&6; } +{ echo "$as_me:$LINENO: result: $LINKCC" >&5 +echo "${ECHO_T}$LINKCC" >&6; } # GNULD is set to "yes" if the GNU linker is used. If this goes wrong # make sure we default having it set to "no": this is used by @@ -4526,8 +3956,8 @@ # to linker command lines, and failing to detect GNU ld simply results # in the same bahaviour as before. -{ $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } +{ echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } ac_prog=ld if test "$GCC" = yes; then ac_prog=`$CC -print-prog-name=ld` @@ -4538,11 +3968,11 @@ *) GNULD=no;; esac -{ $as_echo "$as_me:$LINENO: result: $GNULD" >&5 -$as_echo "$GNULD" >&6; } +{ echo "$as_me:$LINENO: result: $GNULD" >&5 +echo "${ECHO_T}$GNULD" >&6; } -{ $as_echo "$as_me:$LINENO: checking for --enable-shared" >&5 -$as_echo_n "checking for --enable-shared... " >&6; } +{ echo "$as_me:$LINENO: checking for --enable-shared" >&5 +echo $ECHO_N "checking for --enable-shared... $ECHO_C" >&6; } # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then enableval=$enable_shared; @@ -4558,11 +3988,11 @@ enable_shared="no";; esac fi -{ $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } +{ echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6; } -{ $as_echo "$as_me:$LINENO: checking for --enable-profiling" >&5 -$as_echo_n "checking for --enable-profiling... " >&6; } +{ echo "$as_me:$LINENO: checking for --enable-profiling" >&5 +echo $ECHO_N "checking for --enable-profiling... $ECHO_C" >&6; } # Check whether --enable-profiling was given. if test "${enable_profiling+set}" = set; then enableval=$enable_profiling; ac_save_cc="$CC" @@ -4584,32 +4014,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_enable_profiling="yes" else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_enable_profiling="no" fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -4617,8 +4044,8 @@ CC="$ac_save_cc" fi -{ $as_echo "$as_me:$LINENO: result: $ac_enable_profiling" >&5 -$as_echo "$ac_enable_profiling" >&6; } +{ echo "$as_me:$LINENO: result: $ac_enable_profiling" >&5 +echo "${ECHO_T}$ac_enable_profiling" >&6; } case "$ac_enable_profiling" in "yes") @@ -4627,8 +4054,8 @@ ;; esac -{ $as_echo "$as_me:$LINENO: checking LDLIBRARY" >&5 -$as_echo_n "checking LDLIBRARY... " >&6; } +{ echo "$as_me:$LINENO: checking LDLIBRARY" >&5 +echo $ECHO_N "checking LDLIBRARY... $ECHO_C" >&6; } # MacOSX framework builds need more magic. LDLIBRARY is the dynamic # library that we build, but we do not want to link against it (we @@ -4712,16 +4139,16 @@ esac fi -{ $as_echo "$as_me:$LINENO: result: $LDLIBRARY" >&5 -$as_echo "$LDLIBRARY" >&6; } +{ echo "$as_me:$LINENO: result: $LDLIBRARY" >&5 +echo "${ECHO_T}$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:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. @@ -4734,7 +4161,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4745,11 +4172,11 @@ fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -4758,10 +4185,10 @@ 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:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. @@ -4774,7 +4201,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4785,11 +4212,11 @@ fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -4797,8 +4224,12 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$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;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -4812,10 +4243,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AR+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. @@ -4828,7 +4259,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4839,11 +4270,11 @@ fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:$LINENO: result: $AR" >&5 -$as_echo "$AR" >&6; } + { echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -4862,10 +4293,10 @@ # Extract the first word of "svnversion", so it can be a program name with args. set dummy svnversion; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_SVNVERSION+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$SVNVERSION"; then ac_cv_prog_SVNVERSION="$SVNVERSION" # Let the user override the test. @@ -4878,7 +4309,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_SVNVERSION="found" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -4890,11 +4321,11 @@ fi SVNVERSION=$ac_cv_prog_SVNVERSION if test -n "$SVNVERSION"; then - { $as_echo "$as_me:$LINENO: result: $SVNVERSION" >&5 -$as_echo "$SVNVERSION" >&6; } + { echo "$as_me:$LINENO: result: $SVNVERSION" >&5 +echo "${ECHO_T}$SVNVERSION" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -4930,8 +4361,8 @@ fi done if test -z "$ac_aux_dir"; then - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi @@ -4957,12 +4388,11 @@ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -4991,29 +4421,17 @@ # program-specific install script used by HP pwplus--don't use. : else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 fi fi done done ;; esac - done IFS=$as_save_IFS -rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then @@ -5026,8 +4444,8 @@ INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -5049,8 +4467,8 @@ fi # Check for --with-pydebug -{ $as_echo "$as_me:$LINENO: checking for --with-pydebug" >&5 -$as_echo_n "checking for --with-pydebug... " >&6; } +{ echo "$as_me:$LINENO: checking for --with-pydebug" >&5 +echo $ECHO_N "checking for --with-pydebug... $ECHO_C" >&6; } # Check whether --with-pydebug was given. if test "${with_pydebug+set}" = set; then @@ -5062,15 +4480,15 @@ #define Py_DEBUG 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; }; + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; }; Py_DEBUG='true' -else { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; }; Py_DEBUG='false' +else { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; }; Py_DEBUG='false' fi else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -5148,8 +4566,8 @@ # Python violates C99 rules, by casting between incompatible # pointer types. GCC may generate bad code as a result of that, # so use -fno-strict-aliasing if supported. - { $as_echo "$as_me:$LINENO: checking whether $CC accepts -fno-strict-aliasing" >&5 -$as_echo_n "checking whether $CC accepts -fno-strict-aliasing... " >&6; } + { echo "$as_me:$LINENO: checking whether $CC accepts -fno-strict-aliasing" >&5 +echo $ECHO_N "checking whether $CC accepts -fno-strict-aliasing... $ECHO_C" >&6; } ac_save_cc="$CC" CC="$CC -fno-strict-aliasing" if test "$cross_compiling" = yes; then @@ -5169,39 +4587,36 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_no_strict_aliasing_ok=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_no_strict_aliasing_ok=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CC="$ac_save_cc" - { $as_echo "$as_me:$LINENO: result: $ac_cv_no_strict_aliasing_ok" >&5 -$as_echo "$ac_cv_no_strict_aliasing_ok" >&6; } + { echo "$as_me:$LINENO: result: $ac_cv_no_strict_aliasing_ok" >&5 +echo "${ECHO_T}$ac_cv_no_strict_aliasing_ok" >&6; } if test $ac_cv_no_strict_aliasing_ok = yes then BASECFLAGS="$BASECFLAGS -fno-strict-aliasing" @@ -5240,8 +4655,8 @@ ARCH_RUN_32BIT="arch -i386 -ppc" else - { { $as_echo "$as_me:$LINENO: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&5 -$as_echo "$as_me: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&2;} + { { echo "$as_me:$LINENO: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&5 +echo "$as_me: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&2;} { (exit 1); exit 1; }; } fi @@ -5315,10 +4730,10 @@ ac_cv_opt_olimit_ok=no fi -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -OPT:Olimit=0" >&5 -$as_echo_n "checking whether $CC accepts -OPT:Olimit=0... " >&6; } +{ echo "$as_me:$LINENO: checking whether $CC accepts -OPT:Olimit=0" >&5 +echo $ECHO_N "checking whether $CC accepts -OPT:Olimit=0... $ECHO_C" >&6; } if test "${ac_cv_opt_olimit_ok+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cc="$CC" CC="$CC -OPT:Olimit=0" @@ -5339,32 +4754,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_opt_olimit_ok=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_opt_olimit_ok=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5372,8 +4784,8 @@ CC="$ac_save_cc" fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_opt_olimit_ok" >&5 -$as_echo "$ac_cv_opt_olimit_ok" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_opt_olimit_ok" >&5 +echo "${ECHO_T}$ac_cv_opt_olimit_ok" >&6; } if test $ac_cv_opt_olimit_ok = yes; then case $ac_sys_system in # XXX is this branch needed? On MacOSX 10.2.2 the result of the @@ -5386,10 +4798,10 @@ ;; esac else - { $as_echo "$as_me:$LINENO: checking whether $CC accepts -Olimit 1500" >&5 -$as_echo_n "checking whether $CC accepts -Olimit 1500... " >&6; } + { echo "$as_me:$LINENO: checking whether $CC accepts -Olimit 1500" >&5 +echo $ECHO_N "checking whether $CC accepts -Olimit 1500... $ECHO_C" >&6; } if test "${ac_cv_olimit_ok+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cc="$CC" CC="$CC -Olimit 1500" @@ -5410,32 +4822,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_olimit_ok=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_olimit_ok=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5443,8 +4852,8 @@ CC="$ac_save_cc" fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_olimit_ok" >&5 -$as_echo "$ac_cv_olimit_ok" >&6; } + { echo "$as_me:$LINENO: result: $ac_cv_olimit_ok" >&5 +echo "${ECHO_T}$ac_cv_olimit_ok" >&6; } if test $ac_cv_olimit_ok = yes; then BASECFLAGS="$BASECFLAGS -Olimit 1500" fi @@ -5453,8 +4862,8 @@ # Check whether GCC supports PyArg_ParseTuple format if test "$GCC" = "yes" then - { $as_echo "$as_me:$LINENO: checking whether gcc supports ParseTuple __format__" >&5 -$as_echo_n "checking whether gcc supports ParseTuple __format__... " >&6; } + { echo "$as_me:$LINENO: checking whether gcc supports ParseTuple __format__" >&5 +echo $ECHO_N "checking whether gcc supports ParseTuple __format__... $ECHO_C" >&6; } save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -Werror" cat >conftest.$ac_ext <<_ACEOF @@ -5480,14 +4889,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -5497,14 +4905,14 @@ #define HAVE_ATTRIBUTE_FORMAT_PARSETUPLE 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -5517,10 +4925,10 @@ # complain if unaccepted options are passed (e.g. gcc on Mac OS X). # So we have to see first whether pthreads are available without # options before we can check whether -Kpthread improves anything. -{ $as_echo "$as_me:$LINENO: checking whether pthreads are available without options" >&5 -$as_echo_n "checking whether pthreads are available without options... " >&6; } +{ echo "$as_me:$LINENO: checking whether pthreads are available without options" >&5 +echo $ECHO_N "checking whether pthreads are available without options... $ECHO_C" >&6; } if test "${ac_cv_pthread_is_default+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_pthread_is_default=no @@ -5551,21 +4959,19 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_pthread_is_default=yes @@ -5573,14 +4979,13 @@ ac_cv_pthread=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_pthread_is_default=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5588,8 +4993,8 @@ fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_pthread_is_default" >&5 -$as_echo "$ac_cv_pthread_is_default" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_pthread_is_default" >&5 +echo "${ECHO_T}$ac_cv_pthread_is_default" >&6; } if test $ac_cv_pthread_is_default = yes @@ -5601,10 +5006,10 @@ # Some compilers won't report that they do not support -Kpthread, # so we need to run a program to see whether it really made the # function available. -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -Kpthread" >&5 -$as_echo_n "checking whether $CC accepts -Kpthread... " >&6; } +{ echo "$as_me:$LINENO: checking whether $CC accepts -Kpthread" >&5 +echo $ECHO_N "checking whether $CC accepts -Kpthread... $ECHO_C" >&6; } if test "${ac_cv_kpthread+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cc="$CC" CC="$CC -Kpthread" @@ -5637,32 +5042,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_kpthread=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_kpthread=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5670,8 +5072,8 @@ CC="$ac_save_cc" fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_kpthread" >&5 -$as_echo "$ac_cv_kpthread" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_kpthread" >&5 +echo "${ECHO_T}$ac_cv_kpthread" >&6; } fi if test $ac_cv_kpthread = no -a $ac_cv_pthread_is_default = no @@ -5681,10 +5083,10 @@ # Some compilers won't report that they do not support -Kthread, # so we need to run a program to see whether it really made the # function available. -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -Kthread" >&5 -$as_echo_n "checking whether $CC accepts -Kthread... " >&6; } +{ echo "$as_me:$LINENO: checking whether $CC accepts -Kthread" >&5 +echo $ECHO_N "checking whether $CC accepts -Kthread... $ECHO_C" >&6; } if test "${ac_cv_kthread+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cc="$CC" CC="$CC -Kthread" @@ -5717,32 +5119,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_kthread=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_kthread=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5750,8 +5149,8 @@ CC="$ac_save_cc" fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_kthread" >&5 -$as_echo "$ac_cv_kthread" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_kthread" >&5 +echo "${ECHO_T}$ac_cv_kthread" >&6; } fi if test $ac_cv_kthread = no -a $ac_cv_pthread_is_default = no @@ -5761,10 +5160,10 @@ # Some compilers won't report that they do not support -pthread, # so we need to run a program to see whether it really made the # function available. -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -pthread" >&5 -$as_echo_n "checking whether $CC accepts -pthread... " >&6; } +{ echo "$as_me:$LINENO: checking whether $CC accepts -pthread" >&5 +echo $ECHO_N "checking whether $CC accepts -pthread... $ECHO_C" >&6; } if test "${ac_cv_thread+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_cc="$CC" CC="$CC -pthread" @@ -5797,32 +5196,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_pthread=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_pthread=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -5830,8 +5226,8 @@ CC="$ac_save_cc" fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_pthread" >&5 -$as_echo "$ac_cv_pthread" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_pthread" >&5 +echo "${ECHO_T}$ac_cv_pthread" >&6; } fi # If we have set a CC compiler flag for thread support then @@ -5839,8 +5235,8 @@ ac_cv_cxx_thread=no if test ! -z "$CXX" then -{ $as_echo "$as_me:$LINENO: checking whether $CXX also accepts flags for thread support" >&5 -$as_echo_n "checking whether $CXX also accepts flags for thread support... " >&6; } +{ echo "$as_me:$LINENO: checking whether $CXX also accepts flags for thread support" >&5 +echo $ECHO_N "checking whether $CXX also accepts flags for thread support... $ECHO_C" >&6; } ac_save_cxx="$CXX" if test "$ac_cv_kpthread" = "yes" @@ -5870,17 +5266,17 @@ fi rm -fr conftest* fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_thread" >&5 -$as_echo "$ac_cv_cxx_thread" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_cxx_thread" >&5 +echo "${ECHO_T}$ac_cv_cxx_thread" >&6; } fi CXX="$ac_save_cxx" # checks for header files -{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5907,21 +5303,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no @@ -6013,40 +5408,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -6055,6 +5447,75 @@ fi +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + @@ -6122,21 +5583,20 @@ sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ bluetooth/bluetooth.h linux/tipc.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6152,33 +5612,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6192,52 +5651,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -6246,24 +5704,21 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -6277,11 +5732,11 @@ ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 -$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } + as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 +echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6307,21 +5762,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -6329,15 +5783,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break @@ -6346,10 +5797,10 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then - { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } + { echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -6387,30 +5838,26 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_search_opendir=$ac_res else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then @@ -6425,8 +5872,8 @@ rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -6434,10 +5881,10 @@ fi else - { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5 -$as_echo_n "checking for library containing opendir... " >&6; } + { echo "$as_me:$LINENO: checking for library containing opendir" >&5 +echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; } if test "${ac_cv_search_opendir+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -6475,30 +5922,26 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_search_opendir=$ac_res else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_opendir+set}" = set; then @@ -6513,8 +5956,8 @@ rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 -$as_echo "$ac_cv_search_opendir" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 +echo "${ECHO_T}$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -6523,10 +5966,10 @@ fi -{ $as_echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5 -$as_echo_n "checking whether sys/types.h defines makedev... " >&6; } +{ echo "$as_me:$LINENO: checking whether sys/types.h defines makedev" >&5 +echo $ECHO_N "checking whether sys/types.h defines makedev... $ECHO_C" >&6; } if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6549,50 +5992,46 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_header_sys_types_h_makedev=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_types_h_makedev=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 -$as_echo "$ac_cv_header_sys_types_h_makedev" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 +echo "${ECHO_T}$ac_cv_header_sys_types_h_makedev" >&6; } if test $ac_cv_header_sys_types_h_makedev = no; then if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 -$as_echo_n "checking for sys/mkdev.h... " >&6; } + { echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 +echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 -$as_echo "$ac_cv_header_sys_mkdev_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 -$as_echo_n "checking sys/mkdev.h usability... " >&6; } +{ echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 +echo $ECHO_N "checking sys/mkdev.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6608,33 +6047,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5 -$as_echo_n "checking sys/mkdev.h presence... " >&6; } +{ echo "$as_me:$LINENO: checking sys/mkdev.h presence" >&5 +echo $ECHO_N "checking sys/mkdev.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6648,52 +6086,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -6702,18 +6139,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 -$as_echo_n "checking for sys/mkdev.h... " >&6; } +{ echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 +echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_mkdev_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_mkdev_h=$ac_header_preproc fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 -$as_echo "$ac_cv_header_sys_mkdev_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6; } fi -if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then +if test $ac_cv_header_sys_mkdev_h = yes; then cat >>confdefs.h <<\_ACEOF #define MAJOR_IN_MKDEV 1 @@ -6725,17 +6162,17 @@ if test $ac_cv_header_sys_mkdev_h = no; then if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 -$as_echo_n "checking for sys/sysmacros.h... " >&6; } + { echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 +echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 -$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 -$as_echo_n "checking sys/sysmacros.h usability... " >&6; } +{ echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 +echo $ECHO_N "checking sys/sysmacros.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6751,33 +6188,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5 -$as_echo_n "checking sys/sysmacros.h presence... " >&6; } +{ echo "$as_me:$LINENO: checking sys/sysmacros.h presence" >&5 +echo $ECHO_N "checking sys/sysmacros.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6791,52 +6227,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -6845,18 +6280,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 -$as_echo_n "checking for sys/sysmacros.h... " >&6; } +{ echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 +echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6; } if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_sysmacros_h=$ac_header_preproc fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 -$as_echo "$ac_cv_header_sys_sysmacros_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6; } fi -if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then +if test $ac_cv_header_sys_sysmacros_h = yes; then cat >>confdefs.h <<\_ACEOF #define MAJOR_IN_SYSMACROS 1 @@ -6873,11 +6308,11 @@ for ac_header in term.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6899,21 +6334,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -6921,15 +6355,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -6941,11 +6372,11 @@ for ac_header in linux/netlink.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6970,21 +6401,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -6992,15 +6422,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -7010,8 +6437,8 @@ # checks for typedefs was_it_defined=no -{ $as_echo "$as_me:$LINENO: checking for clock_t in time.h" >&5 -$as_echo_n "checking for clock_t in time.h... " >&6; } +{ echo "$as_me:$LINENO: checking for clock_t in time.h" >&5 +echo $ECHO_N "checking for clock_t in time.h... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7035,12 +6462,12 @@ fi rm -f conftest* -{ $as_echo "$as_me:$LINENO: result: $was_it_defined" >&5 -$as_echo "$was_it_defined" >&6; } +{ echo "$as_me:$LINENO: result: $was_it_defined" >&5 +echo "${ECHO_T}$was_it_defined" >&6; } # Check whether using makedev requires defining _OSF_SOURCE -{ $as_echo "$as_me:$LINENO: checking for makedev" >&5 -$as_echo_n "checking for makedev... " >&6; } +{ echo "$as_me:$LINENO: checking for makedev" >&5 +echo $ECHO_N "checking for makedev... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7062,30 +6489,26 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_has_makedev=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_has_makedev=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_has_makedev" = "no"; then @@ -7114,30 +6537,26 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_has_makedev=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_has_makedev=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_has_makedev" = "yes"; then @@ -7148,8 +6567,8 @@ fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_has_makedev" >&5 -$as_echo "$ac_cv_has_makedev" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_has_makedev" >&5 +echo "${ECHO_T}$ac_cv_has_makedev" >&6; } if test "$ac_cv_has_makedev" = "yes"; then cat >>confdefs.h <<\_ACEOF @@ -7166,8 +6585,8 @@ # work-around, disable LFS on such configurations use_lfs=yes -{ $as_echo "$as_me:$LINENO: checking Solaris LFS bug" >&5 -$as_echo_n "checking Solaris LFS bug... " >&6; } +{ echo "$as_me:$LINENO: checking Solaris LFS bug" >&5 +echo $ECHO_N "checking Solaris LFS bug... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7193,29 +6612,28 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then sol_lfs_bug=no else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 sol_lfs_bug=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $sol_lfs_bug" >&5 -$as_echo "$sol_lfs_bug" >&6; } +{ echo "$as_me:$LINENO: result: $sol_lfs_bug" >&5 +echo "${ECHO_T}$sol_lfs_bug" >&6; } if test "$sol_lfs_bug" = "yes"; then use_lfs=no fi @@ -7243,46 +6661,11 @@ EOF # Type availability checks -{ $as_echo "$as_me:$LINENO: checking for mode_t" >&5 -$as_echo_n "checking for mode_t... " >&6; } +{ echo "$as_me:$LINENO: checking for mode_t" >&5 +echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; } if test "${ac_cv_type_mode_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_type_mode_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (mode_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7290,11 +6673,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef mode_t ac__type_new_; int main () { -if (sizeof ((mode_t))) - return 0; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -7305,39 +6691,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_mode_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_type_mode_t=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_type_mode_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 -$as_echo "$ac_cv_type_mode_t" >&6; } -if test "x$ac_cv_type_mode_t" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 +echo "${ECHO_T}$ac_cv_type_mode_t" >&6; } +if test $ac_cv_type_mode_t = yes; then : else @@ -7347,46 +6724,11 @@ fi -{ $as_echo "$as_me:$LINENO: checking for off_t" >&5 -$as_echo_n "checking for off_t... " >&6; } +{ echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } if test "${ac_cv_type_off_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_type_off_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (off_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7394,11 +6736,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef off_t ac__type_new_; int main () { -if (sizeof ((off_t))) - return 0; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -7409,39 +6754,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_off_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_type_off_t=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_type_off_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 -$as_echo "$ac_cv_type_off_t" >&6; } -if test "x$ac_cv_type_off_t" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6; } +if test $ac_cv_type_off_t = yes; then : else @@ -7451,46 +6787,11 @@ fi -{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5 -$as_echo_n "checking for pid_t... " >&6; } +{ echo "$as_me:$LINENO: checking for pid_t" >&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } if test "${ac_cv_type_pid_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_type_pid_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (pid_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7498,11 +6799,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef pid_t ac__type_new_; int main () { -if (sizeof ((pid_t))) - return 0; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -7513,39 +6817,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_pid_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_type_pid_t=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_type_pid_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 -$as_echo "$ac_cv_type_pid_t" >&6; } -if test "x$ac_cv_type_pid_t" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } +if test $ac_cv_type_pid_t = yes; then : else @@ -7555,10 +6850,10 @@ fi -{ $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } +{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } if test "${ac_cv_type_signal+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7583,76 +6878,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_type_signal=int else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } - -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF - - -{ $as_echo "$as_me:$LINENO: checking for size_t" >&5 -$as_echo_n "checking for size_t... " >&6; } -if test "${ac_cv_type_size_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_size_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (size_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6; } + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + +{ echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7660,11 +6919,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef size_t ac__type_new_; int main () { -if (sizeof ((size_t))) - return 0; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -7675,39 +6937,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_size_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_type_size_t=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_type_size_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 -$as_echo "$ac_cv_type_size_t" >&6; } -if test "x$ac_cv_type_size_t" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6; } +if test $ac_cv_type_size_t = yes; then : else @@ -7717,10 +6970,10 @@ fi -{ $as_echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 -$as_echo_n "checking for uid_t in sys/types.h... " >&6; } +{ echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 +echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; } if test "${ac_cv_type_uid_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7740,8 +6993,8 @@ rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 -$as_echo "$ac_cv_type_uid_t" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 +echo "${ECHO_T}$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF @@ -7756,10 +7009,10 @@ fi - { $as_echo "$as_me:$LINENO: checking for uint32_t" >&5 -$as_echo_n "checking for uint32_t... " >&6; } + { echo "$as_me:$LINENO: checking for uint32_t" >&5 +echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6; } if test "${ac_cv_c_uint32_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_uint32_t=no for ac_type in 'uint32_t' 'unsigned int' 'unsigned long int' \ @@ -7787,14 +7040,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7805,7 +7057,7 @@ esac else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -7815,8 +7067,8 @@ test "$ac_cv_c_uint32_t" != no && break done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint32_t" >&5 -$as_echo "$ac_cv_c_uint32_t" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_c_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_c_uint32_t" >&6; } case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) @@ -7833,10 +7085,10 @@ esac - { $as_echo "$as_me:$LINENO: checking for uint64_t" >&5 -$as_echo_n "checking for uint64_t... " >&6; } + { echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6; } if test "${ac_cv_c_uint64_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_uint64_t=no for ac_type in 'uint64_t' 'unsigned int' 'unsigned long int' \ @@ -7864,14 +7116,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7882,7 +7133,7 @@ esac else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -7892,8 +7143,8 @@ test "$ac_cv_c_uint64_t" != no && break done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint64_t" >&5 -$as_echo "$ac_cv_c_uint64_t" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_c_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_c_uint64_t" >&6; } case $ac_cv_c_uint64_t in #( no|yes) ;; #( *) @@ -7910,10 +7161,10 @@ esac - { $as_echo "$as_me:$LINENO: checking for int32_t" >&5 -$as_echo_n "checking for int32_t... " >&6; } + { echo "$as_me:$LINENO: checking for int32_t" >&5 +echo $ECHO_N "checking for int32_t... $ECHO_C" >&6; } if test "${ac_cv_c_int32_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_int32_t=no for ac_type in 'int32_t' 'int' 'long int' \ @@ -7941,14 +7192,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -7964,7 +7214,7 @@ main () { static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 1) - < ($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 2))]; + < ($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 2))]; test_array [0] = 0 ; @@ -7977,21 +7227,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 case $ac_type in @@ -8003,7 +7252,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -8013,8 +7262,8 @@ test "$ac_cv_c_int32_t" != no && break done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int32_t" >&5 -$as_echo "$ac_cv_c_int32_t" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_c_int32_t" >&5 +echo "${ECHO_T}$ac_cv_c_int32_t" >&6; } case $ac_cv_c_int32_t in #( no|yes) ;; #( *) @@ -8026,10 +7275,10 @@ esac - { $as_echo "$as_me:$LINENO: checking for int64_t" >&5 -$as_echo_n "checking for int64_t... " >&6; } + { echo "$as_me:$LINENO: checking for int64_t" >&5 +echo $ECHO_N "checking for int64_t... $ECHO_C" >&6; } if test "${ac_cv_c_int64_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_int64_t=no for ac_type in 'int64_t' 'int' 'long int' \ @@ -8057,14 +7306,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8080,7 +7328,7 @@ main () { static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 1) - < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 2))]; + < ($ac_type) (((($ac_type) 1 << (64 - 2)) - 1) * 2 + 2))]; test_array [0] = 0 ; @@ -8093,21 +7341,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 case $ac_type in @@ -8119,7 +7366,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -8129,8 +7376,8 @@ test "$ac_cv_c_int64_t" != no && break done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_int64_t" >&5 -$as_echo "$ac_cv_c_int64_t" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_c_int64_t" >&5 +echo "${ECHO_T}$ac_cv_c_int64_t" >&6; } case $ac_cv_c_int64_t in #( no|yes) ;; #( *) @@ -8141,24 +7388,26 @@ ;; esac -{ $as_echo "$as_me:$LINENO: checking for ssize_t" >&5 -$as_echo_n "checking for ssize_t... " >&6; } +{ echo "$as_me:$LINENO: checking for ssize_t" >&5 +echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6; } if test "${ac_cv_type_ssize_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_type_ssize_t=no -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef ssize_t ac__type_new_; int main () { -if (sizeof (ssize_t)) - return 0; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -8169,18 +7418,45 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then + ac_cv_type_ssize_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_ssize_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 +echo "${ECHO_T}$ac_cv_type_ssize_t" >&6; } +if test $ac_cv_type_ssize_t = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SSIZE_T 1 +_ACEOF + +fi + + +# Sizes of various common basic types +# ANSI C requires sizeof(char) == 1, so no need to check it +{ echo "$as_me:$LINENO: checking for int" >&5 +echo $ECHO_N "checking for int... $ECHO_C" >&6; } +if test "${ac_cv_type_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8188,11 +7464,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef int ac__type_new_; int main () { -if (sizeof ((ssize_t))) - return 0; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -8203,57 +7482,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_ssize_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_type_int=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_type_int=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_ssize_t" >&5 -$as_echo "$ac_cv_type_ssize_t" >&6; } -if test "x$ac_cv_type_ssize_t" = x""yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_SSIZE_T 1 -_ACEOF - -fi - +{ echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 +echo "${ECHO_T}$ac_cv_type_int" >&6; } -# Sizes of various common basic types -# ANSI C requires sizeof(char) == 1, so no need to check it # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of int" >&5 -$as_echo_n "checking size of int... " >&6; } +{ echo "$as_me:$LINENO: checking size of int" >&5 +echo $ECHO_N "checking size of int... $ECHO_C" >&6; } if test "${ac_cv_sizeof_int+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -8264,10 +7524,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -8280,14 +7541,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8301,10 +7561,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8317,21 +7578,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -8345,7 +7605,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -8355,10 +7615,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (int))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -8371,14 +7632,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8392,10 +7652,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -8408,21 +7669,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -8436,7 +7696,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -8456,10 +7716,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef int ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8472,21 +7733,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -8497,13 +7757,11 @@ case $ac_lo in ?*) ac_cv_sizeof_int=$ac_lo;; '') if test "$ac_cv_type_int" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (int) +echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_int=0 fi ;; @@ -8516,8 +7774,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -static long int longval () { return (long int) (sizeof (int)); } -static unsigned long int ulongval () { return (long int) (sizeof (int)); } + typedef int ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -8527,22 +7786,20 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (int))) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (int)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%ld", i); + fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (int)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%lu", i); + fprintf (f, "%lu\n", i); } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -8555,48 +7812,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_int" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (int) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (int) +echo "$as_me: error: cannot compute sizeof (int) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_int=0 fi fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 -$as_echo "$ac_cv_sizeof_int" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 +echo "${ECHO_T}$ac_cv_sizeof_int" >&6; } @@ -8605,14 +7857,68 @@ _ACEOF +{ echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6; } +if test "${ac_cv_type_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef long ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_long=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6; } + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } +{ echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -8623,10 +7929,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -8639,14 +7946,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8660,10 +7966,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8676,21 +7983,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -8704,7 +8010,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -8714,10 +8020,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -8730,14 +8037,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -8751,10 +8057,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -8767,21 +8074,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -8795,7 +8101,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -8815,10 +8121,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -8831,21 +8138,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -8856,13 +8162,11 @@ case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (long) +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi ;; @@ -8875,8 +8179,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -static long int longval () { return (long int) (sizeof (long)); } -static unsigned long int ulongval () { return (long int) (sizeof (long)); } + typedef long ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -8886,22 +8191,20 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (long))) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (long)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%ld", i); + fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (long)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%lu", i); + fprintf (f, "%lu\n", i); } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -8914,48 +8217,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (long) +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } @@ -8964,14 +8262,68 @@ _ACEOF +{ echo "$as_me:$LINENO: checking for void *" >&5 +echo $ECHO_N "checking for void *... $ECHO_C" >&6; } +if test "${ac_cv_type_void_p+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef void * ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_void_p=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_void_p=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 +echo "${ECHO_T}$ac_cv_type_void_p" >&6; } + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of void *" >&5 -$as_echo_n "checking size of void *... " >&6; } +{ echo "$as_me:$LINENO: checking size of void *" >&5 +echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -8982,10 +8334,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -8998,14 +8351,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9019,10 +8371,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9035,21 +8388,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -9063,7 +8415,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -9073,10 +8425,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void *))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -9089,14 +8442,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9110,10 +8462,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -9126,21 +8479,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -9154,7 +8506,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -9174,10 +8526,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9190,21 +8543,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -9215,13 +8567,11 @@ case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; '') if test "$ac_cv_type_void_p" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (void *) +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_void_p=0 fi ;; @@ -9234,8 +8584,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -static long int longval () { return (long int) (sizeof (void *)); } -static unsigned long int ulongval () { return (long int) (sizeof (void *)); } + typedef void * ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -9245,22 +8596,20 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (void *))) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (void *)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%ld", i); + fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (void *)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%lu", i); + fprintf (f, "%lu\n", i); } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9273,48 +8622,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_void_p=`cat conftest.val` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_void_p" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (void *) +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_void_p=0 fi fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -$as_echo "$ac_cv_sizeof_void_p" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } @@ -9323,14 +8667,68 @@ _ACEOF +{ echo "$as_me:$LINENO: checking for short" >&5 +echo $ECHO_N "checking for short... $ECHO_C" >&6; } +if test "${ac_cv_type_short+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef short ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_short=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_short=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 +echo "${ECHO_T}$ac_cv_type_short" >&6; } + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of short" >&5 -$as_echo_n "checking size of short... " >&6; } +{ echo "$as_me:$LINENO: checking size of short" >&5 +echo $ECHO_N "checking size of short... $ECHO_C" >&6; } if test "${ac_cv_sizeof_short+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -9341,10 +8739,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -9357,14 +8756,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9378,10 +8776,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9394,21 +8793,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -9422,7 +8820,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -9432,10 +8830,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (short))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -9448,14 +8847,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9469,10 +8867,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (short))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -9485,21 +8884,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -9513,7 +8911,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -9533,10 +8931,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef short ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (short))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9549,21 +8948,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -9574,13 +8972,11 @@ case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; '') if test "$ac_cv_type_short" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (short) +echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_short=0 fi ;; @@ -9593,8 +8989,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -static long int longval () { return (long int) (sizeof (short)); } -static unsigned long int ulongval () { return (long int) (sizeof (short)); } + typedef short ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -9604,22 +9001,20 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (short))) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (short)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%ld", i); + fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (short)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%lu", i); + fprintf (f, "%lu\n", i); } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9632,48 +9027,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_short=`cat conftest.val` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_short" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (short) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (short) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (short) +echo "$as_me: error: cannot compute sizeof (short) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_short=0 fi fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 -$as_echo "$ac_cv_sizeof_short" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 +echo "${ECHO_T}$ac_cv_sizeof_short" >&6; } @@ -9682,14 +9072,68 @@ _ACEOF +{ echo "$as_me:$LINENO: checking for float" >&5 +echo $ECHO_N "checking for float... $ECHO_C" >&6; } +if test "${ac_cv_type_float+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef float ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_float=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_float=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_float" >&5 +echo "${ECHO_T}$ac_cv_type_float" >&6; } + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of float" >&5 -$as_echo_n "checking size of float... " >&6; } +{ echo "$as_me:$LINENO: checking size of float" >&5 +echo $ECHO_N "checking size of float... $ECHO_C" >&6; } if test "${ac_cv_sizeof_float+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -9700,10 +9144,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (float))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -9716,14 +9161,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9737,10 +9181,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (float))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9753,21 +9198,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -9781,7 +9225,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -9791,10 +9235,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (float))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -9807,14 +9252,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -9828,10 +9272,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (float))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -9844,21 +9289,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -9872,7 +9316,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -9892,10 +9336,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef float ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (float))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -9908,21 +9353,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -9933,13 +9377,11 @@ case $ac_lo in ?*) ac_cv_sizeof_float=$ac_lo;; '') if test "$ac_cv_type_float" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (float) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (float) +echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_float=0 fi ;; @@ -9952,8 +9394,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -static long int longval () { return (long int) (sizeof (float)); } -static unsigned long int ulongval () { return (long int) (sizeof (float)); } + typedef float ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -9963,22 +9406,20 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (float))) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (float)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%ld", i); + fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (float)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%lu", i); + fprintf (f, "%lu\n", i); } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -9991,64 +9432,113 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_float=`cat conftest.val` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_float" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (float) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (float) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (float) +echo "$as_me: error: cannot compute sizeof (float) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_float=0 fi fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 -$as_echo "$ac_cv_sizeof_float" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_float" >&5 +echo "${ECHO_T}$ac_cv_sizeof_float" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_FLOAT $ac_cv_sizeof_float +_ACEOF +{ echo "$as_me:$LINENO: checking for double" >&5 +echo $ECHO_N "checking for double... $ECHO_C" >&6; } +if test "${ac_cv_type_double+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef double ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_double=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -cat >>confdefs.h <<_ACEOF -#define SIZEOF_FLOAT $ac_cv_sizeof_float -_ACEOF + ac_cv_type_double=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_double" >&5 +echo "${ECHO_T}$ac_cv_type_double" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of double" >&5 -$as_echo_n "checking size of double... " >&6; } +{ echo "$as_me:$LINENO: checking size of double" >&5 +echo $ECHO_N "checking size of double... $ECHO_C" >&6; } if test "${ac_cv_sizeof_double+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -10059,10 +9549,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -10075,14 +9566,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10096,10 +9586,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10112,21 +9603,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -10140,7 +9630,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -10150,10 +9640,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (double))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -10166,14 +9657,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10187,10 +9677,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (double))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -10203,21 +9694,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -10231,7 +9721,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -10251,10 +9741,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (double))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10267,21 +9758,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -10292,13 +9782,11 @@ case $ac_lo in ?*) ac_cv_sizeof_double=$ac_lo;; '') if test "$ac_cv_type_double" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (double) +echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_double=0 fi ;; @@ -10311,8 +9799,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -static long int longval () { return (long int) (sizeof (double)); } -static unsigned long int ulongval () { return (long int) (sizeof (double)); } + typedef double ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -10322,22 +9811,20 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (double))) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (double)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%ld", i); + fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (double)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%lu", i); + fprintf (f, "%lu\n", i); } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -10350,48 +9837,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_double=`cat conftest.val` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_double" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (double) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (double) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (double) +echo "$as_me: error: cannot compute sizeof (double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_double=0 fi fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 -$as_echo "$ac_cv_sizeof_double" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_double" >&5 +echo "${ECHO_T}$ac_cv_sizeof_double" >&6; } @@ -10400,14 +9882,68 @@ _ACEOF +{ echo "$as_me:$LINENO: checking for fpos_t" >&5 +echo $ECHO_N "checking for fpos_t... $ECHO_C" >&6; } +if test "${ac_cv_type_fpos_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef fpos_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_fpos_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_fpos_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_fpos_t" >&5 +echo "${ECHO_T}$ac_cv_type_fpos_t" >&6; } + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of fpos_t" >&5 -$as_echo_n "checking size of fpos_t... " >&6; } +{ echo "$as_me:$LINENO: checking size of fpos_t" >&5 +echo $ECHO_N "checking size of fpos_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_fpos_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -10418,10 +9954,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -10434,14 +9971,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10455,10 +9991,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10471,21 +10008,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -10499,7 +10035,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -10509,10 +10045,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -10525,14 +10062,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10546,10 +10082,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -10562,21 +10099,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -10590,7 +10126,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -10610,10 +10146,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef fpos_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (fpos_t))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10626,21 +10163,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -10651,13 +10187,11 @@ case $ac_lo in ?*) ac_cv_sizeof_fpos_t=$ac_lo;; '') if test "$ac_cv_type_fpos_t" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (fpos_t) +echo "$as_me: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_fpos_t=0 fi ;; @@ -10670,8 +10204,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -static long int longval () { return (long int) (sizeof (fpos_t)); } -static unsigned long int ulongval () { return (long int) (sizeof (fpos_t)); } + typedef fpos_t ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -10681,22 +10216,20 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (fpos_t))) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (fpos_t)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%ld", i); + fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (fpos_t)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%lu", i); + fprintf (f, "%lu\n", i); } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -10709,48 +10242,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_fpos_t=`cat conftest.val` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_fpos_t" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (fpos_t) +echo "$as_me: error: cannot compute sizeof (fpos_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_fpos_t=0 fi fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_fpos_t" >&5 -$as_echo "$ac_cv_sizeof_fpos_t" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_fpos_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_fpos_t" >&6; } @@ -10759,14 +10287,68 @@ _ACEOF +{ echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef size_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_size_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6; } + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of size_t" >&5 -$as_echo_n "checking size of size_t... " >&6; } +{ echo "$as_me:$LINENO: checking size of size_t" >&5 +echo $ECHO_N "checking size of size_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_size_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -10777,10 +10359,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -10793,14 +10376,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10814,10 +10396,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10830,21 +10413,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -10858,7 +10440,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -10868,10 +10450,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -10884,14 +10467,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -10905,10 +10487,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -10921,21 +10504,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -10949,7 +10531,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -10969,10 +10551,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef size_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -10985,21 +10568,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -11010,13 +10592,11 @@ case $ac_lo in ?*) ac_cv_sizeof_size_t=$ac_lo;; '') if test "$ac_cv_type_size_t" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (size_t) +echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_size_t=0 fi ;; @@ -11029,8 +10609,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -static long int longval () { return (long int) (sizeof (size_t)); } -static unsigned long int ulongval () { return (long int) (sizeof (size_t)); } + typedef size_t ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -11040,22 +10621,20 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (size_t))) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (size_t)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%ld", i); + fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (size_t)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%lu", i); + fprintf (f, "%lu\n", i); } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -11068,48 +10647,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_size_t=`cat conftest.val` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_size_t" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (size_t) +echo "$as_me: error: cannot compute sizeof (size_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_size_t=0 fi fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 -$as_echo "$ac_cv_sizeof_size_t" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_size_t" >&6; } @@ -11118,14 +10692,68 @@ _ACEOF +{ echo "$as_me:$LINENO: checking for pid_t" >&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; } +if test "${ac_cv_type_pid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef pid_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_pid_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_pid_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6; } + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of pid_t" >&5 -$as_echo_n "checking size of pid_t... " >&6; } +{ echo "$as_me:$LINENO: checking size of pid_t" >&5 +echo $ECHO_N "checking size of pid_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_pid_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -11136,10 +10764,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -11152,14 +10781,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11173,10 +10801,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11189,21 +10818,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -11217,7 +10845,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -11227,10 +10855,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -11243,14 +10872,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11264,10 +10892,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -11280,21 +10909,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -11308,7 +10936,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -11328,10 +10956,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef pid_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (pid_t))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11344,21 +10973,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -11369,13 +10997,11 @@ case $ac_lo in ?*) ac_cv_sizeof_pid_t=$ac_lo;; '') if test "$ac_cv_type_pid_t" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (pid_t) +echo "$as_me: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_pid_t=0 fi ;; @@ -11388,8 +11014,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -static long int longval () { return (long int) (sizeof (pid_t)); } -static unsigned long int ulongval () { return (long int) (sizeof (pid_t)); } + typedef pid_t ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -11399,22 +11026,20 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (pid_t))) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (pid_t)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%ld", i); + fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (pid_t)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%lu", i); + fprintf (f, "%lu\n", i); } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -11427,48 +11052,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_pid_t=`cat conftest.val` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_pid_t" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (pid_t) +echo "$as_me: error: cannot compute sizeof (pid_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_pid_t=0 fi fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_pid_t" >&5 -$as_echo "$ac_cv_sizeof_pid_t" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_pid_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_pid_t" >&6; } @@ -11478,8 +11098,8 @@ -{ $as_echo "$as_me:$LINENO: checking for long long support" >&5 -$as_echo_n "checking for long long support... " >&6; } +{ echo "$as_me:$LINENO: checking for long long support" >&5 +echo $ECHO_N "checking for long long support... $ECHO_C" >&6; } have_long_long=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -11502,14 +11122,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11523,24 +11142,78 @@ have_long_long=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $have_long_long" >&5 -$as_echo "$have_long_long" >&6; } +{ echo "$as_me:$LINENO: result: $have_long_long" >&5 +echo "${ECHO_T}$have_long_long" >&6; } if test "$have_long_long" = yes ; then +{ echo "$as_me:$LINENO: checking for long long" >&5 +echo $ECHO_N "checking for long long... $ECHO_C" >&6; } +if test "${ac_cv_type_long_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef long long ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_long_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_long_long=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long" >&5 +echo "${ECHO_T}$ac_cv_type_long_long" >&6; } + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of long long" >&5 -$as_echo_n "checking size of long long... " >&6; } +{ echo "$as_me:$LINENO: checking size of long long" >&5 +echo $ECHO_N "checking size of long long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long_long+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -11551,10 +11224,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -11567,14 +11241,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11588,10 +11261,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11604,21 +11278,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -11632,7 +11305,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -11642,10 +11315,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long long))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -11658,14 +11332,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11679,10 +11352,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -11695,21 +11369,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -11723,7 +11396,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -11743,10 +11416,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -11759,21 +11433,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -11784,13 +11457,11 @@ case $ac_lo in ?*) ac_cv_sizeof_long_long=$ac_lo;; '') if test "$ac_cv_type_long_long" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (long long) +echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_long_long=0 fi ;; @@ -11803,8 +11474,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -static long int longval () { return (long int) (sizeof (long long)); } -static unsigned long int ulongval () { return (long int) (sizeof (long long)); } + typedef long long ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -11814,22 +11486,20 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (long long))) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (long long)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%ld", i); + fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (long long)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%lu", i); + fprintf (f, "%lu\n", i); } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -11842,48 +11512,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_long=`cat conftest.val` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long_long" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (long long) +echo "$as_me: error: cannot compute sizeof (long long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_long_long=0 fi fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 -$as_echo "$ac_cv_sizeof_long_long" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6; } @@ -11894,8 +11559,8 @@ fi -{ $as_echo "$as_me:$LINENO: checking for long double support" >&5 -$as_echo_n "checking for long double support... " >&6; } +{ echo "$as_me:$LINENO: checking for long double support" >&5 +echo $ECHO_N "checking for long double support... $ECHO_C" >&6; } have_long_double=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -11918,14 +11583,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -11939,24 +11603,78 @@ have_long_double=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $have_long_double" >&5 -$as_echo "$have_long_double" >&6; } +{ echo "$as_me:$LINENO: result: $have_long_double" >&5 +echo "${ECHO_T}$have_long_double" >&6; } if test "$have_long_double" = yes ; then +{ echo "$as_me:$LINENO: checking for long double" >&5 +echo $ECHO_N "checking for long double... $ECHO_C" >&6; } +if test "${ac_cv_type_long_double+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef long double ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_long_double=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_long_double=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_long_double" >&5 +echo "${ECHO_T}$ac_cv_type_long_double" >&6; } + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of long double" >&5 -$as_echo_n "checking size of long double... " >&6; } +{ echo "$as_me:$LINENO: checking size of long double" >&5 +echo $ECHO_N "checking size of long double... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long_double+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -11967,10 +11685,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long double))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -11983,14 +11702,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12004,10 +11722,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long double))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12020,21 +11739,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -12048,7 +11766,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -12058,10 +11776,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long double))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -12074,14 +11793,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12095,10 +11813,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long double))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -12111,21 +11830,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -12139,7 +11857,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -12159,10 +11877,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long double ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long double))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12175,21 +11894,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -12200,13 +11918,11 @@ case $ac_lo in ?*) ac_cv_sizeof_long_double=$ac_lo;; '') if test "$ac_cv_type_long_double" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long double) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (long double) +echo "$as_me: error: cannot compute sizeof (long double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_long_double=0 fi ;; @@ -12219,8 +11935,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -static long int longval () { return (long int) (sizeof (long double)); } -static unsigned long int ulongval () { return (long int) (sizeof (long double)); } + typedef long double ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -12230,22 +11947,20 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (long double))) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (long double)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%ld", i); + fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (long double)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%lu", i); + fprintf (f, "%lu\n", i); } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -12258,48 +11973,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long_double=`cat conftest.val` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long_double" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long double) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long double) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (long double) +echo "$as_me: error: cannot compute sizeof (long double) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_long_double=0 fi fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5 -$as_echo "$ac_cv_sizeof_long_double" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_double" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long_double" >&6; } @@ -12310,21 +12020,81 @@ fi - -{ $as_echo "$as_me:$LINENO: checking for _Bool support" >&5 -$as_echo_n "checking for _Bool support... " >&6; } -have_c99_bool=no -cat >conftest.$ac_ext <<_ACEOF + +{ echo "$as_me:$LINENO: checking for _Bool support" >&5 +echo $ECHO_N "checking for _Bool support... $ECHO_C" >&6; } +have_c99_bool=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +_Bool x; x = (_Bool)0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + + +cat >>confdefs.h <<\_ACEOF +#define HAVE_C99_BOOL 1 +_ACEOF + + have_c99_bool=yes + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $have_c99_bool" >&5 +echo "${ECHO_T}$have_c99_bool" >&6; } +if test "$have_c99_bool" = yes ; then +{ echo "$as_me:$LINENO: checking for _Bool" >&5 +echo $ECHO_N "checking for _Bool... $ECHO_C" >&6; } +if test "${ac_cv_type__Bool+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - +$ac_includes_default +typedef _Bool ac__type_new_; int main () { -_Bool x; x = (_Bool)0; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -12335,45 +12105,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - - -cat >>confdefs.h <<\_ACEOF -#define HAVE_C99_BOOL 1 -_ACEOF - - have_c99_bool=yes - + ac_cv_type__Bool=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_type__Bool=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $have_c99_bool" >&5 -$as_echo "$have_c99_bool" >&6; } -if test "$have_c99_bool" = yes ; then +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 +echo "${ECHO_T}$ac_cv_type__Bool" >&6; } + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of _Bool" >&5 -$as_echo_n "checking size of _Bool... " >&6; } +{ echo "$as_me:$LINENO: checking size of _Bool" >&5 +echo $ECHO_N "checking size of _Bool... $ECHO_C" >&6; } if test "${ac_cv_sizeof__Bool+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -12384,10 +12147,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -12400,14 +12164,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12421,10 +12184,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12437,21 +12201,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -12465,7 +12228,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -12475,10 +12238,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -12491,14 +12255,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12512,10 +12275,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -12528,21 +12292,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -12556,7 +12319,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -12576,10 +12339,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef _Bool ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (_Bool))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12592,21 +12356,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -12617,13 +12380,11 @@ case $ac_lo in ?*) ac_cv_sizeof__Bool=$ac_lo;; '') if test "$ac_cv_type__Bool" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (_Bool) +echo "$as_me: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof__Bool=0 fi ;; @@ -12636,8 +12397,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -static long int longval () { return (long int) (sizeof (_Bool)); } -static unsigned long int ulongval () { return (long int) (sizeof (_Bool)); } + typedef _Bool ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -12647,22 +12409,20 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (_Bool))) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (_Bool)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%ld", i); + fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (_Bool)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%lu", i); + fprintf (f, "%lu\n", i); } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -12675,48 +12435,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof__Bool=`cat conftest.val` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type__Bool" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (_Bool) +echo "$as_me: error: cannot compute sizeof (_Bool) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof__Bool=0 fi fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof__Bool" >&5 -$as_echo "$ac_cv_sizeof__Bool" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof__Bool" >&5 +echo "${ECHO_T}$ac_cv_sizeof__Bool" >&6; } @@ -12727,13 +12482,12 @@ fi -{ $as_echo "$as_me:$LINENO: checking for uintptr_t" >&5 -$as_echo_n "checking for uintptr_t... " >&6; } +{ echo "$as_me:$LINENO: checking for uintptr_t" >&5 +echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; } if test "${ac_cv_type_uintptr_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_type_uintptr_t=no -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -12743,11 +12497,14 @@ #include #endif +typedef uintptr_t ac__type_new_; int main () { -if (sizeof (uintptr_t)) - return 0; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -12758,33 +12515,55 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then + ac_cv_type_uintptr_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_uintptr_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; } +if test $ac_cv_type_uintptr_t = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_UINTPTR_T 1 +_ACEOF + +{ echo "$as_me:$LINENO: checking for uintptr_t" >&5 +echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6; } +if test "${ac_cv_type_uintptr_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#ifdef HAVE_STDINT_H - #include - #endif - +$ac_includes_default +typedef uintptr_t ac__type_new_; int main () { -if (sizeof ((uintptr_t))) - return 0; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -12795,52 +12574,38 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_uintptr_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_type_uintptr_t=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_type_uintptr_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 -$as_echo "$ac_cv_type_uintptr_t" >&6; } -if test "x$ac_cv_type_uintptr_t" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_UINTPTR_T 1 -_ACEOF +{ echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of uintptr_t" >&5 -$as_echo_n "checking size of uintptr_t... " >&6; } +{ echo "$as_me:$LINENO: checking size of uintptr_t" >&5 +echo $ECHO_N "checking size of uintptr_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_uintptr_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -12851,10 +12616,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -12867,14 +12633,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12888,10 +12653,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -12904,21 +12670,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -12932,7 +12697,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -12942,10 +12707,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -12958,14 +12724,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -12979,10 +12744,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -12995,21 +12761,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -13023,7 +12788,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -13043,10 +12808,11 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef uintptr_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (uintptr_t))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -13059,21 +12825,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -13084,13 +12849,11 @@ case $ac_lo in ?*) ac_cv_sizeof_uintptr_t=$ac_lo;; '') if test "$ac_cv_type_uintptr_t" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (uintptr_t) +echo "$as_me: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_uintptr_t=0 fi ;; @@ -13103,8 +12866,9 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -static long int longval () { return (long int) (sizeof (uintptr_t)); } -static unsigned long int ulongval () { return (long int) (sizeof (uintptr_t)); } + typedef uintptr_t ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -13114,22 +12878,20 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (uintptr_t))) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (uintptr_t)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%ld", i); + fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (uintptr_t)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%lu", i); + fprintf (f, "%lu\n", i); } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -13142,48 +12904,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_uintptr_t=`cat conftest.val` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_uintptr_t" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (uintptr_t) +echo "$as_me: error: cannot compute sizeof (uintptr_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_uintptr_t=0 fi fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_uintptr_t" >&5 -$as_echo "$ac_cv_sizeof_uintptr_t" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_uintptr_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_uintptr_t" >&6; } @@ -13197,10 +12954,10 @@ # Hmph. AC_CHECK_SIZEOF() doesn't include . -{ $as_echo "$as_me:$LINENO: checking size of off_t" >&5 -$as_echo_n "checking size of off_t... " >&6; } +{ echo "$as_me:$LINENO: checking size of off_t" >&5 +echo $ECHO_N "checking size of off_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_off_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_sizeof_off_t=4 @@ -13227,32 +12984,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_off_t=`cat conftestval` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_sizeof_off_t=0 fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -13260,16 +13014,16 @@ fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 -$as_echo "$ac_cv_sizeof_off_t" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF -{ $as_echo "$as_me:$LINENO: checking whether to enable large file support" >&5 -$as_echo_n "checking whether to enable large file support... " >&6; } +{ echo "$as_me:$LINENO: checking whether to enable large file support" >&5 +echo $ECHO_N "checking whether to enable large file support... $ECHO_C" >&6; } if test "$have_long_long" = yes -a \ "$ac_cv_sizeof_off_t" -gt "$ac_cv_sizeof_long" -a \ "$ac_cv_sizeof_long_long" -ge "$ac_cv_sizeof_off_t"; then @@ -13278,18 +13032,18 @@ #define HAVE_LARGEFILE_SUPPORT 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # AC_CHECK_SIZEOF() doesn't include . -{ $as_echo "$as_me:$LINENO: checking size of time_t" >&5 -$as_echo_n "checking size of time_t... " >&6; } +{ echo "$as_me:$LINENO: checking size of time_t" >&5 +echo $ECHO_N "checking size of time_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_time_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_sizeof_time_t=4 @@ -13316,32 +13070,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_time_t=`cat conftestval` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_sizeof_time_t=0 fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -13349,8 +13100,8 @@ fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5 -$as_echo "$ac_cv_sizeof_time_t" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_time_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_TIME_T $ac_cv_sizeof_time_t @@ -13367,8 +13118,8 @@ elif test "$ac_cv_pthread" = "yes" then CC="$CC -pthread" fi -{ $as_echo "$as_me:$LINENO: checking for pthread_t" >&5 -$as_echo_n "checking for pthread_t... " >&6; } +{ echo "$as_me:$LINENO: checking for pthread_t" >&5 +echo $ECHO_N "checking for pthread_t... $ECHO_C" >&6; } have_pthread_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -13391,35 +13142,34 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then have_pthread_t=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $have_pthread_t" >&5 -$as_echo "$have_pthread_t" >&6; } +{ echo "$as_me:$LINENO: result: $have_pthread_t" >&5 +echo "${ECHO_T}$have_pthread_t" >&6; } if test "$have_pthread_t" = yes ; then # AC_CHECK_SIZEOF() doesn't include . - { $as_echo "$as_me:$LINENO: checking size of pthread_t" >&5 -$as_echo_n "checking size of pthread_t... " >&6; } + { echo "$as_me:$LINENO: checking size of pthread_t" >&5 +echo $ECHO_N "checking size of pthread_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_pthread_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_sizeof_pthread_t=4 @@ -13446,32 +13196,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_pthread_t=`cat conftestval` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_sizeof_pthread_t=0 fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -13479,8 +13226,8 @@ fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_pthread_t" >&5 -$as_echo "$ac_cv_sizeof_pthread_t" >&6; } + { echo "$as_me:$LINENO: result: $ac_cv_sizeof_pthread_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_pthread_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_PTHREAD_T $ac_cv_sizeof_pthread_t @@ -13525,8 +13272,8 @@ LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';; esac -{ $as_echo "$as_me:$LINENO: checking for --enable-framework" >&5 -$as_echo_n "checking for --enable-framework... " >&6; } +{ echo "$as_me:$LINENO: checking for --enable-framework" >&5 +echo $ECHO_N "checking for --enable-framework... $ECHO_C" >&6; } if test "$enable_framework" then BASECFLAGS="$BASECFLAGS -fno-common -dynamic" @@ -13537,15 +13284,15 @@ #define WITH_NEXT_FRAMEWORK 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -{ $as_echo "$as_me:$LINENO: checking for dyld" >&5 -$as_echo_n "checking for dyld... " >&6; } +{ echo "$as_me:$LINENO: checking for dyld" >&5 +echo $ECHO_N "checking for dyld... $ECHO_C" >&6; } case $ac_sys_system/$ac_sys_release in Darwin/*) @@ -13553,12 +13300,12 @@ #define WITH_DYLD 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: always on for Darwin" >&5 -$as_echo "always on for Darwin" >&6; } + { echo "$as_me:$LINENO: result: always on for Darwin" >&5 +echo "${ECHO_T}always on for Darwin" >&6; } ;; *) - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } ;; esac @@ -13570,8 +13317,8 @@ # SO is the extension of shared libraries `(including the dot!) # -- usually .so, .sl on HP-UX, .dll on Cygwin -{ $as_echo "$as_me:$LINENO: checking SO" >&5 -$as_echo_n "checking SO... " >&6; } +{ echo "$as_me:$LINENO: checking SO" >&5 +echo $ECHO_N "checking SO... $ECHO_C" >&6; } if test -z "$SO" then case $ac_sys_system in @@ -13596,8 +13343,8 @@ echo '=====================================================================' sleep 10 fi -{ $as_echo "$as_me:$LINENO: result: $SO" >&5 -$as_echo "$SO" >&6; } +{ echo "$as_me:$LINENO: result: $SO" >&5 +echo "${ECHO_T}$SO" >&6; } cat >>confdefs.h <<_ACEOF @@ -13608,8 +13355,8 @@ # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 # (Shared libraries in this instance are shared modules to be loaded into # Python, as opposed to building Python itself as a shared library.) -{ $as_echo "$as_me:$LINENO: checking LDSHARED" >&5 -$as_echo_n "checking LDSHARED... " >&6; } +{ echo "$as_me:$LINENO: checking LDSHARED" >&5 +echo $ECHO_N "checking LDSHARED... $ECHO_C" >&6; } if test -z "$LDSHARED" then case $ac_sys_system/$ac_sys_release in @@ -13711,13 +13458,13 @@ *) LDSHARED="ld";; esac fi -{ $as_echo "$as_me:$LINENO: result: $LDSHARED" >&5 -$as_echo "$LDSHARED" >&6; } +{ echo "$as_me:$LINENO: result: $LDSHARED" >&5 +echo "${ECHO_T}$LDSHARED" >&6; } BLDSHARED=${BLDSHARED-$LDSHARED} # CCSHARED are the C *flags* used to create objects to go into a shared # library (module) -- this is only needed for a few systems -{ $as_echo "$as_me:$LINENO: checking CCSHARED" >&5 -$as_echo_n "checking CCSHARED... " >&6; } +{ echo "$as_me:$LINENO: checking CCSHARED" >&5 +echo $ECHO_N "checking CCSHARED... $ECHO_C" >&6; } if test -z "$CCSHARED" then case $ac_sys_system/$ac_sys_release in @@ -13752,12 +13499,12 @@ atheos*) CCSHARED="-fPIC";; esac fi -{ $as_echo "$as_me:$LINENO: result: $CCSHARED" >&5 -$as_echo "$CCSHARED" >&6; } +{ echo "$as_me:$LINENO: result: $CCSHARED" >&5 +echo "${ECHO_T}$CCSHARED" >&6; } # LINKFORSHARED are the flags passed to the $(CC) command that links # the python executable -- this is only needed for a few systems -{ $as_echo "$as_me:$LINENO: checking LINKFORSHARED" >&5 -$as_echo_n "checking LINKFORSHARED... " >&6; } +{ echo "$as_me:$LINENO: checking LINKFORSHARED" >&5 +echo $ECHO_N "checking LINKFORSHARED... $ECHO_C" >&6; } if test -z "$LINKFORSHARED" then case $ac_sys_system/$ac_sys_release in @@ -13804,13 +13551,13 @@ LINKFORSHARED='-Wl,-E -N 2048K';; esac fi -{ $as_echo "$as_me:$LINENO: result: $LINKFORSHARED" >&5 -$as_echo "$LINKFORSHARED" >&6; } +{ echo "$as_me:$LINENO: result: $LINKFORSHARED" >&5 +echo "${ECHO_T}$LINKFORSHARED" >&6; } -{ $as_echo "$as_me:$LINENO: checking CFLAGSFORSHARED" >&5 -$as_echo_n "checking CFLAGSFORSHARED... " >&6; } +{ echo "$as_me:$LINENO: checking CFLAGSFORSHARED" >&5 +echo $ECHO_N "checking CFLAGSFORSHARED... $ECHO_C" >&6; } if test ! "$LIBRARY" = "$LDLIBRARY" then case $ac_sys_system in @@ -13822,8 +13569,8 @@ CFLAGSFORSHARED='$(CCSHARED)' esac fi -{ $as_echo "$as_me:$LINENO: result: $CFLAGSFORSHARED" >&5 -$as_echo "$CFLAGSFORSHARED" >&6; } +{ echo "$as_me:$LINENO: result: $CFLAGSFORSHARED" >&5 +echo "${ECHO_T}$CFLAGSFORSHARED" >&6; } # SHLIBS are libraries (except -lc and -lm) to link to the python shared # library (with --enable-shared). @@ -13834,22 +13581,22 @@ # don't need to link LIBS explicitly. The default should be only changed # on systems where this approach causes problems. -{ $as_echo "$as_me:$LINENO: checking SHLIBS" >&5 -$as_echo_n "checking SHLIBS... " >&6; } +{ echo "$as_me:$LINENO: checking SHLIBS" >&5 +echo $ECHO_N "checking SHLIBS... $ECHO_C" >&6; } case "$ac_sys_system" in *) SHLIBS='$(LIBS)';; esac -{ $as_echo "$as_me:$LINENO: result: $SHLIBS" >&5 -$as_echo "$SHLIBS" >&6; } +{ echo "$as_me:$LINENO: result: $SHLIBS" >&5 +echo "${ECHO_T}$SHLIBS" >&6; } # checks for libraries -{ $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } +{ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" @@ -13881,37 +13628,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_dl_dlopen=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } +if test $ac_cv_lib_dl_dlopen = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDL 1 _ACEOF @@ -13921,10 +13664,10 @@ fi # Dynamic linking for SunOS/Solaris and SYSV -{ $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } +{ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" @@ -13956,37 +13699,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_dld_shl_load=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } +if test $ac_cv_lib_dld_shl_load = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDLD 1 _ACEOF @@ -13998,10 +13737,10 @@ # only check for sem_init if thread support is requested if test "$with_threads" = "yes" -o -z "$with_threads"; then - { $as_echo "$as_me:$LINENO: checking for library containing sem_init" >&5 -$as_echo_n "checking for library containing sem_init... " >&6; } + { echo "$as_me:$LINENO: checking for library containing sem_init" >&5 +echo $ECHO_N "checking for library containing sem_init... $ECHO_C" >&6; } if test "${ac_cv_search_sem_init+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF @@ -14039,30 +13778,26 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_search_sem_init=$ac_res else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_sem_init+set}" = set; then @@ -14077,8 +13812,8 @@ rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_sem_init" >&5 -$as_echo "$ac_cv_search_sem_init" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_search_sem_init" >&5 +echo "${ECHO_T}$ac_cv_search_sem_init" >&6; } ac_res=$ac_cv_search_sem_init if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" @@ -14090,10 +13825,10 @@ fi # check if we need libintl for locale functions -{ $as_echo "$as_me:$LINENO: checking for textdomain in -lintl" >&5 -$as_echo_n "checking for textdomain in -lintl... " >&6; } +{ echo "$as_me:$LINENO: checking for textdomain in -lintl" >&5 +echo $ECHO_N "checking for textdomain in -lintl... $ECHO_C" >&6; } if test "${ac_cv_lib_intl_textdomain+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" @@ -14125,37 +13860,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_intl_textdomain=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_intl_textdomain=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_textdomain" >&5 -$as_echo "$ac_cv_lib_intl_textdomain" >&6; } -if test "x$ac_cv_lib_intl_textdomain" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_intl_textdomain" >&5 +echo "${ECHO_T}$ac_cv_lib_intl_textdomain" >&6; } +if test $ac_cv_lib_intl_textdomain = yes; then cat >>confdefs.h <<\_ACEOF #define WITH_LIBINTL 1 @@ -14166,8 +13897,8 @@ # checks for system dependent C++ extensions support case "$ac_sys_system" in - AIX*) { $as_echo "$as_me:$LINENO: checking for genuine AIX C++ extensions support" >&5 -$as_echo_n "checking for genuine AIX C++ extensions support... " >&6; } + AIX*) { echo "$as_me:$LINENO: checking for genuine AIX C++ extensions support" >&5 +echo $ECHO_N "checking for genuine AIX C++ extensions support... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14189,47 +13920,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then cat >>confdefs.h <<\_ACEOF #define AIX_GENUINE_CPLUSPLUS 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext;; *) ;; esac # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. -{ $as_echo "$as_me:$LINENO: checking for t_open in -lnsl" >&5 -$as_echo_n "checking for t_open in -lnsl... " >&6; } +{ echo "$as_me:$LINENO: checking for t_open in -lnsl" >&5 +echo $ECHO_N "checking for t_open in -lnsl... $ECHO_C" >&6; } if test "${ac_cv_lib_nsl_t_open+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" @@ -14261,44 +13988,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_nsl_t_open=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_t_open=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_t_open" >&5 -$as_echo "$ac_cv_lib_nsl_t_open" >&6; } -if test "x$ac_cv_lib_nsl_t_open" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_t_open" >&5 +echo "${ECHO_T}$ac_cv_lib_nsl_t_open" >&6; } +if test $ac_cv_lib_nsl_t_open = yes; then LIBS="-lnsl $LIBS" fi # SVR4 -{ $as_echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 -$as_echo_n "checking for socket in -lsocket... " >&6; } +{ echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 +echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6; } if test "${ac_cv_lib_socket_socket+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS $LIBS" @@ -14330,60 +14053,56 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_socket_socket=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_socket=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 -$as_echo "$ac_cv_lib_socket_socket" >&6; } -if test "x$ac_cv_lib_socket_socket" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6; } +if test $ac_cv_lib_socket_socket = yes; then LIBS="-lsocket $LIBS" fi # SVR4 sockets -{ $as_echo "$as_me:$LINENO: checking for --with-libs" >&5 -$as_echo_n "checking for --with-libs... " >&6; } +{ echo "$as_me:$LINENO: checking for --with-libs" >&5 +echo $ECHO_N "checking for --with-libs... $ECHO_C" >&6; } # Check whether --with-libs was given. if test "${with_libs+set}" = set; then withval=$with_libs; -{ $as_echo "$as_me:$LINENO: result: $withval" >&5 -$as_echo "$withval" >&6; } +{ echo "$as_me:$LINENO: result: $withval" >&5 +echo "${ECHO_T}$withval" >&6; } LIBS="$withval $LIBS" else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Check for use of the system libffi library -{ $as_echo "$as_me:$LINENO: checking for --with-system-ffi" >&5 -$as_echo_n "checking for --with-system-ffi... " >&6; } +{ echo "$as_me:$LINENO: checking for --with-system-ffi" >&5 +echo $ECHO_N "checking for --with-system-ffi... $ECHO_C" >&6; } # Check whether --with-system_ffi was given. if test "${with_system_ffi+set}" = set; then @@ -14391,41 +14110,41 @@ fi -{ $as_echo "$as_me:$LINENO: result: $with_system_ffi" >&5 -$as_echo "$with_system_ffi" >&6; } +{ echo "$as_me:$LINENO: result: $with_system_ffi" >&5 +echo "${ECHO_T}$with_system_ffi" >&6; } # Check for --with-dbmliborder -{ $as_echo "$as_me:$LINENO: checking for --with-dbmliborder" >&5 -$as_echo_n "checking for --with-dbmliborder... " >&6; } +{ echo "$as_me:$LINENO: checking for --with-dbmliborder" >&5 +echo $ECHO_N "checking for --with-dbmliborder... $ECHO_C" >&6; } # Check whether --with-dbmliborder was given. if test "${with_dbmliborder+set}" = set; then withval=$with_dbmliborder; if test x$with_dbmliborder = xyes then -{ { $as_echo "$as_me:$LINENO: error: proper usage is --with-dbmliborder=db1:db2:..." >&5 -$as_echo "$as_me: error: proper usage is --with-dbmliborder=db1:db2:..." >&2;} +{ { echo "$as_me:$LINENO: error: proper usage is --with-dbmliborder=db1:db2:..." >&5 +echo "$as_me: error: proper usage is --with-dbmliborder=db1:db2:..." >&2;} { (exit 1); exit 1; }; } else for db in `echo $with_dbmliborder | sed 's/:/ /g'`; do if test x$db != xndbm && test x$db != xgdbm && test x$db != xbdb then - { { $as_echo "$as_me:$LINENO: error: proper usage is --with-dbmliborder=db1:db2:..." >&5 -$as_echo "$as_me: error: proper usage is --with-dbmliborder=db1:db2:..." >&2;} + { { echo "$as_me:$LINENO: error: proper usage is --with-dbmliborder=db1:db2:..." >&5 +echo "$as_me: error: proper usage is --with-dbmliborder=db1:db2:..." >&2;} { (exit 1); exit 1; }; } fi done fi fi -{ $as_echo "$as_me:$LINENO: result: $with_dbmliborder" >&5 -$as_echo "$with_dbmliborder" >&6; } +{ echo "$as_me:$LINENO: result: $with_dbmliborder" >&5 +echo "${ECHO_T}$with_dbmliborder" >&6; } # Determine if signalmodule should be used. -{ $as_echo "$as_me:$LINENO: checking for --with-signal-module" >&5 -$as_echo_n "checking for --with-signal-module... " >&6; } +{ echo "$as_me:$LINENO: checking for --with-signal-module" >&5 +echo $ECHO_N "checking for --with-signal-module... $ECHO_C" >&6; } # Check whether --with-signal-module was given. if test "${with_signal_module+set}" = set; then @@ -14436,8 +14155,8 @@ if test -z "$with_signal_module" then with_signal_module="yes" fi -{ $as_echo "$as_me:$LINENO: result: $with_signal_module" >&5 -$as_echo "$with_signal_module" >&6; } +{ echo "$as_me:$LINENO: result: $with_signal_module" >&5 +echo "${ECHO_T}$with_signal_module" >&6; } if test "${with_signal_module}" = "yes"; then USE_SIGNAL_MODULE="" @@ -14451,22 +14170,22 @@ USE_THREAD_MODULE="" -{ $as_echo "$as_me:$LINENO: checking for --with-dec-threads" >&5 -$as_echo_n "checking for --with-dec-threads... " >&6; } +{ echo "$as_me:$LINENO: checking for --with-dec-threads" >&5 +echo $ECHO_N "checking for --with-dec-threads... $ECHO_C" >&6; } # Check whether --with-dec-threads was given. if test "${with_dec_threads+set}" = set; then withval=$with_dec_threads; -{ $as_echo "$as_me:$LINENO: result: $withval" >&5 -$as_echo "$withval" >&6; } +{ echo "$as_me:$LINENO: result: $withval" >&5 +echo "${ECHO_T}$withval" >&6; } LDLAST=-threads if test "${with_thread+set}" != set; then with_thread="$withval"; fi else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -14479,8 +14198,8 @@ -{ $as_echo "$as_me:$LINENO: checking for --with-threads" >&5 -$as_echo_n "checking for --with-threads... " >&6; } +{ echo "$as_me:$LINENO: checking for --with-threads" >&5 +echo $ECHO_N "checking for --with-threads... $ECHO_C" >&6; } # Check whether --with-threads was given. if test "${with_threads+set}" = set; then @@ -14499,8 +14218,8 @@ if test -z "$with_threads" then with_threads="yes" fi -{ $as_echo "$as_me:$LINENO: result: $with_threads" >&5 -$as_echo "$with_threads" >&6; } +{ echo "$as_me:$LINENO: result: $with_threads" >&5 +echo "${ECHO_T}$with_threads" >&6; } if test "$with_threads" = "no" @@ -14566,8 +14285,8 @@ # According to the POSIX spec, a pthreads implementation must # define _POSIX_THREADS in unistd.h. Some apparently don't # (e.g. gnu pth with pthread emulation) - { $as_echo "$as_me:$LINENO: checking for _POSIX_THREADS in unistd.h" >&5 -$as_echo_n "checking for _POSIX_THREADS in unistd.h... " >&6; } + { echo "$as_me:$LINENO: checking for _POSIX_THREADS in unistd.h" >&5 +echo $ECHO_N "checking for _POSIX_THREADS in unistd.h... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14589,25 +14308,25 @@ fi rm -f conftest* - { $as_echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5 -$as_echo "$unistd_defines_pthreads" >&6; } + { echo "$as_me:$LINENO: result: $unistd_defines_pthreads" >&5 +echo "${ECHO_T}$unistd_defines_pthreads" >&6; } cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF if test "${ac_cv_header_cthreads_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for cthreads.h" >&5 -$as_echo_n "checking for cthreads.h... " >&6; } + { echo "$as_me:$LINENO: checking for cthreads.h" >&5 +echo $ECHO_N "checking for cthreads.h... $ECHO_C" >&6; } if test "${ac_cv_header_cthreads_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 -$as_echo "$ac_cv_header_cthreads_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 +echo "${ECHO_T}$ac_cv_header_cthreads_h" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking cthreads.h usability" >&5 -$as_echo_n "checking cthreads.h usability... " >&6; } +{ echo "$as_me:$LINENO: checking cthreads.h usability" >&5 +echo $ECHO_N "checking cthreads.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14623,33 +14342,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking cthreads.h presence" >&5 -$as_echo_n "checking cthreads.h presence... " >&6; } +{ echo "$as_me:$LINENO: checking cthreads.h presence" >&5 +echo $ECHO_N "checking cthreads.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14663,52 +14381,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: cthreads.h: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: cthreads.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: cthreads.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: cthreads.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: cthreads.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: cthreads.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: cthreads.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: cthreads.h: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: cthreads.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: cthreads.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: cthreads.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: cthreads.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: cthreads.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: cthreads.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: cthreads.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: cthreads.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: cthreads.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: cthreads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -14717,18 +14434,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for cthreads.h" >&5 -$as_echo_n "checking for cthreads.h... " >&6; } +{ echo "$as_me:$LINENO: checking for cthreads.h" >&5 +echo $ECHO_N "checking for cthreads.h... $ECHO_C" >&6; } if test "${ac_cv_header_cthreads_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_cthreads_h=$ac_header_preproc fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 -$as_echo "$ac_cv_header_cthreads_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_cthreads_h" >&5 +echo "${ECHO_T}$ac_cv_header_cthreads_h" >&6; } fi -if test "x$ac_cv_header_cthreads_h" = x""yes; then +if test $ac_cv_header_cthreads_h = yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14747,17 +14464,17 @@ else if test "${ac_cv_header_mach_cthreads_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 -$as_echo_n "checking for mach/cthreads.h... " >&6; } + { echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 +echo $ECHO_N "checking for mach/cthreads.h... $ECHO_C" >&6; } if test "${ac_cv_header_mach_cthreads_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 -$as_echo "$ac_cv_header_mach_cthreads_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 +echo "${ECHO_T}$ac_cv_header_mach_cthreads_h" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking mach/cthreads.h usability" >&5 -$as_echo_n "checking mach/cthreads.h usability... " >&6; } +{ echo "$as_me:$LINENO: checking mach/cthreads.h usability" >&5 +echo $ECHO_N "checking mach/cthreads.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14773,33 +14490,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking mach/cthreads.h presence" >&5 -$as_echo_n "checking mach/cthreads.h presence... " >&6; } +{ echo "$as_me:$LINENO: checking mach/cthreads.h presence" >&5 +echo $ECHO_N "checking mach/cthreads.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14813,52 +14529,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: mach/cthreads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: mach/cthreads.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: mach/cthreads.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: mach/cthreads.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: mach/cthreads.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: mach/cthreads.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: mach/cthreads.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: mach/cthreads.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: mach/cthreads.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: mach/cthreads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -14867,18 +14582,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 -$as_echo_n "checking for mach/cthreads.h... " >&6; } +{ echo "$as_me:$LINENO: checking for mach/cthreads.h" >&5 +echo $ECHO_N "checking for mach/cthreads.h... $ECHO_C" >&6; } if test "${ac_cv_header_mach_cthreads_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_mach_cthreads_h=$ac_header_preproc fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 -$as_echo "$ac_cv_header_mach_cthreads_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_mach_cthreads_h" >&5 +echo "${ECHO_T}$ac_cv_header_mach_cthreads_h" >&6; } fi -if test "x$ac_cv_header_mach_cthreads_h" = x""yes; then +if test $ac_cv_header_mach_cthreads_h = yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14895,13 +14610,13 @@ THREADOBJ="Python/thread.o" else - { $as_echo "$as_me:$LINENO: checking for --with-pth" >&5 -$as_echo_n "checking for --with-pth... " >&6; } + { echo "$as_me:$LINENO: checking for --with-pth" >&5 +echo $ECHO_N "checking for --with-pth... $ECHO_C" >&6; } # Check whether --with-pth was given. if test "${with_pth+set}" = set; then - withval=$with_pth; { $as_echo "$as_me:$LINENO: result: $withval" >&5 -$as_echo "$withval" >&6; } + withval=$with_pth; { echo "$as_me:$LINENO: result: $withval" >&5 +echo "${ECHO_T}$withval" >&6; } cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14914,16 +14629,16 @@ LIBS="-lpth $LIBS" THREADOBJ="Python/thread.o" else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } # Just looking for pthread_create in libpthread is not enough: # on HP/UX, pthread.h renames pthread_create to a different symbol name. # So we really have to include pthread.h, and then link. _libs=$LIBS LIBS="$LIBS -lpthread" - { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 -$as_echo_n "checking for pthread_create in -lpthread... " >&6; } + { echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 +echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -14948,24 +14663,21 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -14973,15 +14685,15 @@ posix_threads=yes THREADOBJ="Python/thread.o" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$_libs - { $as_echo "$as_me:$LINENO: checking for pthread_detach" >&5 -$as_echo_n "checking for pthread_detach... " >&6; } + { echo "$as_me:$LINENO: checking for pthread_detach" >&5 +echo $ECHO_N "checking for pthread_detach... $ECHO_C" >&6; } if test "${ac_cv_func_pthread_detach+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -15034,36 +14746,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_pthread_detach=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_pthread_detach=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_pthread_detach" >&5 -$as_echo "$ac_cv_func_pthread_detach" >&6; } -if test "x$ac_cv_func_pthread_detach" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_func_pthread_detach" >&5 +echo "${ECHO_T}$ac_cv_func_pthread_detach" >&6; } +if test $ac_cv_func_pthread_detach = yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15073,17 +14781,17 @@ else if test "${ac_cv_header_atheos_threads_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 -$as_echo_n "checking for atheos/threads.h... " >&6; } + { echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 +echo $ECHO_N "checking for atheos/threads.h... $ECHO_C" >&6; } if test "${ac_cv_header_atheos_threads_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 -$as_echo "$ac_cv_header_atheos_threads_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 +echo "${ECHO_T}$ac_cv_header_atheos_threads_h" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking atheos/threads.h usability" >&5 -$as_echo_n "checking atheos/threads.h usability... " >&6; } +{ echo "$as_me:$LINENO: checking atheos/threads.h usability" >&5 +echo $ECHO_N "checking atheos/threads.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15099,33 +14807,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking atheos/threads.h presence" >&5 -$as_echo_n "checking atheos/threads.h presence... " >&6; } +{ echo "$as_me:$LINENO: checking atheos/threads.h presence" >&5 +echo $ECHO_N "checking atheos/threads.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -15139,52 +14846,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: atheos/threads.h: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: atheos/threads.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: atheos/threads.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: atheos/threads.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: atheos/threads.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: atheos/threads.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: atheos/threads.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: atheos/threads.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: atheos/threads.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: atheos/threads.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: atheos/threads.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: atheos/threads.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: atheos/threads.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -15193,18 +14899,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 -$as_echo_n "checking for atheos/threads.h... " >&6; } +{ echo "$as_me:$LINENO: checking for atheos/threads.h" >&5 +echo $ECHO_N "checking for atheos/threads.h... $ECHO_C" >&6; } if test "${ac_cv_header_atheos_threads_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_atheos_threads_h=$ac_header_preproc fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 -$as_echo "$ac_cv_header_atheos_threads_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_atheos_threads_h" >&5 +echo "${ECHO_T}$ac_cv_header_atheos_threads_h" >&6; } fi -if test "x$ac_cv_header_atheos_threads_h" = x""yes; then +if test $ac_cv_header_atheos_threads_h = yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15217,10 +14923,10 @@ THREADOBJ="Python/thread.o" else - { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthreads" >&5 -$as_echo_n "checking for pthread_create in -lpthreads... " >&6; } + { echo "$as_me:$LINENO: checking for pthread_create in -lpthreads" >&5 +echo $ECHO_N "checking for pthread_create in -lpthreads... $ECHO_C" >&6; } if test "${ac_cv_lib_pthreads_pthread_create+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" @@ -15252,37 +14958,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_pthreads_pthread_create=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthreads_pthread_create=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_create" >&5 -$as_echo "$ac_cv_lib_pthreads_pthread_create" >&6; } -if test "x$ac_cv_lib_pthreads_pthread_create" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_create" >&5 +echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_create" >&6; } +if test $ac_cv_lib_pthreads_pthread_create = yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15292,10 +14994,10 @@ THREADOBJ="Python/thread.o" else - { $as_echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5 -$as_echo_n "checking for pthread_create in -lc_r... " >&6; } + { echo "$as_me:$LINENO: checking for pthread_create in -lc_r" >&5 +echo $ECHO_N "checking for pthread_create in -lc_r... $ECHO_C" >&6; } if test "${ac_cv_lib_c_r_pthread_create+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" @@ -15327,37 +15029,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_c_r_pthread_create=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_create=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5 -$as_echo "$ac_cv_lib_c_r_pthread_create" >&6; } -if test "x$ac_cv_lib_c_r_pthread_create" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_create" >&5 +echo "${ECHO_T}$ac_cv_lib_c_r_pthread_create" >&6; } +if test $ac_cv_lib_c_r_pthread_create = yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15367,10 +15065,10 @@ THREADOBJ="Python/thread.o" else - { $as_echo "$as_me:$LINENO: checking for __pthread_create_system in -lpthread" >&5 -$as_echo_n "checking for __pthread_create_system in -lpthread... " >&6; } + { echo "$as_me:$LINENO: checking for __pthread_create_system in -lpthread" >&5 +echo $ECHO_N "checking for __pthread_create_system in -lpthread... $ECHO_C" >&6; } if test "${ac_cv_lib_pthread___pthread_create_system+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" @@ -15402,37 +15100,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_pthread___pthread_create_system=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread___pthread_create_system=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_create_system" >&5 -$as_echo "$ac_cv_lib_pthread___pthread_create_system" >&6; } -if test "x$ac_cv_lib_pthread___pthread_create_system" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_create_system" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread___pthread_create_system" >&6; } +if test $ac_cv_lib_pthread___pthread_create_system = yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15442,10 +15136,10 @@ THREADOBJ="Python/thread.o" else - { $as_echo "$as_me:$LINENO: checking for pthread_create in -lcma" >&5 -$as_echo_n "checking for pthread_create in -lcma... " >&6; } + { echo "$as_me:$LINENO: checking for pthread_create in -lcma" >&5 +echo $ECHO_N "checking for pthread_create in -lcma... $ECHO_C" >&6; } if test "${ac_cv_lib_cma_pthread_create+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcma $LIBS" @@ -15477,37 +15171,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_cma_pthread_create=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_cma_pthread_create=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cma_pthread_create" >&5 -$as_echo "$ac_cv_lib_cma_pthread_create" >&6; } -if test "x$ac_cv_lib_cma_pthread_create" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_cma_pthread_create" >&5 +echo "${ECHO_T}$ac_cv_lib_cma_pthread_create" >&6; } +if test $ac_cv_lib_cma_pthread_create = yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15534,7 +15224,6 @@ fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi @@ -15546,10 +15235,10 @@ - { $as_echo "$as_me:$LINENO: checking for usconfig in -lmpc" >&5 -$as_echo_n "checking for usconfig in -lmpc... " >&6; } + { echo "$as_me:$LINENO: checking for usconfig in -lmpc" >&5 +echo $ECHO_N "checking for usconfig in -lmpc... $ECHO_C" >&6; } if test "${ac_cv_lib_mpc_usconfig+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmpc $LIBS" @@ -15581,37 +15270,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_mpc_usconfig=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_mpc_usconfig=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mpc_usconfig" >&5 -$as_echo "$ac_cv_lib_mpc_usconfig" >&6; } -if test "x$ac_cv_lib_mpc_usconfig" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_mpc_usconfig" >&5 +echo "${ECHO_T}$ac_cv_lib_mpc_usconfig" >&6; } +if test $ac_cv_lib_mpc_usconfig = yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15623,10 +15308,10 @@ if test "$posix_threads" != "yes"; then - { $as_echo "$as_me:$LINENO: checking for thr_create in -lthread" >&5 -$as_echo_n "checking for thr_create in -lthread... " >&6; } + { echo "$as_me:$LINENO: checking for thr_create in -lthread" >&5 +echo $ECHO_N "checking for thr_create in -lthread... $ECHO_C" >&6; } if test "${ac_cv_lib_thread_thr_create+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lthread $LIBS" @@ -15658,37 +15343,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_thread_thr_create=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_thread_thr_create=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_thread_thr_create" >&5 -$as_echo "$ac_cv_lib_thread_thr_create" >&6; } -if test "x$ac_cv_lib_thread_thr_create" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_thread_thr_create" >&5 +echo "${ECHO_T}$ac_cv_lib_thread_thr_create" >&6; } +if test $ac_cv_lib_thread_thr_create = yes; then cat >>confdefs.h <<\_ACEOF #define WITH_THREAD 1 _ACEOF @@ -15741,10 +15422,10 @@ ;; esac - { $as_echo "$as_me:$LINENO: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5 -$as_echo_n "checking if PTHREAD_SCOPE_SYSTEM is supported... " >&6; } + { echo "$as_me:$LINENO: checking if PTHREAD_SCOPE_SYSTEM is supported" >&5 +echo $ECHO_N "checking if PTHREAD_SCOPE_SYSTEM is supported... $ECHO_C" >&6; } if test "${ac_cv_pthread_system_supported+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_pthread_system_supported=no @@ -15774,32 +15455,29 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_pthread_system_supported=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_pthread_system_supported=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -15807,8 +15485,8 @@ fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_pthread_system_supported" >&5 -$as_echo "$ac_cv_pthread_system_supported" >&6; } + { echo "$as_me:$LINENO: result: $ac_cv_pthread_system_supported" >&5 +echo "${ECHO_T}$ac_cv_pthread_system_supported" >&6; } if test "$ac_cv_pthread_system_supported" = "yes"; then cat >>confdefs.h <<\_ACEOF @@ -15819,11 +15497,11 @@ for ac_func in pthread_sigmask do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -15876,42 +15554,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF case $ac_sys_system in CYGWIN*) @@ -15931,18 +15602,18 @@ # Check for enable-ipv6 -{ $as_echo "$as_me:$LINENO: checking if --enable-ipv6 is specified" >&5 -$as_echo_n "checking if --enable-ipv6 is specified... " >&6; } +{ echo "$as_me:$LINENO: checking if --enable-ipv6 is specified" >&5 +echo $ECHO_N "checking if --enable-ipv6 is specified... $ECHO_C" >&6; } # Check whether --enable-ipv6 was given. if test "${enable_ipv6+set}" = set; then enableval=$enable_ipv6; case "$enableval" in no) - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } ipv6=no ;; - *) { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + *) { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define ENABLE_IPV6 1 _ACEOF @@ -15953,8 +15624,8 @@ else if test "$cross_compiling" = yes; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } ipv6=no else @@ -15982,44 +15653,41 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } ipv6=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } +{ echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } ipv6=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test "$ipv6" = "yes"; then - { $as_echo "$as_me:$LINENO: checking if RFC2553 API is available" >&5 -$as_echo_n "checking if RFC2553 API is available... " >&6; } + { echo "$as_me:$LINENO: checking if RFC2553 API is available" >&5 +echo $ECHO_N "checking if RFC2553 API is available... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16043,27 +15711,26 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } ipv6=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } ipv6=no fi @@ -16085,8 +15752,8 @@ ipv6trylibc=no if test "$ipv6" = "yes"; then - { $as_echo "$as_me:$LINENO: checking ipv6 stack type" >&5 -$as_echo_n "checking ipv6 stack type... " >&6; } + { echo "$as_me:$LINENO: checking ipv6 stack type" >&5 +echo $ECHO_N "checking ipv6 stack type... $ECHO_C" >&6; } for i in inria kame linux-glibc linux-inet6 solaris toshiba v6d zeta; do case $i in @@ -16242,8 +15909,8 @@ break fi done - { $as_echo "$as_me:$LINENO: result: $ipv6type" >&5 -$as_echo "$ipv6type" >&6; } + { echo "$as_me:$LINENO: result: $ipv6type" >&5 +echo "${ECHO_T}$ipv6type" >&6; } fi if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then @@ -16262,8 +15929,8 @@ fi fi -{ $as_echo "$as_me:$LINENO: checking for OSX 10.5 SDK or later" >&5 -$as_echo_n "checking for OSX 10.5 SDK or later... " >&6; } +{ echo "$as_me:$LINENO: checking for OSX 10.5 SDK or later" >&5 +echo $ECHO_N "checking for OSX 10.5 SDK or later... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16285,14 +15952,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16302,22 +15968,22 @@ #define HAVE_OSX105_SDK 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Check for --with-doc-strings -{ $as_echo "$as_me:$LINENO: checking for --with-doc-strings" >&5 -$as_echo_n "checking for --with-doc-strings... " >&6; } +{ echo "$as_me:$LINENO: checking for --with-doc-strings" >&5 +echo $ECHO_N "checking for --with-doc-strings... $ECHO_C" >&6; } # Check whether --with-doc-strings was given. if test "${with_doc_strings+set}" = set; then @@ -16336,12 +16002,12 @@ _ACEOF fi -{ $as_echo "$as_me:$LINENO: result: $with_doc_strings" >&5 -$as_echo "$with_doc_strings" >&6; } +{ echo "$as_me:$LINENO: result: $with_doc_strings" >&5 +echo "${ECHO_T}$with_doc_strings" >&6; } # Check for Python-specific malloc support -{ $as_echo "$as_me:$LINENO: checking for --with-tsc" >&5 -$as_echo_n "checking for --with-tsc... " >&6; } +{ echo "$as_me:$LINENO: checking for --with-tsc" >&5 +echo $ECHO_N "checking for --with-tsc... $ECHO_C" >&6; } # Check whether --with-tsc was given. if test "${with_tsc+set}" = set; then @@ -16353,20 +16019,20 @@ #define WITH_TSC 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } -else { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Check for Python-specific malloc support -{ $as_echo "$as_me:$LINENO: checking for --with-pymalloc" >&5 -$as_echo_n "checking for --with-pymalloc... " >&6; } +{ echo "$as_me:$LINENO: checking for --with-pymalloc" >&5 +echo $ECHO_N "checking for --with-pymalloc... $ECHO_C" >&6; } # Check whether --with-pymalloc was given. if test "${with_pymalloc+set}" = set; then @@ -16385,12 +16051,12 @@ _ACEOF fi -{ $as_echo "$as_me:$LINENO: result: $with_pymalloc" >&5 -$as_echo "$with_pymalloc" >&6; } +{ echo "$as_me:$LINENO: result: $with_pymalloc" >&5 +echo "${ECHO_T}$with_pymalloc" >&6; } # Check for --with-wctype-functions -{ $as_echo "$as_me:$LINENO: checking for --with-wctype-functions" >&5 -$as_echo_n "checking for --with-wctype-functions... " >&6; } +{ echo "$as_me:$LINENO: checking for --with-wctype-functions" >&5 +echo $ECHO_N "checking for --with-wctype-functions... $ECHO_C" >&6; } # Check whether --with-wctype-functions was given. if test "${with_wctype_functions+set}" = set; then @@ -16402,14 +16068,14 @@ #define WANT_WCTYPE_FUNCTIONS 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } -else { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -16422,11 +16088,11 @@ for ac_func in dlopen do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -16479,42 +16145,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -16524,8 +16183,8 @@ # DYNLOADFILE specifies which dynload_*.o file we will use for dynamic # loading of modules. -{ $as_echo "$as_me:$LINENO: checking DYNLOADFILE" >&5 -$as_echo_n "checking DYNLOADFILE... " >&6; } +{ echo "$as_me:$LINENO: checking DYNLOADFILE" >&5 +echo $ECHO_N "checking DYNLOADFILE... $ECHO_C" >&6; } if test -z "$DYNLOADFILE" then case $ac_sys_system/$ac_sys_release in @@ -16549,8 +16208,8 @@ ;; esac fi -{ $as_echo "$as_me:$LINENO: result: $DYNLOADFILE" >&5 -$as_echo "$DYNLOADFILE" >&6; } +{ echo "$as_me:$LINENO: result: $DYNLOADFILE" >&5 +echo "${ECHO_T}$DYNLOADFILE" >&6; } if test "$DYNLOADFILE" != "dynload_stub.o" then @@ -16563,16 +16222,16 @@ # MACHDEP_OBJS can be set to platform-specific object files needed by Python -{ $as_echo "$as_me:$LINENO: checking MACHDEP_OBJS" >&5 -$as_echo_n "checking MACHDEP_OBJS... " >&6; } +{ echo "$as_me:$LINENO: checking MACHDEP_OBJS" >&5 +echo $ECHO_N "checking MACHDEP_OBJS... $ECHO_C" >&6; } if test -z "$MACHDEP_OBJS" then MACHDEP_OBJS=$extra_machdep_objs else MACHDEP_OBJS="$MACHDEP_OBJS $extra_machdep_objs" fi -{ $as_echo "$as_me:$LINENO: result: MACHDEP_OBJS" >&5 -$as_echo "MACHDEP_OBJS" >&6; } +{ echo "$as_me:$LINENO: result: MACHDEP_OBJS" >&5 +echo "${ECHO_T}MACHDEP_OBJS" >&6; } # checks for library functions @@ -16663,6 +16322,7 @@ + for ac_func in alarm setitimer getitimer bind_textdomain_codeset chown \ clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \ @@ -16675,13 +16335,14 @@ setlocale setregid setreuid setsid setpgid setpgrp setuid setvbuf snprintf \ sigaction siginterrupt sigrelse strftime strlcpy \ sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ - truncate uname unsetenv utimes waitpid wait3 wait4 wcscoll wcsxfrm _getpty + truncate uname unsetenv utimes waitpid wait3 wait4 \ + wcscoll wcsftime wcsxfrm _getpty do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -16734,42 +16395,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -16778,8 +16432,8 @@ # For some functions, having a definition is not sufficient, since # we want to take their address. -{ $as_echo "$as_me:$LINENO: checking for chroot" >&5 -$as_echo_n "checking for chroot... " >&6; } +{ echo "$as_me:$LINENO: checking for chroot" >&5 +echo $ECHO_N "checking for chroot... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16801,14 +16455,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16818,20 +16471,20 @@ #define HAVE_CHROOT 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: checking for link" >&5 -$as_echo_n "checking for link... " >&6; } +{ echo "$as_me:$LINENO: checking for link" >&5 +echo $ECHO_N "checking for link... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16853,14 +16506,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16870,20 +16522,20 @@ #define HAVE_LINK 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: checking for symlink" >&5 -$as_echo_n "checking for symlink... " >&6; } +{ echo "$as_me:$LINENO: checking for symlink" >&5 +echo $ECHO_N "checking for symlink... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16905,14 +16557,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16922,20 +16573,20 @@ #define HAVE_SYMLINK 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: checking for fchdir" >&5 -$as_echo_n "checking for fchdir... " >&6; } +{ echo "$as_me:$LINENO: checking for fchdir" >&5 +echo $ECHO_N "checking for fchdir... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -16957,14 +16608,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -16974,20 +16624,20 @@ #define HAVE_FCHDIR 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: checking for fsync" >&5 -$as_echo_n "checking for fsync... " >&6; } +{ echo "$as_me:$LINENO: checking for fsync" >&5 +echo $ECHO_N "checking for fsync... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17009,14 +16659,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17026,20 +16675,20 @@ #define HAVE_FSYNC 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: checking for fdatasync" >&5 -$as_echo_n "checking for fdatasync... " >&6; } +{ echo "$as_me:$LINENO: checking for fdatasync" >&5 +echo $ECHO_N "checking for fdatasync... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17061,14 +16710,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17078,20 +16726,20 @@ #define HAVE_FDATASYNC 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: checking for epoll" >&5 -$as_echo_n "checking for epoll... " >&6; } +{ echo "$as_me:$LINENO: checking for epoll" >&5 +echo $ECHO_N "checking for epoll... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17113,14 +16761,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17130,20 +16777,20 @@ #define HAVE_EPOLL 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: checking for kqueue" >&5 -$as_echo_n "checking for kqueue... " >&6; } +{ echo "$as_me:$LINENO: checking for kqueue" >&5 +echo $ECHO_N "checking for kqueue... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17168,14 +16815,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17185,14 +16831,14 @@ #define HAVE_KQUEUE 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -17203,8 +16849,8 @@ # address to avoid compiler warnings and potential miscompilations # because of the missing prototypes. -{ $as_echo "$as_me:$LINENO: checking for ctermid_r" >&5 -$as_echo_n "checking for ctermid_r... " >&6; } +{ echo "$as_me:$LINENO: checking for ctermid_r" >&5 +echo $ECHO_N "checking for ctermid_r... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17229,14 +16875,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17246,21 +16891,21 @@ #define HAVE_CTERMID_R 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: checking for flock" >&5 -$as_echo_n "checking for flock... " >&6; } +{ echo "$as_me:$LINENO: checking for flock" >&5 +echo $ECHO_N "checking for flock... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17285,14 +16930,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17302,21 +16946,21 @@ #define HAVE_FLOCK 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: checking for getpagesize" >&5 -$as_echo_n "checking for getpagesize... " >&6; } +{ echo "$as_me:$LINENO: checking for getpagesize" >&5 +echo $ECHO_N "checking for getpagesize... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17341,14 +16985,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17358,14 +17001,14 @@ #define HAVE_GETPAGESIZE 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -17375,10 +17018,10 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_TRUE+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$TRUE"; then ac_cv_prog_TRUE="$TRUE" # Let the user override the test. @@ -17391,7 +17034,7 @@ for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_TRUE="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -17402,11 +17045,11 @@ fi TRUE=$ac_cv_prog_TRUE if test -n "$TRUE"; then - { $as_echo "$as_me:$LINENO: result: $TRUE" >&5 -$as_echo "$TRUE" >&6; } + { echo "$as_me:$LINENO: result: $TRUE" >&5 +echo "${ECHO_T}$TRUE" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -17415,10 +17058,10 @@ test -n "$TRUE" || TRUE="/bin/true" -{ $as_echo "$as_me:$LINENO: checking for inet_aton in -lc" >&5 -$as_echo_n "checking for inet_aton in -lc... " >&6; } +{ echo "$as_me:$LINENO: checking for inet_aton in -lc" >&5 +echo $ECHO_N "checking for inet_aton in -lc... $ECHO_C" >&6; } if test "${ac_cv_lib_c_inet_aton+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" @@ -17450,44 +17093,40 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_c_inet_aton=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_inet_aton=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_inet_aton" >&5 -$as_echo "$ac_cv_lib_c_inet_aton" >&6; } -if test "x$ac_cv_lib_c_inet_aton" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_c_inet_aton" >&5 +echo "${ECHO_T}$ac_cv_lib_c_inet_aton" >&6; } +if test $ac_cv_lib_c_inet_aton = yes; then $ac_cv_prog_TRUE else -{ $as_echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5 -$as_echo_n "checking for inet_aton in -lresolv... " >&6; } +{ echo "$as_me:$LINENO: checking for inet_aton in -lresolv" >&5 +echo $ECHO_N "checking for inet_aton in -lresolv... $ECHO_C" >&6; } if test "${ac_cv_lib_resolv_inet_aton+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" @@ -17519,37 +17158,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_resolv_inet_aton=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_resolv_inet_aton=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5 -$as_echo "$ac_cv_lib_resolv_inet_aton" >&6; } -if test "x$ac_cv_lib_resolv_inet_aton" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_aton" >&5 +echo "${ECHO_T}$ac_cv_lib_resolv_inet_aton" >&6; } +if test $ac_cv_lib_resolv_inet_aton = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF @@ -17564,16 +17199,14 @@ # On Tru64, chflags seems to be present, but calling it will # exit Python -{ $as_echo "$as_me:$LINENO: checking for chflags" >&5 -$as_echo_n "checking for chflags... " >&6; } +{ echo "$as_me:$LINENO: checking for chflags" >&5 +echo $ECHO_N "checking for chflags... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run test program while cross compiling +echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17598,55 +17231,50 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_CHFLAGS 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } +{ echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: checking for lchflags" >&5 -$as_echo_n "checking for lchflags... " >&6; } +{ echo "$as_me:$LINENO: checking for lchflags" >&5 +echo $ECHO_N "checking for lchflags... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run test program while cross compiling +echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -17671,40 +17299,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_LCHFLAGS 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } +{ echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -17719,10 +17344,10 @@ ;; esac -{ $as_echo "$as_me:$LINENO: checking for inflateCopy in -lz" >&5 -$as_echo_n "checking for inflateCopy in -lz... " >&6; } +{ echo "$as_me:$LINENO: checking for inflateCopy in -lz" >&5 +echo $ECHO_N "checking for inflateCopy in -lz... $ECHO_C" >&6; } if test "${ac_cv_lib_z_inflateCopy+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" @@ -17754,37 +17379,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_z_inflateCopy=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_z_inflateCopy=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateCopy" >&5 -$as_echo "$ac_cv_lib_z_inflateCopy" >&6; } -if test "x$ac_cv_lib_z_inflateCopy" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_inflateCopy" >&5 +echo "${ECHO_T}$ac_cv_lib_z_inflateCopy" >&6; } +if test $ac_cv_lib_z_inflateCopy = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ZLIB_COPY 1 @@ -17800,8 +17421,8 @@ ;; esac -{ $as_echo "$as_me:$LINENO: checking for hstrerror" >&5 -$as_echo_n "checking for hstrerror... " >&6; } +{ echo "$as_me:$LINENO: checking for hstrerror" >&5 +echo $ECHO_N "checking for hstrerror... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17826,43 +17447,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then cat >>confdefs.h <<\_ACEOF #define HAVE_HSTRERROR 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: checking for inet_aton" >&5 -$as_echo_n "checking for inet_aton... " >&6; } +{ echo "$as_me:$LINENO: checking for inet_aton" >&5 +echo $ECHO_N "checking for inet_aton... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17890,43 +17507,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then cat >>confdefs.h <<\_ACEOF #define HAVE_INET_ATON 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: checking for inet_pton" >&5 -$as_echo_n "checking for inet_pton... " >&6; } +{ echo "$as_me:$LINENO: checking for inet_pton" >&5 +echo $ECHO_N "checking for inet_pton... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -17954,14 +17567,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -17971,22 +17583,22 @@ #define HAVE_INET_PTON 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # On some systems, setgroups is in unistd.h, on others, in grp.h -{ $as_echo "$as_me:$LINENO: checking for setgroups" >&5 -$as_echo_n "checking for setgroups... " >&6; } +{ echo "$as_me:$LINENO: checking for setgroups" >&5 +echo $ECHO_N "checking for setgroups... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -18014,14 +17626,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -18031,14 +17642,14 @@ #define HAVE_SETGROUPS 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -18049,11 +17660,11 @@ for ac_func in openpty do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18106,49 +17717,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else - { $as_echo "$as_me:$LINENO: checking for openpty in -lutil" >&5 -$as_echo_n "checking for openpty in -lutil... " >&6; } + { echo "$as_me:$LINENO: checking for openpty in -lutil" >&5 +echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6; } if test "${ac_cv_lib_util_openpty+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" @@ -18180,46 +17784,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_util_openpty=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_util_openpty=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_util_openpty" >&5 -$as_echo "$ac_cv_lib_util_openpty" >&6; } -if test "x$ac_cv_lib_util_openpty" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_util_openpty" >&5 +echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6; } +if test $ac_cv_lib_util_openpty = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_OPENPTY 1 _ACEOF LIBS="$LIBS -lutil" else - { $as_echo "$as_me:$LINENO: checking for openpty in -lbsd" >&5 -$as_echo_n "checking for openpty in -lbsd... " >&6; } + { echo "$as_me:$LINENO: checking for openpty in -lbsd" >&5 +echo $ECHO_N "checking for openpty in -lbsd... $ECHO_C" >&6; } if test "${ac_cv_lib_bsd_openpty+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" @@ -18251,37 +17851,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_bsd_openpty=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_openpty=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_openpty" >&5 -$as_echo "$ac_cv_lib_bsd_openpty" >&6; } -if test "x$ac_cv_lib_bsd_openpty" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_openpty" >&5 +echo "${ECHO_T}$ac_cv_lib_bsd_openpty" >&6; } +if test $ac_cv_lib_bsd_openpty = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_OPENPTY 1 _ACEOF @@ -18298,11 +17894,11 @@ for ac_func in forkpty do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18355,49 +17951,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else - { $as_echo "$as_me:$LINENO: checking for forkpty in -lutil" >&5 -$as_echo_n "checking for forkpty in -lutil... " >&6; } + { echo "$as_me:$LINENO: checking for forkpty in -lutil" >&5 +echo $ECHO_N "checking for forkpty in -lutil... $ECHO_C" >&6; } if test "${ac_cv_lib_util_forkpty+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" @@ -18429,46 +18018,42 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_util_forkpty=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_util_forkpty=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_util_forkpty" >&5 -$as_echo "$ac_cv_lib_util_forkpty" >&6; } -if test "x$ac_cv_lib_util_forkpty" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_util_forkpty" >&5 +echo "${ECHO_T}$ac_cv_lib_util_forkpty" >&6; } +if test $ac_cv_lib_util_forkpty = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FORKPTY 1 _ACEOF LIBS="$LIBS -lutil" else - { $as_echo "$as_me:$LINENO: checking for forkpty in -lbsd" >&5 -$as_echo_n "checking for forkpty in -lbsd... " >&6; } + { echo "$as_me:$LINENO: checking for forkpty in -lbsd" >&5 +echo $ECHO_N "checking for forkpty in -lbsd... $ECHO_C" >&6; } if test "${ac_cv_lib_bsd_forkpty+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" @@ -18500,37 +18085,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_bsd_forkpty=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_forkpty=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_forkpty" >&5 -$as_echo "$ac_cv_lib_bsd_forkpty" >&6; } -if test "x$ac_cv_lib_bsd_forkpty" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_forkpty" >&5 +echo "${ECHO_T}$ac_cv_lib_bsd_forkpty" >&6; } +if test $ac_cv_lib_bsd_forkpty = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_FORKPTY 1 _ACEOF @@ -18549,11 +18130,11 @@ for ac_func in memmove do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18606,42 +18187,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -18657,11 +18231,11 @@ for ac_func in fseek64 fseeko fstatvfs ftell64 ftello statvfs do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18714,42 +18288,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -18761,11 +18328,11 @@ for ac_func in dup2 getcwd strdup do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18818,42 +18385,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF else @@ -18870,11 +18430,11 @@ for ac_func in getpgrp do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18927,42 +18487,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -18985,14 +18538,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -19004,7 +18556,7 @@ else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -19018,11 +18570,11 @@ for ac_func in setpgrp do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19075,42 +18627,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19133,14 +18678,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -19152,7 +18696,7 @@ else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -19166,11 +18710,11 @@ for ac_func in gettimeofday do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19223,42 +18767,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19281,21 +18818,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -19312,8 +18848,8 @@ done -{ $as_echo "$as_me:$LINENO: checking for major" >&5 -$as_echo_n "checking for major... " >&6; } +{ echo "$as_me:$LINENO: checking for major" >&5 +echo $ECHO_N "checking for major... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -19345,48 +18881,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then cat >>confdefs.h <<\_ACEOF #define HAVE_DEVICE_MACROS 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext # On OSF/1 V5.1, getaddrinfo is available, but a define # for [no]getaddrinfo in netdb.h. -{ $as_echo "$as_me:$LINENO: checking for getaddrinfo" >&5 -$as_echo_n "checking for getaddrinfo... " >&6; } +{ echo "$as_me:$LINENO: checking for getaddrinfo" >&5 +echo $ECHO_N "checking for getaddrinfo... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -19415,29 +18947,26 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } -{ $as_echo "$as_me:$LINENO: checking getaddrinfo bug" >&5 -$as_echo_n "checking getaddrinfo bug... " >&6; } +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +{ echo "$as_me:$LINENO: checking getaddrinfo bug" >&5 +echo $ECHO_N "checking getaddrinfo bug... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then - { $as_echo "$as_me:$LINENO: result: buggy" >&5 -$as_echo "buggy" >&6; } + { echo "$as_me:$LINENO: result: buggy" >&5 +echo "${ECHO_T}buggy" >&6; } buggygetaddrinfo=yes else cat >conftest.$ac_ext <<_ACEOF @@ -19540,52 +19069,48 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { $as_echo "$as_me:$LINENO: result: good" >&5 -$as_echo "good" >&6; } + { echo "$as_me:$LINENO: result: good" >&5 +echo "${ECHO_T}good" >&6; } buggygetaddrinfo=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ $as_echo "$as_me:$LINENO: result: buggy" >&5 -$as_echo "buggy" >&6; } +{ echo "$as_me:$LINENO: result: buggy" >&5 +echo "${ECHO_T}buggy" >&6; } buggygetaddrinfo=yes fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } +{ echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } buggygetaddrinfo=yes fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext @@ -19605,11 +19130,11 @@ for ac_func in getnameinfo do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19662,42 +19187,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -19705,10 +19223,10 @@ # checks for structures -{ $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } +{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; } if test "${ac_cv_header_time+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19735,21 +19253,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no @@ -19757,8 +19274,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 -$as_echo "$ac_cv_header_time" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF @@ -19767,10 +19284,10 @@ fi -{ $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 -$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } if test "${ac_cv_struct_tm+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19786,7 +19303,7 @@ { struct tm tm; int *p = &tm.tm_sec; - return !p; + return !p; ; return 0; } @@ -19797,21 +19314,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_tm=time.h else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_tm=sys/time.h @@ -19819,8 +19335,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 -$as_echo "$ac_cv_struct_tm" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6; } if test $ac_cv_struct_tm = sys/time.h; then cat >>confdefs.h <<\_ACEOF @@ -19829,10 +19345,10 @@ fi -{ $as_echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 -$as_echo_n "checking for struct tm.tm_zone... " >&6; } +{ echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 +echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6; } if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19860,21 +19376,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -19903,21 +19418,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_zone=no @@ -19928,9 +19442,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 -$as_echo "$ac_cv_member_struct_tm_tm_zone" >&6; } -if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 +echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6; } +if test $ac_cv_member_struct_tm_tm_zone = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 @@ -19946,10 +19460,10 @@ _ACEOF else - { $as_echo "$as_me:$LINENO: checking whether tzname is declared" >&5 -$as_echo_n "checking whether tzname is declared... " >&6; } + { echo "$as_me:$LINENO: checking whether tzname is declared" >&5 +echo $ECHO_N "checking whether tzname is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_tzname+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -19976,21 +19490,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_tzname=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_tzname=no @@ -19998,9 +19511,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 -$as_echo "$ac_cv_have_decl_tzname" >&6; } -if test "x$ac_cv_have_decl_tzname" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 +echo "${ECHO_T}$ac_cv_have_decl_tzname" >&6; } +if test $ac_cv_have_decl_tzname = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_TZNAME 1 @@ -20016,10 +19529,10 @@ fi - { $as_echo "$as_me:$LINENO: checking for tzname" >&5 -$as_echo_n "checking for tzname... " >&6; } + { echo "$as_me:$LINENO: checking for tzname" >&5 +echo $ECHO_N "checking for tzname... $ECHO_C" >&6; } if test "${ac_cv_var_tzname+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20046,35 +19559,31 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_var_tzname=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_var_tzname=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 -$as_echo "$ac_cv_var_tzname" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 +echo "${ECHO_T}$ac_cv_var_tzname" >&6; } if test $ac_cv_var_tzname = yes; then cat >>confdefs.h <<\_ACEOF @@ -20084,10 +19593,10 @@ fi fi -{ $as_echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 -$as_echo_n "checking for struct stat.st_rdev... " >&6; } +{ echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 +echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6; } if test "${ac_cv_member_struct_stat_st_rdev+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20112,21 +19621,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -20152,21 +19660,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_rdev=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_rdev=no @@ -20177,9 +19684,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 -$as_echo "$ac_cv_member_struct_stat_st_rdev" >&6; } -if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 +echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6; } +if test $ac_cv_member_struct_stat_st_rdev = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_RDEV 1 @@ -20188,10 +19695,10 @@ fi -{ $as_echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 -$as_echo_n "checking for struct stat.st_blksize... " >&6; } +{ echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5 +echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6; } if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20216,21 +19723,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blksize=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -20256,21 +19762,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blksize=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_blksize=no @@ -20281,9 +19786,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 -$as_echo "$ac_cv_member_struct_stat_st_blksize" >&6; } -if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5 +echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6; } +if test $ac_cv_member_struct_stat_st_blksize = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLKSIZE 1 @@ -20292,10 +19797,10 @@ fi -{ $as_echo "$as_me:$LINENO: checking for struct stat.st_flags" >&5 -$as_echo_n "checking for struct stat.st_flags... " >&6; } +{ echo "$as_me:$LINENO: checking for struct stat.st_flags" >&5 +echo $ECHO_N "checking for struct stat.st_flags... $ECHO_C" >&6; } if test "${ac_cv_member_struct_stat_st_flags+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20320,21 +19825,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_flags=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -20360,21 +19864,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_flags=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_flags=no @@ -20385,9 +19888,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_flags" >&5 -$as_echo "$ac_cv_member_struct_stat_st_flags" >&6; } -if test "x$ac_cv_member_struct_stat_st_flags" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_flags" >&5 +echo "${ECHO_T}$ac_cv_member_struct_stat_st_flags" >&6; } +if test $ac_cv_member_struct_stat_st_flags = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_FLAGS 1 @@ -20396,10 +19899,10 @@ fi -{ $as_echo "$as_me:$LINENO: checking for struct stat.st_gen" >&5 -$as_echo_n "checking for struct stat.st_gen... " >&6; } +{ echo "$as_me:$LINENO: checking for struct stat.st_gen" >&5 +echo $ECHO_N "checking for struct stat.st_gen... $ECHO_C" >&6; } if test "${ac_cv_member_struct_stat_st_gen+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20424,21 +19927,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_gen=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -20464,21 +19966,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_gen=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_gen=no @@ -20489,9 +19990,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_gen" >&5 -$as_echo "$ac_cv_member_struct_stat_st_gen" >&6; } -if test "x$ac_cv_member_struct_stat_st_gen" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_gen" >&5 +echo "${ECHO_T}$ac_cv_member_struct_stat_st_gen" >&6; } +if test $ac_cv_member_struct_stat_st_gen = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_GEN 1 @@ -20500,10 +20001,10 @@ fi -{ $as_echo "$as_me:$LINENO: checking for struct stat.st_birthtime" >&5 -$as_echo_n "checking for struct stat.st_birthtime... " >&6; } +{ echo "$as_me:$LINENO: checking for struct stat.st_birthtime" >&5 +echo $ECHO_N "checking for struct stat.st_birthtime... $ECHO_C" >&6; } if test "${ac_cv_member_struct_stat_st_birthtime+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20528,21 +20029,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_birthtime=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -20568,21 +20068,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_birthtime=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_birthtime=no @@ -20593,9 +20092,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_birthtime" >&5 -$as_echo "$ac_cv_member_struct_stat_st_birthtime" >&6; } -if test "x$ac_cv_member_struct_stat_st_birthtime" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_birthtime" >&5 +echo "${ECHO_T}$ac_cv_member_struct_stat_st_birthtime" >&6; } +if test $ac_cv_member_struct_stat_st_birthtime = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BIRTHTIME 1 @@ -20604,10 +20103,10 @@ fi -{ $as_echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5 -$as_echo_n "checking for struct stat.st_blocks... " >&6; } +{ echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5 +echo $ECHO_N "checking for struct stat.st_blocks... $ECHO_C" >&6; } if test "${ac_cv_member_struct_stat_st_blocks+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20632,21 +20131,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blocks=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -20672,21 +20170,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_stat_st_blocks=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_blocks=no @@ -20697,9 +20194,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5 -$as_echo "$ac_cv_member_struct_stat_st_blocks" >&6; } -if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blocks" >&5 +echo "${ECHO_T}$ac_cv_member_struct_stat_st_blocks" >&6; } +if test $ac_cv_member_struct_stat_st_blocks = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_BLOCKS 1 @@ -20721,10 +20218,10 @@ -{ $as_echo "$as_me:$LINENO: checking for time.h that defines altzone" >&5 -$as_echo_n "checking for time.h that defines altzone... " >&6; } +{ echo "$as_me:$LINENO: checking for time.h that defines altzone" >&5 +echo $ECHO_N "checking for time.h that defines altzone... $ECHO_C" >&6; } if test "${ac_cv_header_time_altzone+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20747,21 +20244,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_time_altzone=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time_altzone=no @@ -20770,8 +20266,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time_altzone" >&5 -$as_echo "$ac_cv_header_time_altzone" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_time_altzone" >&5 +echo "${ECHO_T}$ac_cv_header_time_altzone" >&6; } if test $ac_cv_header_time_altzone = yes; then cat >>confdefs.h <<\_ACEOF @@ -20781,8 +20277,8 @@ fi was_it_defined=no -{ $as_echo "$as_me:$LINENO: checking whether sys/select.h and sys/time.h may both be included" >&5 -$as_echo_n "checking whether sys/select.h and sys/time.h may both be included... " >&6; } +{ echo "$as_me:$LINENO: checking whether sys/select.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether sys/select.h and sys/time.h may both be included... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20808,14 +20304,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -20829,20 +20324,20 @@ was_it_defined=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $was_it_defined" >&5 -$as_echo "$was_it_defined" >&6; } +{ echo "$as_me:$LINENO: result: $was_it_defined" >&5 +echo "${ECHO_T}$was_it_defined" >&6; } -{ $as_echo "$as_me:$LINENO: checking for addrinfo" >&5 -$as_echo_n "checking for addrinfo... " >&6; } +{ echo "$as_me:$LINENO: checking for addrinfo" >&5 +echo $ECHO_N "checking for addrinfo... $ECHO_C" >&6; } if test "${ac_cv_struct_addrinfo+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20866,21 +20361,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_addrinfo=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_addrinfo=no @@ -20889,8 +20383,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_addrinfo" >&5 -$as_echo "$ac_cv_struct_addrinfo" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_struct_addrinfo" >&5 +echo "${ECHO_T}$ac_cv_struct_addrinfo" >&6; } if test $ac_cv_struct_addrinfo = yes; then cat >>confdefs.h <<\_ACEOF @@ -20899,10 +20393,10 @@ fi -{ $as_echo "$as_me:$LINENO: checking for sockaddr_storage" >&5 -$as_echo_n "checking for sockaddr_storage... " >&6; } +{ echo "$as_me:$LINENO: checking for sockaddr_storage" >&5 +echo $ECHO_N "checking for sockaddr_storage... $ECHO_C" >&6; } if test "${ac_cv_struct_sockaddr_storage+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20927,21 +20421,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_struct_sockaddr_storage=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_struct_sockaddr_storage=no @@ -20950,8 +20443,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_sockaddr_storage" >&5 -$as_echo "$ac_cv_struct_sockaddr_storage" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_struct_sockaddr_storage" >&5 +echo "${ECHO_T}$ac_cv_struct_sockaddr_storage" >&6; } if test $ac_cv_struct_sockaddr_storage = yes; then cat >>confdefs.h <<\_ACEOF @@ -20963,10 +20456,10 @@ # checks for compiler characteristics -{ $as_echo "$as_me:$LINENO: checking whether char is unsigned" >&5 -$as_echo_n "checking whether char is unsigned... " >&6; } +{ echo "$as_me:$LINENO: checking whether char is unsigned" >&5 +echo $ECHO_N "checking whether char is unsigned... $ECHO_C" >&6; } if test "${ac_cv_c_char_unsigned+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -20991,21 +20484,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_char_unsigned=no else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_char_unsigned=yes @@ -21013,8 +20505,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5 -$as_echo "$ac_cv_c_char_unsigned" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_c_char_unsigned" >&5 +echo "${ECHO_T}$ac_cv_c_char_unsigned" >&6; } if test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then cat >>confdefs.h <<\_ACEOF #define __CHAR_UNSIGNED__ 1 @@ -21022,10 +20514,10 @@ fi -{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } if test "${ac_cv_c_const+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21097,21 +20589,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no @@ -21119,20 +20610,20 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF -#define const /**/ +#define const _ACEOF fi works=no -{ $as_echo "$as_me:$LINENO: checking for working volatile" >&5 -$as_echo_n "checking for working volatile... " >&6; } +{ echo "$as_me:$LINENO: checking for working volatile" >&5 +echo $ECHO_N "checking for working volatile... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21154,38 +20645,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then works=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >>confdefs.h <<\_ACEOF -#define volatile /**/ +#define volatile _ACEOF fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $works" >&5 -$as_echo "$works" >&6; } +{ echo "$as_me:$LINENO: result: $works" >&5 +echo "${ECHO_T}$works" >&6; } works=no -{ $as_echo "$as_me:$LINENO: checking for working signed char" >&5 -$as_echo_n "checking for working signed char... " >&6; } +{ echo "$as_me:$LINENO: checking for working signed char" >&5 +echo $ECHO_N "checking for working signed char... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21207,38 +20697,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then works=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >>confdefs.h <<\_ACEOF -#define signed /**/ +#define signed _ACEOF fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $works" >&5 -$as_echo "$works" >&6; } +{ echo "$as_me:$LINENO: result: $works" >&5 +echo "${ECHO_T}$works" >&6; } have_prototypes=no -{ $as_echo "$as_me:$LINENO: checking for prototypes" >&5 -$as_echo_n "checking for prototypes... " >&6; } +{ echo "$as_me:$LINENO: checking for prototypes" >&5 +echo $ECHO_N "checking for prototypes... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21260,14 +20749,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21281,19 +20769,19 @@ have_prototypes=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $have_prototypes" >&5 -$as_echo "$have_prototypes" >&6; } +{ echo "$as_me:$LINENO: result: $have_prototypes" >&5 +echo "${ECHO_T}$have_prototypes" >&6; } works=no -{ $as_echo "$as_me:$LINENO: checking for variable length prototypes and stdarg.h" >&5 -$as_echo_n "checking for variable length prototypes and stdarg.h... " >&6; } +{ echo "$as_me:$LINENO: checking for variable length prototypes and stdarg.h" >&5 +echo $ECHO_N "checking for variable length prototypes and stdarg.h... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21325,14 +20813,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21346,19 +20833,19 @@ works=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $works" >&5 -$as_echo "$works" >&6; } +{ echo "$as_me:$LINENO: result: $works" >&5 +echo "${ECHO_T}$works" >&6; } # check for socketpair -{ $as_echo "$as_me:$LINENO: checking for socketpair" >&5 -$as_echo_n "checking for socketpair... " >&6; } +{ echo "$as_me:$LINENO: checking for socketpair" >&5 +echo $ECHO_N "checking for socketpair... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21383,14 +20870,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21400,22 +20886,22 @@ #define HAVE_SOCKETPAIR 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # check if sockaddr has sa_len member -{ $as_echo "$as_me:$LINENO: checking if sockaddr has sa_len member" >&5 -$as_echo_n "checking if sockaddr has sa_len member... " >&6; } +{ echo "$as_me:$LINENO: checking if sockaddr has sa_len member" >&5 +echo $ECHO_N "checking if sockaddr has sa_len member... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21439,38 +20925,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKADDR_SA_LEN 1 _ACEOF else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext va_list_is_array=no -{ $as_echo "$as_me:$LINENO: checking whether va_list is an array" >&5 -$as_echo_n "checking whether va_list is an array... " >&6; } +{ echo "$as_me:$LINENO: checking whether va_list is an array" >&5 +echo $ECHO_N "checking whether va_list is an array... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21498,21 +20983,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -21526,17 +21010,17 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $va_list_is_array" >&5 -$as_echo "$va_list_is_array" >&6; } +{ echo "$as_me:$LINENO: result: $va_list_is_array" >&5 +echo "${ECHO_T}$va_list_is_array" >&6; } # sigh -- gethostbyname_r is a mess; it can have 3, 5 or 6 arguments :-( -{ $as_echo "$as_me:$LINENO: checking for gethostbyname_r" >&5 -$as_echo_n "checking for gethostbyname_r... " >&6; } +{ echo "$as_me:$LINENO: checking for gethostbyname_r" >&5 +echo $ECHO_N "checking for gethostbyname_r... $ECHO_C" >&6; } if test "${ac_cv_func_gethostbyname_r+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21589,43 +21073,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_gethostbyname_r=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname_r=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5 -$as_echo "$ac_cv_func_gethostbyname_r" >&6; } -if test "x$ac_cv_func_gethostbyname_r" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5 +echo "${ECHO_T}$ac_cv_func_gethostbyname_r" >&6; } +if test $ac_cv_func_gethostbyname_r = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_GETHOSTBYNAME_R 1 _ACEOF - { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 6 args" >&5 -$as_echo_n "checking gethostbyname_r with 6 args... " >&6; } + { echo "$as_me:$LINENO: checking gethostbyname_r with 6 args" >&5 +echo $ECHO_N "checking gethostbyname_r with 6 args... $ECHO_C" >&6; } OLD_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $MY_CPPFLAGS $MY_THREAD_CPPFLAGS $MY_CFLAGS" cat >conftest.$ac_ext <<_ACEOF @@ -21659,14 +21139,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21681,18 +21160,18 @@ #define HAVE_GETHOSTBYNAME_R_6_ARG 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 5 args" >&5 -$as_echo_n "checking gethostbyname_r with 5 args... " >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + { echo "$as_me:$LINENO: checking gethostbyname_r with 5 args" >&5 +echo $ECHO_N "checking gethostbyname_r with 5 args... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21724,14 +21203,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21746,18 +21224,18 @@ #define HAVE_GETHOSTBYNAME_R_5_ARG 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:$LINENO: checking gethostbyname_r with 3 args" >&5 -$as_echo_n "checking gethostbyname_r with 3 args... " >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + { echo "$as_me:$LINENO: checking gethostbyname_r with 3 args" >&5 +echo $ECHO_N "checking gethostbyname_r with 3 args... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21787,14 +21265,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -21809,16 +21286,16 @@ #define HAVE_GETHOSTBYNAME_R_3_ARG 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -21838,11 +21315,11 @@ for ac_func in gethostbyname do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -21895,42 +21372,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -21949,10 +21419,10 @@ # (none yet) # Linux requires this for correct f.p. operations -{ $as_echo "$as_me:$LINENO: checking for __fpu_control" >&5 -$as_echo_n "checking for __fpu_control... " >&6; } +{ echo "$as_me:$LINENO: checking for __fpu_control" >&5 +echo $ECHO_N "checking for __fpu_control... $ECHO_C" >&6; } if test "${ac_cv_func___fpu_control+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22005,43 +21475,39 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func___fpu_control=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func___fpu_control=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func___fpu_control" >&5 -$as_echo "$ac_cv_func___fpu_control" >&6; } -if test "x$ac_cv_func___fpu_control" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_func___fpu_control" >&5 +echo "${ECHO_T}$ac_cv_func___fpu_control" >&6; } +if test $ac_cv_func___fpu_control = yes; then : else -{ $as_echo "$as_me:$LINENO: checking for __fpu_control in -lieee" >&5 -$as_echo_n "checking for __fpu_control in -lieee... " >&6; } +{ echo "$as_me:$LINENO: checking for __fpu_control in -lieee" >&5 +echo $ECHO_N "checking for __fpu_control in -lieee... $ECHO_C" >&6; } if test "${ac_cv_lib_ieee___fpu_control+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" @@ -22073,37 +21539,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_ieee___fpu_control=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ieee___fpu_control=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ieee___fpu_control" >&5 -$as_echo "$ac_cv_lib_ieee___fpu_control" >&6; } -if test "x$ac_cv_lib_ieee___fpu_control" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ieee___fpu_control" >&5 +echo "${ECHO_T}$ac_cv_lib_ieee___fpu_control" >&6; } +if test $ac_cv_lib_ieee___fpu_control = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBIEEE 1 _ACEOF @@ -22117,8 +21579,8 @@ # Check for --with-fpectl -{ $as_echo "$as_me:$LINENO: checking for --with-fpectl" >&5 -$as_echo_n "checking for --with-fpectl... " >&6; } +{ echo "$as_me:$LINENO: checking for --with-fpectl" >&5 +echo $ECHO_N "checking for --with-fpectl... $ECHO_C" >&6; } # Check whether --with-fpectl was given. if test "${with_fpectl+set}" = set; then @@ -22130,14 +21592,14 @@ #define WANT_SIGFPE_HANDLER 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } -else { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -22147,53 +21609,53 @@ Darwin) ;; *) LIBM=-lm esac -{ $as_echo "$as_me:$LINENO: checking for --with-libm=STRING" >&5 -$as_echo_n "checking for --with-libm=STRING... " >&6; } +{ echo "$as_me:$LINENO: checking for --with-libm=STRING" >&5 +echo $ECHO_N "checking for --with-libm=STRING... $ECHO_C" >&6; } # Check whether --with-libm was given. if test "${with_libm+set}" = set; then withval=$with_libm; if test "$withval" = no then LIBM= - { $as_echo "$as_me:$LINENO: result: force LIBM empty" >&5 -$as_echo "force LIBM empty" >&6; } + { echo "$as_me:$LINENO: result: force LIBM empty" >&5 +echo "${ECHO_T}force LIBM empty" >&6; } elif test "$withval" != yes then LIBM=$withval - { $as_echo "$as_me:$LINENO: result: set LIBM=\"$withval\"" >&5 -$as_echo "set LIBM=\"$withval\"" >&6; } -else { { $as_echo "$as_me:$LINENO: error: proper usage is --with-libm=STRING" >&5 -$as_echo "$as_me: error: proper usage is --with-libm=STRING" >&2;} + { echo "$as_me:$LINENO: result: set LIBM=\"$withval\"" >&5 +echo "${ECHO_T}set LIBM=\"$withval\"" >&6; } +else { { echo "$as_me:$LINENO: error: proper usage is --with-libm=STRING" >&5 +echo "$as_me: error: proper usage is --with-libm=STRING" >&2;} { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:$LINENO: result: default LIBM=\"$LIBM\"" >&5 -$as_echo "default LIBM=\"$LIBM\"" >&6; } + { echo "$as_me:$LINENO: result: default LIBM=\"$LIBM\"" >&5 +echo "${ECHO_T}default LIBM=\"$LIBM\"" >&6; } fi # check for --with-libc=... -{ $as_echo "$as_me:$LINENO: checking for --with-libc=STRING" >&5 -$as_echo_n "checking for --with-libc=STRING... " >&6; } +{ echo "$as_me:$LINENO: checking for --with-libc=STRING" >&5 +echo $ECHO_N "checking for --with-libc=STRING... $ECHO_C" >&6; } # Check whether --with-libc was given. if test "${with_libc+set}" = set; then withval=$with_libc; if test "$withval" = no then LIBC= - { $as_echo "$as_me:$LINENO: result: force LIBC empty" >&5 -$as_echo "force LIBC empty" >&6; } + { echo "$as_me:$LINENO: result: force LIBC empty" >&5 +echo "${ECHO_T}force LIBC empty" >&6; } elif test "$withval" != yes then LIBC=$withval - { $as_echo "$as_me:$LINENO: result: set LIBC=\"$withval\"" >&5 -$as_echo "set LIBC=\"$withval\"" >&6; } -else { { $as_echo "$as_me:$LINENO: error: proper usage is --with-libc=STRING" >&5 -$as_echo "$as_me: error: proper usage is --with-libc=STRING" >&2;} + { echo "$as_me:$LINENO: result: set LIBC=\"$withval\"" >&5 +echo "${ECHO_T}set LIBC=\"$withval\"" >&6; } +else { { echo "$as_me:$LINENO: error: proper usage is --with-libc=STRING" >&5 +echo "$as_me: error: proper usage is --with-libc=STRING" >&2;} { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:$LINENO: result: default LIBC=\"$LIBC\"" >&5 -$as_echo "default LIBC=\"$LIBC\"" >&6; } + { echo "$as_me:$LINENO: result: default LIBC=\"$LIBC\"" >&5 +echo "${ECHO_T}default LIBC=\"$LIBC\"" >&6; } fi @@ -22201,10 +21663,10 @@ # * Check for various properties of floating point * # ************************************************** -{ $as_echo "$as_me:$LINENO: checking whether C doubles are little-endian IEEE 754 binary64" >&5 -$as_echo_n "checking whether C doubles are little-endian IEEE 754 binary64... " >&6; } +{ echo "$as_me:$LINENO: checking whether C doubles are little-endian IEEE 754 binary64" >&5 +echo $ECHO_N "checking whether C doubles are little-endian IEEE 754 binary64... $ECHO_C" >&6; } if test "${ac_cv_little_endian_double+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then @@ -22233,40 +21695,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_little_endian_double=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_little_endian_double=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_little_endian_double" >&5 -$as_echo "$ac_cv_little_endian_double" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_little_endian_double" >&5 +echo "${ECHO_T}$ac_cv_little_endian_double" >&6; } if test "$ac_cv_little_endian_double" = yes then @@ -22276,10 +21735,10 @@ fi -{ $as_echo "$as_me:$LINENO: checking whether C doubles are big-endian IEEE 754 binary64" >&5 -$as_echo_n "checking whether C doubles are big-endian IEEE 754 binary64... " >&6; } +{ echo "$as_me:$LINENO: checking whether C doubles are big-endian IEEE 754 binary64" >&5 +echo $ECHO_N "checking whether C doubles are big-endian IEEE 754 binary64... $ECHO_C" >&6; } if test "${ac_cv_big_endian_double+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then @@ -22308,40 +21767,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_big_endian_double=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_big_endian_double=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_big_endian_double" >&5 -$as_echo "$ac_cv_big_endian_double" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_big_endian_double" >&5 +echo "${ECHO_T}$ac_cv_big_endian_double" >&6; } if test "$ac_cv_big_endian_double" = yes then @@ -22355,10 +21811,10 @@ # While Python doesn't currently have full support for these platforms # (see e.g., issue 1762561), we can at least make sure that float <-> string # conversions work. -{ $as_echo "$as_me:$LINENO: checking whether C doubles are ARM mixed-endian IEEE 754 binary64" >&5 -$as_echo_n "checking whether C doubles are ARM mixed-endian IEEE 754 binary64... " >&6; } +{ echo "$as_me:$LINENO: checking whether C doubles are ARM mixed-endian IEEE 754 binary64" >&5 +echo $ECHO_N "checking whether C doubles are ARM mixed-endian IEEE 754 binary64... $ECHO_C" >&6; } if test "${ac_cv_mixed_endian_double+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then @@ -22387,40 +21843,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_mixed_endian_double=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_mixed_endian_double=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_mixed_endian_double" >&5 -$as_echo "$ac_cv_mixed_endian_double" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_mixed_endian_double" >&5 +echo "${ECHO_T}$ac_cv_mixed_endian_double" >&6; } if test "$ac_cv_mixed_endian_double" = yes then @@ -22440,8 +21893,8 @@ then # Check that it's okay to use gcc inline assembler to get and set # x87 control word. It should be, but you never know... - { $as_echo "$as_me:$LINENO: checking whether we can use gcc inline assembler to get and set x87 control word" >&5 -$as_echo_n "checking whether we can use gcc inline assembler to get and set x87 control word... " >&6; } + { echo "$as_me:$LINENO: checking whether we can use gcc inline assembler to get and set x87 control word" >&5 +echo $ECHO_N "checking whether we can use gcc inline assembler to get and set x87 control word... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -22467,29 +21920,28 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then have_gcc_asm_for_x87=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 have_gcc_asm_for_x87=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:$LINENO: result: $have_gcc_asm_for_x87" >&5 -$as_echo "$have_gcc_asm_for_x87" >&6; } + { echo "$as_me:$LINENO: result: $have_gcc_asm_for_x87" >&5 +echo "${ECHO_T}$have_gcc_asm_for_x87" >&6; } if test "$have_gcc_asm_for_x87" = yes then @@ -22505,8 +21957,8 @@ # IEEE 754 platforms. On IEEE 754, test should return 1 if rounding # mode is round-to-nearest and double rounding issues are present, and # 0 otherwise. See http://bugs.python.org/issue2937 for more info. -{ $as_echo "$as_me:$LINENO: checking for x87-style double rounding" >&5 -$as_echo_n "checking for x87-style double rounding... " >&6; } +{ echo "$as_me:$LINENO: checking for x87-style double rounding" >&5 +echo $ECHO_N "checking for x87-style double rounding... $ECHO_C" >&6; } # $BASECFLAGS may affect the result ac_save_cc="$CC" CC="$CC $BASECFLAGS" @@ -22546,39 +21998,36 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_x87_double_rounding=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_x87_double_rounding=yes fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi CC="$ac_save_cc" -{ $as_echo "$as_me:$LINENO: result: $ac_cv_x87_double_rounding" >&5 -$as_echo "$ac_cv_x87_double_rounding" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_x87_double_rounding" >&5 +echo "${ECHO_T}$ac_cv_x87_double_rounding" >&6; } if test "$ac_cv_x87_double_rounding" = yes then @@ -22597,10 +22046,10 @@ # On FreeBSD 6.2, it appears that tanh(-0.) returns 0. instead of # -0. on some architectures. -{ $as_echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5 -$as_echo_n "checking whether tanh preserves the sign of zero... " >&6; } +{ echo "$as_me:$LINENO: checking whether tanh preserves the sign of zero" >&5 +echo $ECHO_N "checking whether tanh preserves the sign of zero... $ECHO_C" >&6; } if test "${ac_cv_tanh_preserves_zero_sign+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then @@ -22631,40 +22080,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_tanh_preserves_zero_sign=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_tanh_preserves_zero_sign=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_tanh_preserves_zero_sign" >&5 -$as_echo "$ac_cv_tanh_preserves_zero_sign" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_tanh_preserves_zero_sign" >&5 +echo "${ECHO_T}$ac_cv_tanh_preserves_zero_sign" >&6; } if test "$ac_cv_tanh_preserves_zero_sign" = yes then @@ -22685,11 +22131,11 @@ for ac_func in acosh asinh atanh copysign expm1 finite hypot log1p round do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22742,51 +22188,44 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done -{ $as_echo "$as_me:$LINENO: checking whether isinf is declared" >&5 -$as_echo_n "checking whether isinf is declared... " >&6; } +{ echo "$as_me:$LINENO: checking whether isinf is declared" >&5 +echo $ECHO_N "checking whether isinf is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_isinf+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22813,21 +22252,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_isinf=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_isinf=no @@ -22835,9 +22273,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5 -$as_echo "$ac_cv_have_decl_isinf" >&6; } -if test "x$ac_cv_have_decl_isinf" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isinf" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isinf" >&6; } +if test $ac_cv_have_decl_isinf = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ISINF 1 @@ -22851,10 +22289,10 @@ fi -{ $as_echo "$as_me:$LINENO: checking whether isnan is declared" >&5 -$as_echo_n "checking whether isnan is declared... " >&6; } +{ echo "$as_me:$LINENO: checking whether isnan is declared" >&5 +echo $ECHO_N "checking whether isnan is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_isnan+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22881,21 +22319,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_isnan=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_isnan=no @@ -22903,9 +22340,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5 -$as_echo "$ac_cv_have_decl_isnan" >&6; } -if test "x$ac_cv_have_decl_isnan" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isnan" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isnan" >&6; } +if test $ac_cv_have_decl_isnan = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ISNAN 1 @@ -22919,10 +22356,10 @@ fi -{ $as_echo "$as_me:$LINENO: checking whether isfinite is declared" >&5 -$as_echo_n "checking whether isfinite is declared... " >&6; } +{ echo "$as_me:$LINENO: checking whether isfinite is declared" >&5 +echo $ECHO_N "checking whether isfinite is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_isfinite+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -22949,21 +22386,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_isfinite=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_isfinite=no @@ -22971,9 +22407,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5 -$as_echo "$ac_cv_have_decl_isfinite" >&6; } -if test "x$ac_cv_have_decl_isfinite" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_isfinite" >&5 +echo "${ECHO_T}$ac_cv_have_decl_isfinite" >&6; } +if test $ac_cv_have_decl_isfinite = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ISFINITE 1 @@ -22993,16 +22429,14 @@ LIBS=$LIBS_SAVE # Multiprocessing check for broken sem_getvalue -{ $as_echo "$as_me:$LINENO: checking for broken sem_getvalue" >&5 -$as_echo_n "checking for broken sem_getvalue... " >&6; } +{ echo "$as_me:$LINENO: checking for broken sem_getvalue" >&5 +echo $ECHO_N "checking for broken sem_getvalue... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run test program while cross compiling +echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23039,32 +22473,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_BROKEN_SEM_GETVALUE 1 @@ -23072,15 +22504,14 @@ fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi # determine what size digit to use for Python's longs -{ $as_echo "$as_me:$LINENO: checking digit size for Python's longs" >&5 -$as_echo_n "checking digit size for Python's longs... " >&6; } +{ echo "$as_me:$LINENO: checking digit size for Python's longs" >&5 +echo $ECHO_N "checking digit size for Python's longs... $ECHO_C" >&6; } # Check whether --enable-big-digits was given. if test "${enable_big_digits+set}" = set; then enableval=$enable_big_digits; case $enable_big_digits in @@ -23091,12 +22522,12 @@ 15|30) ;; *) - { { $as_echo "$as_me:$LINENO: error: bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30" >&5 -$as_echo "$as_me: error: bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30" >&2;} + { { echo "$as_me:$LINENO: error: bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30" >&5 +echo "$as_me: error: bad value $enable_big_digits for --enable-big-digits; value should be 15 or 30" >&2;} { (exit 1); exit 1; }; } ;; esac -{ $as_echo "$as_me:$LINENO: result: $enable_big_digits" >&5 -$as_echo "$enable_big_digits" >&6; } +{ echo "$as_me:$LINENO: result: $enable_big_digits" >&5 +echo "${ECHO_T}$enable_big_digits" >&6; } cat >>confdefs.h <<_ACEOF #define PYLONG_BITS_IN_DIGIT $enable_big_digits @@ -23104,24 +22535,24 @@ else - { $as_echo "$as_me:$LINENO: result: no value specified" >&5 -$as_echo "no value specified" >&6; } + { echo "$as_me:$LINENO: result: no value specified" >&5 +echo "${ECHO_T}no value specified" >&6; } fi # check for wchar.h if test "${ac_cv_header_wchar_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for wchar.h" >&5 -$as_echo_n "checking for wchar.h... " >&6; } + { echo "$as_me:$LINENO: checking for wchar.h" >&5 +echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; } if test "${ac_cv_header_wchar_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 -$as_echo "$ac_cv_header_wchar_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 +echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking wchar.h usability" >&5 -$as_echo_n "checking wchar.h usability... " >&6; } +{ echo "$as_me:$LINENO: checking wchar.h usability" >&5 +echo $ECHO_N "checking wchar.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -23137,33 +22568,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking wchar.h presence" >&5 -$as_echo_n "checking wchar.h presence... " >&6; } +{ echo "$as_me:$LINENO: checking wchar.h presence" >&5 +echo $ECHO_N "checking wchar.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -23177,52 +22607,51 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: wchar.h: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: wchar.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: wchar.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: wchar.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: wchar.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: wchar.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: wchar.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: wchar.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: wchar.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: wchar.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: wchar.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: wchar.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: wchar.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: wchar.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: wchar.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: wchar.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: wchar.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: wchar.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: wchar.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: wchar.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: wchar.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------- ## ## Report this to http://bugs.python.org/ ## @@ -23231,18 +22660,18 @@ ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for wchar.h" >&5 -$as_echo_n "checking for wchar.h... " >&6; } +{ echo "$as_me:$LINENO: checking for wchar.h" >&5 +echo $ECHO_N "checking for wchar.h... $ECHO_C" >&6; } if test "${ac_cv_header_wchar_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_wchar_h=$ac_header_preproc fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 -$as_echo "$ac_cv_header_wchar_h" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 +echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } fi -if test "x$ac_cv_header_wchar_h" = x""yes; then +if test $ac_cv_header_wchar_h = yes; then cat >>confdefs.h <<\_ACEOF @@ -23261,14 +22690,69 @@ # determine wchar_t size if test "$wchar_h" = yes then - # The cast to long int works around a bug in the HP C Compiler + { echo "$as_me:$LINENO: checking for wchar_t" >&5 +echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6; } +if test "${ac_cv_type_wchar_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +typedef wchar_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_wchar_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_wchar_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_wchar_t" >&5 +echo "${ECHO_T}$ac_cv_type_wchar_t" >&6; } + +# The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of wchar_t" >&5 -$as_echo_n "checking size of wchar_t... " >&6; } +{ echo "$as_me:$LINENO: checking size of wchar_t" >&5 +echo $ECHO_N "checking size of wchar_t... $ECHO_C" >&6; } if test "${ac_cv_sizeof_wchar_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -23280,10 +22764,11 @@ /* end confdefs.h. */ #include + typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -23296,14 +22781,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -23318,10 +22802,11 @@ /* end confdefs.h. */ #include + typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -23334,21 +22819,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -23362,7 +22846,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -23373,10 +22857,11 @@ /* end confdefs.h. */ #include + typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -23389,14 +22874,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -23411,10 +22895,11 @@ /* end confdefs.h. */ #include + typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -23427,21 +22912,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -23455,7 +22939,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -23476,10 +22960,11 @@ /* end confdefs.h. */ #include + typedef wchar_t ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (wchar_t))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -23492,21 +22977,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -23517,13 +23001,11 @@ case $ac_lo in ?*) ac_cv_sizeof_wchar_t=$ac_lo;; '') if test "$ac_cv_type_wchar_t" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (wchar_t) +echo "$as_me: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_wchar_t=0 fi ;; @@ -23537,8 +23019,9 @@ /* end confdefs.h. */ #include -static long int longval () { return (long int) (sizeof (wchar_t)); } -static unsigned long int ulongval () { return (long int) (sizeof (wchar_t)); } + typedef wchar_t ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -23548,22 +23031,20 @@ FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (wchar_t))) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (wchar_t)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%ld", i); + fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (wchar_t)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%lu", i); + fprintf (f, "%lu\n", i); } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -23576,48 +23057,43 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_wchar_t=`cat conftest.val` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_wchar_t" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (wchar_t) +echo "$as_me: error: cannot compute sizeof (wchar_t) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_wchar_t=0 fi fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5 -$as_echo "$ac_cv_sizeof_wchar_t" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_wchar_t" >&5 +echo "${ECHO_T}$ac_cv_sizeof_wchar_t" >&6; } @@ -23628,8 +23104,8 @@ fi -{ $as_echo "$as_me:$LINENO: checking for UCS-4 tcl" >&5 -$as_echo_n "checking for UCS-4 tcl... " >&6; } +{ echo "$as_me:$LINENO: checking for UCS-4 tcl" >&5 +echo $ECHO_N "checking for UCS-4 tcl... $ECHO_C" >&6; } have_ucs4_tcl=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -23656,14 +23132,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -23677,24 +23152,24 @@ have_ucs4_tcl=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $have_ucs4_tcl" >&5 -$as_echo "$have_ucs4_tcl" >&6; } +{ echo "$as_me:$LINENO: result: $have_ucs4_tcl" >&5 +echo "${ECHO_T}$have_ucs4_tcl" >&6; } # check whether wchar_t is signed or not if test "$wchar_h" = yes then # check whether wchar_t is signed or not - { $as_echo "$as_me:$LINENO: checking whether wchar_t is signed" >&5 -$as_echo_n "checking whether wchar_t is signed... " >&6; } + { echo "$as_me:$LINENO: checking whether wchar_t is signed" >&5 +echo $ECHO_N "checking whether wchar_t is signed... $ECHO_C" >&6; } if test "${ac_cv_wchar_t_signed+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then @@ -23721,44 +23196,41 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_wchar_t_signed=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_wchar_t_signed=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi - { $as_echo "$as_me:$LINENO: result: $ac_cv_wchar_t_signed" >&5 -$as_echo "$ac_cv_wchar_t_signed" >&6; } + { echo "$as_me:$LINENO: result: $ac_cv_wchar_t_signed" >&5 +echo "${ECHO_T}$ac_cv_wchar_t_signed" >&6; } fi -{ $as_echo "$as_me:$LINENO: checking what type to use for str" >&5 -$as_echo_n "checking what type to use for str... " >&6; } +{ echo "$as_me:$LINENO: checking what type to use for str" >&5 +echo $ECHO_N "checking what type to use for str... $ECHO_C" >&6; } # Check whether --with-wide-unicode was given. if test "${with_wide_unicode+set}" = set; then @@ -23808,195 +23280,49 @@ #define PY_UNICODE_TYPE wchar_t _ACEOF -elif test "$ac_cv_sizeof_short" = "$unicode_size" -then - PY_UNICODE_TYPE="unsigned short" - cat >>confdefs.h <<\_ACEOF -#define PY_UNICODE_TYPE unsigned short -_ACEOF - -elif test "$ac_cv_sizeof_long" = "$unicode_size" -then - PY_UNICODE_TYPE="unsigned long" - cat >>confdefs.h <<\_ACEOF -#define PY_UNICODE_TYPE unsigned long -_ACEOF - -else - PY_UNICODE_TYPE="no type found" -fi -{ $as_echo "$as_me:$LINENO: result: $PY_UNICODE_TYPE" >&5 -$as_echo "$PY_UNICODE_TYPE" >&6; } - -# check for endianness - - { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; - -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - - # Check for potential -arch flags. It is not universal unless - # there are some -arch flags. Note that *ppc* also matches - # ppc64. This check is also rather less than ideal. - case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( - *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; - esac -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - #include - -int -main () -{ -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to BIG_ENDIAN or not. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - #include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif - - ; - return 0; -} +elif test "$ac_cv_sizeof_short" = "$unicode_size" +then + PY_UNICODE_TYPE="unsigned short" + cat >>confdefs.h <<\_ACEOF +#define PY_UNICODE_TYPE unsigned short _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_bigendian=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_c_bigendian=no -fi +elif test "$ac_cv_sizeof_long" = "$unicode_size" +then + PY_UNICODE_TYPE="unsigned long" + cat >>confdefs.h <<\_ACEOF +#define PY_UNICODE_TYPE unsigned long +_ACEOF -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - + PY_UNICODE_TYPE="no type found" fi +{ echo "$as_me:$LINENO: result: $PY_UNICODE_TYPE" >&5 +echo "${ECHO_T}$PY_UNICODE_TYPE" >&6; } -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat >conftest.$ac_ext <<_ACEOF +# check for endianness +{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include +#include int main () { -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ + && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) + bogus endian macros +#endif ; return 0; @@ -24008,33 +23334,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat >conftest.$ac_ext <<_ACEOF + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include +#include int main () { -#ifndef _BIG_ENDIAN - not big endian - #endif +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif ; return 0; @@ -24046,21 +23372,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no @@ -24068,44 +23393,29 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then - # Try to guess by grepping values from an object file. - cat >conftest.$ac_ext <<_ACEOF + # It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; - +short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { -return use_ascii (foo) == use_ebcdic (foo); + _ascii (); _ebcdic (); ; return 0; } @@ -24116,31 +23426,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -24159,14 +23468,14 @@ main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; ; return 0; @@ -24178,70 +23487,63 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF -;; #( - no) - ;; #( - universal) + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } +case $ac_cv_c_bigendian in + yes) cat >>confdefs.h <<\_ACEOF -#define AC_APPLE_UNIVERSAL_BUILD 1 +#define WORDS_BIGENDIAN 1 _ACEOF - - ;; #( - *) - { { $as_echo "$as_me:$LINENO: error: unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -$as_echo "$as_me: error: unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; - esac +esac # Check whether right shifting a negative integer extends the sign bit # or fills with zeros (like the Cray J90, according to Tim Peters). -{ $as_echo "$as_me:$LINENO: checking whether right shift extends the sign bit" >&5 -$as_echo_n "checking whether right shift extends the sign bit... " >&6; } +{ echo "$as_me:$LINENO: checking whether right shift extends the sign bit" >&5 +echo $ECHO_N "checking whether right shift extends the sign bit... $ECHO_C" >&6; } if test "${ac_cv_rshift_extends_sign+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then @@ -24266,40 +23568,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_rshift_extends_sign=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_rshift_extends_sign=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_rshift_extends_sign" >&5 -$as_echo "$ac_cv_rshift_extends_sign" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_rshift_extends_sign" >&5 +echo "${ECHO_T}$ac_cv_rshift_extends_sign" >&6; } if test "$ac_cv_rshift_extends_sign" = no then @@ -24310,10 +23609,10 @@ fi # check for getc_unlocked and related locking functions -{ $as_echo "$as_me:$LINENO: checking for getc_unlocked() and friends" >&5 -$as_echo_n "checking for getc_unlocked() and friends... " >&6; } +{ echo "$as_me:$LINENO: checking for getc_unlocked() and friends" >&5 +echo $ECHO_N "checking for getc_unlocked() and friends... $ECHO_C" >&6; } if test "${ac_cv_have_getc_unlocked+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -24342,36 +23641,32 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_have_getc_unlocked=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_getc_unlocked=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_getc_unlocked" >&5 -$as_echo "$ac_cv_have_getc_unlocked" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_have_getc_unlocked" >&5 +echo "${ECHO_T}$ac_cv_have_getc_unlocked" >&6; } if test "$ac_cv_have_getc_unlocked" = yes then @@ -24389,8 +23684,8 @@ # library. NOTE: Keep the precedence of listed libraries synchronised # with setup.py. py_cv_lib_readline=no -{ $as_echo "$as_me:$LINENO: checking how to link readline libs" >&5 -$as_echo_n "checking how to link readline libs... " >&6; } +{ echo "$as_me:$LINENO: checking how to link readline libs" >&5 +echo $ECHO_N "checking how to link readline libs... $ECHO_C" >&6; } for py_libtermcap in "" ncursesw ncurses curses termcap; do if test -z "$py_libtermcap"; then READLINE_LIBS="-lreadline" @@ -24426,30 +23721,26 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then py_cv_lib_readline=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test $py_cv_lib_readline = yes; then @@ -24459,11 +23750,11 @@ # Uncomment this line if you want to use READINE_LIBS in Makefile or scripts #AC_SUBST([READLINE_LIBS]) if test $py_cv_lib_readline = no; then - { $as_echo "$as_me:$LINENO: result: none" >&5 -$as_echo "none" >&6; } + { echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6; } else - { $as_echo "$as_me:$LINENO: result: $READLINE_LIBS" >&5 -$as_echo "$READLINE_LIBS" >&6; } + { echo "$as_me:$LINENO: result: $READLINE_LIBS" >&5 +echo "${ECHO_T}$READLINE_LIBS" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_LIBREADLINE 1 @@ -24472,10 +23763,10 @@ fi # check for readline 2.1 -{ $as_echo "$as_me:$LINENO: checking for rl_callback_handler_install in -lreadline" >&5 -$as_echo_n "checking for rl_callback_handler_install in -lreadline... " >&6; } +{ echo "$as_me:$LINENO: checking for rl_callback_handler_install in -lreadline" >&5 +echo $ECHO_N "checking for rl_callback_handler_install in -lreadline... $ECHO_C" >&6; } if test "${ac_cv_lib_readline_rl_callback_handler_install+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -24507,37 +23798,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_readline_rl_callback_handler_install=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_callback_handler_install=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_callback_handler_install" >&5 -$as_echo "$ac_cv_lib_readline_rl_callback_handler_install" >&6; } -if test "x$ac_cv_lib_readline_rl_callback_handler_install" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_callback_handler_install" >&5 +echo "${ECHO_T}$ac_cv_lib_readline_rl_callback_handler_install" >&6; } +if test $ac_cv_lib_readline_rl_callback_handler_install = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_CALLBACK 1 @@ -24560,21 +23847,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then have_readline=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 have_readline=no @@ -24605,10 +23891,10 @@ fi # check for readline 4.0 -{ $as_echo "$as_me:$LINENO: checking for rl_pre_input_hook in -lreadline" >&5 -$as_echo_n "checking for rl_pre_input_hook in -lreadline... " >&6; } +{ echo "$as_me:$LINENO: checking for rl_pre_input_hook in -lreadline" >&5 +echo $ECHO_N "checking for rl_pre_input_hook in -lreadline... $ECHO_C" >&6; } if test "${ac_cv_lib_readline_rl_pre_input_hook+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -24640,37 +23926,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_readline_rl_pre_input_hook=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_pre_input_hook=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_pre_input_hook" >&5 -$as_echo "$ac_cv_lib_readline_rl_pre_input_hook" >&6; } -if test "x$ac_cv_lib_readline_rl_pre_input_hook" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_pre_input_hook" >&5 +echo "${ECHO_T}$ac_cv_lib_readline_rl_pre_input_hook" >&6; } +if test $ac_cv_lib_readline_rl_pre_input_hook = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_PRE_INPUT_HOOK 1 @@ -24680,10 +23962,10 @@ # also in 4.0 -{ $as_echo "$as_me:$LINENO: checking for rl_completion_display_matches_hook in -lreadline" >&5 -$as_echo_n "checking for rl_completion_display_matches_hook in -lreadline... " >&6; } +{ echo "$as_me:$LINENO: checking for rl_completion_display_matches_hook in -lreadline" >&5 +echo $ECHO_N "checking for rl_completion_display_matches_hook in -lreadline... $ECHO_C" >&6; } if test "${ac_cv_lib_readline_rl_completion_display_matches_hook+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -24715,37 +23997,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_readline_rl_completion_display_matches_hook=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_completion_display_matches_hook=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_display_matches_hook" >&5 -$as_echo "$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6; } -if test "x$ac_cv_lib_readline_rl_completion_display_matches_hook" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_display_matches_hook" >&5 +echo "${ECHO_T}$ac_cv_lib_readline_rl_completion_display_matches_hook" >&6; } +if test $ac_cv_lib_readline_rl_completion_display_matches_hook = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1 @@ -24755,10 +24033,10 @@ # check for readline 4.2 -{ $as_echo "$as_me:$LINENO: checking for rl_completion_matches in -lreadline" >&5 -$as_echo_n "checking for rl_completion_matches in -lreadline... " >&6; } +{ echo "$as_me:$LINENO: checking for rl_completion_matches in -lreadline" >&5 +echo $ECHO_N "checking for rl_completion_matches in -lreadline... $ECHO_C" >&6; } if test "${ac_cv_lib_readline_rl_completion_matches+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $READLINE_LIBS $LIBS" @@ -24790,37 +24068,33 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_readline_rl_completion_matches=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_readline_rl_completion_matches=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_matches" >&5 -$as_echo "$ac_cv_lib_readline_rl_completion_matches" >&6; } -if test "x$ac_cv_lib_readline_rl_completion_matches" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_readline_rl_completion_matches" >&5 +echo "${ECHO_T}$ac_cv_lib_readline_rl_completion_matches" >&6; } +if test $ac_cv_lib_readline_rl_completion_matches = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_RL_COMPLETION_MATCHES 1 @@ -24843,21 +24117,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then have_readline=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 have_readline=no @@ -24890,10 +24163,10 @@ # End of readline checks: restore LIBS LIBS=$LIBS_no_readline -{ $as_echo "$as_me:$LINENO: checking for broken nice()" >&5 -$as_echo_n "checking for broken nice()... " >&6; } +{ echo "$as_me:$LINENO: checking for broken nice()" >&5 +echo $ECHO_N "checking for broken nice()... $ECHO_C" >&6; } if test "${ac_cv_broken_nice+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then @@ -24921,40 +24194,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_broken_nice=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_broken_nice=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_nice" >&5 -$as_echo "$ac_cv_broken_nice" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_broken_nice" >&5 +echo "${ECHO_T}$ac_cv_broken_nice" >&6; } if test "$ac_cv_broken_nice" = yes then @@ -24964,8 +24234,8 @@ fi -{ $as_echo "$as_me:$LINENO: checking for broken poll()" >&5 -$as_echo_n "checking for broken poll()... " >&6; } +{ echo "$as_me:$LINENO: checking for broken poll()" >&5 +echo $ECHO_N "checking for broken poll()... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then ac_cv_broken_poll=no else @@ -25007,38 +24277,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_broken_poll=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_broken_poll=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_poll" >&5 -$as_echo "$ac_cv_broken_poll" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_broken_poll" >&5 +echo "${ECHO_T}$ac_cv_broken_poll" >&6; } if test "$ac_cv_broken_poll" = yes then @@ -25051,10 +24318,10 @@ # Before we can test tzset, we need to check if struct tm has a tm_zone # (which is not required by ISO C or UNIX spec) and/or if we support # tzname[] -{ $as_echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 -$as_echo_n "checking for struct tm.tm_zone... " >&6; } +{ echo "$as_me:$LINENO: checking for struct tm.tm_zone" >&5 +echo $ECHO_N "checking for struct tm.tm_zone... $ECHO_C" >&6; } if test "${ac_cv_member_struct_tm_tm_zone+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -25082,21 +24349,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -25125,21 +24391,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_member_struct_tm_tm_zone=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_tm_tm_zone=no @@ -25150,9 +24415,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 -$as_echo "$ac_cv_member_struct_tm_tm_zone" >&6; } -if test "x$ac_cv_member_struct_tm_tm_zone" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_tm_tm_zone" >&5 +echo "${ECHO_T}$ac_cv_member_struct_tm_tm_zone" >&6; } +if test $ac_cv_member_struct_tm_tm_zone = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_TM_TM_ZONE 1 @@ -25168,10 +24433,10 @@ _ACEOF else - { $as_echo "$as_me:$LINENO: checking whether tzname is declared" >&5 -$as_echo_n "checking whether tzname is declared... " >&6; } + { echo "$as_me:$LINENO: checking whether tzname is declared" >&5 +echo $ECHO_N "checking whether tzname is declared... $ECHO_C" >&6; } if test "${ac_cv_have_decl_tzname+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -25198,21 +24463,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_have_decl_tzname=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_have_decl_tzname=no @@ -25220,9 +24484,9 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 -$as_echo "$ac_cv_have_decl_tzname" >&6; } -if test "x$ac_cv_have_decl_tzname" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_tzname" >&5 +echo "${ECHO_T}$ac_cv_have_decl_tzname" >&6; } +if test $ac_cv_have_decl_tzname = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_DECL_TZNAME 1 @@ -25238,10 +24502,10 @@ fi - { $as_echo "$as_me:$LINENO: checking for tzname" >&5 -$as_echo_n "checking for tzname... " >&6; } + { echo "$as_me:$LINENO: checking for tzname" >&5 +echo $ECHO_N "checking for tzname... $ECHO_C" >&6; } if test "${ac_cv_var_tzname+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -25268,35 +24532,31 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_var_tzname=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_var_tzname=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 -$as_echo "$ac_cv_var_tzname" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_var_tzname" >&5 +echo "${ECHO_T}$ac_cv_var_tzname" >&6; } if test $ac_cv_var_tzname = yes; then cat >>confdefs.h <<\_ACEOF @@ -25308,10 +24568,10 @@ # check tzset(3) exists and works like we expect it to -{ $as_echo "$as_me:$LINENO: checking for working tzset()" >&5 -$as_echo_n "checking for working tzset()... " >&6; } +{ echo "$as_me:$LINENO: checking for working tzset()" >&5 +echo $ECHO_N "checking for working tzset()... $ECHO_C" >&6; } if test "${ac_cv_working_tzset+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then @@ -25394,40 +24654,37 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_working_tzset=yes else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_working_tzset=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_working_tzset" >&5 -$as_echo "$ac_cv_working_tzset" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_working_tzset" >&5 +echo "${ECHO_T}$ac_cv_working_tzset" >&6; } if test "$ac_cv_working_tzset" = yes then @@ -25438,10 +24695,10 @@ fi # Look for subsecond timestamps in struct stat -{ $as_echo "$as_me:$LINENO: checking for tv_nsec in struct stat" >&5 -$as_echo_n "checking for tv_nsec in struct stat... " >&6; } +{ echo "$as_me:$LINENO: checking for tv_nsec in struct stat" >&5 +echo $ECHO_N "checking for tv_nsec in struct stat... $ECHO_C" >&6; } if test "${ac_cv_stat_tv_nsec+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -25467,21 +24724,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_stat_tv_nsec=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_stat_tv_nsec=no @@ -25490,8 +24746,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec" >&5 -$as_echo "$ac_cv_stat_tv_nsec" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec" >&5 +echo "${ECHO_T}$ac_cv_stat_tv_nsec" >&6; } if test "$ac_cv_stat_tv_nsec" = yes then @@ -25502,10 +24758,10 @@ fi # Look for BSD style subsecond timestamps in struct stat -{ $as_echo "$as_me:$LINENO: checking for tv_nsec2 in struct stat" >&5 -$as_echo_n "checking for tv_nsec2 in struct stat... " >&6; } +{ echo "$as_me:$LINENO: checking for tv_nsec2 in struct stat" >&5 +echo $ECHO_N "checking for tv_nsec2 in struct stat... $ECHO_C" >&6; } if test "${ac_cv_stat_tv_nsec2+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -25531,21 +24787,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_stat_tv_nsec2=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_stat_tv_nsec2=no @@ -25554,8 +24809,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec2" >&5 -$as_echo "$ac_cv_stat_tv_nsec2" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_stat_tv_nsec2" >&5 +echo "${ECHO_T}$ac_cv_stat_tv_nsec2" >&6; } if test "$ac_cv_stat_tv_nsec2" = yes then @@ -25566,10 +24821,10 @@ fi # On HP/UX 11.0, mvwdelch is a block with a return statement -{ $as_echo "$as_me:$LINENO: checking whether mvwdelch is an expression" >&5 -$as_echo_n "checking whether mvwdelch is an expression... " >&6; } +{ echo "$as_me:$LINENO: checking whether mvwdelch is an expression" >&5 +echo $ECHO_N "checking whether mvwdelch is an expression... $ECHO_C" >&6; } if test "${ac_cv_mvwdelch_is_expression+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -25595,21 +24850,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_mvwdelch_is_expression=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_mvwdelch_is_expression=no @@ -25618,8 +24872,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_mvwdelch_is_expression" >&5 -$as_echo "$ac_cv_mvwdelch_is_expression" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_mvwdelch_is_expression" >&5 +echo "${ECHO_T}$ac_cv_mvwdelch_is_expression" >&6; } if test "$ac_cv_mvwdelch_is_expression" = yes then @@ -25630,10 +24884,10 @@ fi -{ $as_echo "$as_me:$LINENO: checking whether WINDOW has _flags" >&5 -$as_echo_n "checking whether WINDOW has _flags... " >&6; } +{ echo "$as_me:$LINENO: checking whether WINDOW has _flags" >&5 +echo $ECHO_N "checking whether WINDOW has _flags... $ECHO_C" >&6; } if test "${ac_cv_window_has_flags+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -25659,21 +24913,20 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_window_has_flags=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_window_has_flags=no @@ -25682,8 +24935,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_window_has_flags" >&5 -$as_echo "$ac_cv_window_has_flags" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_window_has_flags" >&5 +echo "${ECHO_T}$ac_cv_window_has_flags" >&6; } if test "$ac_cv_window_has_flags" = yes @@ -25695,8 +24948,8 @@ fi -{ $as_echo "$as_me:$LINENO: checking for is_term_resized" >&5 -$as_echo_n "checking for is_term_resized... " >&6; } +{ echo "$as_me:$LINENO: checking for is_term_resized" >&5 +echo $ECHO_N "checking for is_term_resized... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -25718,14 +24971,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -25735,21 +24987,21 @@ #define HAVE_CURSES_IS_TERM_RESIZED 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: checking for resize_term" >&5 -$as_echo_n "checking for resize_term... " >&6; } +{ echo "$as_me:$LINENO: checking for resize_term" >&5 +echo $ECHO_N "checking for resize_term... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -25771,14 +25023,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -25788,21 +25039,21 @@ #define HAVE_CURSES_RESIZE_TERM 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: checking for resizeterm" >&5 -$as_echo_n "checking for resizeterm... " >&6; } +{ echo "$as_me:$LINENO: checking for resizeterm" >&5 +echo $ECHO_N "checking for resizeterm... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -25824,14 +25075,13 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -25841,63 +25091,61 @@ #define HAVE_CURSES_RESIZETERM 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: checking for /dev/ptmx" >&5 -$as_echo_n "checking for /dev/ptmx... " >&6; } +{ echo "$as_me:$LINENO: checking for /dev/ptmx" >&5 +echo $ECHO_N "checking for /dev/ptmx... $ECHO_C" >&6; } if test -r /dev/ptmx then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_DEV_PTMX 1 _ACEOF else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -{ $as_echo "$as_me:$LINENO: checking for /dev/ptc" >&5 -$as_echo_n "checking for /dev/ptc... " >&6; } +{ echo "$as_me:$LINENO: checking for /dev/ptc" >&5 +echo $ECHO_N "checking for /dev/ptc... $ECHO_C" >&6; } if test -r /dev/ptc then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define HAVE_DEV_PTC 1 _ACEOF else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -{ $as_echo "$as_me:$LINENO: checking for %zd printf() format support" >&5 -$as_echo_n "checking for %zd printf() format support... " >&6; } +{ echo "$as_me:$LINENO: checking for %zd printf() format support" >&5 +echo $ECHO_N "checking for %zd printf() format support... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run test program while cross compiling +echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -25946,92 +25194,46 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } cat >>confdefs.h <<\_ACEOF #define PY_FORMAT_SIZE_T "z" _ACEOF else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } +{ echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: checking for socklen_t" >&5 -$as_echo_n "checking for socklen_t... " >&6; } +{ echo "$as_me:$LINENO: checking for socklen_t" >&5 +echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; } if test "${ac_cv_type_socklen_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_type_socklen_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif - - -int -main () -{ -if (sizeof (socklen_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -26047,11 +25249,14 @@ #endif +typedef socklen_t ac__type_new_; int main () { -if (sizeof ((socklen_t))) - return 0; +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; ; return 0; } @@ -26062,39 +25267,30 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_socklen_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_type_socklen_t=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + ac_cv_type_socklen_t=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 -$as_echo "$ac_cv_type_socklen_t" >&6; } -if test "x$ac_cv_type_socklen_t" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 +echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; } +if test $ac_cv_type_socklen_t = yes; then : else @@ -26105,8 +25301,8 @@ fi -{ $as_echo "$as_me:$LINENO: checking for broken mbstowcs" >&5 -$as_echo_n "checking for broken mbstowcs... " >&6; } +{ echo "$as_me:$LINENO: checking for broken mbstowcs" >&5 +echo $ECHO_N "checking for broken mbstowcs... $ECHO_C" >&6; } if test "$cross_compiling" = yes; then ac_cv_broken_mbstowcs=no else @@ -26132,38 +25328,35 @@ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_broken_mbstowcs=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_broken_mbstowcs=yes fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_broken_mbstowcs" >&5 -$as_echo "$ac_cv_broken_mbstowcs" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_broken_mbstowcs" >&5 +echo "${ECHO_T}$ac_cv_broken_mbstowcs" >&6; } if test "$ac_cv_broken_mbstowcs" = yes then @@ -26174,8 +25367,8 @@ fi # Check for --with-computed-gotos -{ $as_echo "$as_me:$LINENO: checking for --with-computed-gotos" >&5 -$as_echo_n "checking for --with-computed-gotos... " >&6; } +{ echo "$as_me:$LINENO: checking for --with-computed-gotos" >&5 +echo $ECHO_N "checking for --with-computed-gotos... $ECHO_C" >&6; } # Check whether --with-computed-gotos was given. if test "${with_computed_gotos+set}" = set; then @@ -26187,14 +25380,14 @@ #define USE_COMPUTED_GOTOS 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } -else { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -26208,15 +25401,15 @@ SRCDIRS="Parser Grammar Objects Python Modules Mac" -{ $as_echo "$as_me:$LINENO: checking for build directories" >&5 -$as_echo_n "checking for build directories... " >&6; } +{ echo "$as_me:$LINENO: checking for build directories" >&5 +echo $ECHO_N "checking for build directories... $ECHO_C" >&6; } for dir in $SRCDIRS; do if test ! -d $dir; then mkdir $dir fi done -{ $as_echo "$as_me:$LINENO: result: done" >&5 -$as_echo "done" >&6; } +{ echo "$as_me:$LINENO: result: done" >&5 +echo "${ECHO_T}done" >&6; } # generate output files ac_config_files="$ac_config_files Makefile.pre Modules/Setup.config Misc/python.pc" @@ -26248,12 +25441,11 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -26286,12 +25478,12 @@ if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -26307,7 +25499,7 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -26319,14 +25511,12 @@ - : ${CONFIG_STATUS=./config.status} -ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -26339,7 +25529,7 @@ SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -26349,7 +25539,7 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -26371,45 +25561,17 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. @@ -26425,6 +25587,8 @@ # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) +as_nl=' +' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -26447,7 +25611,7 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -26460,10 +25624,17 @@ PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -26485,7 +25656,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -26536,7 +25707,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -26564,6 +25735,7 @@ *) ECHO_N='-n';; esac + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -26576,22 +25748,19 @@ rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null + mkdir conf$$.dir fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln else as_ln_s='cp -p' fi @@ -26616,10 +25785,10 @@ as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -26642,7 +25811,7 @@ # values after options handling. ac_log=" This file was extended by python $as_me 3.1, which was -generated by GNU Autoconf 2.63. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -26655,39 +25824,29 @@ _ACEOF -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -config_files="`echo $ac_config_files`" -config_headers="`echo $ac_config_headers`" +config_files="$ac_config_files" +config_headers="$ac_config_headers" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. -Usage: $0 [OPTION]... [FILE]... +Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - -q, --quiet, --silent - do not print progress messages + -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -26698,24 +25857,24 @@ Report bugs to ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ python config.status 3.1 -configured by $0, generated by GNU Autoconf 2.63, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' -test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do @@ -26737,36 +25896,30 @@ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { $as_echo "$as_me: error: ambiguous option: $1 + { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { $as_echo "$as_me: error: unrecognized option: $1 + -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -26785,32 +25938,30 @@ fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL export CONFIG_SHELL - exec "\$@" + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + echo "$ac_log" } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets @@ -26825,8 +25976,8 @@ "Modules/Setup.config") CONFIG_FILES="$CONFIG_FILES Modules/Setup.config" ;; "Misc/python.pc") CONFIG_FILES="$CONFIG_FILES Misc/python.pc" ;; - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done @@ -26866,145 +26017,224 @@ (umask 077 && mkdir "$tmp") } || { - $as_echo "$as_me: cannot create a temporary directory in ." >&2 + echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - +# +# Set up the sed scripts for CONFIG_FILES section. +# -ac_cr=' -' -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "$CONFIG_FILES"; then -echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + ac_delim='%!_!# ' for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +VERSION!$VERSION$ac_delim +SOVERSION!$SOVERSION$ac_delim +CONFIG_ARGS!$CONFIG_ARGS$ac_delim +UNIVERSALSDK!$UNIVERSALSDK$ac_delim +ARCH_RUN_32BIT!$ARCH_RUN_32BIT$ac_delim +PYTHONFRAMEWORK!$PYTHONFRAMEWORK$ac_delim +PYTHONFRAMEWORKIDENTIFIER!$PYTHONFRAMEWORKIDENTIFIER$ac_delim +PYTHONFRAMEWORKDIR!$PYTHONFRAMEWORKDIR$ac_delim +PYTHONFRAMEWORKPREFIX!$PYTHONFRAMEWORKPREFIX$ac_delim +PYTHONFRAMEWORKINSTALLDIR!$PYTHONFRAMEWORKINSTALLDIR$ac_delim +FRAMEWORKINSTALLFIRST!$FRAMEWORKINSTALLFIRST$ac_delim +FRAMEWORKINSTALLLAST!$FRAMEWORKINSTALLLAST$ac_delim +FRAMEWORKALTINSTALLFIRST!$FRAMEWORKALTINSTALLFIRST$ac_delim +FRAMEWORKALTINSTALLLAST!$FRAMEWORKALTINSTALLLAST$ac_delim +FRAMEWORKUNIXTOOLSPREFIX!$FRAMEWORKUNIXTOOLSPREFIX$ac_delim +MACHDEP!$MACHDEP$ac_delim +SGI_ABI!$SGI_ABI$ac_delim +CONFIGURE_MACOSX_DEPLOYMENT_TARGET!$CONFIGURE_MACOSX_DEPLOYMENT_TARGET$ac_delim +EXPORT_MACOSX_DEPLOYMENT_TARGET!$EXPORT_MACOSX_DEPLOYMENT_TARGET$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +CXX!$CXX$ac_delim +MAINCC!$MAINCC$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +BUILDEXEEXT!$BUILDEXEEXT$ac_delim +LIBRARY!$LIBRARY$ac_delim +LDLIBRARY!$LDLIBRARY$ac_delim +DLLLIBRARY!$DLLLIBRARY$ac_delim +BLDLIBRARY!$BLDLIBRARY$ac_delim +LDLIBRARYDIR!$LDLIBRARYDIR$ac_delim +INSTSONAME!$INSTSONAME$ac_delim +RUNSHARED!$RUNSHARED$ac_delim +LINKCC!$LINKCC$ac_delim +GNULD!$GNULD$ac_delim +RANLIB!$RANLIB$ac_delim +AR!$AR$ac_delim +ARFLAGS!$ARFLAGS$ac_delim +SVNVERSION!$SVNVERSION$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +LN!$LN$ac_delim +OPT!$OPT$ac_delim +BASECFLAGS!$BASECFLAGS$ac_delim +UNIVERSAL_ARCH_FLAGS!$UNIVERSAL_ARCH_FLAGS$ac_delim +OTHER_LIBTOOL_OPT!$OTHER_LIBTOOL_OPT$ac_delim +LIBTOOL_CRUFT!$LIBTOOL_CRUFT$ac_delim +SO!$SO$ac_delim +LDSHARED!$LDSHARED$ac_delim +BLDSHARED!$BLDSHARED$ac_delim +CCSHARED!$CCSHARED$ac_delim +LINKFORSHARED!$LINKFORSHARED$ac_delim +CFLAGSFORSHARED!$CFLAGSFORSHARED$ac_delim +_ACEOF - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done -rm -f conf$$subs.sh -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\).*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\).*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF - print line -} -_ACAWK +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHLIBS!$SHLIBS$ac_delim +USE_SIGNAL_MODULE!$USE_SIGNAL_MODULE$ac_delim +SIGNAL_OBJS!$SIGNAL_OBJS$ac_delim +USE_THREAD_MODULE!$USE_THREAD_MODULE$ac_delim +LDLAST!$LDLAST$ac_delim +THREADOBJ!$THREADOBJ$ac_delim +DLINCLDIR!$DLINCLDIR$ac_delim +DYNLOADFILE!$DYNLOADFILE$ac_delim +MACHDEP_OBJS!$MACHDEP_OBJS$ac_delim +TRUE!$TRUE$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +HAVE_GETHOSTBYNAME_R_6_ARG!$HAVE_GETHOSTBYNAME_R_6_ARG$ac_delim +HAVE_GETHOSTBYNAME_R_5_ARG!$HAVE_GETHOSTBYNAME_R_5_ARG$ac_delim +HAVE_GETHOSTBYNAME_R_3_ARG!$HAVE_GETHOSTBYNAME_R_3_ARG$ac_delim +HAVE_GETHOSTBYNAME_R!$HAVE_GETHOSTBYNAME_R$ac_delim +HAVE_GETHOSTBYNAME!$HAVE_GETHOSTBYNAME$ac_delim +LIBM!$LIBM$ac_delim +LIBC!$LIBC$ac_delim +THREADHEADERS!$THREADHEADERS$ac_delim +SRCDIRS!$SRCDIRS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 -$as_echo "$as_me: error: could not setup config files machinery" >&2;} + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 21; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof _ACEOF + # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty @@ -27020,133 +26250,19 @@ }' fi -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then - break - elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 -$as_echo "$as_me: error: could not setup config headers machinery" >&2;} - { (exit 1); exit 1; }; } -fi # test -n "$CONFIG_HEADERS" - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " -shift -for ac_tag +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 -$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; @@ -27175,38 +26291,26 @@ [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - ac_file_inputs="$ac_file_inputs '$ac_f'" + ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; + *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac @@ -27216,7 +26320,7 @@ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -27242,7 +26346,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -27251,7 +26355,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -27272,17 +26376,17 @@ test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -27322,13 +26426,12 @@ esac _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { +case `sed -n '/datarootdir/ { p q } @@ -27337,14 +26440,13 @@ /@infodir@/p /@localedir@/p /@mandir@/p -' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g @@ -27358,16 +26460,15 @@ # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t +s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t @@ -27377,58 +26478,119 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac ;; :H) # # CONFIG_HEADER # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : +do + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines conftest.tail + +echo "ac_result=$ac_in" >>$CONFIG_STATUS +cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} else - rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + rm -f $ac_file + mv "$tmp/config.h" $ac_file fi else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 -$as_echo "$as_me: error: could not create -" >&2;} - { (exit 1); exit 1; }; } + echo "/* $configure_input */" + cat "$ac_result" fi + rm -f "$tmp/out12" ;; @@ -27442,11 +26604,6 @@ chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save -test $ac_write_fail = 0 || - { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -27468,10 +26625,6 @@ # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi echo "creating Modules/Setup" Modified: python/branches/py3k/configure.in ============================================================================== --- python/branches/py3k/configure.in (original) +++ python/branches/py3k/configure.in Fri May 29 19:25:39 2009 @@ -2429,7 +2429,8 @@ setlocale setregid setreuid setsid setpgid setpgrp setuid setvbuf snprintf \ sigaction siginterrupt sigrelse strftime strlcpy \ sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ - truncate uname unsetenv utimes waitpid wait3 wait4 wcscoll wcsxfrm _getpty) + truncate uname unsetenv utimes waitpid wait3 wait4 \ + wcscoll wcsftime wcsxfrm _getpty) # For some functions, having a definition is not sufficient, since # we want to take their address. Modified: python/branches/py3k/pyconfig.h.in ============================================================================== --- python/branches/py3k/pyconfig.h.in (original) +++ python/branches/py3k/pyconfig.h.in Fri May 29 19:25:39 2009 @@ -5,9 +5,6 @@ #define Py_PYCONFIG_H -/* Define if building universal (internal helper macro) */ -#undef AC_APPLE_UNIVERSAL_BUILD - /* Define for AIX if your compiler is a genuine IBM xlC/xlC_r and you want support for AIX C++ shared extension modules. */ #undef AIX_GENUINE_CPLUSPLUS @@ -847,6 +844,9 @@ /* Define to 1 if you have the `wcscoll' function. */ #undef HAVE_WCSCOLL +/* Define to 1 if you have the `wcsftime' function. */ +#undef HAVE_WCSFTIME + /* Define to 1 if you have the `wcsxfrm' function. */ #undef HAVE_WCSXFRM @@ -995,28 +995,6 @@ /* Define if you want to use computed gotos in ceval.c. */ #undef USE_COMPUTED_GOTOS -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* Enable threading extensions on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif - - /* Define if a va_list is an array of some kind */ #undef VA_LIST_IS_ARRAY @@ -1054,21 +1032,20 @@ /* Define to profile with the Pentium timestamp counter */ #undef WITH_TSC -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -# undef WORDS_BIGENDIAN -# endif -#endif +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN /* Define if arithmetic is subject to x87-style double rounding issue */ #undef X87_DOUBLE_ROUNDING +/* Define to 1 if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif + /* Define on OpenBSD to activate all library features */ #undef _BSD_SOURCE @@ -1087,25 +1064,15 @@ /* This must be defined on some systems to enable large file support. */ #undef _LARGEFILE_SOURCE -/* Define to 1 if on MINIX. */ -#undef _MINIX - /* Define on NetBSD to activate all library features */ #undef _NETBSD_SOURCE /* Define _OSF_SOURCE to get the makedev macro. */ #undef _OSF_SOURCE -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -#undef _POSIX_1_SOURCE - /* Define to activate features from IEEE Stds 1003.1-2001 */ #undef _POSIX_C_SOURCE -/* Define to 1 if you need to in order for `stat' and other things to work. */ -#undef _POSIX_SOURCE - /* Define if you have POSIX threads, and your system does not define that. */ #undef _POSIX_THREADS @@ -1113,12 +1080,12 @@ #undef _REENTRANT /* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or is not used. If the typedef were allowed, the + , or is not used. If the typedef was allowed, the #define below would cause a syntax error. */ #undef _UINT32_T /* Define for Solaris 2.5.1 so the uint64_t typedef from , - , or is not used. If the typedef were allowed, the + , or is not used. If the typedef was allowed, the #define below would cause a syntax error. */ #undef _UINT64_T From python-checkins at python.org Fri May 29 19:31:05 2009 From: python-checkins at python.org (r.david.murray) Date: Fri, 29 May 2009 19:31:05 +0200 (CEST) Subject: [Python-checkins] r73022 - python/trunk/Lib/test/test_smtplib.py Message-ID: <20090529173105.B483CD4A9@mail.python.org> Author: r.david.murray Date: Fri May 29 19:31:05 2009 New Revision: 73022 Log: Refactor test parameterization to resolve update timing problem. Modified: python/trunk/Lib/test/test_smtplib.py Modified: python/trunk/Lib/test/test_smtplib.py ============================================================================== --- python/trunk/Lib/test/test_smtplib.py (original) +++ python/trunk/Lib/test/test_smtplib.py Fri May 29 19:31:05 2009 @@ -294,17 +294,11 @@ # Simulated SMTP channel & server class SimSMTPChannel(smtpd.SMTPChannel): - def __init__(self, *args, **kw): - self.__extrafeatures = [] + def __init__(self, extra_features, *args, **kw): + self._extrafeatures = ''.join( + [ "250-{0}\r\n".format(x) for x in extra_features ]) smtpd.SMTPChannel.__init__(self, *args, **kw) - @property - def _extrafeatures(self): - return ''.join([ "250-{0}\r\n".format(x) for x in self.__extrafeatures ]) - - def add_feature(self, feature): - self.__extrafeatures.append(feature) - def smtp_EHLO(self, arg): resp = ('250-testhost\r\n' '250-EXPN\r\n' @@ -354,15 +348,20 @@ class SimSMTPServer(smtpd.SMTPServer): + def __init__(self, *args, **kw): + self._extra_features = [] + smtpd.SMTPServer.__init__(self, *args, **kw) + def handle_accept(self): conn, addr = self.accept() - self._SMTPchannel = SimSMTPChannel(self, conn, addr) + self._SMTPchannel = SimSMTPChannel(self._extra_features, + self, conn, addr) def process_message(self, peer, mailfrom, rcpttos, data): pass def add_feature(self, feature): - self._SMTPchannel.add_feature(feature) + self._extra_features.append(feature) # Test various SMTP & ESMTP commands/behaviors that require a simulated server @@ -441,8 +440,8 @@ smtp.quit() def testAUTH_PLAIN(self): - smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) self.serv.add_feature("AUTH PLAIN") + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) expected_auth_ok = (235, b'plain auth ok') self.assertEqual(smtp.login(sim_auth[0], sim_auth[1]), expected_auth_ok) @@ -456,16 +455,16 @@ # the error message). def testAUTH_LOGIN(self): - smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) self.serv.add_feature("AUTH LOGIN") + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) try: smtp.login(sim_auth[0], sim_auth[1]) except smtplib.SMTPAuthenticationError as err: if sim_auth_login_password not in str(err): raise "expected encoded password not found in error message" def testAUTH_CRAM_MD5(self): - smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) self.serv.add_feature("AUTH CRAM-MD5") + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) try: smtp.login(sim_auth[0], sim_auth[1]) except smtplib.SMTPAuthenticationError as err: From python-checkins at python.org Fri May 29 19:38:17 2009 From: python-checkins at python.org (r.david.murray) Date: Fri, 29 May 2009 19:38:17 +0200 (CEST) Subject: [Python-checkins] r73023 - in python/branches/release26-maint: Lib/test/test_smtplib.py Message-ID: <20090529173817.04FAFD7AE@mail.python.org> Author: r.david.murray Date: Fri May 29 19:38:16 2009 New Revision: 73023 Log: Merged revisions 73022 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r73022 | r.david.murray | 2009-05-29 13:31:05 -0400 (Fri, 29 May 2009) | 2 lines Refactor test parameterization to resolve update timing problem. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_smtplib.py Modified: python/branches/release26-maint/Lib/test/test_smtplib.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_smtplib.py (original) +++ python/branches/release26-maint/Lib/test/test_smtplib.py Fri May 29 19:38:16 2009 @@ -294,17 +294,11 @@ # Simulated SMTP channel & server class SimSMTPChannel(smtpd.SMTPChannel): - def __init__(self, *args, **kw): - self.__extrafeatures = [] + def __init__(self, extra_features, *args, **kw): + self._extrafeatures = ''.join( + [ "250-{0}\r\n".format(x) for x in extra_features ]) smtpd.SMTPChannel.__init__(self, *args, **kw) - @property - def _extrafeatures(self): - return ''.join([ "250-{0}\r\n".format(x) for x in self.__extrafeatures ]) - - def add_feature(self, feature): - self.__extrafeatures.append(feature) - def smtp_EHLO(self, arg): resp = ('250-testhost\r\n' '250-EXPN\r\n' @@ -354,15 +348,20 @@ class SimSMTPServer(smtpd.SMTPServer): + def __init__(self, *args, **kw): + self._extra_features = [] + smtpd.SMTPServer.__init__(self, *args, **kw) + def handle_accept(self): conn, addr = self.accept() - self._SMTPchannel = SimSMTPChannel(self, conn, addr) + self._SMTPchannel = SimSMTPChannel(self._extra_features, + self, conn, addr) def process_message(self, peer, mailfrom, rcpttos, data): pass def add_feature(self, feature): - self._SMTPchannel.add_feature(feature) + self._extra_features.append(feature) # Test various SMTP & ESMTP commands/behaviors that require a simulated server @@ -441,8 +440,8 @@ smtp.quit() def testAUTH_PLAIN(self): - smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) self.serv.add_feature("AUTH PLAIN") + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) expected_auth_ok = (235, b'plain auth ok') self.assertEqual(smtp.login(sim_auth[0], sim_auth[1]), expected_auth_ok) @@ -456,16 +455,16 @@ # the error message). def testAUTH_LOGIN(self): - smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) self.serv.add_feature("AUTH LOGIN") + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) try: smtp.login(sim_auth[0], sim_auth[1]) except smtplib.SMTPAuthenticationError as err: if sim_auth_login_password not in str(err): raise "expected encoded password not found in error message" def testAUTH_CRAM_MD5(self): - smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) self.serv.add_feature("AUTH CRAM-MD5") + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) try: smtp.login(sim_auth[0], sim_auth[1]) except smtplib.SMTPAuthenticationError as err: From python-checkins at python.org Fri May 29 20:03:16 2009 From: python-checkins at python.org (r.david.murray) Date: Fri, 29 May 2009 20:03:16 +0200 (CEST) Subject: [Python-checkins] r73024 - in python/branches/py3k: Lib/test/test_smtplib.py Message-ID: <20090529180316.AAB1CD756@mail.python.org> Author: r.david.murray Date: Fri May 29 20:03:16 2009 New Revision: 73024 Log: Merged revisions 73022 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r73022 | r.david.murray | 2009-05-29 13:31:05 -0400 (Fri, 29 May 2009) | 2 lines Refactor test parameterization to resolve update timing problem. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_smtplib.py Modified: python/branches/py3k/Lib/test/test_smtplib.py ============================================================================== --- python/branches/py3k/Lib/test/test_smtplib.py (original) +++ python/branches/py3k/Lib/test/test_smtplib.py Fri May 29 20:03:16 2009 @@ -302,17 +302,11 @@ # Simulated SMTP channel & server class SimSMTPChannel(smtpd.SMTPChannel): - def __init__(self, *args, **kw): - self.__extrafeatures = [] + def __init__(self, extra_features, *args, **kw): + self._extrafeatures = ''.join( + [ "250-{0}\r\n".format(x) for x in extra_features ]) super(SimSMTPChannel, self).__init__(*args, **kw) - @property - def _extrafeatures(self): - return ''.join([ "250-{}\r\n".format(x) for x in self.__extrafeatures ]) - - def add_feature(self, feature): - self.__extrafeatures.append(feature) - def smtp_EHLO(self, arg): resp = ('250-testhost\r\n' '250-EXPN\r\n' @@ -362,15 +356,20 @@ class SimSMTPServer(smtpd.SMTPServer): + def __init__(self, *args, **kw): + self._extra_features = [] + smtpd.SMTPServer.__init__(self, *args, **kw) + def handle_accept(self): conn, addr = self.accept() - self._SMTPchannel = SimSMTPChannel(self, conn, addr) + self._SMTPchannel = SimSMTPChannel(self._extra_features, + self, conn, addr) def process_message(self, peer, mailfrom, rcpttos, data): pass def add_feature(self, feature): - self._SMTPchannel.add_feature(feature) + self._extra_features.append(feature) # Test various SMTP & ESMTP commands/behaviors that require a simulated server @@ -452,8 +451,8 @@ smtp.quit() def testAUTH_PLAIN(self): - smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) self.serv.add_feature("AUTH PLAIN") + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) expected_auth_ok = (235, b'plain auth ok') self.assertEqual(smtp.login(sim_auth[0], sim_auth[1]), expected_auth_ok) @@ -467,16 +466,16 @@ # the error message). def testAUTH_LOGIN(self): - smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) self.serv.add_feature("AUTH LOGIN") + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) try: smtp.login(sim_auth[0], sim_auth[1]) except smtplib.SMTPAuthenticationError as err: if sim_auth_login_password not in str(err): raise "expected encoded password not found in error message" def testAUTH_CRAM_MD5(self): - smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) self.serv.add_feature("AUTH CRAM-MD5") + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) try: smtp.login(sim_auth[0], sim_auth[1]) except smtplib.SMTPAuthenticationError as err: From python-checkins at python.org Fri May 29 20:06:14 2009 From: python-checkins at python.org (r.david.murray) Date: Fri, 29 May 2009 20:06:14 +0200 (CEST) Subject: [Python-checkins] r73025 - in python/branches/release30-maint: Lib/test/test_smtplib.py Message-ID: <20090529180614.CA3B4D778@mail.python.org> Author: r.david.murray Date: Fri May 29 20:06:14 2009 New Revision: 73025 Log: Merged revisions 73024 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r73024 | r.david.murray | 2009-05-29 14:03:16 -0400 (Fri, 29 May 2009) | 9 lines Merged revisions 73022 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r73022 | r.david.murray | 2009-05-29 13:31:05 -0400 (Fri, 29 May 2009) | 2 lines Refactor test parameterization to resolve update timing problem. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/test/test_smtplib.py Modified: python/branches/release30-maint/Lib/test/test_smtplib.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_smtplib.py (original) +++ python/branches/release30-maint/Lib/test/test_smtplib.py Fri May 29 20:06:14 2009 @@ -302,17 +302,11 @@ # Simulated SMTP channel & server class SimSMTPChannel(smtpd.SMTPChannel): - def __init__(self, *args, **kw): - self.__extrafeatures = [] + def __init__(self, extra_features, *args, **kw): + self._extrafeatures = ''.join( + [ "250-{0}\r\n".format(x) for x in extra_features ]) super(SimSMTPChannel, self).__init__(*args, **kw) - @property - def _extrafeatures(self): - return ''.join([ "250-{0}\r\n".format(x) for x in self.__extrafeatures ]) - - def add_feature(self, feature): - self.__extrafeatures.append(feature) - def smtp_EHLO(self, arg): resp = ('250-testhost\r\n' '250-EXPN\r\n' @@ -362,15 +356,20 @@ class SimSMTPServer(smtpd.SMTPServer): + def __init__(self, *args, **kw): + self._extra_features = [] + smtpd.SMTPServer.__init__(self, *args, **kw) + def handle_accept(self): conn, addr = self.accept() - self._SMTPchannel = SimSMTPChannel(self, conn, addr) + self._SMTPchannel = SimSMTPChannel(self._extra_features, + self, conn, addr) def process_message(self, peer, mailfrom, rcpttos, data): pass def add_feature(self, feature): - self._SMTPchannel.add_feature(feature) + self._extra_features.append(feature) # Test various SMTP & ESMTP commands/behaviors that require a simulated server @@ -452,8 +451,8 @@ smtp.quit() def testAUTH_PLAIN(self): - smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) self.serv.add_feature("AUTH PLAIN") + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) expected_auth_ok = (235, b'plain auth ok') self.assertEqual(smtp.login(sim_auth[0], sim_auth[1]), expected_auth_ok) @@ -467,16 +466,16 @@ # the error message). def testAUTH_LOGIN(self): - smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) self.serv.add_feature("AUTH LOGIN") + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) try: smtp.login(sim_auth[0], sim_auth[1]) except smtplib.SMTPAuthenticationError as err: if sim_auth_login_password not in str(err): raise "expected encoded password not found in error message" def testAUTH_CRAM_MD5(self): - smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) self.serv.add_feature("AUTH CRAM-MD5") + smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15) try: smtp.login(sim_auth[0], sim_auth[1]) except smtplib.SMTPAuthenticationError as err: From mal at egenix.com Fri May 29 20:53:39 2009 From: mal at egenix.com (M.-A. Lemburg) Date: Fri, 29 May 2009 20:53:39 +0200 Subject: [Python-checkins] r73021 - in python/branches/py3k: configure configure.in pyconfig.h.in In-Reply-To: <20090529172540.70074D7B5@mail.python.org> References: <20090529172540.70074D7B5@mail.python.org> Message-ID: <4A202F33.8040202@egenix.com> martin.v.loewis wrote: > Author: martin.v.loewis > Date: Fri May 29 19:25:39 2009 > New Revision: 73021 > > Log: > Issue 5562: check for wcsftime. > > > Modified: > python/branches/py3k/configure > python/branches/py3k/configure.in > python/branches/py3k/pyconfig.h.in > > Modified: python/branches/py3k/configure > ============================================================================== > --- python/branches/py3k/configure (original) > +++ python/branches/py3k/configure Fri May 29 19:25:39 2009 > @@ -1,12 +1,12 @@ > #! /bin/sh > -# From configure.in Revision: 72874 . > +# From configure.in Revision: 72899 . > # Guess values for system-dependent variables and create Makefiles. > -# Generated by GNU Autoconf 2.63 for python 3.1. > +# Generated by GNU Autoconf 2.61 for python 3.1. Wouldn't it be better to use 2.63 instead of reverting back to 2.61 ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, May 29 2009) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ 2009-06-29: EuroPython 2009, Birmingham, UK 30 days to go ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ From buildbot at python.org Fri May 29 21:29:35 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 29 May 2009 19:29:35 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090529192935.89199D61D@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/835 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: sincerely, -The Buildbot From python-checkins at python.org Fri May 29 21:30:27 2009 From: python-checkins at python.org (r.david.murray) Date: Fri, 29 May 2009 21:30:27 +0200 (CEST) Subject: [Python-checkins] r73026 - python/trunk/Doc/library/subprocess.rst Message-ID: <20090529193027.90B5DD662@mail.python.org> Author: r.david.murray Date: Fri May 29 21:30:27 2009 New Revision: 73026 Log: Issue 6141: document that the first item of args is still the command name even when executable is specified. Modified: python/trunk/Doc/library/subprocess.rst Modified: python/trunk/Doc/library/subprocess.rst ============================================================================== --- python/trunk/Doc/library/subprocess.rst (original) +++ python/trunk/Doc/library/subprocess.rst Fri May 29 21:30:27 2009 @@ -39,9 +39,12 @@ Arguments are: *args* should be a string, or a sequence of program arguments. The program - to execute is normally the first item in the args sequence or the string if a - string is given, but can be explicitly set by using the *executable* - argument. + to execute is normally the first item in the args sequence or the string if + a string is given, but can be explicitly set by using the *executable* + argument. When *executable* is given, the first item in the args sequence + is still treated by most programs as the command name, which can then be + different from the actual executable name. On Unix, it becomes the display + name for the executing program in utilities such as :program:`ps`. On Unix, with *shell=False* (default): In this case, the Popen class uses :meth:`os.execvp` to execute the child program. *args* should normally be a From benjamin at python.org Fri May 29 22:24:20 2009 From: benjamin at python.org (Benjamin Peterson) Date: Fri, 29 May 2009 15:24:20 -0500 Subject: [Python-checkins] r73021 - in python/branches/py3k: configure configure.in pyconfig.h.in In-Reply-To: <4A202F33.8040202@egenix.com> References: <20090529172540.70074D7B5@mail.python.org> <4A202F33.8040202@egenix.com> Message-ID: <1afaf6160905291324m41180ae9h6cae6183b5e86246@mail.gmail.com> 2009/5/29 M.-A. Lemburg : > martin.v.loewis wrote: > Wouldn't it be better to use 2.63 instead of reverting back to > 2.61 ? Does it matter? -- Regards, Benjamin From python-checkins at python.org Fri May 29 22:33:47 2009 From: python-checkins at python.org (michael.foord) Date: Fri, 29 May 2009 22:33:47 +0200 (CEST) Subject: [Python-checkins] r73027 - in python/trunk: Doc/library/unittest.rst Lib/test/test_unittest.py Lib/unittest.py Misc/NEWS Message-ID: <20090529203347.274EDD6AD@mail.python.org> Author: michael.foord Date: Fri May 29 22:33:46 2009 New Revision: 73027 Log: Add test discovery to unittest. Issue 6001. Modified: python/trunk/Doc/library/unittest.rst python/trunk/Lib/test/test_unittest.py python/trunk/Lib/unittest.py python/trunk/Misc/NEWS Modified: python/trunk/Doc/library/unittest.rst ============================================================================== --- python/trunk/Doc/library/unittest.rst (original) +++ python/trunk/Doc/library/unittest.rst Fri May 29 22:33:46 2009 @@ -90,6 +90,9 @@ `python-mock `_ and `minimock `_ Tools for creating mock test objects (objects simulating external resources). + +.. _unittest-command-line-interface: + Command Line Interface ---------------------- @@ -100,8 +103,8 @@ python -m unittest test_module.TestClass python -m unittest test_module.TestClass.test_method -You can pass in a list with any combination of module names, and fully qualified class or -method names. +You can pass in a list with any combination of module names, and fully +qualified class or method names. You can run tests with more detail (higher verbosity) by passing in the -v flag:: @@ -111,9 +114,47 @@ python -m unittest -h -.. versionchanged:: 27 - In earlier versions it was only possible to run individual test methods and not modules - or classes. +.. versionchanged:: 2.7 + In earlier versions it was only possible to run individual test methods and + not modules or classes. + +The command line can also be used for test discovery, for running all of the +tests in a project or just a subset. + + +.. _unittest-test-discovery: + +Test Discovery +-------------- + +.. versionadded:: 2.7 + +unittest supports simple test discovery. For a project's tests to be +compatible with test discovery they must all be importable from the top level +directory of the project; i.e. they must all be in Python packages. + +Test discovery is implemented in :meth:`TestLoader.discover`, but can also be +used from the command line. The basic command line usage is:: + + cd project_directory + python -m unittest discover + +The ``discover`` sub-command has the following options: + + -v, --verbose Verbose output + -s directory Directory to start discovery ('.' default) + -p pattern Pattern to match test files ('test*.py' default) + -t directory Top level directory of project (default to + start directory) + +The -s, -p, & -t options can be passsed in as positional arguments. The +following two command lines are equivalent:: + + python -m unittest -s project_directory -p '*_test.py' + python -m unittest project_directory '*_test.py' + +Test modules and packages can customize test loading and discovery by through +the `load_tests protocol`_. .. _unittest-minimal-example: @@ -1151,6 +1192,13 @@ directly does not play well with this method. Doing so, however, can be useful when the fixtures are different and defined in subclasses. + If a module provides a ``load_tests`` function it will be called to + load the tests. This allows modules to customize test loading. + This is the `load_tests protocol`_. + + .. versionchanged:: 2.7 + Support for ``load_tests`` added. + .. method:: loadTestsFromName(name[, module]) @@ -1165,13 +1213,14 @@ rather than "a callable object". For example, if you have a module :mod:`SampleTests` containing a - :class:`TestCase`\ -derived class :class:`SampleTestCase` with three test - methods (:meth:`test_one`, :meth:`test_two`, and :meth:`test_three`), the - specifier ``'SampleTests.SampleTestCase'`` would cause this method to return a - suite which will run all three test methods. Using the specifier - ``'SampleTests.SampleTestCase.test_two'`` would cause it to return a test suite - which will run only the :meth:`test_two` test method. The specifier can refer - to modules and packages which have not been imported; they will be imported as a + :class:`TestCase`\ -derived class :class:`SampleTestCase` with three + test methods (:meth:`test_one`, :meth:`test_two`, and + :meth:`test_three`), the specifier ``'SampleTests.SampleTestCase'`` + would cause this method to return a suite which will run all three test + methods. Using the specifier ``'SampleTests.SampleTestCase.test_two'`` + would cause it to return a test suite which will run only the + :meth:`test_two` test method. The specifier can refer to modules and + packages which have not been imported; they will be imported as a side-effect. The method optionally resolves *name* relative to the given *module*. @@ -1189,6 +1238,31 @@ Return a sorted sequence of method names found within *testCaseClass*; this should be a subclass of :class:`TestCase`. + + .. method:: discover(start_dir, pattern='test*.py', top_level_dir=None) + + Find and return all test modules from the specified start directory, + recursing into subdirectories to find them. Only test files that match + *pattern* will be loaded. (Using shell style pattern matching.) + + All test modules must be importable from the top level of the project. If + the start directory is not the top level directory then the top level + directory must be specified separately. + + If a test package name (directory with :file:`__init__.py`) matches the + pattern then the package will be checked for a ``load_tests`` + function. If this exists then it will be called with *loader*, *tests*, + *pattern*. + + If load_tests exists then discovery does *not* recurse into the package, + ``load_tests`` is responsible for loading all tests in the package. + + The pattern is deliberately not stored as a loader attribute so that + packages can continue discovery themselves. *top_level_dir* is stored so + ``load_tests`` does not need to pass this argument in to + ``loader.discover()``. + + The following attributes of a :class:`TestLoader` can be configured either by subclassing or assignment on an instance: @@ -1353,8 +1427,8 @@ .. method:: addFailure(test, err) - Called when the test case *test* signals a failure. *err* is a tuple of the form - returned by :func:`sys.exc_info`: ``(type, value, traceback)``. + Called when the test case *test* signals a failure. *err* is a tuple of + the form returned by :func:`sys.exc_info`: ``(type, value, traceback)``. The default implementation appends a tuple ``(test, formatted_err)`` to the instance's :attr:`failures` attribute, where *formatted_err* is a @@ -1447,3 +1521,68 @@ .. versionchanged:: 2.7 The ``exit`` and ``verbosity`` parameters were added. + + +load_tests Protocol +################### + +Modules or packages can customize how tests are loaded from them during normal +test runs or test discovery by implementing a function called ``load_tests``. + +If a test module defines ``load_tests`` it will be called by +:meth:`TestLoader.loadTestsFromModule` with the following arguments:: + + load_tests(loader, standard_tests, None) + +It should return a :class:`TestSuite`. + +*loader* is the instance of :class:`TestLoader` doing the loading. +*standard_tests* are the tests that would be loaded by default from the +module. It is common for test modules to only want to add or remove tests +from the standard set of tests. +The third argument is used when loading packages as part of test discovery. + +A typical ``load_tests`` function that loads tests from a specific set of +:class:`TestCase` classes may look like:: + + test_cases = (TestCase1, TestCase2, TestCase3) + + def load_tests(loader, tests, pattern): + suite = TestSuite() + for test_class in test_cases: + tests = loader.loadTestsFromTestCase(test_class) + suite.addTests(tests) + return suite + +If discovery is started, either from the command line or by calling +:meth:`TestLoader.discover`, with a pattern that matches a package +name then the package :file:`__init__.py` will be checked for ``load_tests``. + +.. note:: + + The default pattern is 'test*.py'. This matches all python files + that start with 'test' but *won't* match any test directories. + + A pattern like 'test*' will match test packages as well as + modules. + +If the package :file:`__init__.py` defines ``load_tests`` then it will be +called and discovery not continued into the package. ``load_tests`` +is called with the following arguments:: + + load_tests(loader, standard_tests, pattern) + +This should return a :class:`TestSuite` representing all the tests +from the package. (``standard_tests`` will only contain tests +collected from :file:`__init__.py`.) + +Because the pattern is passed into ``load_tests`` the package is free to +continue (and potentially modify) test discovery. A 'do nothing' +``load_tests`` function for a test package would look like:: + + def load_tests(loader, standard_tests, pattern): + # top level directory cached on loader instance + this_dir = os.path.dirname(__file__) + package_tests = loader.discover(start_dir=this_dir, pattern=pattern) + standard_tests.addTests(package_tests) + return standard_tests Modified: python/trunk/Lib/test/test_unittest.py ============================================================================== --- python/trunk/Lib/test/test_unittest.py (original) +++ python/trunk/Lib/test/test_unittest.py Fri May 29 22:33:46 2009 @@ -7,7 +7,9 @@ """ from StringIO import StringIO +import os import re +import sys from test import test_support import unittest from unittest import TestCase, TestProgram @@ -256,6 +258,30 @@ reference = [unittest.TestSuite([MyTestCase('test')])] self.assertEqual(list(suite), reference) + + # Check that loadTestsFromModule honors (or not) a module + # with a load_tests function. + def test_loadTestsFromModule__load_tests(self): + m = types.ModuleType('m') + class MyTestCase(unittest.TestCase): + def test(self): + pass + m.testcase_1 = MyTestCase + + load_tests_args = [] + def load_tests(loader, tests, pattern): + load_tests_args.extend((loader, tests, pattern)) + return tests + m.load_tests = load_tests + + loader = unittest.TestLoader() + suite = loader.loadTestsFromModule(m) + self.assertEquals(load_tests_args, [loader, suite, None]) + + load_tests_args = [] + suite = loader.loadTestsFromModule(m, use_load_tests=False) + self.assertEquals(load_tests_args, []) + ################################################################ ### /Tests for TestLoader.loadTestsFromModule() @@ -3379,6 +3405,275 @@ self.assertEqual(events, expected) +class TestDiscovery(TestCase): + + # Heavily mocked tests so I can avoid hitting the filesystem + def test_get_module_from_path(self): + loader = unittest.TestLoader() + + def restore_import(): + unittest.__import__ = __import__ + unittest.__import__ = lambda *_: None + self.addCleanup(restore_import) + + expected_module = object() + def del_module(): + del sys.modules['bar.baz'] + sys.modules['bar.baz'] = expected_module + self.addCleanup(del_module) + + loader._top_level_dir = '/foo' + module = loader._get_module_from_path('/foo/bar/baz.py') + self.assertEqual(module, expected_module) + + if not __debug__: + # asserts are off + return + + with self.assertRaises(AssertionError): + loader._get_module_from_path('/bar/baz.py') + + def test_find_tests(self): + loader = unittest.TestLoader() + + original_listdir = os.listdir + def restore_listdir(): + os.listdir = original_listdir + original_isfile = os.path.isfile + def restore_isfile(): + os.path.isfile = original_isfile + original_isdir = os.path.isdir + def restore_isdir(): + os.path.isdir = original_isdir + + path_lists = [['test1.py', 'test2.py', 'not_a_test.py', 'test_dir', + 'test.foo', 'another_dir'], + ['test3.py', 'test4.py', ]] + os.listdir = lambda path: path_lists.pop(0) + self.addCleanup(restore_listdir) + + def isdir(path): + return path.endswith('dir') + os.path.isdir = isdir + self.addCleanup(restore_isdir) + + def isfile(path): + # another_dir is not a package and so shouldn't be recursed into + return not path.endswith('dir') and not 'another_dir' in path + os.path.isfile = isfile + self.addCleanup(restore_isfile) + + loader._get_module_from_path = lambda path: path + ' module' + loader.loadTestsFromModule = lambda module: module + ' tests' + + loader._top_level_dir = '/foo' + suite = list(loader._find_tests('/foo', 'test*.py')) + + expected = [os.path.join('/foo', name) + ' module tests' for name in + ('test1.py', 'test2.py')] + expected.extend([os.path.join('/foo', 'test_dir', name) + ' module tests' for name in + ('test3.py', 'test4.py')]) + self.assertEqual(suite, expected) + + def test_find_tests_with_package(self): + loader = unittest.TestLoader() + + original_listdir = os.listdir + def restore_listdir(): + os.listdir = original_listdir + original_isfile = os.path.isfile + def restore_isfile(): + os.path.isfile = original_isfile + original_isdir = os.path.isdir + def restore_isdir(): + os.path.isdir = original_isdir + + directories = ['a_directory', 'test_directory', 'test_directory2'] + path_lists = [directories, [], [], []] + os.listdir = lambda path: path_lists.pop(0) + self.addCleanup(restore_listdir) + + os.path.isdir = lambda path: True + self.addCleanup(restore_isdir) + + os.path.isfile = lambda path: os.path.basename(path) not in directories + self.addCleanup(restore_isfile) + + class Module(object): + paths = [] + load_tests_args = [] + + def __init__(self, path): + self.path = path + self.paths.append(path) + if os.path.basename(path) == 'test_directory': + def load_tests(loader, tests, pattern): + self.load_tests_args.append((loader, tests, pattern)) + return 'load_tests' + self.load_tests = load_tests + + def __eq__(self, other): + return self.path == other.path + + loader._get_module_from_path = lambda path: Module(path) + def loadTestsFromModule(module, use_load_tests): + if use_load_tests: + raise self.failureException('use_load_tests should be False for packages') + return module.path + ' module tests' + loader.loadTestsFromModule = loadTestsFromModule + + loader._top_level_dir = '/foo' + # this time no '.py' on the pattern so that it can match + # a test package + suite = list(loader._find_tests('/foo', 'test*')) + + # We should have loaded tests from the test_directory package by calling load_tests + # and directly from the test_directory2 package + self.assertEqual(suite, ['load_tests', '/foo/test_directory2 module tests']) + self.assertEqual(Module.paths, [os.path.join('/foo', 'test_directory'), + os.path.join('/foo', 'test_directory2')]) + + # load_tests should have been called once with loader, tests and pattern + self.assertEqual(Module.load_tests_args, + [(loader, os.path.join('/foo', 'test_directory') + ' module tests', + 'test*')]) + + def test_discover(self): + loader = unittest.TestLoader() + + original_isfile = os.path.isfile + def restore_isfile(): + os.path.isfile = original_isfile + + os.path.isfile = lambda path: False + self.addCleanup(restore_isfile) + + full_path = os.path.abspath(os.path.normpath('/foo')) + def clean_path(): + if sys.path[-1] == full_path: + sys.path.pop(-1) + self.addCleanup(clean_path) + + with self.assertRaises(ImportError): + loader.discover('/foo/bar', top_level_dir='/foo') + + self.assertEqual(loader._top_level_dir, full_path) + self.assertIn(full_path, sys.path) + + os.path.isfile = lambda path: True + _find_tests_args = [] + def _find_tests(start_dir, pattern): + _find_tests_args.append((start_dir, pattern)) + return ['tests'] + loader._find_tests = _find_tests + loader.suiteClass = str + + suite = loader.discover('/foo/bar/baz', 'pattern', '/foo/bar') + + top_level_dir = os.path.abspath(os.path.normpath('/foo/bar')) + start_dir = os.path.abspath(os.path.normpath('/foo/bar/baz')) + self.assertEqual(suite, "['tests']") + self.assertEqual(loader._top_level_dir, top_level_dir) + self.assertEqual(_find_tests_args, [(start_dir, 'pattern')]) + + def test_command_line_handling_parseArgs(self): + # Haha - take that uninstantiable class + program = object.__new__(TestProgram) + + args = [] + def do_discovery(argv): + args.extend(argv) + program._do_discovery = do_discovery + program.parseArgs(['something', 'discover']) + self.assertEqual(args, []) + + program.parseArgs(['something', 'discover', 'foo', 'bar']) + self.assertEqual(args, ['foo', 'bar']) + + def test_command_line_handling_do_discovery_too_many_arguments(self): + class Stop(Exception): + pass + def usageExit(): + raise Stop + + program = object.__new__(TestProgram) + program.usageExit = usageExit + + with self.assertRaises(Stop): + # too many args + program._do_discovery(['one', 'two', 'three', 'four']) + + + def test_command_line_handling_do_discovery_calls_loader(self): + program = object.__new__(TestProgram) + + class Loader(object): + args = [] + def discover(self, start_dir, pattern, top_level_dir): + self.args.append((start_dir, pattern, top_level_dir)) + return 'tests' + + program._do_discovery(['-v'], Loader=Loader) + self.assertEqual(program.verbosity, 2) + self.assertEqual(program.test, 'tests') + self.assertEqual(Loader.args, [('.', 'test*.py', None)]) + + Loader.args = [] + program = object.__new__(TestProgram) + program._do_discovery(['--verbose'], Loader=Loader) + self.assertEqual(program.test, 'tests') + self.assertEqual(Loader.args, [('.', 'test*.py', None)]) + + Loader.args = [] + program = object.__new__(TestProgram) + program._do_discovery([], Loader=Loader) + self.assertEqual(program.test, 'tests') + self.assertEqual(Loader.args, [('.', 'test*.py', None)]) + + Loader.args = [] + program = object.__new__(TestProgram) + program._do_discovery(['fish'], Loader=Loader) + self.assertEqual(program.test, 'tests') + self.assertEqual(Loader.args, [('fish', 'test*.py', None)]) + + Loader.args = [] + program = object.__new__(TestProgram) + program._do_discovery(['fish', 'eggs'], Loader=Loader) + self.assertEqual(program.test, 'tests') + self.assertEqual(Loader.args, [('fish', 'eggs', None)]) + + Loader.args = [] + program = object.__new__(TestProgram) + program._do_discovery(['fish', 'eggs', 'ham'], Loader=Loader) + self.assertEqual(program.test, 'tests') + self.assertEqual(Loader.args, [('fish', 'eggs', 'ham')]) + + Loader.args = [] + program = object.__new__(TestProgram) + program._do_discovery(['-s', 'fish'], Loader=Loader) + self.assertEqual(program.test, 'tests') + self.assertEqual(Loader.args, [('fish', 'test*.py', None)]) + + Loader.args = [] + program = object.__new__(TestProgram) + program._do_discovery(['-t', 'fish'], Loader=Loader) + self.assertEqual(program.test, 'tests') + self.assertEqual(Loader.args, [('.', 'test*.py', 'fish')]) + + Loader.args = [] + program = object.__new__(TestProgram) + program._do_discovery(['-p', 'fish'], Loader=Loader) + self.assertEqual(program.test, 'tests') + self.assertEqual(Loader.args, [('.', 'fish', None)]) + + Loader.args = [] + program = object.__new__(TestProgram) + program._do_discovery(['-p', 'eggs', '-s', 'fish', '-v'], Loader=Loader) + self.assertEqual(program.test, 'tests') + self.assertEqual(Loader.args, [('fish', 'eggs', None)]) + self.assertEqual(program.verbosity, 2) + + ###################################################################### ## Main ###################################################################### @@ -3387,7 +3682,7 @@ test_support.run_unittest(Test_TestCase, Test_TestLoader, Test_TestSuite, Test_TestResult, Test_FunctionTestCase, Test_TestSkipping, Test_Assertions, TestLongMessage, - Test_TestProgram, TestCleanUp) + Test_TestProgram, TestCleanUp, TestDiscovery) if __name__ == "__main__": test_main() Modified: python/trunk/Lib/unittest.py ============================================================================== --- python/trunk/Lib/unittest.py (original) +++ python/trunk/Lib/unittest.py Fri May 29 22:33:46 2009 @@ -56,6 +56,9 @@ import types import warnings +from fnmatch import fnmatch + + ############################################################################## # Exported classes and functions ############################################################################## @@ -1196,6 +1199,7 @@ testMethodPrefix = 'test' sortTestMethodsUsing = cmp suiteClass = TestSuite + _top_level_dir = None def loadTestsFromTestCase(self, testCaseClass): """Return a suite of all tests cases contained in testCaseClass""" @@ -1208,13 +1212,17 @@ suite = self.suiteClass(map(testCaseClass, testCaseNames)) return suite - def loadTestsFromModule(self, module): + def loadTestsFromModule(self, module, use_load_tests=True): """Return a suite of all tests cases contained in the given module""" tests = [] for name in dir(module): obj = getattr(module, name) if isinstance(obj, type) and issubclass(obj, TestCase): tests.append(self.loadTestsFromTestCase(obj)) + + load_tests = getattr(module, 'load_tests', None) + if use_load_tests and load_tests is not None: + return load_tests(self, tests, None) return self.suiteClass(tests) def loadTestsFromName(self, name, module=None): @@ -1283,7 +1291,97 @@ testFnNames.sort(key=_CmpToKey(self.sortTestMethodsUsing)) return testFnNames + def discover(self, start_dir, pattern='test*.py', top_level_dir=None): + """Find and return all test modules from the specified start + directory, recursing into subdirectories to find them. Only test files + that match the pattern will be loaded. (Using shell style pattern + matching.) + + All test modules must be importable from the top level of the project. + If the start directory is not the top level directory then the top + level directory must be specified separately. + + If a test package name (directory with '__init__.py') matches the + pattern then the package will be checked for a 'load_tests' function. If + this exists then it will be called with loader, tests, pattern. + + If load_tests exists then discovery does *not* recurse into the package, + load_tests is responsible for loading all tests in the package. + + The pattern is deliberately not stored as a loader attribute so that + packages can continue discovery themselves. top_level_dir is stored so + load_tests does not need to pass this argument in to loader.discover(). + """ + if top_level_dir is None and self._top_level_dir is not None: + # make top_level_dir optional if called from load_tests in a package + top_level_dir = self._top_level_dir + elif top_level_dir is None: + top_level_dir = start_dir + + top_level_dir = os.path.abspath(os.path.normpath(top_level_dir)) + start_dir = os.path.abspath(os.path.normpath(start_dir)) + + if not top_level_dir in sys.path: + # all test modules must be importable from the top level directory + sys.path.append(top_level_dir) + self._top_level_dir = top_level_dir + + if start_dir != top_level_dir and not os.path.isfile(os.path.join(start_dir, '__init__.py')): + # what about __init__.pyc or pyo (etc) + raise ImportError('Start directory is not importable: %r' % start_dir) + + tests = list(self._find_tests(start_dir, pattern)) + return self.suiteClass(tests) + + def _get_module_from_path(self, path): + """Load a module from a path relative to the top-level directory + of a project. Used by discovery.""" + path = os.path.splitext(os.path.normpath(path))[0] + + relpath = os.path.relpath(path, self._top_level_dir) + assert not os.path.isabs(relpath), "Path must be within the project" + assert not relpath.startswith('..'), "Path must be within the project" + + name = relpath.replace(os.path.sep, '.') + __import__(name) + return sys.modules[name] + + def _find_tests(self, start_dir, pattern): + """Used by discovery. Yields test suites it loads.""" + paths = os.listdir(start_dir) + + for path in paths: + full_path = os.path.join(start_dir, path) + # what about __init__.pyc or pyo (etc) + # we would need to avoid loading the same tests multiple times + # from '.py', '.pyc' *and* '.pyo' + if os.path.isfile(full_path) and path.lower().endswith('.py'): + if fnmatch(path, pattern): + # if the test file matches, load it + module = self._get_module_from_path(full_path) + yield self.loadTestsFromModule(module) + elif os.path.isdir(full_path): + if not os.path.isfile(os.path.join(full_path, '__init__.py')): + continue + + load_tests = None + tests = None + if fnmatch(path, pattern): + # only check load_tests if the package directory itself matches the filter + package = self._get_module_from_path(full_path) + load_tests = getattr(package, 'load_tests', None) + tests = self.loadTestsFromModule(package, use_load_tests=False) + + if load_tests is None: + if tests is not None: + # tests loaded from package file + yield tests + # recurse into the package + for test in self._find_tests(full_path, pattern): + yield test + else: + yield load_tests(self, tests, pattern) defaultTestLoader = TestLoader() @@ -1484,11 +1582,37 @@ # Facilities for running tests from the command line ############################################################################## -class TestProgram(object): - """A command-line program that runs a set of tests; this is primarily - for making test modules conveniently executable. - """ - USAGE = """\ +USAGE_AS_MAIN = """\ +Usage: %(progName)s [options] [tests] + +Options: + -h, --help Show this message + -v, --verbose Verbose output + -q, --quiet Minimal output + +Examples: + %(progName)s test_module - run tests from test_module + %(progName)s test_module.TestClass - run tests from + test_module.TestClass + %(progName)s test_module.TestClass.test_method - run specified test method + +[tests] can be a list of any number of test modules, classes and test +methods. + +Alternative Usage: %(progName)s discover [options] + +Options: + -v, --verbose Verbose output + -s directory Directory to start discovery ('.' default) + -p pattern Pattern to match test files ('test*.py' default) + -t directory Top level directory of project (default to + start directory) + +For test discovery all test modules must be importable from the top +level directory of the project. +""" + +USAGE_FROM_MODULE = """\ Usage: %(progName)s [options] [test] [...] Options: @@ -1503,6 +1627,18 @@ %(progName)s MyTestCase - run all 'test*' test methods in MyTestCase """ + +if __name__ == '__main__': + USAGE = USAGE_AS_MAIN +else: + USAGE = USAGE_FROM_MODULE + + +class TestProgram(object): + """A command-line program that runs a set of tests; this is primarily + for making test modules conveniently executable. + """ + USAGE = USAGE def __init__(self, module='__main__', defaultTest=None, argv=None, testRunner=TextTestRunner, testLoader=defaultTestLoader, exit=True, @@ -1532,6 +1668,10 @@ sys.exit(2) def parseArgs(self, argv): + if len(argv) > 1 and argv[1].lower() == 'discover': + self._do_discovery(argv[2:]) + return + import getopt long_opts = ['help','verbose','quiet'] try: @@ -1548,7 +1688,8 @@ return if len(args) > 0: self.testNames = args - if sys.modules['unittest'] is sys.modules['__main__']: + if __name__ == '__main__': + # to support python -m unittest ... self.module = None else: self.testNames = (self.defaultTest,) @@ -1560,6 +1701,36 @@ self.test = self.testLoader.loadTestsFromNames(self.testNames, self.module) + def _do_discovery(self, argv, Loader=TestLoader): + # handle command line args for test discovery + import optparse + parser = optparse.OptionParser() + parser.add_option('-v', '--verbose', dest='verbose', default=False, + help='Verbose output', action='store_true') + parser.add_option('-s', '--start-directory', dest='start', default='.', + help="Directory to start discovery ('.' default)") + parser.add_option('-p', '--pattern', dest='pattern', default='test*.py', + help="Pattern to match tests ('test*.py' default)") + parser.add_option('-t', '--top-level-directory', dest='top', default=None, + help='Top level directory of project (defaults to start directory)') + + options, args = parser.parse_args(argv) + if len(args) > 3: + self.usageExit() + + for name, value in zip(('start', 'pattern', 'top'), args): + setattr(options, name, value) + + if options.verbose: + self.verbosity = 2 + + start_dir = options.start + pattern = options.pattern + top_level_dir = options.top + + loader = Loader() + self.test = loader.discover(start_dir, pattern, top_level_dir) + def runTests(self): if isinstance(self.testRunner, (type, types.ClassType)): try: Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Fri May 29 22:33:46 2009 @@ -503,6 +503,9 @@ - unittest.assertNotEqual() now uses the inequality operator (!=) instead of the equality operator. + +- Issue #6001: Test discovery for unittest. Implemented in + unittest.TestLoader.discover and from the command line. - Issue #5679: The methods unittest.TestCase.addCleanup and doCleanups were added. addCleanup allows you to add cleanup functions that will be called From python-checkins at python.org Fri May 29 22:42:48 2009 From: python-checkins at python.org (georg.brandl) Date: Fri, 29 May 2009 22:42:48 +0200 (CEST) Subject: [Python-checkins] r73028 - python/branches/py3k/Lib/email/base64mime.py Message-ID: <20090529204248.18E92D807@mail.python.org> Author: georg.brandl Date: Fri May 29 22:42:47 2009 New Revision: 73028 Log: #6139: fix typo of variable name. Modified: python/branches/py3k/Lib/email/base64mime.py Modified: python/branches/py3k/Lib/email/base64mime.py ============================================================================== --- python/branches/py3k/Lib/email/base64mime.py (original) +++ python/branches/py3k/Lib/email/base64mime.py Fri May 29 22:42:47 2009 @@ -113,7 +113,7 @@ elif isinstance(string, str): return a2b_base64(string.encode('raw-unicode-escape')) else: - return a2b_base64(s) + return a2b_base64(string) # For convenience and backwards compatibility w/ standard base64 module From python-checkins at python.org Fri May 29 23:20:41 2009 From: python-checkins at python.org (raymond.hettinger) Date: Fri, 29 May 2009 23:20:41 +0200 (CEST) Subject: [Python-checkins] r73029 - python/trunk/Doc/library/unittest.rst Message-ID: <20090529212041.45D42D5FA@mail.python.org> Author: raymond.hettinger Date: Fri May 29 23:20:41 2009 New Revision: 73029 Log: Move the basic examples section back to the beginning. Modified: python/trunk/Doc/library/unittest.rst Modified: python/trunk/Doc/library/unittest.rst ============================================================================== --- python/trunk/Doc/library/unittest.rst (original) +++ python/trunk/Doc/library/unittest.rst Fri May 29 23:20:41 2009 @@ -91,70 +91,7 @@ Tools for creating mock test objects (objects simulating external resources). -.. _unittest-command-line-interface: - -Command Line Interface ----------------------- - -The unittest module can be used from the command line to run tests from -modules, classes or even individual test methods:: - - python -m unittest test_module1 test_module2 - python -m unittest test_module.TestClass - python -m unittest test_module.TestClass.test_method - -You can pass in a list with any combination of module names, and fully -qualified class or method names. - -You can run tests with more detail (higher verbosity) by passing in the -v flag:: - python-m unittest -v test_module - -For a list of all the command line options:: - - python -m unittest -h - -.. versionchanged:: 2.7 - In earlier versions it was only possible to run individual test methods and - not modules or classes. - -The command line can also be used for test discovery, for running all of the -tests in a project or just a subset. - - -.. _unittest-test-discovery: - -Test Discovery --------------- - -.. versionadded:: 2.7 - -unittest supports simple test discovery. For a project's tests to be -compatible with test discovery they must all be importable from the top level -directory of the project; i.e. they must all be in Python packages. - -Test discovery is implemented in :meth:`TestLoader.discover`, but can also be -used from the command line. The basic command line usage is:: - - cd project_directory - python -m unittest discover - -The ``discover`` sub-command has the following options: - - -v, --verbose Verbose output - -s directory Directory to start discovery ('.' default) - -p pattern Pattern to match test files ('test*.py' default) - -t directory Top level directory of project (default to - start directory) - -The -s, -p, & -t options can be passsed in as positional arguments. The -following two command lines are equivalent:: - - python -m unittest -s project_directory -p '*_test.py' - python -m unittest project_directory '*_test.py' - -Test modules and packages can customize test loading and discovery by through -the `load_tests protocol`_. .. _unittest-minimal-example: @@ -243,6 +180,73 @@ are sufficient to meet many everyday testing needs. The remainder of the documentation explores the full feature set from first principles. + +.. _unittest-command-line-interface: + +Command Line Interface +---------------------- + +The unittest module can be used from the command line to run tests from +modules, classes or even individual test methods:: + + python -m unittest test_module1 test_module2 + python -m unittest test_module.TestClass + python -m unittest test_module.TestClass.test_method + +You can pass in a list with any combination of module names, and fully +qualified class or method names. + +You can run tests with more detail (higher verbosity) by passing in the -v flag:: + + python-m unittest -v test_module + +For a list of all the command line options:: + + python -m unittest -h + +.. versionchanged:: 2.7 + In earlier versions it was only possible to run individual test methods and + not modules or classes. + +The command line can also be used for test discovery, for running all of the +tests in a project or just a subset. + + +.. _unittest-test-discovery: + +Test Discovery +-------------- + +.. versionadded:: 2.7 + +Unittest supports simple test discovery. For a project's tests to be +compatible with test discovery they must all be importable from the top level +directory of the project (in other words, they must all be in Python packages). + +Test discovery is implemented in :meth:`TestLoader.discover`, but can also be +used from the command line. The basic command line usage is:: + + cd project_directory + python -m unittest discover + +The ``discover`` sub-command has the following options: + + -v, --verbose Verbose output + -s directory Directory to start discovery ('.' default) + -p pattern Pattern to match test files ('test*.py' default) + -t directory Top level directory of project (default to + start directory) + +The -s, -p, & -t options can be passsed in as positional arguments. The +following two command lines are equivalent:: + + python -m unittest -s project_directory -p '*_test.py' + python -m unittest project_directory '*_test.py' + +Test modules and packages can customize test loading and discovery by through +the `load_tests protocol`_. + + .. _organizing-tests: Organizing test code From mal at egenix.com Fri May 29 23:22:04 2009 From: mal at egenix.com (M.-A. Lemburg) Date: Fri, 29 May 2009 23:22:04 +0200 Subject: [Python-checkins] r73021 - in python/branches/py3k: configure configure.in pyconfig.h.in In-Reply-To: <1afaf6160905291324m41180ae9h6cae6183b5e86246@mail.gmail.com> References: <20090529172540.70074D7B5@mail.python.org> <4A202F33.8040202@egenix.com> <1afaf6160905291324m41180ae9h6cae6183b5e86246@mail.gmail.com> Message-ID: <4A2051FC.6000509@egenix.com> Benjamin Peterson wrote: > 2009/5/29 M.-A. Lemburg : >> martin.v.loewis wrote: >> Wouldn't it be better to use 2.63 instead of reverting back to >> 2.61 ? > > Does it matter? Here's what configure.in says: dnl NOTE: autoconf 2.64 doesn't seem to work (use 2.61). (no idea why... AFAICTL there is no 2.64 - the latest version is 2.63b) However, there were a few changes in autoconf 2.62 which are relevant on some platforms, e.g. Mac OS X (AC_C_BIGENDIAN): http://lists.gnu.org/archive/html/autotools-announce/2008-04/msg00002.html and 2.63 fixes some regressions introduced in 2.62: http://lists.gnu.org/archive/html/autotools-announce/2008-09/msg00002.html So 2.63 appears to be the best version to use. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, May 29 2009) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ 2009-06-29: EuroPython 2009, Birmingham, UK 30 days to go ::: Try our new mxODBC.Connect Python Database Interface for free ! :::: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ From python-checkins at python.org Fri May 29 23:30:56 2009 From: python-checkins at python.org (r.david.murray) Date: Fri, 29 May 2009 23:30:56 +0200 (CEST) Subject: [Python-checkins] r73030 - in python/branches/release30-maint: Lib/trace.py Misc/NEWS Message-ID: <20090529213056.0347CC48D@mail.python.org> Author: r.david.murray Date: Fri May 29 23:30:55 2009 New Revision: 73030 Log: Merged revisions 69111 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ........ r69111 | brett.cannon | 2009-01-29 20:31:34 -0500 (Thu, 29 Jan 2009) | 3 lines The trace module was trying to turn ints into ints since co_lnotab was changed to a bytes object. ........ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Lib/trace.py python/branches/release30-maint/Misc/NEWS Modified: python/branches/release30-maint/Lib/trace.py ============================================================================== --- python/branches/release30-maint/Lib/trace.py (original) +++ python/branches/release30-maint/Lib/trace.py Fri May 29 23:30:55 2009 @@ -367,7 +367,7 @@ """Return dict where keys are lines in the line number table.""" linenos = {} - line_increments = [ord(c) for c in code.co_lnotab[1::2]] + line_increments = code.co_lnotab[1::2] table_length = len(line_increments) docstring = False Modified: python/branches/release30-maint/Misc/NEWS ============================================================================== --- python/branches/release30-maint/Misc/NEWS (original) +++ python/branches/release30-maint/Misc/NEWS Fri May 29 23:30:55 2009 @@ -65,6 +65,9 @@ Library ------- +- Fix a bug in the trace module where a bytes object from co_lnotab had its + items being passed through ord(). (Fixes Issue #3821) + - smtplib 'login' and 'cram-md5' login are also fixed (see Issue #5259). - Issue #6121: pydoc now ignores leading and trailing spaces in the From python-checkins at python.org Fri May 29 23:48:20 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 29 May 2009 23:48:20 +0200 (CEST) Subject: [Python-checkins] r73031 - python/trunk/Lib/test/test_grammar.py Message-ID: <20090529214820.13AADD690@mail.python.org> Author: benjamin.peterson Date: Fri May 29 23:48:19 2009 New Revision: 73031 Log: add with statements Modified: python/trunk/Lib/test/test_grammar.py Modified: python/trunk/Lib/test/test_grammar.py ============================================================================== --- python/trunk/Lib/test/test_grammar.py (original) +++ python/trunk/Lib/test/test_grammar.py Fri May 29 23:48:19 2009 @@ -920,6 +920,26 @@ self.assertEqual([x for x, in [(4,), (5,), (6,)]], [4, 5, 6]) self.assertEqual(list(x for x, in [(7,), (8,), (9,)]), [7, 8, 9]) + def test_with_statement(self): + class manager(object): + def __enter__(self): + return (1, 2) + def __exit__(self, *args): + pass + + with manager(): + pass + with manager() as x: + pass + with manager() as (x, y): + pass + with manager(), manager(): + pass + with manager() as x, manager() as y: + pass + with manager() as x, manager(): + pass + def testIfElseExpr(self): # Test ifelse expressions in various cases def _checkeval(msg, ret): From python-checkins at python.org Fri May 29 23:55:57 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 29 May 2009 23:55:57 +0200 (CEST) Subject: [Python-checkins] r73032 - in python/branches/py3k: Lib/test/test_grammar.py Message-ID: <20090529215557.9294AD569@mail.python.org> Author: benjamin.peterson Date: Fri May 29 23:55:57 2009 New Revision: 73032 Log: Merged revisions 73031 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r73031 | benjamin.peterson | 2009-05-29 16:48:19 -0500 (Fri, 29 May 2009) | 1 line add with statements ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_grammar.py Modified: python/branches/py3k/Lib/test/test_grammar.py ============================================================================== --- python/branches/py3k/Lib/test/test_grammar.py (original) +++ python/branches/py3k/Lib/test/test_grammar.py Fri May 29 23:55:57 2009 @@ -868,6 +868,26 @@ self.assertEqual([x for x, in [(4,), (5,), (6,)]], [4, 5, 6]) self.assertEqual(list(x for x, in [(7,), (8,), (9,)]), [7, 8, 9]) + def test_with_statement(self): + class manager(object): + def __enter__(self): + return (1, 2) + def __exit__(self, *args): + pass + + with manager(): + pass + with manager() as x: + pass + with manager() as (x, y): + pass + with manager(), manager(): + pass + with manager() as x, manager() as y: + pass + with manager() as x, manager(): + pass + def testIfElseExpr(self): # Test ifelse expressions in various cases def _checkeval(msg, ret): From python-checkins at python.org Fri May 29 23:58:32 2009 From: python-checkins at python.org (benjamin.peterson) Date: Fri, 29 May 2009 23:58:32 +0200 (CEST) Subject: [Python-checkins] r73033 - in sandbox/trunk/2to3/lib2to3: Grammar.txt tests/data/py2_test_grammar.py tests/data/py3_test_grammar.py Message-ID: <20090529215832.663C2D615@mail.python.org> Author: benjamin.peterson Date: Fri May 29 23:58:32 2009 New Revision: 73033 Log: update grammar for multi with statement Modified: sandbox/trunk/2to3/lib2to3/Grammar.txt sandbox/trunk/2to3/lib2to3/tests/data/py2_test_grammar.py sandbox/trunk/2to3/lib2to3/tests/data/py3_test_grammar.py Modified: sandbox/trunk/2to3/lib2to3/Grammar.txt ============================================================================== --- sandbox/trunk/2to3/lib2to3/Grammar.txt (original) +++ sandbox/trunk/2to3/lib2to3/Grammar.txt Fri May 29 23:58:32 2009 @@ -90,7 +90,8 @@ ['else' ':' suite] ['finally' ':' suite] | 'finally' ':' suite)) -with_stmt: 'with' test [ with_var ] ':' suite +with_stmt: 'with' with_item (',' with_item)* ':' suite +with_item: test ['as' expr] with_var: 'as' expr # NB compile.c makes sure that the default except clause is last except_clause: 'except' [test [(',' | 'as') test]] Modified: sandbox/trunk/2to3/lib2to3/tests/data/py2_test_grammar.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/data/py2_test_grammar.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/data/py2_test_grammar.py Fri May 29 23:58:32 2009 @@ -1,5 +1,3 @@ -# Python 2's Lib/test/test_grammar.py (r66189) - # Python test set -- part 1, grammar. # This just tests whether the parser accepts them all. @@ -922,6 +920,26 @@ self.assertEqual([x for x, in [(4,), (5,), (6,)]], [4, 5, 6]) self.assertEqual(list(x for x, in [(7,), (8,), (9,)]), [7, 8, 9]) + def test_with_statement(self): + class manager(object): + def __enter__(self): + return (1, 2) + def __exit__(self, *args): + pass + + with manager(): + pass + with manager() as x: + pass + with manager() as (x, y): + pass + with manager(), manager(): + pass + with manager() as x, manager() as y: + pass + with manager() as x, manager(): + pass + def testIfElseExpr(self): # Test ifelse expressions in various cases def _checkeval(msg, ret): Modified: sandbox/trunk/2to3/lib2to3/tests/data/py3_test_grammar.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/data/py3_test_grammar.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/data/py3_test_grammar.py Fri May 29 23:58:32 2009 @@ -868,6 +868,26 @@ self.assertEqual([x for x, in [(4,), (5,), (6,)]], [4, 5, 6]) self.assertEqual(list(x for x, in [(7,), (8,), (9,)]), [7, 8, 9]) + def test_with_statement(self): + class manager(object): + def __enter__(self): + return (1, 2) + def __exit__(self, *args): + pass + + with manager(): + pass + with manager() as x: + pass + with manager() as (x, y): + pass + with manager(), manager(): + pass + with manager() as x, manager() as y: + pass + with manager() as x, manager(): + pass + def testIfElseExpr(self): # Test ifelse expressions in various cases def _checkeval(msg, ret): From python-checkins at python.org Sat May 30 00:02:45 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 30 May 2009 00:02:45 +0200 (CEST) Subject: [Python-checkins] r73034 - sandbox/trunk/release/release.py Message-ID: <20090529220245.AABB6D79C@mail.python.org> Author: benjamin.peterson Date: Sat May 30 00:02:45 2009 New Revision: 73034 Log: use sha1 instead of md5 Modified: sandbox/trunk/release/release.py Modified: sandbox/trunk/release/release.py ============================================================================== --- sandbox/trunk/release/release.py (original) +++ sandbox/trunk/release/release.py Sat May 30 00:02:45 2009 @@ -10,6 +10,7 @@ import sys import os +import hashlib import optparse import re import subprocess @@ -18,7 +19,6 @@ import time from contextlib import nested, contextmanager -from hashlib import md5 from string import Template from urlparse import urlsplit, urlunsplit @@ -223,21 +223,21 @@ print "Making .tar.bz2" run_cmd(['tar cf - %s | bzip2 -9 > %s' % (source, bz)]) - print 'Calculating md5 sums' - md5sum_tgz = md5() + print 'Calculating sha1 sums' + checksum_tgz = hashlib.sha1() with open(tgz, 'rb') as data: - md5sum_tgz.update(data.read()) - md5sum_bz2 = md5() + checksum_tgz.update(data.read()) + checksum_bz2 = hashlib.sha1 with open(bz, 'rb') as data: - md5sum_bz2.update(data.read()) + checksum_bz2.update(data.read()) print ' %s %8s %s' % ( - md5sum_tgz.hexdigest(), int(os.path.getsize(tgz)), tgz) + checksum_tgz.hexdigest(), int(os.path.getsize(tgz)), tgz) print ' %s %8s %s' % ( - md5sum_bz2.hexdigest(), int(os.path.getsize(bz)), bz) - with open(tgz + '.md5', 'w') as md5file: - print >> md5file, md5sum_tgz.hexdigest() - with open(bz + '.md5', 'w') as md5file: - print >> md5file, md5sum_bz2.hexdigest() + checksum_bz2.hexdigest(), int(os.path.getsize(bz)), bz) + with open(tgz + '.sha1', 'w') as fp: + fp.write(checksum_tgz.hexdigest()) + with open(bz + '.sha1', 'w') as fp: + fp.write(checksum_bz2.hexdigest()) print 'Signing tarballs' os.system('gpg -bas ' + tgz) From buildbot at python.org Sat May 30 00:03:33 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 29 May 2009 22:03:33 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090529220333.A0D6FD690@mail.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/647 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis,r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_winreg ====================================================================== FAIL: testLocalMachineRegistryWorks (test.test_winreg.WinregTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_winreg.py", line 148, in testLocalMachineRegistryWorks self.TestAll(HKEY_CURRENT_USER) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_winreg.py", line 143, in TestAll self.WriteTestData(root_key, subkeystr) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_winreg.py", line 50, in WriteTestData "Not the correct number of values") AssertionError: Not the correct number of values sincerely, -The Buildbot From python-checkins at python.org Sat May 30 00:11:22 2009 From: python-checkins at python.org (raymond.hettinger) Date: Sat, 30 May 2009 00:11:22 +0200 (CEST) Subject: [Python-checkins] r73035 - python/branches/py3k/Objects/unicodeobject.c Message-ID: <20090529221122.CCD7FD6AD@mail.python.org> Author: raymond.hettinger Date: Sat May 30 00:11:22 2009 New Revision: 73035 Log: Strengthen the guard. The code doesn't work well with subclasses. Modified: python/branches/py3k/Objects/unicodeobject.c Modified: python/branches/py3k/Objects/unicodeobject.c ============================================================================== --- python/branches/py3k/Objects/unicodeobject.c (original) +++ python/branches/py3k/Objects/unicodeobject.c Sat May 30 00:11:22 2009 @@ -8547,7 +8547,7 @@ } } else { /* x must be a dict */ - if (!PyDict_Check(x)) { + if (!PyDict_CheckExact(x)) { PyErr_SetString(PyExc_TypeError, "if you give only one argument " "to maketrans it must be a dict"); goto err; From buildbot at python.org Sat May 30 00:23:08 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 29 May 2009 22:23:08 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.0 Message-ID: <20090529222308.5C754D585@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.0/builds/397 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_distutils test_posix ====================================================================== FAIL: test_get_python_inc (distutils.tests.test_sysconfig.SysconfigTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/distutils/tests/test_sysconfig.py", line 45, in test_get_python_inc self.assert_(os.path.isdir(inc_dir), inc_dir) AssertionError: /home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/Include ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/test_posix.py", line 252, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/test/support.py", line 98, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 225, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.0.loewis-sun/build/Lib/shutil.py", line 223, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.0.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sat May 30 00:33:21 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 30 May 2009 00:33:21 +0200 (CEST) Subject: [Python-checkins] r73036 - in sandbox/trunk/2to3/lib2to3: fixes/fix_unicode.py tests/test_fixers.py Message-ID: <20090529223321.2A41FD781@mail.python.org> Author: benjamin.peterson Date: Sat May 30 00:33:20 2009 New Revision: 73036 Log: simplify fix_unicode Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_unicode.py sandbox/trunk/2to3/lib2to3/tests/test_fixers.py Modified: sandbox/trunk/2to3/lib2to3/fixes/fix_unicode.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/fixes/fix_unicode.py (original) +++ sandbox/trunk/2to3/lib2to3/fixes/fix_unicode.py Sat May 30 00:33:20 2009 @@ -6,23 +6,20 @@ from ..pgen2 import token from .. import fixer_base +_mapping = {u"unichr" : u"chr", u"unicode" : u"str"} +_literal_re = re.compile(ur"[uU][rR]?[\'\"]") + class FixUnicode(fixer_base.BaseFix): - PATTERN = "STRING | NAME<'unicode' | 'unichr'>" + PATTERN = "STRING | 'unicode' | 'unichr'" def transform(self, node, results): if node.type == token.NAME: - if node.value == u"unicode": - new = node.clone() - new.value = u"str" - return new - if node.value == u"unichr": - new = node.clone() - new.value = u"chr" - return new - # XXX Warn when __unicode__ found? + new = node.clone() + new.value = _mapping[node.value] + return new elif node.type == token.STRING: - if re.match(ur"[uU][rR]?[\'\"]", node.value): + if _literal_re.match(node.value): new = node.clone() new.value = new.value[1:] return new Modified: sandbox/trunk/2to3/lib2to3/tests/test_fixers.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/test_fixers.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/test_fixers.py Sat May 30 00:33:20 2009 @@ -2646,6 +2646,11 @@ a = """str(x, y, z)""" self.check(b, a) + def test_unichr(self): + b = """unichr(u'h')""" + a = """chr('h')""" + self.check(b, a) + def test_unicode_literal_1(self): b = '''u"x"''' a = '''"x"''' From martin at v.loewis.de Sat May 30 00:40:59 2009 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sat, 30 May 2009 00:40:59 +0200 Subject: [Python-checkins] r73021 - in python/branches/py3k: configure configure.in pyconfig.h.in In-Reply-To: <4A202F33.8040202@egenix.com> References: <20090529172540.70074D7B5@mail.python.org> <4A202F33.8040202@egenix.com> Message-ID: <4A20647B.5090604@v.loewis.de> > Wouldn't it be better to use 2.63 instead of reverting back to > 2.61 ? No, it wouldn't. From python-checkins at python.org Sat May 30 00:53:03 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 30 May 2009 00:53:03 +0200 (CEST) Subject: [Python-checkins] r73037 - sandbox/trunk/2to3/lib2to3/patcomp.py Message-ID: <20090529225303.C2C17D7D4@mail.python.org> Author: benjamin.peterson Date: Sat May 30 00:53:03 2009 New Revision: 73037 Log: add custom error for pattern syntax errors Modified: sandbox/trunk/2to3/lib2to3/patcomp.py Modified: sandbox/trunk/2to3/lib2to3/patcomp.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/patcomp.py (original) +++ sandbox/trunk/2to3/lib2to3/patcomp.py Sat May 30 00:53:03 2009 @@ -14,10 +14,7 @@ import os # Fairly local imports -from .pgen2 import driver -from .pgen2 import literals -from .pgen2 import token -from .pgen2 import tokenize +from .pgen2 import driver, literals, token, tokenize, parse # Really local imports from . import pytree @@ -28,6 +25,10 @@ "PatternGrammar.txt") +class PatternSyntaxError(Exception): + pass + + def tokenize_wrapper(input): """Tokenizes a string suppressing significant whitespace.""" skip = set((token.NEWLINE, token.INDENT, token.DEDENT)) @@ -54,7 +55,10 @@ def compile_pattern(self, input, debug=False): """Compiles a pattern string to a nested pytree.*Pattern object.""" tokens = tokenize_wrapper(input) - root = self.driver.parse_tokens(tokens, debug=debug) + try: + root = self.driver.parse_tokens(tokens, debug=debug) + except parse.ParseError as e: + raise PatternSyntaxError(str(e)) return self.compile_node(root) def compile_node(self, node): @@ -139,7 +143,7 @@ value = node.value if value.isupper(): if value not in TOKEN_MAP: - raise SyntaxError("Invalid token: %r" % value) + raise PatternSyntaxError("Invalid token: %r" % value) return pytree.LeafPattern(TOKEN_MAP[value]) else: if value == "any": @@ -147,7 +151,7 @@ elif not value.startswith("_"): type = getattr(self.pysyms, value, None) if type is None: - raise SyntaxError("Invalid symbol: %r" % value) + raise PatternSyntaxError("Invalid symbol: %r" % value) if nodes[1:]: # Details present content = [self.compile_node(nodes[1].children[1])] else: From martin at v.loewis.de Sat May 30 00:54:42 2009 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sat, 30 May 2009 00:54:42 +0200 Subject: [Python-checkins] r73021 - in python/branches/py3k: configure configure.in pyconfig.h.in In-Reply-To: <4A2051FC.6000509@egenix.com> References: <20090529172540.70074D7B5@mail.python.org> <4A202F33.8040202@egenix.com> <1afaf6160905291324m41180ae9h6cae6183b5e86246@mail.gmail.com> <4A2051FC.6000509@egenix.com> Message-ID: <4A2067B2.4070807@v.loewis.de> > So 2.63 appears to be the best version to use. No, 2.63 doesn't work. It puts a CR character into configure which then breaks subversion's text mode. Regards, Martin From python-checkins at python.org Sat May 30 00:55:00 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 30 May 2009 00:55:00 +0200 (CEST) Subject: [Python-checkins] r73038 - sandbox/trunk/2to3/lib2to3/patcomp.py Message-ID: <20090529225500.E8503D5FB@mail.python.org> Author: benjamin.peterson Date: Sat May 30 00:55:00 2009 New Revision: 73038 Log: complain if details are attached to a token Modified: sandbox/trunk/2to3/lib2to3/patcomp.py Modified: sandbox/trunk/2to3/lib2to3/patcomp.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/patcomp.py (original) +++ sandbox/trunk/2to3/lib2to3/patcomp.py Sat May 30 00:55:00 2009 @@ -144,6 +144,8 @@ if value.isupper(): if value not in TOKEN_MAP: raise PatternSyntaxError("Invalid token: %r" % value) + if nodes[1:]: + raise PatternSyntaxError("Can't have details for token") return pytree.LeafPattern(TOKEN_MAP[value]) else: if value == "any": From python-checkins at python.org Sat May 30 01:00:28 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 30 May 2009 01:00:28 +0200 (CEST) Subject: [Python-checkins] r73039 - sandbox/trunk/2to3/lib2to3/tests/test_fixers.py Message-ID: <20090529230028.5AFEAD729@mail.python.org> Author: benjamin.peterson Date: Sat May 30 01:00:28 2009 New Revision: 73039 Log: add a test for whitespace Modified: sandbox/trunk/2to3/lib2to3/tests/test_fixers.py Modified: sandbox/trunk/2to3/lib2to3/tests/test_fixers.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/test_fixers.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/test_fixers.py Sat May 30 01:00:28 2009 @@ -2641,6 +2641,19 @@ class Test_unicode(FixerTestCase): fixer = "unicode" + def test_whitespace(self): + b = """unicode( x)""" + a = """str( x)""" + self.check(b, a) + + b = """ unicode(x )""" + a = """ str(x )""" + self.check(b, a) + + b = """ u'h'""" + a = """ 'h'""" + self.check(b, a) + def test_unicode_call(self): b = """unicode(x, y, z)""" a = """str(x, y, z)""" From python-checkins at python.org Sat May 30 01:01:17 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 30 May 2009 01:01:17 +0200 (CEST) Subject: [Python-checkins] r73040 - sandbox/trunk/2to3/lib2to3/tests/test_fixers.py Message-ID: <20090529230117.7DCC6D812@mail.python.org> Author: benjamin.peterson Date: Sat May 30 01:01:17 2009 New Revision: 73040 Log: a fix for emacs highlighting Modified: sandbox/trunk/2to3/lib2to3/tests/test_fixers.py Modified: sandbox/trunk/2to3/lib2to3/tests/test_fixers.py ============================================================================== --- sandbox/trunk/2to3/lib2to3/tests/test_fixers.py (original) +++ sandbox/trunk/2to3/lib2to3/tests/test_fixers.py Sat May 30 01:01:17 2009 @@ -2675,8 +2675,8 @@ self.check(b, a) def test_unicode_literal_3(self): - b = """UR'''x'''""" - a = """R'''x'''""" + b = """UR'''x''' """ + a = """R'''x''' """ self.check(b, a) class Test_callable(FixerTestCase): From buildbot at python.org Sat May 30 01:03:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Fri, 29 May 2009 23:03:46 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090529230346.438D8D756@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/778 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis,r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sat May 30 04:48:38 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 30 May 2009 04:48:38 +0200 (CEST) Subject: [Python-checkins] r73041 - sandbox/trunk/release/release.py Message-ID: <20090530024838.98110D578@mail.python.org> Author: benjamin.peterson Date: Sat May 30 04:48:38 2009 New Revision: 73041 Log: must instantiate hash class Modified: sandbox/trunk/release/release.py Modified: sandbox/trunk/release/release.py ============================================================================== --- sandbox/trunk/release/release.py (original) +++ sandbox/trunk/release/release.py Sat May 30 04:48:38 2009 @@ -227,7 +227,7 @@ checksum_tgz = hashlib.sha1() with open(tgz, 'rb') as data: checksum_tgz.update(data.read()) - checksum_bz2 = hashlib.sha1 + checksum_bz2 = hashlib.sha1() with open(bz, 'rb') as data: checksum_bz2.update(data.read()) print ' %s %8s %s' % ( From python-checkins at python.org Sat May 30 05:10:59 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 30 May 2009 05:10:59 +0200 (CEST) Subject: [Python-checkins] r73042 - python/trunk/Doc/library/os.rst Message-ID: <20090530031059.35E09C2BC@mail.python.org> Author: benjamin.peterson Date: Sat May 30 05:10:52 2009 New Revision: 73042 Log: no fdatasync on macos Modified: python/trunk/Doc/library/os.rst Modified: python/trunk/Doc/library/os.rst ============================================================================== --- python/trunk/Doc/library/os.rst (original) +++ python/trunk/Doc/library/os.rst Sat May 30 05:10:52 2009 @@ -528,6 +528,9 @@ Force write of file with filedescriptor *fd* to disk. Does not force update of metadata. Availability: Unix. + .. note:: + This function is not available on MacOS. + .. function:: fpathconf(fd, name) From buildbot at python.org Sat May 30 05:35:07 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 30 May 2009 03:35:07 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 2.6 Message-ID: <20090530033507.6FA7FD36F@mail.python.org> The Buildbot has detected a new failure of x86 XP-4 2.6. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%202.6/builds/308 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/release26-maint] HEAD Blamelist: martin.v.loewis,r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_bsddb3 test_winreg ====================================================================== ERROR: test01_badpointer (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 21, in test01_badpointer dbs = dbshelve.open(self.filename) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\dbshelve.py", line 106, in open d.open(filename, dbname, filetype, flags, mode) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\dbshelve.py", line 171, in open self.db.open(*args, **kwargs) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test03_repr_closed_db (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 37, in test03_repr_closed_db db = hashopen(self.filename) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test04_repr_db (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 43, in test04_repr_db db = hashopen(self.filename) File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\__init__.py", line 361, in hashopen d.open(file, db.DB_HASH, flags, mode) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test05_double_free_make_key_dbt (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 65, in test05_double_free_make_key_dbt db.DB_CREATE | db.DB_THREAD) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test06_key_with_null_bytes (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 77, in test06_key_with_null_bytes db1.open(self.filename, None, db.DB_HASH, db.DB_CREATE) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test07_DB_set_flags_persists (bsddb.test.test_misc.MiscTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_misc.py", line 101, in test07_DB_set_flags_persists db1.open(self.filename, db.DB_HASH, db.DB_CREATE) DBFileExistsError: (17, 'File exists -- __fop_file_setup: Retry limit (100) exceeded') ====================================================================== ERROR: test01_basic_replication (bsddb.test.test_replication.DBReplicationManager) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_replication.py", line 170, in test01_basic_replication mode=0666, txn=txn) DBNoSuchFileError: (2, 'No such file or directory -- connection closed: Successful return: 0') ====================================================================== ERROR: test01_basic_replication (bsddb.test.test_replication.DBReplicationManager) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_replication.py", line 58, in tearDown if self.dbClient : DBError: (0, 'DB object has been closed') ====================================================================== FAIL: test01_basic_replication (bsddb.test.test_replication.DBBaseReplication) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\2.6.bolen-windows\build\lib\bsddb\test\test_replication.py", line 315, in test01_basic_replication self.assertTrue(time.time() The Buildbot has detected a new failure of x86 XP-4 3.0. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.0/builds/328 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/release30-maint] HEAD Blamelist: r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\tests\test_build_ext.py", line 258, in test_get_outputs cmd.run() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\command\build_ext.py", line 337, in run self.build_extensions() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\command\build_ext.py", line 445, in build_extensions self.build_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\command\build_ext.py", line 527, in build_extension target_lang=language) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\ccompiler.py", line 792, in link_shared_object extra_preargs, extra_postargs, build_temp, target_lang) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\msvc9compiler.py", line 636, in link raise LinkError(msg) distutils.errors.LinkError: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe"' failed with exit status 1120 3 tests failed: test_distutils test_memoryio test_winreg ====================================================================== ERROR: test_get_outputs (distutils.tests.test_build_ext.BuildExtTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\msvc9compiler.py", line 634, in link self.spawn([self.linker] + ld_args) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\ccompiler.py", line 982, in spawn spawn(cmd, dry_run=self.dry_run) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\spawn.py", line 33, in spawn _spawn_nt(cmd, search_path, dry_run=dry_run) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\spawn.py", line 74, in _spawn_nt "command '%s' failed with exit status %d" % (cmd[0], rc)) distutils.errors.DistutilsExecError: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe"' failed with exit status 1120 Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\tests\test_build_ext.py", line 258, in test_get_outputs cmd.run() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\command\build_ext.py", line 337, in run self.build_extensions() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\command\build_ext.py", line 445, in build_extensions self.build_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\command\build_ext.py", line 527, in build_extension target_lang=language) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\ccompiler.py", line 792, in link_shared_object extra_preargs, extra_postargs, build_temp, target_lang) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\msvc9compiler.py", line 636, in link raise LinkError(msg) distutils.errors.LinkError: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe"' failed with exit status 1120 Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\tests\test_build_ext.py", line 258, in test_get_outputs cmd.run() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\command\build_ext.py", line 337, in run self.build_extensions() File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\command\build_ext.py", line 445, in build_extensions self.build_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\command\build_ext.py", line 527, in build_extension target_lang=language) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\ccompiler.py", line 792, in link_shared_object extra_preargs, extra_postargs, build_temp, target_lang) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\distutils\msvc9compiler.py", line 636, in link raise LinkError(msg) distutils.errors.LinkError: command '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe"' failed with exit status 1120 ====================================================================== FAIL: test_newline_none (test.test_memoryio.PyStringIOTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_memoryio.py", line 381, in test_newline_none self.assertEqual(memio.readlines(), ["hello\n", "hi\n"]) AssertionError: ['hello\n', '\n', 'hi\n', '\n'] != ['hello\n', 'hi\n'] ====================================================================== FAIL: test_newline_none (test.test_memoryio.CStringIOTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_memoryio.py", line 381, in test_newline_none self.assertEqual(memio.readlines(), ["hello\n", "hi\n"]) AssertionError: ['hello\n', '\n', '\n', 'hi\n', '\n', '\n'] != ['hello\n', 'hi\n'] ====================================================================== FAIL: testLocalMachineRegistryWorks (test.test_winreg.WinregTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_winreg.py", line 145, in testLocalMachineRegistryWorks self.TestAll(HKEY_CURRENT_USER) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_winreg.py", line 140, in TestAll self.WriteTestData(root_key, subkeystr) File "E:\cygwin\home\db3l\buildarea\3.0.bolen-windows\build\lib\test\test_winreg.py", line 47, in WriteTestData "Not the correct number of values") AssertionError: Not the correct number of values sincerely, -The Buildbot From python-checkins at python.org Sat May 30 08:13:40 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 30 May 2009 08:13:40 +0200 (CEST) Subject: [Python-checkins] r73043 - in python/branches/py3k: Lib/test/test_time.py Misc/NEWS Modules/timemodule.c PC/pyconfig.h Message-ID: <20090530061340.EA159C4FC@mail.python.org> Author: martin.v.loewis Date: Sat May 30 08:13:40 2009 New Revision: 73043 Log: Issue #5562: Use wcsftime for time.strftime where available. Modified: python/branches/py3k/Lib/test/test_time.py python/branches/py3k/Misc/NEWS python/branches/py3k/Modules/timemodule.c python/branches/py3k/PC/pyconfig.h Modified: python/branches/py3k/Lib/test/test_time.py ============================================================================== --- python/branches/py3k/Lib/test/test_time.py (original) +++ python/branches/py3k/Lib/test/test_time.py Sat May 30 08:13:40 2009 @@ -1,7 +1,7 @@ from test import support import time import unittest - +import locale class TimeTestCase(unittest.TestCase): @@ -223,9 +223,24 @@ t1 = time.mktime(lt1) self.assert_(0 <= (t1-t0) < 0.2) -def test_main(): - support.run_unittest(TimeTestCase) +class TestLocale(unittest.TestCase): + def setUp(self): + self.oldloc = locale.setlocale(locale.LC_ALL) + + def tearDown(self): + locale.setlocale(locale.LC_ALL, self.oldloc) + def test_bug_5562(self): + try: + tmp = locale.setlocale(locale.LC_ALL, "fr_FR") + except locale.Error: + # skip this test + return + # This should not cause an exception + time.strftime("%B", (2009,2,1,0,0,0,0,0,0)) + +def test_main(): + support.run_unittest(TimeTestCase, TestLocale) if __name__ == "__main__": test_main() Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 30 08:13:40 2009 @@ -111,6 +111,8 @@ Extension Modules ----------------- +- Issue #5562: Use wcsftime for time.strftime where available. + - Issue #4873: Fix resource leaks in error cases of pwd and grp. - Issue #6093: Fix off-by-one error in locale.strxfrm. Modified: python/branches/py3k/Modules/timemodule.c ============================================================================== --- python/branches/py3k/Modules/timemodule.c (original) +++ python/branches/py3k/Modules/timemodule.c Sat May 30 08:13:40 2009 @@ -417,15 +417,25 @@ } #ifdef HAVE_STRFTIME +#ifdef HAVE_WCSFTIME +#define time_char wchar_t +#define format_time wcsftime +#define time_strlen wcslen +#else +#define time_char char +#define format_time strftime +#define time_strlen strlen +#endif + static PyObject * time_strftime(PyObject *self, PyObject *args) { PyObject *tup = NULL; struct tm buf; - const char *fmt; - PyObject *format; + const time_char *fmt; + PyObject *format, *tmpfmt; size_t fmtlen, buflen; - char *outbuf = 0; + time_char *outbuf = 0; size_t i; memset((void *) &buf, '\0', sizeof(buf)); @@ -508,22 +518,38 @@ return NULL; } +#ifdef HAVE_WCSFTIME + tmpfmt = PyBytes_FromStringAndSize(NULL, + sizeof(wchar_t) * (PyUnicode_GetSize(format)+1)); + if (!tmpfmt) + return NULL; + /* This assumes that PyUnicode_AsWideChar doesn't do any UTF-16 + expansion. */ + if (PyUnicode_AsWideChar((PyUnicodeObject*)format, + (wchar_t*)PyBytes_AS_STRING(tmpfmt), + PyUnicode_GetSize(format)+1) == (size_t)-1) + /* This shouldn't fail. */ + Py_FatalError("PyUnicode_AsWideChar failed"); + format = tmpfmt; + fmt = (wchar_t*)PyBytes_AS_STRING(format); +#else /* Convert the unicode string to an ascii one */ format = PyUnicode_AsEncodedString(format, TZNAME_ENCODING, NULL); if (format == NULL) return NULL; fmt = PyBytes_AS_STRING(format); +#endif #ifdef MS_WINDOWS /* check that the format string contains only valid directives */ - for(outbuf = strchr(fmt, '%'); + for(outbuf = wcschr(fmt, L'%'); outbuf != NULL; - outbuf = strchr(outbuf+2, '%')) + outbuf = wcschr(outbuf+2, L'%')) { if (outbuf[1]=='#') ++outbuf; /* not documented by python, */ if (outbuf[1]=='\0' || - !strchr("aAbBcdfHIjmMpSUwWxXyYzZ%", outbuf[1])) + !wcschr(L"aAbBcdfHIjmMpSUwWxXyYzZ%", outbuf[1])) { PyErr_SetString(PyExc_ValueError, "Invalid format string"); return 0; @@ -531,18 +557,18 @@ } #endif - fmtlen = strlen(fmt); + fmtlen = time_strlen(fmt); /* I hate these functions that presume you know how big the output * will be ahead of time... */ for (i = 1024; ; i += i) { - outbuf = (char *)PyMem_Malloc(i); + outbuf = (time_char *)PyMem_Malloc(i*sizeof(time_char)); if (outbuf == NULL) { Py_DECREF(format); return PyErr_NoMemory(); } - buflen = strftime(outbuf, i, fmt, &buf); + buflen = format_time(outbuf, i, fmt, &buf); if (buflen > 0 || i >= 256 * fmtlen) { /* If the buffer is 256 times as long as the format, it's probably not failing for lack of room! @@ -550,8 +576,12 @@ e.g. an empty format, or %Z when the timezone is unknown. */ PyObject *ret; +#ifdef HAVE_WCSFTIME + ret = PyUnicode_FromWideChar(outbuf, buflen); +#else ret = PyUnicode_Decode(outbuf, buflen, TZNAME_ENCODING, NULL); +#endif PyMem_Free(outbuf); Py_DECREF(format); return ret; @@ -568,6 +598,9 @@ } } +#undef time_char +#undef format_time + PyDoc_STRVAR(strftime_doc, "strftime(format[, tuple]) -> string\n\ \n\ Modified: python/branches/py3k/PC/pyconfig.h ============================================================================== --- python/branches/py3k/PC/pyconfig.h (original) +++ python/branches/py3k/PC/pyconfig.h Sat May 30 08:13:40 2009 @@ -637,6 +637,9 @@ /* Define if you have waitpid. */ /* #undef HAVE_WAITPID */ +/* Define to 1 if you have the `wcsftime' function. */ +#define HAVE_WCSFTIME 1 + /* Define to 1 if you have the `wcscoll' function. */ #ifndef MS_WINCE #define HAVE_WCSCOLL 1 From python-checkins at python.org Sat May 30 08:15:30 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sat, 30 May 2009 08:15:30 +0200 (CEST) Subject: [Python-checkins] r73044 - in python/branches/py3k: Lib/test/test_time.py Misc/NEWS Message-ID: <20090530061530.5D56DD32C@mail.python.org> Author: martin.v.loewis Date: Sat May 30 08:15:30 2009 New Revision: 73044 Log: 5562 -> 3061. Modified: python/branches/py3k/Lib/test/test_time.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/test/test_time.py ============================================================================== --- python/branches/py3k/Lib/test/test_time.py (original) +++ python/branches/py3k/Lib/test/test_time.py Sat May 30 08:15:30 2009 @@ -230,7 +230,7 @@ def tearDown(self): locale.setlocale(locale.LC_ALL, self.oldloc) - def test_bug_5562(self): + def test_bug_3061(self): try: tmp = locale.setlocale(locale.LC_ALL, "fr_FR") except locale.Error: Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 30 08:15:30 2009 @@ -111,7 +111,7 @@ Extension Modules ----------------- -- Issue #5562: Use wcsftime for time.strftime where available. +- Issue #3061: Use wcsftime for time.strftime where available. - Issue #4873: Fix resource leaks in error cases of pwd and grp. From buildbot at python.org Sat May 30 09:03:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 30 May 2009 07:03:48 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090530070348.3E809C4D8@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/780 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: martin.v.loewis BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sat May 30 09:26:04 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 30 May 2009 09:26:04 +0200 (CEST) Subject: [Python-checkins] r73045 - python/trunk/Doc/library/rlcompleter.rst Message-ID: <20090530072604.DF923C4C8@mail.python.org> Author: georg.brandl Date: Sat May 30 09:26:04 2009 New Revision: 73045 Log: #6146: fix markup bug. Modified: python/trunk/Doc/library/rlcompleter.rst Modified: python/trunk/Doc/library/rlcompleter.rst ============================================================================== --- python/trunk/Doc/library/rlcompleter.rst (original) +++ python/trunk/Doc/library/rlcompleter.rst Sat May 30 09:26:04 2009 @@ -52,7 +52,7 @@ .. method:: Completer.complete(text, state) - Return the *state*th completion for *text*. + Return the *state*\ th completion for *text*. If called for *text* that doesn't include a period character (``'.'``), it will complete from names currently defined in :mod:`__main__`, :mod:`__builtin__` and From python-checkins at python.org Sat May 30 09:31:25 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 30 May 2009 09:31:25 +0200 (CEST) Subject: [Python-checkins] r73046 - python/trunk/Doc/tutorial/controlflow.rst Message-ID: <20090530073125.24535C4E5@mail.python.org> Author: georg.brandl Date: Sat May 30 09:31:25 2009 New Revision: 73046 Log: Use preferred form of raising exceptions. Modified: python/trunk/Doc/tutorial/controlflow.rst Modified: python/trunk/Doc/tutorial/controlflow.rst ============================================================================== --- python/trunk/Doc/tutorial/controlflow.rst (original) +++ python/trunk/Doc/tutorial/controlflow.rst Sat May 30 09:31:25 2009 @@ -315,7 +315,7 @@ if ok in ('y', 'ye', 'yes'): return True if ok in ('n', 'no', 'nop', 'nope'): return False retries = retries - 1 - if retries < 0: raise IOError, 'refusenik user' + if retries < 0: raise IOError('refusenik user') print complaint This function can be called either like this: ``ask_ok('Do you really want to From python-checkins at python.org Sat May 30 12:33:23 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 30 May 2009 12:33:23 +0200 (CEST) Subject: [Python-checkins] r73047 - python/trunk/Doc/c-api/sequence.rst Message-ID: <20090530103323.D7250C3DF@mail.python.org> Author: georg.brandl Date: Sat May 30 12:33:23 2009 New Revision: 73047 Log: Fix some more small markup problems. Modified: python/trunk/Doc/c-api/sequence.rst Modified: python/trunk/Doc/c-api/sequence.rst ============================================================================== --- python/trunk/Doc/c-api/sequence.rst (original) +++ python/trunk/Doc/c-api/sequence.rst Sat May 30 12:33:23 2009 @@ -62,7 +62,7 @@ .. cfunction:: PyObject* PySequence_GetItem(PyObject *o, Py_ssize_t i) - Return the *i*th element of *o*, or *NULL* on failure. This is the equivalent of + Return the *i*\ th element of *o*, or *NULL* on failure. This is the equivalent of the Python expression ``o[i]``. .. versionchanged:: 2.5 @@ -82,7 +82,7 @@ .. cfunction:: int PySequence_SetItem(PyObject *o, Py_ssize_t i, PyObject *v) - Assign object *v* to the *i*th element of *o*. Returns ``-1`` on failure. This + Assign object *v* to the *i*\ th element of *o*. Returns ``-1`` on failure. This is the equivalent of the Python statement ``o[i] = v``. This function *does not* steal a reference to *v*. @@ -93,7 +93,7 @@ .. cfunction:: int PySequence_DelItem(PyObject *o, Py_ssize_t i) - Delete the *i*th element of object *o*. Returns ``-1`` on failure. This is the + Delete the *i*\ th element of object *o*. Returns ``-1`` on failure. This is the equivalent of the Python statement ``del o[i]``. .. versionchanged:: 2.5 @@ -175,7 +175,7 @@ .. cfunction:: PyObject* PySequence_Fast_GET_ITEM(PyObject *o, Py_ssize_t i) - Return the *i*th element of *o*, assuming that *o* was returned by + Return the *i*\ th element of *o*, assuming that *o* was returned by :cfunc:`PySequence_Fast`, *o* is not *NULL*, and that *i* is within bounds. .. versionchanged:: 2.5 @@ -197,7 +197,7 @@ .. cfunction:: PyObject* PySequence_ITEM(PyObject *o, Py_ssize_t i) - Return the *i*th element of *o* or *NULL* on failure. Macro form of + Return the *i*\ th element of *o* or *NULL* on failure. Macro form of :cfunc:`PySequence_GetItem` but without checking that :cfunc:`PySequence_Check(o)` is true and without adjustment for negative indices. From python-checkins at python.org Sat May 30 12:34:25 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 30 May 2009 12:34:25 +0200 (CEST) Subject: [Python-checkins] r73048 - python/trunk/Doc/library/easydialogs.rst Message-ID: <20090530103425.2A1B4C4CA@mail.python.org> Author: georg.brandl Date: Sat May 30 12:34:25 2009 New Revision: 73048 Log: Fix markup problem. Modified: python/trunk/Doc/library/easydialogs.rst Modified: python/trunk/Doc/library/easydialogs.rst ============================================================================== --- python/trunk/Doc/library/easydialogs.rst (original) +++ python/trunk/Doc/library/easydialogs.rst Sat May 30 12:34:25 2009 @@ -100,7 +100,7 @@ +----------------------+------------------------------------------+ *commandlist* is a list of items of the form *cmdstr* or ``(cmdstr, descr)``, - where *descr* is as above. The *cmdstr*s will appear in a popup menu. When + where *descr* is as above. The *cmdstr*\ s will appear in a popup menu. When chosen, the text of *cmdstr* will be appended to the command line as is, except that a trailing ``':'`` or ``'='`` (if present) will be trimmed off. From python-checkins at python.org Sat May 30 12:45:40 2009 From: python-checkins at python.org (georg.brandl) Date: Sat, 30 May 2009 12:45:40 +0200 (CEST) Subject: [Python-checkins] r73049 - python/trunk/Doc/library/unittest.rst Message-ID: <20090530104540.CF7F6D56F@mail.python.org> Author: georg.brandl Date: Sat May 30 12:45:40 2009 New Revision: 73049 Log: Rewrap a few long lines. Modified: python/trunk/Doc/library/unittest.rst Modified: python/trunk/Doc/library/unittest.rst ============================================================================== --- python/trunk/Doc/library/unittest.rst (original) +++ python/trunk/Doc/library/unittest.rst Sat May 30 12:45:40 2009 @@ -79,16 +79,20 @@ Module :mod:`doctest` Another test-support module with a very different flavor. - `Simple Smalltalk Testing: With Patterns `_ - Kent Beck's original paper on testing frameworks using the pattern shared by - :mod:`unittest`. - - `Nose `_ and `py.test `_ - Third-party unittest frameworks with a lighter-weight syntax - for writing tests. For example, ``assert func(10) == 42``. - - `python-mock `_ and `minimock `_ - Tools for creating mock test objects (objects simulating external resources). + `Simple Smalltalk Testing: With Patterns + `_ + Kent Beck's original paper on testing frameworks using the pattern shared + by :mod:`unittest`. + + `Nose `_ and `py.test + `_ + Third-party unittest frameworks with a lighter-weight syntax for writing + tests. For example, ``assert func(10) == 42``. + + `python-mock `_ and + `minimock `_ + Tools for creating mock test objects (objects simulating external + resources). @@ -277,13 +281,12 @@ self.assertEqual(widget.size(), (50, 50), 'incorrect default size') Note that in order to test something, we use the one of the :meth:`assert\*` -methods provided by the :class:`TestCase` base class. If the -test fails, an exception will be raised, and :mod:`unittest` will identify the -test case as a :dfn:`failure`. Any other exceptions will be treated as -:dfn:`errors`. This helps you identify where the problem is: :dfn:`failures` are -caused by incorrect results - a 5 where you expected a 6. :dfn:`Errors` are -caused by incorrect code - e.g., a :exc:`TypeError` caused by an incorrect -function call. +methods provided by the :class:`TestCase` base class. If the test fails, an +exception will be raised, and :mod:`unittest` will identify the test case as a +:dfn:`failure`. Any other exceptions will be treated as :dfn:`errors`. This +helps you identify where the problem is: :dfn:`failures` are caused by incorrect +results - a 5 where you expected a 6. :dfn:`Errors` are caused by incorrect +code - e.g., a :exc:`TypeError` caused by an incorrect function call. The way to run a test case will be described later. For now, note that to construct an instance of such a test case, we call its constructor without @@ -482,10 +485,10 @@ .. note:: - Even though :class:`FunctionTestCase` can be used to quickly convert an existing - test base over to a :mod:`unittest`\ -based system, this approach is not - recommended. Taking the time to set up proper :class:`TestCase` subclasses will - make future test refactorings infinitely easier. + Even though :class:`FunctionTestCase` can be used to quickly convert an + existing test base over to a :mod:`unittest`\ -based system, this approach is + not recommended. Taking the time to set up proper :class:`TestCase` + subclasses will make future test refactorings infinitely easier. In some cases, the existing tests may have been written using the :mod:`doctest` module. If so, :mod:`doctest` provides a :class:`DocTestSuite` class that can @@ -514,7 +517,8 @@ def test_nothing(self): self.fail("shouldn't happen") - @unittest.skipIf(mylib.__version__ < (1, 3), "not supported in this library version") + @unittest.skipIf(mylib.__version__ < (1, 3), + "not supported in this library version") def test_format(self): # Tests that work for only a certain version of the library. pass @@ -1079,10 +1083,10 @@ .. class:: FunctionTestCase(testFunc[, setUp[, tearDown[, description]]]) This class implements the portion of the :class:`TestCase` interface which - allows the test runner to drive the test, but does not provide the methods which - test code can use to check and report errors. This is used to create test cases - using legacy test code, allowing it to be integrated into a :mod:`unittest`\ - -based test framework. + allows the test runner to drive the test, but does not provide the methods + which test code can use to check and report errors. This is used to create + test cases using legacy test code, allowing it to be integrated into a + :mod:`unittest`-based test framework. .. _testsuite-objects: @@ -1117,8 +1121,8 @@ Add all the tests from an iterable of :class:`TestCase` and :class:`TestSuite` instances to this test suite. - This is equivalent to iterating over *tests*, calling :meth:`addTest` for each - element. + This is equivalent to iterating over *tests*, calling :meth:`addTest` for + each element. :class:`TestSuite` shares the following methods with :class:`TestCase`: @@ -1217,15 +1221,14 @@ rather than "a callable object". For example, if you have a module :mod:`SampleTests` containing a - :class:`TestCase`\ -derived class :class:`SampleTestCase` with three - test methods (:meth:`test_one`, :meth:`test_two`, and - :meth:`test_three`), the specifier ``'SampleTests.SampleTestCase'`` - would cause this method to return a suite which will run all three test - methods. Using the specifier ``'SampleTests.SampleTestCase.test_two'`` - would cause it to return a test suite which will run only the - :meth:`test_two` test method. The specifier can refer to modules and - packages which have not been imported; they will be imported as a - side-effect. + :class:`TestCase`\ -derived class :class:`SampleTestCase` with three test + methods (:meth:`test_one`, :meth:`test_two`, and :meth:`test_three`), the + specifier ``'SampleTests.SampleTestCase'`` would cause this method to + return a suite which will run all three test methods. Using the specifier + ``'SampleTests.SampleTestCase.test_two'`` would cause it to return a test + suite which will run only the :meth:`test_two` test method. The specifier + can refer to modules and packages which have not been imported; they will + be imported as a side-effect. The method optionally resolves *name* relative to the given *module*. From python-checkins at python.org Sat May 30 16:03:54 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 30 May 2009 16:03:54 +0200 (CEST) Subject: [Python-checkins] r73050 - sandbox/trunk/tkinter-polo Message-ID: <20090530140354.1BB54C4F9@mail.python.org> Author: guilherme.polo Date: Sat May 30 16:03:53 2009 New Revision: 73050 Log: Removing unused branch. Removed: sandbox/trunk/tkinter-polo/ From python-checkins at python.org Sat May 30 16:06:56 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 30 May 2009 16:06:56 +0200 (CEST) Subject: [Python-checkins] r73051 - sandbox/trunk/tk_and_idle_maintenance Message-ID: <20090530140656.A79F3D3E1@mail.python.org> Author: guilherme.polo Date: Sat May 30 16:06:56 2009 New Revision: 73051 Log: Branching from trunk for doing tkinter & idle maintenance (gsoc project), this is likely to hold tkinter tests only. Added: sandbox/trunk/tk_and_idle_maintenance/ - copied from r73050, /python/trunk/ From python-checkins at python.org Sat May 30 17:13:21 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 30 May 2009 17:13:21 +0200 (CEST) Subject: [Python-checkins] r73052 - sandbox/trunk/tk_and_idle_maintenance Message-ID: <20090530151321.98E48C4EB@mail.python.org> Author: guilherme.polo Date: Sat May 30 17:13:21 2009 New Revision: 73052 Log: Will move to python/branches/tk_and_idle_maintenance. Removed: sandbox/trunk/tk_and_idle_maintenance/ From python-checkins at python.org Sat May 30 17:27:19 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 30 May 2009 17:27:19 +0200 (CEST) Subject: [Python-checkins] r73053 - python/branches/tk_and_idle_maintenance Message-ID: <20090530152719.07532C4CA@mail.python.org> Author: guilherme.polo Date: Sat May 30 17:27:18 2009 New Revision: 73053 Log: Branching from trunk for doing some tkinter & idle maintenance. Added: python/branches/tk_and_idle_maintenance/ - copied from r73052, /python/trunk/ From python-checkins at python.org Sat May 30 17:30:23 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 30 May 2009 17:30:23 +0200 (CEST) Subject: [Python-checkins] r73054 - in python/branches/py3k: Include/patchlevel.h Lib/distutils/__init__.py Lib/idlelib/idlever.py Misc/NEWS Misc/RPM/python-3.1.spec README Message-ID: <20090530153023.9DEB2D36F@mail.python.org> Author: benjamin.peterson Date: Sat May 30 17:30:16 2009 New Revision: 73054 Log: bump to 3.1rc1 Modified: python/branches/py3k/Include/patchlevel.h python/branches/py3k/Lib/distutils/__init__.py python/branches/py3k/Lib/idlelib/idlever.py python/branches/py3k/Misc/NEWS python/branches/py3k/Misc/RPM/python-3.1.spec python/branches/py3k/README Modified: python/branches/py3k/Include/patchlevel.h ============================================================================== --- python/branches/py3k/Include/patchlevel.h (original) +++ python/branches/py3k/Include/patchlevel.h Sat May 30 17:30:16 2009 @@ -19,11 +19,11 @@ #define PY_MAJOR_VERSION 3 #define PY_MINOR_VERSION 1 #define PY_MICRO_VERSION 0 -#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_BETA +#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_GAMMA #define PY_RELEASE_SERIAL 1 /* Version as a string */ -#define PY_VERSION "3.1b1+" +#define PY_VERSION "3.1rc1" /*--end constants--*/ /* Subversion Revision number of this file (not of the repository) */ Modified: python/branches/py3k/Lib/distutils/__init__.py ============================================================================== --- python/branches/py3k/Lib/distutils/__init__.py (original) +++ python/branches/py3k/Lib/distutils/__init__.py Sat May 30 17:30:16 2009 @@ -15,5 +15,5 @@ # Updated automatically by the Python release process. # #--start constants-- -__version__ = "3.1b1" +__version__ = "3.1rc1" #--end constants-- Modified: python/branches/py3k/Lib/idlelib/idlever.py ============================================================================== --- python/branches/py3k/Lib/idlelib/idlever.py (original) +++ python/branches/py3k/Lib/idlelib/idlever.py Sat May 30 17:30:16 2009 @@ -1 +1 @@ -IDLE_VERSION = "3.1b1" +IDLE_VERSION = "3.1rc1" Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 30 17:30:16 2009 @@ -7,7 +7,7 @@ What's New in Python 3.1 release candidate 1? ============================================= -*Release date: XXXX-XX-XX* +*Release date: 2009-05-30* Core and Builtins ----------------- Modified: python/branches/py3k/Misc/RPM/python-3.1.spec ============================================================================== --- python/branches/py3k/Misc/RPM/python-3.1.spec (original) +++ python/branches/py3k/Misc/RPM/python-3.1.spec Sat May 30 17:30:16 2009 @@ -34,7 +34,7 @@ %define name python #--start constants-- -%define version 3.1b1 +%define version 3.1rc1 %define libver 3.1 #--end constants-- %define release 1pydotorg Modified: python/branches/py3k/README ============================================================================== --- python/branches/py3k/README (original) +++ python/branches/py3k/README Sat May 30 17:30:16 2009 @@ -1,5 +1,5 @@ -This is Python version 3.1 beta 1 -================================= +This is Python version 3.1 Release Candidate 1 +============================================== Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Python Software Foundation. From python-checkins at python.org Sat May 30 17:36:08 2009 From: python-checkins at python.org (guilherme.polo) Date: Sat, 30 May 2009 17:36:08 +0200 (CEST) Subject: [Python-checkins] r73055 - python/branches/tk_and_idle_maintenance Message-ID: <20090530153608.AFC80D4CA@mail.python.org> Author: guilherme.polo Date: Sat May 30 17:36:08 2009 New Revision: 73055 Log: Initialized merge tracking via "svnmerge" with revisions "1-73052" from svn+ssh://pythondev/python/trunk Modified: python/branches/tk_and_idle_maintenance/ (props changed) From python-checkins at python.org Sat May 30 17:42:00 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 30 May 2009 17:42:00 +0200 (CEST) Subject: [Python-checkins] r73056 - python/branches/py3k/Lib/pydoc_data/topics.py Message-ID: <20090530154200.278B8C446@mail.python.org> Author: benjamin.peterson Date: Sat May 30 17:41:59 2009 New Revision: 73056 Log: update pydoc topics Modified: python/branches/py3k/Lib/pydoc_data/topics.py Modified: python/branches/py3k/Lib/pydoc_data/topics.py ============================================================================== --- python/branches/py3k/Lib/pydoc_data/topics.py (original) +++ python/branches/py3k/Lib/pydoc_data/topics.py Sat May 30 17:41:59 2009 @@ -1,4 +1,4 @@ -# Autogenerated by Sphinx on Wed May 6 15:36:49 2009 +# Autogenerated by Sphinx on Sat May 30 10:41:05 2009 topics = {'assert': '\nThe ``assert`` statement\n************************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form, ``assert expression``, is equivalent to\n\n if __debug__:\n if not expression: raise AssertionError\n\nThe extended form, ``assert expression1, expression2``, is equivalent\nto\n\n if __debug__:\n if not expression1: raise AssertionError(expression2)\n\nThese equivalences assume that ``__debug__`` and ``AssertionError``\nrefer to the built-in variables with those names. In the current\nimplementation, the built-in variable ``__debug__`` is ``True`` under\nnormal circumstances, ``False`` when optimization is requested\n(command line option -O). The current code generator emits no code\nfor an assert statement when optimization is requested at compile\ntime. Note that it is unnecessary to include the source code for the\nexpression that failed in the error message; it will be displayed as\npart of the stack trace.\n\nAssignments to ``__debug__`` are illegal. The value for the built-in\nvariable is determined when the interpreter starts.\n', 'assignment': '\nAssignment statements\n*********************\n\nAssignment statements are used to (re)bind names to values and to\nmodify attributes or items of mutable objects:\n\n assignment_stmt ::= (target_list "=")+ (expression_list | yield_expression)\n target_list ::= target ("," target)* [","]\n target ::= identifier\n | "(" target_list ")"\n | "[" target_list "]"\n | attributeref\n | subscription\n | slicing\n | "*" target\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn assignment statement evaluates the expression list (remember that\nthis can be a single expression or a comma-separated list, the latter\nyielding a tuple) and assigns the single resulting object to each of\nthe target lists, from left to right.\n\nAssignment is defined recursively depending on the form of the target\n(list). When a target is part of a mutable object (an attribute\nreference, subscription or slicing), the mutable object must\nultimately perform the assignment and decide about its validity, and\nmay raise an exception if the assignment is unacceptable. The rules\nobserved by various types and the exceptions raised are given with the\ndefinition of the object types (see section *The standard type\nhierarchy*).\n\nAssignment of an object to a target list, optionally enclosed in\nparentheses or square brackets, is recursively defined as follows.\n\n* If the target list is a single target: The object is assigned to\n that target.\n\n* If the target list is a comma-separated list of targets: The object\n must be an iterable with the same number of items as there are\n targets in the target list, and the items are assigned, from left to\n right, to the corresponding targets. (This rule is relaxed as of\n Python 1.5; in earlier versions, the object had to be a tuple.\n Since strings are sequences, an assignment like ``a, b = "xy"`` is\n now legal as long as the string has the right length.)\n\n * If the target list contains one target prefixed with an asterisk,\n called a "starred" target: The object must be a sequence with at\n least as many items as there are targets in the target list, minus\n one. The first items of the sequence are assigned, from left to\n right, to the targets before the starred target. The final items\n of the sequence are assigned to the targets after the starred\n target. A list of the remaining items in the sequence is then\n assigned to the starred target (the list can be empty).\n\n * Else: The object must be a sequence with the same number of items\n as there are targets in the target list, and the items are\n assigned, from left to right, to the corresponding targets.\n\nAssignment of an object to a single target is recursively defined as\nfollows.\n\n* If the target is an identifier (name):\n\n * If the name does not occur in a ``global`` or ``nonlocal``\n statement in the current code block: the name is bound to the\n object in the current local namespace.\n\n * Otherwise: the name is bound to the object in the global namespace\n or the outer namespace determined by ``nonlocal``, respectively.\n\n The name is rebound if it was already bound. This may cause the\n reference count for the object previously bound to the name to reach\n zero, causing the object to be deallocated and its destructor (if it\n has one) to be called.\n\n The name is rebound if it was already bound. This may cause the\n reference count for the object previously bound to the name to reach\n zero, causing the object to be deallocated and its destructor (if it\n has one) to be called.\n\n* If the target is a target list enclosed in parentheses or in square\n brackets: The object must be an iterable with the same number of\n items as there are targets in the target list, and its items are\n assigned, from left to right, to the corresponding targets.\n\n* If the target is an attribute reference: The primary expression in\n the reference is evaluated. It should yield an object with\n assignable attributes; if this is not the case, ``TypeError`` is\n raised. That object is then asked to assign the assigned object to\n the given attribute; if it cannot perform the assignment, it raises\n an exception (usually but not necessarily ``AttributeError``).\n\n* If the target is a subscription: The primary expression in the\n reference is evaluated. It should yield either a mutable sequence\n object (such as a list) or a mapping object (such as a dictionary).\n Next, the subscript expression is evaluated.\n\n If the primary is a mutable sequence object (such as a list), the\n subscript must yield an integer. If it is negative, the sequence\'s\n length is added to it. The resulting value must be a nonnegative\n integer less than the sequence\'s length, and the sequence is asked\n to assign the assigned object to its item with that index. If the\n index is out of range, ``IndexError`` is raised (assignment to a\n subscripted sequence cannot add new items to a list).\n\n If the primary is a mapping object (such as a dictionary), the\n subscript must have a type compatible with the mapping\'s key type,\n and the mapping is then asked to create a key/datum pair which maps\n the subscript to the assigned object. This can either replace an\n existing key/value pair with the same key value, or insert a new\n key/value pair (if no key with the same value existed).\n\n For user-defined objects, the ``__setitem__()`` method is called\n with appropriate arguments.\n\n* If the target is a slicing: The primary expression in the reference\n is evaluated. It should yield a mutable sequence object (such as a\n list). The assigned object should be a sequence object of the same\n type. Next, the lower and upper bound expressions are evaluated,\n insofar they are present; defaults are zero and the sequence\'s\n length. The bounds should evaluate to integers. If either bound is\n negative, the sequence\'s length is added to it. The resulting\n bounds are clipped to lie between zero and the sequence\'s length,\n inclusive. Finally, the sequence object is asked to replace the\n slice with the items of the assigned sequence. The length of the\n slice may be different from the length of the assigned sequence,\n thus changing the length of the target sequence, if the object\n allows it.\n\n(In the current implementation, the syntax for targets is taken to be\nthe same as for expressions, and invalid syntax is rejected during the\ncode generation phase, causing less detailed error messages.)\n\nWARNING: Although the definition of assignment implies that overlaps\nbetween the left-hand side and the right-hand side are \'safe\' (for\nexample ``a, b = b, a`` swaps two variables), overlaps *within* the\ncollection of assigned-to variables are not safe! For instance, the\nfollowing program prints ``[0, 2]``:\n\n x = [0, 1]\n i = 0\n i, x[i] = 1, 2\n print(x)\n\nSee also:\n\n **PEP 3132** - Extended Iterable Unpacking\n The specification for the ``*target`` feature.\n\n\nAugmented assignment statements\n===============================\n\nAugmented assignment is the combination, in a single statement, of a\nbinary operation and an assignment statement:\n\n augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)\n augtarget ::= identifier | attributeref | subscription | slicing\n augop ::= "+=" | "-=" | "*=" | "/=" | "//=" | "%=" | "**="\n | ">>=" | "<<=" | "&=" | "^=" | "|="\n\n(See section *Primaries* for the syntax definitions for the last three\nsymbols.)\n\nAn augmented assignment evaluates the target (which, unlike normal\nassignment statements, cannot be an unpacking) and the expression\nlist, performs the binary operation specific to the type of assignment\non the two operands, and assigns the result to the original target.\nThe target is only evaluated once.\n\nAn augmented assignment expression like ``x += 1`` can be rewritten as\n``x = x + 1`` to achieve a similar, but not exactly equal effect. In\nthe augmented version, ``x`` is only evaluated once. Also, when\npossible, the actual operation is performed *in-place*, meaning that\nrather than creating a new object and assigning that to the target,\nthe old object is modified instead.\n\nWith the exception of assigning to tuples and multiple targets in a\nsingle statement, the assignment done by augmented assignment\nstatements is handled the same way as normal assignments. Similarly,\nwith the exception of the possible *in-place* behavior, the binary\noperation performed by augmented assignment is the same as the normal\nbinary operations.\n\nFor targets which are attribute references, the initial value is\nretrieved with a ``getattr()`` and the result is assigned with a\n``setattr()``. Notice that the two methods do not necessarily refer\nto the same variable. When ``getattr()`` refers to a class variable,\n``setattr()`` still writes to an instance variable. For example:\n\n class A:\n x = 3 # class variable\n a = A()\n a.x += 1 # writes a.x as 4 leaving A.x as 3\n', 'atom-identifiers': '\nIdentifiers (Names)\n*******************\n\nAn identifier occurring as an atom is a name. See section\n*Identifiers and keywords* for lexical definition and section *Naming\nand binding* for documentation of naming and binding.\n\nWhen the name is bound to an object, evaluation of the atom yields\nthat object. When a name is not bound, an attempt to evaluate it\nraises a ``NameError`` exception.\n\n**Private name mangling:** When an identifier that textually occurs in\na class definition begins with two or more underscore characters and\ndoes not end in two or more underscores, it is considered a *private\nname* of that class. Private names are transformed to a longer form\nbefore code is generated for them. The transformation inserts the\nclass name in front of the name, with leading underscores removed, and\na single underscore inserted in front of the class name. For example,\nthe identifier ``__spam`` occurring in a class named ``Ham`` will be\ntransformed to ``_Ham__spam``. This transformation is independent of\nthe syntactical context in which the identifier is used. If the\ntransformed name is extremely long (longer than 255 characters),\nimplementation defined truncation may happen. If the class name\nconsists only of underscores, no transformation is done.\n', @@ -10,16 +10,16 @@ 'bitwise': '\nBinary bitwise operations\n*************************\n\nEach of the three bitwise operations has a different priority level:\n\n and_expr ::= shift_expr | and_expr "&" shift_expr\n xor_expr ::= and_expr | xor_expr "^" and_expr\n or_expr ::= xor_expr | or_expr "|" xor_expr\n\nThe ``&`` operator yields the bitwise AND of its arguments, which must\nbe integers.\n\nThe ``^`` operator yields the bitwise XOR (exclusive OR) of its\narguments, which must be integers.\n\nThe ``|`` operator yields the bitwise (inclusive) OR of its arguments,\nwhich must be integers.\n', 'bltin-code-objects': '\nCode Objects\n************\n\nCode objects are used by the implementation to represent "pseudo-\ncompiled" executable Python code such as a function body. They differ\nfrom function objects because they don\'t contain a reference to their\nglobal execution environment. Code objects are returned by the built-\nin ``compile()`` function and can be extracted from function objects\nthrough their ``__code__`` attribute. See also the ``code`` module.\n\nA code object can be executed or evaluated by passing it (instead of a\nsource string) to the ``exec()`` or ``eval()`` built-in functions.\n\nSee *The standard type hierarchy* for more information.\n', 'bltin-ellipsis-object': '\nThe Ellipsis Object\n*******************\n\nThis object is commonly used by slicing (see *Slicings*). It supports\nno special operations. There is exactly one ellipsis object, named\n``Ellipsis`` (a built-in name).\n\nIt is written as ``Ellipsis`` or ``...``.\n', - 'bltin-file-objects': '\nFile Objects\n************\n\nFile objects are implemented using C\'s ``stdio`` package and can be\ncreated with the built-in ``open()`` function. File objects are also\nreturned by some other built-in functions and methods, such as\n``os.popen()`` and ``os.fdopen()`` and the ``makefile()`` method of\nsocket objects. Temporary files can be created using the ``tempfile``\nmodule, and high-level file operations such as copying, moving, and\ndeleting files and directories can be achieved with the ``shutil``\nmodule.\n\nWhen a file operation fails for an I/O-related reason, the exception\n``IOError`` is raised. This includes situations where the operation\nis not defined for some reason, like ``seek()`` on a tty device or\nwriting a file opened for reading.\n\nFiles have the following methods:\n\nfile.close()\n\n Close the file. A closed file cannot be read or written any more.\n Any operation which requires that the file be open will raise a\n ``ValueError`` after the file has been closed. Calling ``close()``\n more than once is allowed.\n\n You can avoid having to call this method explicitly if you use the\n ``with`` statement. For example, the following code will\n automatically close *f* when the ``with`` block is exited:\n\n from __future__ import with_statement # This isn\'t required in Python 2.6\n\n with open("hello.txt") as f:\n for line in f:\n print(line)\n\n In older versions of Python, you would have needed to do this to\n get the same effect:\n\n f = open("hello.txt")\n try:\n for line in f:\n print(line)\n finally:\n f.close()\n\n Note: Not all "file-like" types in Python support use as a context\n manager for the ``with`` statement. If your code is intended to\n work with any file-like object, you can use the function\n ``contextlib.closing()`` instead of using the object directly.\n\nfile.flush()\n\n Flush the internal buffer, like ``stdio``\'s ``fflush``. This may\n be a no-op on some file-like objects.\n\n Note: ``flush()`` does not necessarily write the file\'s data to disk.\n Use ``flush()`` followed by ``os.fsync()`` to ensure this\n behavior.\n\nfile.fileno()\n\n Return the integer "file descriptor" that is used by the underlying\n implementation to request I/O operations from the operating system.\n This can be useful for other, lower level interfaces that use file\n descriptors, such as the ``fcntl`` module or ``os.read()`` and\n friends.\n\n Note: File-like objects which do not have a real file descriptor should\n *not* provide this method!\n\nfile.isatty()\n\n Return ``True`` if the file is connected to a tty(-like) device,\n else ``False``.\n\n Note: If a file-like object is not associated with a real file, this\n method should *not* be implemented.\n\nfile.__next__()\n\n A file object is its own iterator, for example ``iter(f)`` returns\n *f* (unless *f* is closed). When a file is used as an iterator,\n typically in a ``for`` loop (for example, ``for line in f:\n print(line)``), the ``__next__()`` method is called repeatedly.\n This method returns the next input line, or raises\n ``StopIteration`` when EOF is hit when the file is open for reading\n (behavior is undefined when the file is open for writing). In\n order to make a ``for`` loop the most efficient way of looping over\n the lines of a file (a very common operation), the ``__next__()``\n method uses a hidden read-ahead buffer. As a consequence of using\n a read-ahead buffer, combining ``__next__()`` with other file\n methods (like ``readline()``) does not work right. However, using\n ``seek()`` to reposition the file to an absolute position will\n flush the read-ahead buffer.\n\nfile.read([size])\n\n Read at most *size* bytes from the file (less if the read hits EOF\n before obtaining *size* bytes). If the *size* argument is negative\n or omitted, read all data until EOF is reached. The bytes are\n returned as a string object. An empty string is returned when EOF\n is encountered immediately. (For certain files, like ttys, it\n makes sense to continue reading after an EOF is hit.) Note that\n this method may call the underlying C function ``fread`` more than\n once in an effort to acquire as close to *size* bytes as possible.\n Also note that when in non-blocking mode, less data than was\n requested may be returned, even if no *size* parameter was given.\n\nfile.readline([size])\n\n Read one entire line from the file. A trailing newline character\n is kept in the string (but may be absent when a file ends with an\n incomplete line). [5] If the *size* argument is present and non-\n negative, it is a maximum byte count (including the trailing\n newline) and an incomplete line may be returned. An empty string is\n returned *only* when EOF is encountered immediately.\n\n Note: Unlike ``stdio``\'s ``fgets``, the returned string contains null\n characters (``\'\\0\'``) if they occurred in the input.\n\nfile.readlines([sizehint])\n\n Read until EOF using ``readline()`` and return a list containing\n the lines thus read. If the optional *sizehint* argument is\n present, instead of reading up to EOF, whole lines totalling\n approximately *sizehint* bytes (possibly after rounding up to an\n internal buffer size) are read. Objects implementing a file-like\n interface may choose to ignore *sizehint* if it cannot be\n implemented, or cannot be implemented efficiently.\n\nfile.seek(offset[, whence])\n\n Set the file\'s current position, like ``stdio``\'s ``fseek``. The\n *whence* argument is optional and defaults to ``os.SEEK_SET`` or\n ``0`` (absolute file positioning); other values are ``os.SEEK_CUR``\n or ``1`` (seek relative to the current position) and\n ``os.SEEK_END`` or ``2`` (seek relative to the file\'s end). There\n is no return value.\n\n For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by\n two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third\n to last.\n\n Note that if the file is opened for appending (mode ``\'a\'`` or\n ``\'a+\'``), any ``seek()`` operations will be undone at the next\n write. If the file is only opened for writing in append mode (mode\n ``\'a\'``), this method is essentially a no-op, but it remains useful\n for files opened in append mode with reading enabled (mode\n ``\'a+\'``). If the file is opened in text mode (without ``\'b\'``),\n only offsets returned by ``tell()`` are legal. Use of other\n offsets causes undefined behavior.\n\n Note that not all file objects are seekable.\n\nfile.tell()\n\n Return the file\'s current position, like ``stdio``\'s ``ftell``.\n\n Note: On Windows, ``tell()`` can return illegal values (after an\n ``fgets``) when reading files with Unix-style line-endings. Use\n binary mode (``\'rb\'``) to circumvent this problem.\n\nfile.truncate([size])\n\n Truncate the file\'s size. If the optional *size* argument is\n present, the file is truncated to (at most) that size. The size\n defaults to the current position. The current file position is not\n changed. Note that if a specified size exceeds the file\'s current\n size, the result is platform-dependent: possibilities include that\n the file may remain unchanged, increase to the specified size as if\n zero-filled, or increase to the specified size with undefined new\n content. Availability: Windows, many Unix variants.\n\nfile.write(str)\n\n Write a string to the file. Due to buffering, the string may not\n actually show up in the file until the ``flush()`` or ``close()``\n method is called.\n\n The meaning of the return value is not defined for every file-like\n object. Some (mostly low-level) file-like objects may return the\n number of bytes actually written, others return ``None``.\n\nfile.writelines(sequence)\n\n Write a sequence of strings to the file. The sequence can be any\n iterable object producing strings, typically a list of strings.\n There is no return value. (The name is intended to match\n ``readlines()``; ``writelines()`` does not add line separators.)\n\nFiles support the iterator protocol. Each iteration returns the same\nresult as ``file.readline()``, and iteration ends when the\n``readline()`` method returns an empty string.\n\nFile objects also offer a number of other interesting attributes.\nThese are not required for file-like objects, but should be\nimplemented if they make sense for the particular object.\n\nfile.closed\n\n bool indicating the current state of the file object. This is a\n read-only attribute; the ``close()`` method changes the value. It\n may not be available on all file-like objects.\n\nfile.encoding\n\n The encoding that this file uses. When strings are written to a\n file, they will be converted to byte strings using this encoding.\n In addition, when the file is connected to a terminal, the\n attribute gives the encoding that the terminal is likely to use\n (that information might be incorrect if the user has misconfigured\n the terminal). The attribute is read-only and may not be present\n on all file-like objects. It may also be ``None``, in which case\n the file uses the system default encoding for converting strings.\n\nfile.errors\n\n The Unicode error handler used along with the encoding.\n\nfile.mode\n\n The I/O mode for the file. If the file was created using the\n ``open()`` built-in function, this will be the value of the *mode*\n parameter. This is a read-only attribute and may not be present on\n all file-like objects.\n\nfile.name\n\n If the file object was created using ``open()``, the name of the\n file. Otherwise, some string that indicates the source of the file\n object, of the form ``<...>``. This is a read-only attribute and\n may not be present on all file-like objects.\n\nfile.newlines\n\n If Python was built with the *--with-universal-newlines* option to\n **configure** (the default) this read-only attribute exists, and\n for files opened in universal newline read mode it keeps track of\n the types of newlines encountered while reading the file. The\n values it can take are ``\'\\r\'``, ``\'\\n\'``, ``\'\\r\\n\'``, ``None``\n (unknown, no newlines read yet) or a tuple containing all the\n newline types seen, to indicate that multiple newline conventions\n were encountered. For files not opened in universal newline read\n mode the value of this attribute will be ``None``.\n', + 'bltin-file-objects': '\nFile Objects\n************\n\nFile objects are implemented using C\'s ``stdio`` package and can be\ncreated with the built-in ``open()`` function. File objects are also\nreturned by some other built-in functions and methods, such as\n``os.popen()`` and ``os.fdopen()`` and the ``makefile()`` method of\nsocket objects. Temporary files can be created using the ``tempfile``\nmodule, and high-level file operations such as copying, moving, and\ndeleting files and directories can be achieved with the ``shutil``\nmodule.\n\nWhen a file operation fails for an I/O-related reason, the exception\n``IOError`` is raised. This includes situations where the operation\nis not defined for some reason, like ``seek()`` on a tty device or\nwriting a file opened for reading.\n\nFiles have the following methods:\n\nfile.close()\n\n Close the file. A closed file cannot be read or written any more.\n Any operation which requires that the file be open will raise a\n ``ValueError`` after the file has been closed. Calling ``close()``\n more than once is allowed.\n\n You can avoid having to call this method explicitly if you use the\n ``with`` statement. For example, the following code will\n automatically close *f* when the ``with`` block is exited:\n\n from __future__ import with_statement # This isn\'t required in Python 2.6\n\n with open("hello.txt") as f:\n for line in f:\n print(line)\n\n In older versions of Python, you would have needed to do this to\n get the same effect:\n\n f = open("hello.txt")\n try:\n for line in f:\n print(line)\n finally:\n f.close()\n\n Note: Not all "file-like" types in Python support use as a context\n manager for the ``with`` statement. If your code is intended to\n work with any file-like object, you can use the function\n ``contextlib.closing()`` instead of using the object directly.\n\nfile.flush()\n\n Flush the internal buffer, like ``stdio``\'s ``fflush()``. This may\n be a no-op on some file-like objects.\n\n Note: ``flush()`` does not necessarily write the file\'s data to disk.\n Use ``flush()`` followed by ``os.fsync()`` to ensure this\n behavior.\n\nfile.fileno()\n\n Return the integer "file descriptor" that is used by the underlying\n implementation to request I/O operations from the operating system.\n This can be useful for other, lower level interfaces that use file\n descriptors, such as the ``fcntl`` module or ``os.read()`` and\n friends.\n\n Note: File-like objects which do not have a real file descriptor should\n *not* provide this method!\n\nfile.isatty()\n\n Return ``True`` if the file is connected to a tty(-like) device,\n else ``False``.\n\n Note: If a file-like object is not associated with a real file, this\n method should *not* be implemented.\n\nfile.__next__()\n\n A file object is its own iterator, for example ``iter(f)`` returns\n *f* (unless *f* is closed). When a file is used as an iterator,\n typically in a ``for`` loop (for example, ``for line in f:\n print(line)``), the ``__next__()`` method is called repeatedly.\n This method returns the next input line, or raises\n ``StopIteration`` when EOF is hit when the file is open for reading\n (behavior is undefined when the file is open for writing). In\n order to make a ``for`` loop the most efficient way of looping over\n the lines of a file (a very common operation), the ``__next__()``\n method uses a hidden read-ahead buffer. As a consequence of using\n a read-ahead buffer, combining ``__next__()`` with other file\n methods (like ``readline()``) does not work right. However, using\n ``seek()`` to reposition the file to an absolute position will\n flush the read-ahead buffer.\n\nfile.read([size])\n\n Read at most *size* bytes from the file (less if the read hits EOF\n before obtaining *size* bytes). If the *size* argument is negative\n or omitted, read all data until EOF is reached. The bytes are\n returned as a string object. An empty string is returned when EOF\n is encountered immediately. (For certain files, like ttys, it\n makes sense to continue reading after an EOF is hit.) Note that\n this method may call the underlying C function ``fread()`` more\n than once in an effort to acquire as close to *size* bytes as\n possible. Also note that when in non-blocking mode, less data than\n was requested may be returned, even if no *size* parameter was\n given.\n\nfile.readline([size])\n\n Read one entire line from the file. A trailing newline character\n is kept in the string (but may be absent when a file ends with an\n incomplete line). [5] If the *size* argument is present and non-\n negative, it is a maximum byte count (including the trailing\n newline) and an incomplete line may be returned. An empty string is\n returned *only* when EOF is encountered immediately.\n\n Note: Unlike ``stdio``\'s ``fgets()``, the returned string contains null\n characters (``\'\\0\'``) if they occurred in the input.\n\nfile.readlines([sizehint])\n\n Read until EOF using ``readline()`` and return a list containing\n the lines thus read. If the optional *sizehint* argument is\n present, instead of reading up to EOF, whole lines totalling\n approximately *sizehint* bytes (possibly after rounding up to an\n internal buffer size) are read. Objects implementing a file-like\n interface may choose to ignore *sizehint* if it cannot be\n implemented, or cannot be implemented efficiently.\n\nfile.seek(offset[, whence])\n\n Set the file\'s current position, like ``stdio``\'s ``fseek()``. The\n *whence* argument is optional and defaults to ``os.SEEK_SET`` or\n ``0`` (absolute file positioning); other values are ``os.SEEK_CUR``\n or ``1`` (seek relative to the current position) and\n ``os.SEEK_END`` or ``2`` (seek relative to the file\'s end). There\n is no return value.\n\n For example, ``f.seek(2, os.SEEK_CUR)`` advances the position by\n two and ``f.seek(-3, os.SEEK_END)`` sets the position to the third\n to last.\n\n Note that if the file is opened for appending (mode ``\'a\'`` or\n ``\'a+\'``), any ``seek()`` operations will be undone at the next\n write. If the file is only opened for writing in append mode (mode\n ``\'a\'``), this method is essentially a no-op, but it remains useful\n for files opened in append mode with reading enabled (mode\n ``\'a+\'``). If the file is opened in text mode (without ``\'b\'``),\n only offsets returned by ``tell()`` are legal. Use of other\n offsets causes undefined behavior.\n\n Note that not all file objects are seekable.\n\nfile.tell()\n\n Return the file\'s current position, like ``stdio``\'s ``ftell()``.\n\n Note: On Windows, ``tell()`` can return illegal values (after an\n ``fgets()``) when reading files with Unix-style line-endings. Use\n binary mode (``\'rb\'``) to circumvent this problem.\n\nfile.truncate([size])\n\n Truncate the file\'s size. If the optional *size* argument is\n present, the file is truncated to (at most) that size. The size\n defaults to the current position. The current file position is not\n changed. Note that if a specified size exceeds the file\'s current\n size, the result is platform-dependent: possibilities include that\n the file may remain unchanged, increase to the specified size as if\n zero-filled, or increase to the specified size with undefined new\n content. Availability: Windows, many Unix variants.\n\nfile.write(str)\n\n Write a string to the file. Due to buffering, the string may not\n actually show up in the file until the ``flush()`` or ``close()``\n method is called.\n\n The meaning of the return value is not defined for every file-like\n object. Some (mostly low-level) file-like objects may return the\n number of bytes actually written, others return ``None``.\n\nfile.writelines(sequence)\n\n Write a sequence of strings to the file. The sequence can be any\n iterable object producing strings, typically a list of strings.\n There is no return value. (The name is intended to match\n ``readlines()``; ``writelines()`` does not add line separators.)\n\nFiles support the iterator protocol. Each iteration returns the same\nresult as ``file.readline()``, and iteration ends when the\n``readline()`` method returns an empty string.\n\nFile objects also offer a number of other interesting attributes.\nThese are not required for file-like objects, but should be\nimplemented if they make sense for the particular object.\n\nfile.closed\n\n bool indicating the current state of the file object. This is a\n read-only attribute; the ``close()`` method changes the value. It\n may not be available on all file-like objects.\n\nfile.encoding\n\n The encoding that this file uses. When strings are written to a\n file, they will be converted to byte strings using this encoding.\n In addition, when the file is connected to a terminal, the\n attribute gives the encoding that the terminal is likely to use\n (that information might be incorrect if the user has misconfigured\n the terminal). The attribute is read-only and may not be present\n on all file-like objects. It may also be ``None``, in which case\n the file uses the system default encoding for converting strings.\n\nfile.errors\n\n The Unicode error handler used along with the encoding.\n\nfile.mode\n\n The I/O mode for the file. If the file was created using the\n ``open()`` built-in function, this will be the value of the *mode*\n parameter. This is a read-only attribute and may not be present on\n all file-like objects.\n\nfile.name\n\n If the file object was created using ``open()``, the name of the\n file. Otherwise, some string that indicates the source of the file\n object, of the form ``<...>``. This is a read-only attribute and\n may not be present on all file-like objects.\n\nfile.newlines\n\n If Python was built with the *--with-universal-newlines* option to\n **configure** (the default) this read-only attribute exists, and\n for files opened in universal newline read mode it keeps track of\n the types of newlines encountered while reading the file. The\n values it can take are ``\'\\r\'``, ``\'\\n\'``, ``\'\\r\\n\'``, ``None``\n (unknown, no newlines read yet) or a tuple containing all the\n newline types seen, to indicate that multiple newline conventions\n were encountered. For files not opened in universal newline read\n mode the value of this attribute will be ``None``.\n', 'bltin-null-object': "\nThe Null Object\n***************\n\nThis object is returned by functions that don't explicitly return a\nvalue. It supports no special operations. There is exactly one null\nobject, named ``None`` (a built-in name).\n\nIt is written as ``None``.\n", 'bltin-type-objects': "\nType Objects\n************\n\nType objects represent the various object types. An object's type is\naccessed by the built-in function ``type()``. There are no special\noperations on types. The standard module ``types`` defines names for\nall standard built-in types.\n\nTypes are written like this: ````.\n", 'booleans': '\nBoolean operations\n******************\n\nBoolean operations have the lowest priority of all Python operations:\n\n expression ::= conditional_expression | lambda_form\n expression_nocond ::= or_test | lambda_form_nocond\n conditional_expression ::= or_test ["if" or_test "else" expression]\n or_test ::= and_test | or_test "or" and_test\n and_test ::= not_test | and_test "and" not_test\n not_test ::= comparison | "not" not_test\n\nIn the context of Boolean operations, and also when expressions are\nused by control flow statements, the following values are interpreted\nas false: ``False``, ``None``, numeric zero of all types, and empty\nstrings and containers (including strings, tuples, lists,\ndictionaries, sets and frozensets). All other values are interpreted\nas true. User-defined objects can customize their truth value by\nproviding a ``__bool__()`` method.\n\nThe operator ``not`` yields ``True`` if its argument is false,\n``False`` otherwise.\n\nThe expression ``x if C else y`` first evaluates *C* (*not* *x*); if\n*C* is true, *x* is evaluated and its value is returned; otherwise,\n*y* is evaluated and its value is returned.\n\nThe expression ``x and y`` first evaluates *x*; if *x* is false, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\nThe expression ``x or y`` first evaluates *x*; if *x* is true, its\nvalue is returned; otherwise, *y* is evaluated and the resulting value\nis returned.\n\n(Note that neither ``and`` nor ``or`` restrict the value and type they\nreturn to ``False`` and ``True``, but rather return the last evaluated\nargument. This is sometimes useful, e.g., if ``s`` is a string that\nshould be replaced by a default value if it is empty, the expression\n``s or \'foo\'`` yields the desired value. Because ``not`` has to\ninvent a value anyway, it does not bother to return a value of the\nsame type as its argument, so e.g., ``not \'foo\'`` yields ``False``,\nnot ``\'\'``.)\n', 'break': '\nThe ``break`` statement\n***********************\n\n break_stmt ::= "break"\n\n``break`` may only occur syntactically nested in a ``for`` or\n``while`` loop, but not nested in a function or class definition\nwithin that loop.\n\nIt terminates the nearest enclosing loop, skipping the optional\n``else`` clause if the loop has one.\n\nIf a ``for`` loop is terminated by ``break``, the loop control target\nkeeps its current value.\n\nWhen ``break`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nleaving the loop.\n', 'callable-types': '\nEmulating callable objects\n**************************\n\nobject.__call__(self[, args...])\n\n Called when the instance is "called" as a function; if this method\n is defined, ``x(arg1, arg2, ...)`` is a shorthand for\n ``x.__call__(arg1, arg2, ...)``.\n', - 'calls': '\nCalls\n*****\n\nA call calls a callable object (e.g., a function) with a possibly\nempty series of arguments:\n\n call ::= primary "(" [argument_list [","] | comprehension] ")"\n argument_list ::= positional_arguments ["," keyword_arguments]\n ["," "*" expression] ["," keyword_arguments]\n ["," "**" expression]\n | keyword_arguments ["," "*" expression]\n ["," keyword_arguments] ["," "**" expression]\n | "*" expression ["," keyword_arguments] ["," "**" expression]\n | "**" expression\n positional_arguments ::= expression ("," expression)*\n keyword_arguments ::= keyword_item ("," keyword_item)*\n keyword_item ::= identifier "=" expression\n\nA trailing comma may be present after the positional and keyword\narguments but does not affect the semantics.\n\nThe primary must evaluate to a callable object (user-defined\nfunctions, built-in functions, methods of built-in objects, class\nobjects, methods of class instances, and all objects having a\n``__call__()`` method are callable). All argument expressions are\nevaluated before the call is attempted. Please refer to section\n*Function definitions* for the syntax of formal parameter lists.\n\nIf keyword arguments are present, they are first converted to\npositional arguments, as follows. First, a list of unfilled slots is\ncreated for the formal parameters. If there are N positional\narguments, they are placed in the first N slots. Next, for each\nkeyword argument, the identifier is used to determine the\ncorresponding slot (if the identifier is the same as the first formal\nparameter name, the first slot is used, and so on). If the slot is\nalready filled, a ``TypeError`` exception is raised. Otherwise, the\nvalue of the argument is placed in the slot, filling it (even if the\nexpression is ``None``, it fills the slot). When all arguments have\nbeen processed, the slots that are still unfilled are filled with the\ncorresponding default value from the function definition. (Default\nvalues are calculated, once, when the function is defined; thus, a\nmutable object such as a list or dictionary used as default value will\nbe shared by all calls that don\'t specify an argument value for the\ncorresponding slot; this should usually be avoided.) If there are any\nunfilled slots for which no default value is specified, a\n``TypeError`` exception is raised. Otherwise, the list of filled\nslots is used as the argument list for the call.\n\nNote: An implementation may provide builtin functions whose positional\n parameters do not have names, even if they are \'named\' for the\n purpose of documentation, and which therefore cannot be supplied by\n keyword. In CPython, this is the case for functions implemented in\n C that use ``PyArg_ParseTuple`` to parse their arguments.\n\nIf there are more positional arguments than there are formal parameter\nslots, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``*identifier`` is present; in this case, that formal\nparameter receives a tuple containing the excess positional arguments\n(or an empty tuple if there were no excess positional arguments).\n\nIf any keyword argument does not correspond to a formal parameter\nname, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``**identifier`` is present; in this case, that\nformal parameter receives a dictionary containing the excess keyword\narguments (using the keywords as keys and the argument values as\ncorresponding values), or a (new) empty dictionary if there were no\nexcess keyword arguments.\n\nIf the syntax ``*expression`` appears in the function call,\n``expression`` must evaluate to a sequence. Elements from this\nsequence are treated as if they were additional positional arguments;\nif there are positional arguments *x1*,..., *xN*, and ``expression``\nevaluates to a sequence *y1*, ..., *yM*, this is equivalent to a call\nwith M+N positional arguments *x1*, ..., *xN*, *y1*, ..., *yM*.\n\nA consequence of this is that although the ``*expression`` syntax may\nappear *after* some keyword arguments, it is processed *before* the\nkeyword arguments (and the ``**expression`` argument, if any -- see\nbelow). So:\n\n >>> def f(a, b):\n ... print(a, b)\n ...\n >>> f(b=1, *(2,))\n 2 1\n >>> f(a=1, *(2,))\n Traceback (most recent call last):\n File "", line 1, in ?\n TypeError: f() got multiple values for keyword argument \'a\'\n >>> f(1, *(2,))\n 1 2\n\nIt is unusual for both keyword arguments and the ``*expression``\nsyntax to be used in the same call, so in practice this confusion does\nnot arise.\n\nIf the syntax ``**expression`` appears in the function call,\n``expression`` must evaluate to a mapping, the contents of which are\ntreated as additional keyword arguments. In the case of a keyword\nappearing in both ``expression`` and as an explicit keyword argument,\na ``TypeError`` exception is raised.\n\nFormal parameters using the syntax ``*identifier`` or ``**identifier``\ncannot be used as positional argument slots or as keyword argument\nnames.\n\nA call always returns some value, possibly ``None``, unless it raises\nan exception. How this value is computed depends on the type of the\ncallable object.\n\nIf it is---\n\na user-defined function:\n The code block for the function is executed, passing it the\n argument list. The first thing the code block will do is bind the\n formal parameters to the arguments; this is described in section\n *Function definitions*. When the code block executes a ``return``\n statement, this specifies the return value of the function call.\n\na built-in function or method:\n The result is up to the interpreter; see *Built-in Functions* for\n the descriptions of built-in functions and methods.\n\na class object:\n A new instance of that class is returned.\n\na class instance method:\n The corresponding user-defined function is called, with an argument\n list that is one longer than the argument list of the call: the\n instance becomes the first argument.\n\na class instance:\n The class must define a ``__call__()`` method; the effect is then\n the same as if that method was called.\n', + 'calls': '\nCalls\n*****\n\nA call calls a callable object (e.g., a function) with a possibly\nempty series of arguments:\n\n call ::= primary "(" [argument_list [","] | comprehension] ")"\n argument_list ::= positional_arguments ["," keyword_arguments]\n ["," "*" expression] ["," keyword_arguments]\n ["," "**" expression]\n | keyword_arguments ["," "*" expression]\n ["," keyword_arguments] ["," "**" expression]\n | "*" expression ["," keyword_arguments] ["," "**" expression]\n | "**" expression\n positional_arguments ::= expression ("," expression)*\n keyword_arguments ::= keyword_item ("," keyword_item)*\n keyword_item ::= identifier "=" expression\n\nA trailing comma may be present after the positional and keyword\narguments but does not affect the semantics.\n\nThe primary must evaluate to a callable object (user-defined\nfunctions, built-in functions, methods of built-in objects, class\nobjects, methods of class instances, and all objects having a\n``__call__()`` method are callable). All argument expressions are\nevaluated before the call is attempted. Please refer to section\n*Function definitions* for the syntax of formal parameter lists.\n\nIf keyword arguments are present, they are first converted to\npositional arguments, as follows. First, a list of unfilled slots is\ncreated for the formal parameters. If there are N positional\narguments, they are placed in the first N slots. Next, for each\nkeyword argument, the identifier is used to determine the\ncorresponding slot (if the identifier is the same as the first formal\nparameter name, the first slot is used, and so on). If the slot is\nalready filled, a ``TypeError`` exception is raised. Otherwise, the\nvalue of the argument is placed in the slot, filling it (even if the\nexpression is ``None``, it fills the slot). When all arguments have\nbeen processed, the slots that are still unfilled are filled with the\ncorresponding default value from the function definition. (Default\nvalues are calculated, once, when the function is defined; thus, a\nmutable object such as a list or dictionary used as default value will\nbe shared by all calls that don\'t specify an argument value for the\ncorresponding slot; this should usually be avoided.) If there are any\nunfilled slots for which no default value is specified, a\n``TypeError`` exception is raised. Otherwise, the list of filled\nslots is used as the argument list for the call.\n\nNote: An implementation may provide builtin functions whose positional\n parameters do not have names, even if they are \'named\' for the\n purpose of documentation, and which therefore cannot be supplied by\n keyword. In CPython, this is the case for functions implemented in\n C that use ``PyArg_ParseTuple()`` to parse their arguments.\n\nIf there are more positional arguments than there are formal parameter\nslots, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``*identifier`` is present; in this case, that formal\nparameter receives a tuple containing the excess positional arguments\n(or an empty tuple if there were no excess positional arguments).\n\nIf any keyword argument does not correspond to a formal parameter\nname, a ``TypeError`` exception is raised, unless a formal parameter\nusing the syntax ``**identifier`` is present; in this case, that\nformal parameter receives a dictionary containing the excess keyword\narguments (using the keywords as keys and the argument values as\ncorresponding values), or a (new) empty dictionary if there were no\nexcess keyword arguments.\n\nIf the syntax ``*expression`` appears in the function call,\n``expression`` must evaluate to a sequence. Elements from this\nsequence are treated as if they were additional positional arguments;\nif there are positional arguments *x1*,..., *xN*, and ``expression``\nevaluates to a sequence *y1*, ..., *yM*, this is equivalent to a call\nwith M+N positional arguments *x1*, ..., *xN*, *y1*, ..., *yM*.\n\nA consequence of this is that although the ``*expression`` syntax may\nappear *after* some keyword arguments, it is processed *before* the\nkeyword arguments (and the ``**expression`` argument, if any -- see\nbelow). So:\n\n >>> def f(a, b):\n ... print(a, b)\n ...\n >>> f(b=1, *(2,))\n 2 1\n >>> f(a=1, *(2,))\n Traceback (most recent call last):\n File "", line 1, in ?\n TypeError: f() got multiple values for keyword argument \'a\'\n >>> f(1, *(2,))\n 1 2\n\nIt is unusual for both keyword arguments and the ``*expression``\nsyntax to be used in the same call, so in practice this confusion does\nnot arise.\n\nIf the syntax ``**expression`` appears in the function call,\n``expression`` must evaluate to a mapping, the contents of which are\ntreated as additional keyword arguments. In the case of a keyword\nappearing in both ``expression`` and as an explicit keyword argument,\na ``TypeError`` exception is raised.\n\nFormal parameters using the syntax ``*identifier`` or ``**identifier``\ncannot be used as positional argument slots or as keyword argument\nnames.\n\nA call always returns some value, possibly ``None``, unless it raises\nan exception. How this value is computed depends on the type of the\ncallable object.\n\nIf it is---\n\na user-defined function:\n The code block for the function is executed, passing it the\n argument list. The first thing the code block will do is bind the\n formal parameters to the arguments; this is described in section\n *Function definitions*. When the code block executes a ``return``\n statement, this specifies the return value of the function call.\n\na built-in function or method:\n The result is up to the interpreter; see *Built-in Functions* for\n the descriptions of built-in functions and methods.\n\na class object:\n A new instance of that class is returned.\n\na class instance method:\n The corresponding user-defined function is called, with an argument\n list that is one longer than the argument list of the call: the\n instance becomes the first argument.\n\na class instance:\n The class must define a ``__call__()`` method; the effect is then\n the same as if that method was called.\n', 'class': '\nClass definitions\n*****************\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= [decorators] "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. [4] A class object is then created using the inheritance list\nfor the base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\nClasses can also be decorated; as with functions,\n\n @f1(arg)\n @f2\n class Foo: pass\n\nis equivalent to\n\n class Foo: pass\n Foo = f1(arg)(f2(Foo))\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by instances. Instance variables can\nbe set in a method with ``self.name = value``. Both class and\ninstance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. Descriptors can be used to create\ninstance variables with different implementation details.\n\nSee also:\n\n **PEP 3129** - Class Decorators\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n\n[3] A string literal appearing as the first statement in the function\n body is transformed into the function\'s ``__doc__`` attribute and\n therefore the function\'s *docstring*.\n\n[4] A string literal appearing as the first statement in the class\n body is transformed into the namespace\'s ``__doc__`` item and\n therefore the class\'s *docstring*.\n', 'comparisons': '\nComparisons\n***********\n\nUnlike C, all comparison operations in Python have the same priority,\nwhich is lower than that of any arithmetic, shifting or bitwise\noperation. Also unlike C, expressions like ``a < b < c`` have the\ninterpretation that is conventional in mathematics:\n\n comparison ::= or_expr ( comp_operator or_expr )*\n comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "!="\n | "is" ["not"] | ["not"] "in"\n\nComparisons yield boolean values: ``True`` or ``False``.\n\nComparisons can be chained arbitrarily, e.g., ``x < y <= z`` is\nequivalent to ``x < y and y <= z``, except that ``y`` is evaluated\nonly once (but in both cases ``z`` is not evaluated at all when ``x <\ny`` is found to be false).\n\nFormally, if *a*, *b*, *c*, ..., *y*, *z* are expressions and *op1*,\n*op2*, ..., *opN* are comparison operators, then ``a op1 b op2 c ... y\nopN z`` is equivalent to ``a op1 b and b op2 c and ... y opN z``,\nexcept that each expression is evaluated at most once.\n\nNote that ``a op1 b op2 c`` doesn\'t imply any kind of comparison\nbetween *a* and *c*, so that, e.g., ``x < y > z`` is perfectly legal\n(though perhaps not pretty).\n\nThe operators ``<``, ``>``, ``==``, ``>=``, ``<=``, and ``!=`` compare\nthe values of two objects. The objects need not have the same type.\nIf both are numbers, they are converted to a common type. Otherwise,\nthe ``==`` and ``!=`` operators *always* consider objects of different\ntypes to be unequal, while the ``<``, ``>``, ``>=`` and ``<=``\noperators raise a ``TypeError`` when comparing objects of different\ntypes that do not implement these operators for the given pair of\ntypes. You can control comparison behavior of objects of non-builtin\ntypes by defining rich comparison methods like ``__gt__()``, described\nin section *Basic customization*.\n\nComparison of objects of the same type depends on the type:\n\n* Numbers are compared arithmetically.\n\n* The values ``float(\'NaN\')`` and ``Decimal(\'NaN\')`` are special. The\n are identical to themselves, ``x is x`` but are not equal to\n themselves, ``x != x``. Additionally, comparing any value to a\n not-a-number value will return ``False``. For example, both ``3 <\n float(\'NaN\')`` and ``float(\'NaN\') < 3`` will return ``False``.\n\n* Bytes objects are compared lexicographically using the numeric\n values of their elements.\n\n* Strings are compared lexicographically using the numeric equivalents\n (the result of the built-in function ``ord()``) of their characters.\n [3] String and bytes object can\'t be compared!\n\n* Tuples and lists are compared lexicographically using comparison of\n corresponding elements. This means that to compare equal, each\n element must compare equal and the two sequences must be of the same\n type and have the same length.\n\n If not equal, the sequences are ordered the same as their first\n differing elements. For example, ``[1,2,x] <= [1,2,y]`` has the\n same value as ``x <= y``. If the corresponding element does not\n exist, the shorter sequence is ordered first (for example, ``[1,2] <\n [1,2,3]``).\n\n* Mappings (dictionaries) compare equal if and only if their sorted\n ``(key, value)`` lists compare equal. [4] Outcomes other than\n equality are resolved consistently, but are not otherwise defined.\n [5]\n\n* Sets and frozensets define comparison operators to mean subset and\n superset tests. Those relations do not define total orderings (the\n two sets ``{1,2}`` and {2,3} are not equal, nor subsets of one\n another, nor supersets of one another). Accordingly, sets are not\n appropriate arguments for functions which depend on total ordering.\n For example, ``min()``, ``max()``, and ``sorted()`` produce\n undefined results given a list of sets as inputs.\n\n* Most other objects of builtin types compare unequal unless they are\n the same object; the choice whether one object is considered smaller\n or larger than another one is made arbitrarily but consistently\n within one execution of a program.\n\nComparison of objects of the differing types depends on whether either\nof the types provide explicit support for the comparison. Most\nnumeric types can be compared with one another, but comparisons of\n``float`` and ``Decimal`` are not supported to avoid the inevitable\nconfusion arising from representation issues such as ``float(\'1.1\')``\nbeing inexactly represented and therefore not exactly equal to\n``Decimal(\'1.1\')`` which is. When cross-type comparison is not\nsupported, the comparison method returns ``NotImplemented``. This can\ncreate the illusion of non-transitivity between supported cross-type\ncomparisons and unsupported comparisons. For example, ``Decimal(2) ==\n2`` and *2 == float(2)`* but ``Decimal(2) != float(2)``.\n\nThe operators ``in`` and ``not in`` test for membership. ``x in s``\nevaluates to true if *x* is a member of *s*, and false otherwise. ``x\nnot in s`` returns the negation of ``x in s``. All built-in sequences\nand set types support this as well as dictionary, for which ``in``\ntests whether a the dictionary has a given key. For container types\nsuch as list, tuple, set, frozenset, dict, or collections.deque, the\nexpression ``x in y`` is equivalent to ``any(x is e or x == e for val\ne in y)``.\n\nFor the string and bytes types, ``x in y`` is true if and only if *x*\nis a substring of *y*. An equivalent test is ``y.find(x) != -1``.\nEmpty strings are always considered to be a substring of any other\nstring, so ``"" in "abc"`` will return ``True``.\n\nFor user-defined classes which define the ``__contains__()`` method,\n``x in y`` is true if and only if ``y.__contains__(x)`` is true.\n\nFor user-defined classes which do not define ``__contains__()`` and do\ndefine ``__getitem__()``, ``x in y`` is true if and only if there is a\nnon-negative integer index *i* such that ``x == y[i]``, and all lower\ninteger indices do not raise ``IndexError`` exception. (If any other\nexception is raised, it is as if ``in`` raised that exception).\n\nThe operator ``not in`` is defined to have the inverse true value of\n``in``.\n\nThe operators ``is`` and ``is not`` test for object identity: ``x is\ny`` is true if and only if *x* and *y* are the same object. ``x is\nnot y`` yields the inverse truth value. [6]\n', - 'compound': '\nCompound statements\n*******************\n\nCompound statements contain (groups of) other statements; they affect\nor control the execution of those other statements in some way. In\ngeneral, compound statements span multiple lines, although in simple\nincarnations a whole compound statement may be contained in one line.\n\nThe ``if``, ``while`` and ``for`` statements implement traditional\ncontrol flow constructs. ``try`` specifies exception handlers and/or\ncleanup code for a group of statements, while the ``with`` statement\nallows the execution of initialization and finalization code around a\nblock of code. Function and class definitions are also syntactically\ncompound statements.\n\nCompound statements consist of one or more \'clauses.\' A clause\nconsists of a header and a \'suite.\' The clause headers of a\nparticular compound statement are all at the same indentation level.\nEach clause header begins with a uniquely identifying keyword and ends\nwith a colon. A suite is a group of statements controlled by a\nclause. A suite can be one or more semicolon-separated simple\nstatements on the same line as the header, following the header\'s\ncolon, or it can be one or more indented statements on subsequent\nlines. Only the latter form of suite can contain nested compound\nstatements; the following is illegal, mostly because it wouldn\'t be\nclear to which ``if`` clause a following ``else`` clause would belong:\n\n if test1: if test2: print(x)\n\nAlso note that the semicolon binds tighter than the colon in this\ncontext, so that in the following example, either all or none of the\n``print()`` calls are executed:\n\n if x < y < z: print(x); print(y); print(z)\n\nSummarizing:\n\n compound_stmt ::= if_stmt\n | while_stmt\n | for_stmt\n | try_stmt\n | with_stmt\n | funcdef\n | classdef\n suite ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT\n statement ::= stmt_list NEWLINE | compound_stmt\n stmt_list ::= simple_stmt (";" simple_stmt)* [";"]\n\nNote that statements always end in a ``NEWLINE`` possibly followed by\na ``DEDENT``. Also note that optional continuation clauses always\nbegin with a keyword that cannot start a statement, thus there are no\nambiguities (the \'dangling ``else``\' problem is solved in Python by\nrequiring nested ``if`` statements to be indented).\n\nThe formatting of the grammar rules in the following sections places\neach clause on a separate line for clarity.\n\n\nThe ``if`` statement\n====================\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n\n\nThe ``while`` statement\n=======================\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n\n\nThe ``for`` statement\n=====================\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments (see *Assignment statements*), and then the suite is\nexecuted. When the items are exhausted (which is immediately when the\nsequence is empty or an iterator raises a ``StopIteration``\nexception), the suite in the ``else`` clause, if present, is executed,\nand the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nNames in the target list are not deleted when the loop is finished,\nbut if the sequence is empty, it will not have been assigned to at all\nby the loop. Hint: the built-in function ``range()`` returns an\niterator of integers suitable to emulate the effect of Pascal\'s ``for\ni := a to b do``; e.g., ``range(3)`` returns the list ``[0, 1, 2]``.\n\nNote: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An\n internal counter is used to keep track of which item is used next,\n and this is incremented on each iteration. When this counter has\n reached the length of the sequence the loop terminates. This means\n that if the suite deletes the current (or a previous) item from the\n sequence, the next item will be skipped (since it gets the index of\n the current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n\n\nThe ``try`` statement\n=====================\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression ["as" target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object or a tuple containing an item compatible with the\nexception.\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified after the ``as`` keyword in that except clause,\nif present, and the except clause\'s suite is executed. All except\nclauses must have an executable block. When the end of this block is\nreached, execution continues normally after the entire try statement.\n(This means that if two nested handlers exist for the same exception,\nand the exception occurs in the try clause of the inner handler, the\nouter handler will not handle the exception.)\n\nWhen an exception has been assigned using ``as target``, it is cleared\nat the end of the except clause. This is as if\n\n except E as N:\n foo\n\nwas translated to\n\n except E as N:\n try:\n foo\n finally:\n N = None\n del N\n\nThat means that you have to assign the exception to a different name\nif you want to be able to refer to it after the except clause. The\nreason for this is that with the traceback attached to them,\nexceptions will form a reference cycle with the stack frame, keeping\nall locals in that frame alive until the next garbage collection\noccurs.\n\nBefore an except clause\'s suite is executed, details about the\nexception are stored in the ``sys`` module and can be access via\n``sys.exc_info()``. ``sys.exc_info()`` returns a 3-tuple consisting\nof: ``exc_type``, the exception class; ``exc_value``, the exception\ninstance; ``exc_traceback``, a traceback object (see section *The\nstandard type hierarchy*) identifying the point in the program where\nthe exception occurred. ``sys.exc_info()`` values are restored to\ntheir previous values (before the call) when returning from a function\nthat handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n\n\nThe ``with`` statement\n======================\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" expression ["as" target] ":" suite\n\nThe execution of the ``with`` statement proceeds as follows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nFunction definitions\n====================\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n funcdef ::= [decorators] "def" funcname "(" [parameter_list] ")" ["->" expression] ":" suite\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" [parameter] ("," defparameter)*\n [, "**" parameter]\n | "**" parameter\n | defparameter [","] )\n parameter ::= identifier [":" expression]\n defparameter ::= parameter ["=" expression]\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters up until the "``*``" must also have a default value ---\nthis is a syntactic restriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary. Parameters after "``*``" or "``*identifier``" are\nkeyword-only parameters and may only be passed used keyword arguments.\n\nParameters may have annotations of the form "``: expression``"\nfollowing the parameter name. Any parameter may have an annotation\neven those of the form ``*identifier`` or ``**identifier``. Functions\nmay have "return" annotation of the form "``-> expression``" after the\nparameter list. These annotations can be any valid Python expression\nand are evaluated when the function definition is executed.\nAnnotations may be evaluated in a different order than they appear in\nthe source code. The presence of annotations does not change the\nsemantics of a function. The annotation values are available as\nvalues of a dictionary keyed by the parameters\' names in the\n``__annotations__`` attribute of the function object.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Lambdas*. Note that the lambda form is merely a\nshorthand for a simplified function definition; a function defined in\na "``def``" statement can be passed around or assigned to another name\njust like a function defined by a lambda form. The "``def``" form is\nactually more powerful since it allows the execution of multiple\nstatements and annotations.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n\n\nClass definitions\n=================\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= [decorators] "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. [4] A class object is then created using the inheritance list\nfor the base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\nClasses can also be decorated; as with functions,\n\n @f1(arg)\n @f2\n class Foo: pass\n\nis equivalent to\n\n class Foo: pass\n Foo = f1(arg)(f2(Foo))\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by instances. Instance variables can\nbe set in a method with ``self.name = value``. Both class and\ninstance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. Descriptors can be used to create\ninstance variables with different implementation details.\n\nSee also:\n\n **PEP 3129** - Class Decorators\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n\n[3] A string literal appearing as the first statement in the function\n body is transformed into the function\'s ``__doc__`` attribute and\n therefore the function\'s *docstring*.\n\n[4] A string literal appearing as the first statement in the class\n body is transformed into the namespace\'s ``__doc__`` item and\n therefore the class\'s *docstring*.\n', + 'compound': '\nCompound statements\n*******************\n\nCompound statements contain (groups of) other statements; they affect\nor control the execution of those other statements in some way. In\ngeneral, compound statements span multiple lines, although in simple\nincarnations a whole compound statement may be contained in one line.\n\nThe ``if``, ``while`` and ``for`` statements implement traditional\ncontrol flow constructs. ``try`` specifies exception handlers and/or\ncleanup code for a group of statements, while the ``with`` statement\nallows the execution of initialization and finalization code around a\nblock of code. Function and class definitions are also syntactically\ncompound statements.\n\nCompound statements consist of one or more \'clauses.\' A clause\nconsists of a header and a \'suite.\' The clause headers of a\nparticular compound statement are all at the same indentation level.\nEach clause header begins with a uniquely identifying keyword and ends\nwith a colon. A suite is a group of statements controlled by a\nclause. A suite can be one or more semicolon-separated simple\nstatements on the same line as the header, following the header\'s\ncolon, or it can be one or more indented statements on subsequent\nlines. Only the latter form of suite can contain nested compound\nstatements; the following is illegal, mostly because it wouldn\'t be\nclear to which ``if`` clause a following ``else`` clause would belong:\n\n if test1: if test2: print(x)\n\nAlso note that the semicolon binds tighter than the colon in this\ncontext, so that in the following example, either all or none of the\n``print()`` calls are executed:\n\n if x < y < z: print(x); print(y); print(z)\n\nSummarizing:\n\n compound_stmt ::= if_stmt\n | while_stmt\n | for_stmt\n | try_stmt\n | with_stmt\n | funcdef\n | classdef\n suite ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT\n statement ::= stmt_list NEWLINE | compound_stmt\n stmt_list ::= simple_stmt (";" simple_stmt)* [";"]\n\nNote that statements always end in a ``NEWLINE`` possibly followed by\na ``DEDENT``. Also note that optional continuation clauses always\nbegin with a keyword that cannot start a statement, thus there are no\nambiguities (the \'dangling ``else``\' problem is solved in Python by\nrequiring nested ``if`` statements to be indented).\n\nThe formatting of the grammar rules in the following sections places\neach clause on a separate line for clarity.\n\n\nThe ``if`` statement\n====================\n\nThe ``if`` statement is used for conditional execution:\n\n if_stmt ::= "if" expression ":" suite\n ( "elif" expression ":" suite )*\n ["else" ":" suite]\n\nIt selects exactly one of the suites by evaluating the expressions one\nby one until one is found to be true (see section *Boolean operations*\nfor the definition of true and false); then that suite is executed\n(and no other part of the ``if`` statement is executed or evaluated).\nIf all expressions are false, the suite of the ``else`` clause, if\npresent, is executed.\n\n\nThe ``while`` statement\n=======================\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n\n\nThe ``for`` statement\n=====================\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments (see *Assignment statements*), and then the suite is\nexecuted. When the items are exhausted (which is immediately when the\nsequence is empty or an iterator raises a ``StopIteration``\nexception), the suite in the ``else`` clause, if present, is executed,\nand the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nNames in the target list are not deleted when the loop is finished,\nbut if the sequence is empty, it will not have been assigned to at all\nby the loop. Hint: the built-in function ``range()`` returns an\niterator of integers suitable to emulate the effect of Pascal\'s ``for\ni := a to b do``; e.g., ``range(3)`` returns the list ``[0, 1, 2]``.\n\nNote: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An\n internal counter is used to keep track of which item is used next,\n and this is incremented on each iteration. When this counter has\n reached the length of the sequence the loop terminates. This means\n that if the suite deletes the current (or a previous) item from the\n sequence, the next item will be skipped (since it gets the index of\n the current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n\n\nThe ``try`` statement\n=====================\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression ["as" target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object or a tuple containing an item compatible with the\nexception.\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified after the ``as`` keyword in that except clause,\nif present, and the except clause\'s suite is executed. All except\nclauses must have an executable block. When the end of this block is\nreached, execution continues normally after the entire try statement.\n(This means that if two nested handlers exist for the same exception,\nand the exception occurs in the try clause of the inner handler, the\nouter handler will not handle the exception.)\n\nWhen an exception has been assigned using ``as target``, it is cleared\nat the end of the except clause. This is as if\n\n except E as N:\n foo\n\nwas translated to\n\n except E as N:\n try:\n foo\n finally:\n N = None\n del N\n\nThat means that you have to assign the exception to a different name\nif you want to be able to refer to it after the except clause. The\nreason for this is that with the traceback attached to them,\nexceptions will form a reference cycle with the stack frame, keeping\nall locals in that frame alive until the next garbage collection\noccurs.\n\nBefore an except clause\'s suite is executed, details about the\nexception are stored in the ``sys`` module and can be access via\n``sys.exc_info()``. ``sys.exc_info()`` returns a 3-tuple consisting\nof: ``exc_type``, the exception class; ``exc_value``, the exception\ninstance; ``exc_traceback``, a traceback object (see section *The\nstandard type hierarchy*) identifying the point in the program where\nthe exception occurred. ``sys.exc_info()`` values are restored to\ntheir previous values (before the call) when returning from a function\nthat handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n\n\nThe ``with`` statement\n======================\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" with_item ("," with_item)* ":" suite\n with_item ::= expression ["as" target]\n\nThe execution of the ``with`` statement with one "item" proceeds as\nfollows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nWith more than one item, the context managers are processed as if\nmultiple ``with`` statements were nested:\n\n with A() as a, B() as b:\n suite\n\nis equivalent to\n\n with A() as a:\n with B() as b:\n suite\n\nChanged in version 3.1: Support for multiple context expressions.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nFunction definitions\n====================\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n funcdef ::= [decorators] "def" funcname "(" [parameter_list] ")" ["->" expression] ":" suite\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" [parameter] ("," defparameter)*\n [, "**" parameter]\n | "**" parameter\n | defparameter [","] )\n parameter ::= identifier [":" expression]\n defparameter ::= parameter ["=" expression]\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters up until the "``*``" must also have a default value ---\nthis is a syntactic restriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary. Parameters after "``*``" or "``*identifier``" are\nkeyword-only parameters and may only be passed used keyword arguments.\n\nParameters may have annotations of the form "``: expression``"\nfollowing the parameter name. Any parameter may have an annotation\neven those of the form ``*identifier`` or ``**identifier``. Functions\nmay have "return" annotation of the form "``-> expression``" after the\nparameter list. These annotations can be any valid Python expression\nand are evaluated when the function definition is executed.\nAnnotations may be evaluated in a different order than they appear in\nthe source code. The presence of annotations does not change the\nsemantics of a function. The annotation values are available as\nvalues of a dictionary keyed by the parameters\' names in the\n``__annotations__`` attribute of the function object.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Lambdas*. Note that the lambda form is merely a\nshorthand for a simplified function definition; a function defined in\na "``def``" statement can be passed around or assigned to another name\njust like a function defined by a lambda form. The "``def``" form is\nactually more powerful since it allows the execution of multiple\nstatements and annotations.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n\n\nClass definitions\n=================\n\nA class definition defines a class object (see section *The standard\ntype hierarchy*):\n\n classdef ::= [decorators] "class" classname [inheritance] ":" suite\n inheritance ::= "(" [expression_list] ")"\n classname ::= identifier\n\nA class definition is an executable statement. It first evaluates the\ninheritance list, if present. Each item in the inheritance list\nshould evaluate to a class object or class type which allows\nsubclassing. The class\'s suite is then executed in a new execution\nframe (see section *Naming and binding*), using a newly created local\nnamespace and the original global namespace. (Usually, the suite\ncontains only function definitions.) When the class\'s suite finishes\nexecution, its execution frame is discarded but its local namespace is\nsaved. [4] A class object is then created using the inheritance list\nfor the base classes and the saved local namespace for the attribute\ndictionary. The class name is bound to this class object in the\noriginal local namespace.\n\nClasses can also be decorated; as with functions,\n\n @f1(arg)\n @f2\n class Foo: pass\n\nis equivalent to\n\n class Foo: pass\n Foo = f1(arg)(f2(Foo))\n\n**Programmer\'s note:** Variables defined in the class definition are\nclass variables; they are shared by instances. Instance variables can\nbe set in a method with ``self.name = value``. Both class and\ninstance variables are accessible through the notation\n"``self.name``", and an instance variable hides a class variable with\nthe same name when accessed in this way. Class variables can be used\nas defaults for instance variables, but using mutable values there can\nlead to unexpected results. Descriptors can be used to create\ninstance variables with different implementation details.\n\nSee also:\n\n **PEP 3129** - Class Decorators\n\nClass definitions, like function definitions, may be wrapped by one or\nmore *decorator* expressions. The evaluation rules for the decorator\nexpressions are the same as for functions. The result must be a class\nobject, which is then bound to the class name.\n\n-[ Footnotes ]-\n\n[1] The exception is propagated to the invocation stack only if there\n is no ``finally`` clause that negates the exception.\n\n[2] Currently, control "flows off the end" except in the case of an\n exception or the execution of a ``return``, ``continue``, or\n ``break`` statement.\n\n[3] A string literal appearing as the first statement in the function\n body is transformed into the function\'s ``__doc__`` attribute and\n therefore the function\'s *docstring*.\n\n[4] A string literal appearing as the first statement in the class\n body is transformed into the namespace\'s ``__doc__`` item and\n therefore the class\'s *docstring*.\n', 'context-managers': '\nWith Statement Context Managers\n*******************************\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n', 'continue': '\nThe ``continue`` statement\n**************************\n\n continue_stmt ::= "continue"\n\n``continue`` may only occur syntactically nested in a ``for`` or\n``while`` loop, but not nested in a function or class definition or\n``finally`` clause within that loop. It continues with the next cycle\nof the nearest enclosing loop.\n\nWhen ``continue`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nstarting the next loop cycle.\n', 'conversions': '\nArithmetic conversions\n**********************\n\nWhen a description of an arithmetic operator below uses the phrase\n"the numeric arguments are converted to a common type," this means\nthat the operator implementation for built-in types works that way:\n\n* If either argument is a complex number, the other is converted to\n complex;\n\n* otherwise, if either argument is a floating point number, the other\n is converted to floating point;\n\n* otherwise, both must be integers and no conversion is necessary.\n\nSome additional rules apply for certain operators (e.g., a string left\nargument to the \'%\' operator). Extensions must define their own\nconversion behavior.\n', @@ -34,7 +34,7 @@ 'exprlists': '\nExpression lists\n****************\n\n expression_list ::= expression ( "," expression )* [","]\n\nAn expression list containing at least one comma yields a tuple. The\nlength of the tuple is the number of expressions in the list. The\nexpressions are evaluated from left to right.\n\nThe trailing comma is required only to create a single tuple (a.k.a. a\n*singleton*); it is optional in all other cases. A single expression\nwithout a trailing comma doesn\'t create a tuple, but rather yields the\nvalue of that expression. (To create an empty tuple, use an empty pair\nof parentheses: ``()``.)\n', 'floating': '\nFloating point literals\n***********************\n\nFloating point literals are described by the following lexical\ndefinitions:\n\n floatnumber ::= pointfloat | exponentfloat\n pointfloat ::= [intpart] fraction | intpart "."\n exponentfloat ::= (intpart | pointfloat) exponent\n intpart ::= digit+\n fraction ::= "." digit+\n exponent ::= ("e" | "E") ["+" | "-"] digit+\n\nNote that the integer and exponent parts are always interpreted using\nradix 10. For example, ``077e010`` is legal, and denotes the same\nnumber as ``77e10``. The allowed range of floating point literals is\nimplementation-dependent. Some examples of floating point literals:\n\n 3.14 10. .001 1e100 3.14e-10 0e0\n\nNote that numeric literals do not include a sign; a phrase like ``-1``\nis actually an expression composed of the unary operator ``-`` and the\nliteral ``1``.\n', 'for': '\nThe ``for`` statement\n*********************\n\nThe ``for`` statement is used to iterate over the elements of a\nsequence (such as a string, tuple or list) or other iterable object:\n\n for_stmt ::= "for" target_list "in" expression_list ":" suite\n ["else" ":" suite]\n\nThe expression list is evaluated once; it should yield an iterable\nobject. An iterator is created for the result of the\n``expression_list``. The suite is then executed once for each item\nprovided by the iterator, in the order of ascending indices. Each\nitem in turn is assigned to the target list using the standard rules\nfor assignments (see *Assignment statements*), and then the suite is\nexecuted. When the items are exhausted (which is immediately when the\nsequence is empty or an iterator raises a ``StopIteration``\nexception), the suite in the ``else`` clause, if present, is executed,\nand the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ncontinues with the next item, or with the ``else`` clause if there was\nno next item.\n\nThe suite may assign to the variable(s) in the target list; this does\nnot affect the next item assigned to it.\n\nNames in the target list are not deleted when the loop is finished,\nbut if the sequence is empty, it will not have been assigned to at all\nby the loop. Hint: the built-in function ``range()`` returns an\niterator of integers suitable to emulate the effect of Pascal\'s ``for\ni := a to b do``; e.g., ``range(3)`` returns the list ``[0, 1, 2]``.\n\nNote: There is a subtlety when the sequence is being modified by the loop\n (this can only occur for mutable sequences, i.e. lists). An\n internal counter is used to keep track of which item is used next,\n and this is incremented on each iteration. When this counter has\n reached the length of the sequence the loop terminates. This means\n that if the suite deletes the current (or a previous) item from the\n sequence, the next item will be skipped (since it gets the index of\n the current item which has already been treated). Likewise, if the\n suite inserts an item in the sequence before the current item, the\n current item will be treated again the next time through the loop.\n This can lead to nasty bugs that can be avoided by making a\n temporary copy using a slice of the whole sequence, e.g.,\n\n for x in a[:]:\n if x < 0: a.remove(x)\n', - 'formatstrings': '\nFormat String Syntax\n********************\n\nThe ``str.format()`` method and the ``Formatter`` class share the same\nsyntax for format strings (although in the case of ``Formatter``,\nsubclasses can define their own format string syntax.)\n\nFormat strings contain "replacement fields" surrounded by curly braces\n``{}``. Anything that is not contained in braces is considered literal\ntext, which is copied unchanged to the output. If you need to include\na brace character in the literal text, it can be escaped by doubling:\n``{{`` and ``}}``.\n\nThe grammar for a replacement field is as follows:\n\n replacement_field ::= "{" field_name ["!" conversion] [":" format_spec] "}"\n field_name ::= arg_name ("." attribute_name | "[" element_index "]")*\n arg_name ::= (identifier | integer)?\n attribute_name ::= identifier\n element_index ::= integer\n conversion ::= "r" | "s" | "a"\n format_spec ::= \n\nIn less formal terms, the replacement field starts with a *field_name*\nthat specifies the object whose value is to be formatted and inserted\ninto the output instead of the replacement field. The *field_name* is\noptionally followed by a *conversion* field, which is preceded by an\nexclamation point ``\'!\'``, and a *format_spec*, which is preceded by a\ncolon ``\':\'``. These specify a non-default format for the replacement\nvalue.\n\nThe *field_name* itself begins with an *arg_name* that is either\neither a number or a keyword. If it\'s a number, it refers to a\npositional argument, and if it\'s a keyword, it refers to a named\nkeyword argument. If the numerical arg_names in a format string are\n0, 1, 2, ... in sequence, they can all be omitted (not just some) and\nthe numbers 0, 1, 2, ... will be automatically inserted in that order.\nThe *arg_name* can be followed by any number of index or attribute\nexpressions. An expression of the form ``\'.name\'`` selects the named\nattribute using ``getattr()``, while an expression of the form\n``\'[index]\'`` does an index lookup using ``__getitem__()``.\n\nSome simple format string examples:\n\n "First, thou shalt count to {0}" # References first positional argument\n "Bring me a {}" # Implicitly references the first positional argument\n "From {} to {}" # Same as "From {0] to {1}"\n "My quest is {name}" # References keyword argument \'name\'\n "Weight in tons {0.weight}" # \'weight\' attribute of first positional arg\n "Units destroyed: {players[0]}" # First element of keyword argument \'players\'.\n\nThe *conversion* field causes a type coercion before formatting.\nNormally, the job of formatting a value is done by the\n``__format__()`` method of the value itself. However, in some cases\nit is desirable to force a type to be formatted as a string,\noverriding its own definition of formatting. By converting the value\nto a string before calling ``__format__()``, the normal formatting\nlogic is bypassed.\n\nThree conversion flags are currently supported: ``\'!s\'`` which calls\n``str()`` on the value, ``\'!r\'`` which calls ``repr()`` and ``\'!a\'``\nwhich calls ``ascii()``.\n\nSome examples:\n\n "Harold\'s a clever {0!s}" # Calls str() on the argument first\n "Bring out the holy {name!r}" # Calls repr() on the argument first\n\nThe *format_spec* field contains a specification of how the value\nshould be presented, including such details as field width, alignment,\npadding, decimal precision and so on. Each value type can define it\'s\nown "formatting mini-language" or interpretation of the *format_spec*.\n\nMost built-in types support a common formatting mini-language, which\nis described in the next section.\n\nA *format_spec* field can also include nested replacement fields\nwithin it. These nested replacement fields can contain only a field\nname; conversion flags and format specifications are not allowed. The\nreplacement fields within the format_spec are substituted before the\n*format_spec* string is interpreted. This allows the formatting of a\nvalue to be dynamically specified.\n\nFor example, suppose you wanted to have a replacement field whose\nfield width is determined by another variable:\n\n "A man with two {0:{1}}".format("noses", 10)\n\nThis would first evaluate the inner replacement field, making the\nformat string effectively:\n\n "A man with two {0:10}"\n\nThen the outer replacement field would be evaluated, producing:\n\n "noses "\n\nWhich is substituted into the string, yielding:\n\n "A man with two noses "\n\n(The extra space is because we specified a field width of 10, and\nbecause left alignment is the default for strings.)\n\n\nFormat Specification Mini-Language\n==================================\n\n"Format specifications" are used within replacement fields contained\nwithin a format string to define how individual values are presented\n(see *Format String Syntax*.) They can also be passed directly to the\nbuiltin ``format()`` function. Each formattable type may define how\nthe format specification is to be interpreted.\n\nMost built-in types implement the following options for format\nspecifications, although some of the formatting options are only\nsupported by the numeric types.\n\nA general convention is that an empty format string (``""``) produces\nthe same result as if you had called ``str()`` on the value.\n\nThe general form of a *standard format specifier* is:\n\n format_spec ::= [[fill]align][sign][#][0][width][.precision][type]\n fill ::= \n align ::= "<" | ">" | "=" | "^"\n sign ::= "+" | "-" | " "\n width ::= integer\n precision ::= integer\n type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%"\n\nThe *fill* character can be any character other than \'}\' (which\nsignifies the end of the field). The presence of a fill character is\nsignaled by the *next* character, which must be one of the alignment\noptions. If the second character of *format_spec* is not a valid\nalignment option, then it is assumed that both the fill character and\nthe alignment option are absent.\n\nThe meaning of the various alignment options is as follows:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'<\'`` | Forces the field to be left-aligned within the available |\n | | space (This is the default.) |\n +-----------+------------------------------------------------------------+\n | ``\'>\'`` | Forces the field to be right-aligned within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n | ``\'=\'`` | Forces the padding to be placed after the sign (if any) |\n | | but before the digits. This is used for printing fields |\n | | in the form \'+000000120\'. This alignment option is only |\n | | valid for numeric types. |\n +-----------+------------------------------------------------------------+\n | ``\'^\'`` | Forces the field to be centered within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n\nNote that unless a minimum field width is defined, the field width\nwill always be the same size as the data to fill it, so that the\nalignment option has no meaning in this case.\n\nThe *sign* option is only valid for number types, and can be one of\nthe following:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'+\'`` | indicates that a sign should be used for both positive as |\n | | well as negative numbers. |\n +-----------+------------------------------------------------------------+\n | ``\'-\'`` | indicates that a sign should be used only for negative |\n | | numbers (this is the default behavior). |\n +-----------+------------------------------------------------------------+\n | space | indicates that a leading space should be used on positive |\n | | numbers, and a minus sign on negative numbers. |\n +-----------+------------------------------------------------------------+\n\nThe ``\'#\'`` option is only valid for integers, and only for binary,\noctal, or hexadecimal output. If present, it specifies that the\noutput will be prefixed by ``\'0b\'``, ``\'0o\'``, or ``\'0x\'``,\nrespectively.\n\n*width* is a decimal integer defining the minimum field width. If not\nspecified, then the field width will be determined by the content.\n\nIf the *width* field is preceded by a zero (``\'0\'``) character, this\nenables zero-padding. This is equivalent to an *alignment* type of\n``\'=\'`` and a *fill* character of ``\'0\'``.\n\nThe *precision* is a decimal number indicating how many digits should\nbe displayed after the decimal point for a floating point value\nformatted with ``\'f\'`` and ``\'F\'``, or before and after the decimal\npoint for a floating point value formatted with ``\'g\'`` or ``\'G\'``.\nFor non-number types the field indicates the maximum field size - in\nother words, how many characters will be used from the field content.\nThe *precision* is ignored for integer values.\n\nFinally, the *type* determines how the data should be presented.\n\nThe available integer presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'b\'`` | Binary format. Outputs the number in base 2. |\n +-----------+------------------------------------------------------------+\n | ``\'c\'`` | Character. Converts the integer to the corresponding |\n | | unicode character before printing. |\n +-----------+------------------------------------------------------------+\n | ``\'d\'`` | Decimal Integer. Outputs the number in base 10. |\n +-----------+------------------------------------------------------------+\n | ``\'o\'`` | Octal format. Outputs the number in base 8. |\n +-----------+------------------------------------------------------------+\n | ``\'x\'`` | Hex format. Outputs the number in base 16, using lower- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'X\'`` | Hex format. Outputs the number in base 16, using upper- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'d\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'d\'``. |\n +-----------+------------------------------------------------------------+\n\nThe available presentation types for floating point and decimal values\nare:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'e\'`` | Exponent notation. Prints the number in scientific |\n | | notation using the letter \'e\' to indicate the exponent. |\n +-----------+------------------------------------------------------------+\n | ``\'E\'`` | Exponent notation. Same as ``\'e\'`` except it uses an upper |\n | | case \'E\' as the separator character. |\n +-----------+------------------------------------------------------------+\n | ``\'f\'`` | Fixed point. Displays the number as a fixed-point number. |\n +-----------+------------------------------------------------------------+\n | ``\'F\'`` | Fixed point. Same as ``\'f\'``, but converts ``nan`` to |\n | | ``NAN`` and ``inf`` to ``INF``. |\n +-----------+------------------------------------------------------------+\n | ``\'g\'`` | General format. This prints the number as a fixed-point |\n | | number, unless the number is too large, in which case it |\n | | switches to ``\'e\'`` exponent notation. Infinity and NaN |\n | | values are formatted as ``inf``, ``-inf`` and ``nan``, |\n | | respectively. |\n +-----------+------------------------------------------------------------+\n | ``\'G\'`` | General format. Same as ``\'g\'`` except switches to ``\'E\'`` |\n | | if the number gets to large. The representations of |\n | | infinity and NaN are uppercased, too. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'g\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | ``\'%\'`` | Percentage. Multiplies the number by 100 and displays in |\n | | fixed (``\'f\'``) format, followed by a percent sign. |\n +-----------+------------------------------------------------------------+\n | None | Similar to ``\'g\'``, except with at least one digit past |\n | | the decimal point and a default precision of 12. This is |\n | | intended to match ``str()``, except you can add the other |\n | | format modifiers. |\n +-----------+------------------------------------------------------------+\n', + 'formatstrings': '\nFormat String Syntax\n********************\n\nThe ``str.format()`` method and the ``Formatter`` class share the same\nsyntax for format strings (although in the case of ``Formatter``,\nsubclasses can define their own format string syntax.)\n\nFormat strings contain "replacement fields" surrounded by curly braces\n``{}``. Anything that is not contained in braces is considered literal\ntext, which is copied unchanged to the output. If you need to include\na brace character in the literal text, it can be escaped by doubling:\n``{{`` and ``}}``.\n\nThe grammar for a replacement field is as follows:\n\n replacement_field ::= "{" field_name ["!" conversion] [":" format_spec] "}"\n field_name ::= arg_name ("." attribute_name | "[" element_index "]")*\n arg_name ::= (identifier | integer)?\n attribute_name ::= identifier\n element_index ::= integer\n conversion ::= "r" | "s" | "a"\n format_spec ::= \n\nIn less formal terms, the replacement field starts with a *field_name*\nthat specifies the object whose value is to be formatted and inserted\ninto the output instead of the replacement field. The *field_name* is\noptionally followed by a *conversion* field, which is preceded by an\nexclamation point ``\'!\'``, and a *format_spec*, which is preceded by a\ncolon ``\':\'``. These specify a non-default format for the replacement\nvalue.\n\nThe *field_name* itself begins with an *arg_name* that is either\neither a number or a keyword. If it\'s a number, it refers to a\npositional argument, and if it\'s a keyword, it refers to a named\nkeyword argument. If the numerical arg_names in a format string are\n0, 1, 2, ... in sequence, they can all be omitted (not just some) and\nthe numbers 0, 1, 2, ... will be automatically inserted in that order.\nThe *arg_name* can be followed by any number of index or attribute\nexpressions. An expression of the form ``\'.name\'`` selects the named\nattribute using ``getattr()``, while an expression of the form\n``\'[index]\'`` does an index lookup using ``__getitem__()``.\n\nSome simple format string examples:\n\n "First, thou shalt count to {0}" # References first positional argument\n "Bring me a {}" # Implicitly references the first positional argument\n "From {} to {}" # Same as "From {0] to {1}"\n "My quest is {name}" # References keyword argument \'name\'\n "Weight in tons {0.weight}" # \'weight\' attribute of first positional arg\n "Units destroyed: {players[0]}" # First element of keyword argument \'players\'.\n\nThe *conversion* field causes a type coercion before formatting.\nNormally, the job of formatting a value is done by the\n``__format__()`` method of the value itself. However, in some cases\nit is desirable to force a type to be formatted as a string,\noverriding its own definition of formatting. By converting the value\nto a string before calling ``__format__()``, the normal formatting\nlogic is bypassed.\n\nThree conversion flags are currently supported: ``\'!s\'`` which calls\n``str()`` on the value, ``\'!r\'`` which calls ``repr()`` and ``\'!a\'``\nwhich calls ``ascii()``.\n\nSome examples:\n\n "Harold\'s a clever {0!s}" # Calls str() on the argument first\n "Bring out the holy {name!r}" # Calls repr() on the argument first\n\nThe *format_spec* field contains a specification of how the value\nshould be presented, including such details as field width, alignment,\npadding, decimal precision and so on. Each value type can define it\'s\nown "formatting mini-language" or interpretation of the *format_spec*.\n\nMost built-in types support a common formatting mini-language, which\nis described in the next section.\n\nA *format_spec* field can also include nested replacement fields\nwithin it. These nested replacement fields can contain only a field\nname; conversion flags and format specifications are not allowed. The\nreplacement fields within the format_spec are substituted before the\n*format_spec* string is interpreted. This allows the formatting of a\nvalue to be dynamically specified.\n\nFor example, suppose you wanted to have a replacement field whose\nfield width is determined by another variable:\n\n "A man with two {0:{1}}".format("noses", 10)\n\nThis would first evaluate the inner replacement field, making the\nformat string effectively:\n\n "A man with two {0:10}"\n\nThen the outer replacement field would be evaluated, producing:\n\n "noses "\n\nWhich is substituted into the string, yielding:\n\n "A man with two noses "\n\n(The extra space is because we specified a field width of 10, and\nbecause left alignment is the default for strings.)\n\n\nFormat Specification Mini-Language\n==================================\n\n"Format specifications" are used within replacement fields contained\nwithin a format string to define how individual values are presented\n(see *Format String Syntax*.) They can also be passed directly to the\nbuiltin ``format()`` function. Each formattable type may define how\nthe format specification is to be interpreted.\n\nMost built-in types implement the following options for format\nspecifications, although some of the formatting options are only\nsupported by the numeric types.\n\nA general convention is that an empty format string (``""``) produces\nthe same result as if you had called ``str()`` on the value.\n\nThe general form of a *standard format specifier* is:\n\n format_spec ::= [[fill]align][sign][#][0][width][.precision][type]\n fill ::= \n align ::= "<" | ">" | "=" | "^"\n sign ::= "+" | "-" | " "\n width ::= integer\n precision ::= integer\n type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "x" | "X" | "%"\n\nThe *fill* character can be any character other than \'}\' (which\nsignifies the end of the field). The presence of a fill character is\nsignaled by the *next* character, which must be one of the alignment\noptions. If the second character of *format_spec* is not a valid\nalignment option, then it is assumed that both the fill character and\nthe alignment option are absent.\n\nThe meaning of the various alignment options is as follows:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'<\'`` | Forces the field to be left-aligned within the available |\n | | space (This is the default.) |\n +-----------+------------------------------------------------------------+\n | ``\'>\'`` | Forces the field to be right-aligned within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n | ``\'=\'`` | Forces the padding to be placed after the sign (if any) |\n | | but before the digits. This is used for printing fields |\n | | in the form \'+000000120\'. This alignment option is only |\n | | valid for numeric types. |\n +-----------+------------------------------------------------------------+\n | ``\'^\'`` | Forces the field to be centered within the available |\n | | space. |\n +-----------+------------------------------------------------------------+\n\nNote that unless a minimum field width is defined, the field width\nwill always be the same size as the data to fill it, so that the\nalignment option has no meaning in this case.\n\nThe *sign* option is only valid for number types, and can be one of\nthe following:\n\n +-----------+------------------------------------------------------------+\n | Option | Meaning |\n +===========+============================================================+\n | ``\'+\'`` | indicates that a sign should be used for both positive as |\n | | well as negative numbers. |\n +-----------+------------------------------------------------------------+\n | ``\'-\'`` | indicates that a sign should be used only for negative |\n | | numbers (this is the default behavior). |\n +-----------+------------------------------------------------------------+\n | space | indicates that a leading space should be used on positive |\n | | numbers, and a minus sign on negative numbers. |\n +-----------+------------------------------------------------------------+\n\nThe ``\'#\'`` option is only valid for integers, and only for binary,\noctal, or hexadecimal output. If present, it specifies that the\noutput will be prefixed by ``\'0b\'``, ``\'0o\'``, or ``\'0x\'``,\nrespectively.\n\n*width* is a decimal integer defining the minimum field width. If not\nspecified, then the field width will be determined by the content.\n\nIf the *width* field is preceded by a zero (``\'0\'``) character, this\nenables zero-padding. This is equivalent to an *alignment* type of\n``\'=\'`` and a *fill* character of ``\'0\'``.\n\nThe *precision* is a decimal number indicating how many digits should\nbe displayed after the decimal point for a floating point value\nformatted with ``\'f\'`` and ``\'F\'``, or before and after the decimal\npoint for a floating point value formatted with ``\'g\'`` or ``\'G\'``.\nFor non-number types the field indicates the maximum field size - in\nother words, how many characters will be used from the field content.\nThe *precision* is not allowed for integer values.\n\nFinally, the *type* determines how the data should be presented.\n\nThe available integer presentation types are:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'b\'`` | Binary format. Outputs the number in base 2. |\n +-----------+------------------------------------------------------------+\n | ``\'c\'`` | Character. Converts the integer to the corresponding |\n | | unicode character before printing. |\n +-----------+------------------------------------------------------------+\n | ``\'d\'`` | Decimal Integer. Outputs the number in base 10. |\n +-----------+------------------------------------------------------------+\n | ``\'o\'`` | Octal format. Outputs the number in base 8. |\n +-----------+------------------------------------------------------------+\n | ``\'x\'`` | Hex format. Outputs the number in base 16, using lower- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'X\'`` | Hex format. Outputs the number in base 16, using upper- |\n | | case letters for the digits above 9. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'d\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | None | The same as ``\'d\'``. |\n +-----------+------------------------------------------------------------+\n\nThe available presentation types for floating point and decimal values\nare:\n\n +-----------+------------------------------------------------------------+\n | Type | Meaning |\n +===========+============================================================+\n | ``\'e\'`` | Exponent notation. Prints the number in scientific |\n | | notation using the letter \'e\' to indicate the exponent. |\n +-----------+------------------------------------------------------------+\n | ``\'E\'`` | Exponent notation. Same as ``\'e\'`` except it uses an upper |\n | | case \'E\' as the separator character. |\n +-----------+------------------------------------------------------------+\n | ``\'f\'`` | Fixed point. Displays the number as a fixed-point number. |\n +-----------+------------------------------------------------------------+\n | ``\'F\'`` | Fixed point. Same as ``\'f\'``, but converts ``nan`` to |\n | | ``NAN`` and ``inf`` to ``INF``. |\n +-----------+------------------------------------------------------------+\n | ``\'g\'`` | General format. This prints the number as a fixed-point |\n | | number, unless the number is too large, in which case it |\n | | switches to ``\'e\'`` exponent notation. Infinity and NaN |\n | | values are formatted as ``inf``, ``-inf`` and ``nan``, |\n | | respectively. |\n +-----------+------------------------------------------------------------+\n | ``\'G\'`` | General format. Same as ``\'g\'`` except switches to ``\'E\'`` |\n | | if the number gets to large. The representations of |\n | | infinity and NaN are uppercased, too. |\n +-----------+------------------------------------------------------------+\n | ``\'n\'`` | Number. This is the same as ``\'g\'``, except that it uses |\n | | the current locale setting to insert the appropriate |\n | | number separator characters. |\n +-----------+------------------------------------------------------------+\n | ``\'%\'`` | Percentage. Multiplies the number by 100 and displays in |\n | | fixed (``\'f\'``) format, followed by a percent sign. |\n +-----------+------------------------------------------------------------+\n | None | Similar to ``\'g\'``, except with at least one digit past |\n | | the decimal point and a default precision of 12. This is |\n | | intended to match ``str()``, except you can add the other |\n | | format modifiers. |\n +-----------+------------------------------------------------------------+\n', 'function': '\nFunction definitions\n********************\n\nA function definition defines a user-defined function object (see\nsection *The standard type hierarchy*):\n\n funcdef ::= [decorators] "def" funcname "(" [parameter_list] ")" ["->" expression] ":" suite\n decorators ::= decorator+\n decorator ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE\n dotted_name ::= identifier ("." identifier)*\n parameter_list ::= (defparameter ",")*\n ( "*" [parameter] ("," defparameter)*\n [, "**" parameter]\n | "**" parameter\n | defparameter [","] )\n parameter ::= identifier [":" expression]\n defparameter ::= parameter ["=" expression]\n funcname ::= identifier\n\nA function definition is an executable statement. Its execution binds\nthe function name in the current local namespace to a function object\n(a wrapper around the executable code for the function). This\nfunction object contains a reference to the current global namespace\nas the global namespace to be used when the function is called.\n\nThe function definition does not execute the function body; this gets\nexecuted only when the function is called. [3]\n\nA function definition may be wrapped by one or more *decorator*\nexpressions. Decorator expressions are evaluated when the function is\ndefined, in the scope that contains the function definition. The\nresult must be a callable, which is invoked with the function object\nas the only argument. The returned value is bound to the function name\ninstead of the function object. Multiple decorators are applied in\nnested fashion. For example, the following code\n\n @f1(arg)\n @f2\n def func(): pass\n\nis equivalent to\n\n def func(): pass\n func = f1(arg)(f2(func))\n\nWhen one or more parameters have the form *parameter* ``=``\n*expression*, the function is said to have "default parameter values."\nFor a parameter with a default value, the corresponding argument may\nbe omitted from a call, in which case the parameter\'s default value is\nsubstituted. If a parameter has a default value, all following\nparameters up until the "``*``" must also have a default value ---\nthis is a syntactic restriction that is not expressed by the grammar.\n\n**Default parameter values are evaluated when the function definition\nis executed.** This means that the expression is evaluated once, when\nthe function is defined, and that that same "pre-computed" value is\nused for each call. This is especially important to understand when a\ndefault parameter is a mutable object, such as a list or a dictionary:\nif the function modifies the object (e.g. by appending an item to a\nlist), the default value is in effect modified. This is generally not\nwhat was intended. A way around this is to use ``None`` as the\ndefault, and explicitly test for it in the body of the function, e.g.:\n\n def whats_on_the_telly(penguin=None):\n if penguin is None:\n penguin = []\n penguin.append("property of the zoo")\n return penguin\n\nFunction call semantics are described in more detail in section\n*Calls*. A function call always assigns values to all parameters\nmentioned in the parameter list, either from position arguments, from\nkeyword arguments, or from default values. If the form\n"``*identifier``" is present, it is initialized to a tuple receiving\nany excess positional parameters, defaulting to the empty tuple. If\nthe form "``**identifier``" is present, it is initialized to a new\ndictionary receiving any excess keyword arguments, defaulting to a new\nempty dictionary. Parameters after "``*``" or "``*identifier``" are\nkeyword-only parameters and may only be passed used keyword arguments.\n\nParameters may have annotations of the form "``: expression``"\nfollowing the parameter name. Any parameter may have an annotation\neven those of the form ``*identifier`` or ``**identifier``. Functions\nmay have "return" annotation of the form "``-> expression``" after the\nparameter list. These annotations can be any valid Python expression\nand are evaluated when the function definition is executed.\nAnnotations may be evaluated in a different order than they appear in\nthe source code. The presence of annotations does not change the\nsemantics of a function. The annotation values are available as\nvalues of a dictionary keyed by the parameters\' names in the\n``__annotations__`` attribute of the function object.\n\nIt is also possible to create anonymous functions (functions not bound\nto a name), for immediate use in expressions. This uses lambda forms,\ndescribed in section *Lambdas*. Note that the lambda form is merely a\nshorthand for a simplified function definition; a function defined in\na "``def``" statement can be passed around or assigned to another name\njust like a function defined by a lambda form. The "``def``" form is\nactually more powerful since it allows the execution of multiple\nstatements and annotations.\n\n**Programmer\'s note:** Functions are first-class objects. A "``def``"\nform executed inside a function definition defines a local function\nthat can be returned or passed around. Free variables used in the\nnested function can access the local variables of the function\ncontaining the def. See section *Naming and binding* for details.\n', 'global': '\nThe ``global`` statement\n************************\n\n global_stmt ::= "global" identifier ("," identifier)*\n\nThe ``global`` statement is a declaration which holds for the entire\ncurrent code block. It means that the listed identifiers are to be\ninterpreted as globals. It would be impossible to assign to a global\nvariable without ``global``, although free variables may refer to\nglobals without being declared global.\n\nNames listed in a ``global`` statement must not be used in the same\ncode block textually preceding that ``global`` statement.\n\nNames listed in a ``global`` statement must not be defined as formal\nparameters or in a ``for`` loop control target, ``class`` definition,\nfunction definition, or ``import`` statement.\n\n(The current implementation does not enforce the latter two\nrestrictions, but programs should not abuse this freedom, as future\nimplementations may enforce them or silently change the meaning of the\nprogram.)\n\n**Programmer\'s note:** the ``global`` is a directive to the parser.\nIt applies only to code parsed at the same time as the ``global``\nstatement. In particular, a ``global`` statement contained in a string\nor code object supplied to the builtin ``exec()`` function does not\naffect the code block *containing* the function call, and code\ncontained in such a string is unaffected by ``global`` statements in\nthe code containing the function call. The same applies to the\n``eval()`` and ``compile()`` functions.\n', 'id-classes': '\nReserved classes of identifiers\n*******************************\n\nCertain classes of identifiers (besides keywords) have special\nmeanings. These classes are identified by the patterns of leading and\ntrailing underscore characters:\n\n``_*``\n Not imported by ``from module import *``. The special identifier\n ``_`` is used in the interactive interpreter to store the result of\n the last evaluation; it is stored in the ``builtins`` module. When\n not in interactive mode, ``_`` has no special meaning and is not\n defined. See section *The import statement*.\n\n Note: The name ``_`` is often used in conjunction with\n internationalization; refer to the documentation for the\n ``gettext`` module for more information on this convention.\n\n``__*__``\n System-defined names. These names are defined by the interpreter\n and its implementation (including the standard library);\n applications should not expect to define additional names using\n this convention. The set of names of this class defined by Python\n may be extended in future versions. See section *Special method\n names*.\n\n``__*``\n Class-private names. Names in this category, when used within the\n context of a class definition, are re-written to use a mangled form\n to help avoid name clashes between "private" attributes of base and\n derived classes. See section *Identifiers (Names)*.\n', @@ -55,11 +55,11 @@ 'power': '\nThe power operator\n******************\n\nThe power operator binds more tightly than unary operators on its\nleft; it binds less tightly than unary operators on its right. The\nsyntax is:\n\n power ::= primary ["**" u_expr]\n\nThus, in an unparenthesized sequence of power and unary operators, the\noperators are evaluated from right to left (this does not constrain\nthe evaluation order for the operands): ``-1**2`` results in ``-1``.\n\nThe power operator has the same semantics as the built-in ``pow()``\nfunction, when called with two arguments: it yields its left argument\nraised to the power of its right argument. The numeric arguments are\nfirst converted to a common type, and the result is of that type.\n\nFor int operands, the result has the same type as the operands unless\nthe second argument is negative; in that case, all arguments are\nconverted to float and a float result is delivered. For example,\n``10**2`` returns ``100``, but ``10**-2`` returns ``0.01``.\n\nRaising ``0.0`` to a negative power results in a\n``ZeroDivisionError``. Raising a negative number to a fractional power\nresults in a ``complex`` number. (In earlier versions it raised a\n``ValueError``.)\n', 'raise': '\nThe ``raise`` statement\n***********************\n\n raise_stmt ::= "raise" [expression ["from" expression]]\n\nIf no expressions are present, ``raise`` re-raises the last exception\nthat was active in the current scope. If no exception is active in\nthe current scope, a ``TypeError`` exception is raised indicating that\nthis is an error (if running under IDLE, a ``queue.Empty`` exception\nis raised instead).\n\nOtherwise, ``raise`` evaluates the first expression as the exception\nobject. It must be either a subclass or an instance of\n``BaseException``. If it is a class, the exception instance will be\nobtained when needed by instantiating the class with no arguments.\n\nThe *type* of the exception is the exception instance\'s class, the\n*value* is the instance itself.\n\nA traceback object is normally created automatically when an exception\nis raised and attached to it as the ``__traceback__`` attribute, which\nis writable. You can create an exception and set your own traceback in\none step using the ``with_traceback()`` exception method (which\nreturns the same exception instance, with its traceback set to its\nargument), like so:\n\n raise Exception("foo occurred").with_traceback(tracebackobj)\n\nThe ``from`` clause is used for exception chaining: if given, the\nsecond *expression* must be another exception class or instance, which\nwill then be attached to the raised exception as the ``__cause__``\nattribute (which is writable). If the raised exception is not\nhandled, both exceptions will be printed:\n\n >>> try:\n ... print(1 / 0)\n ... except Exception as exc:\n ... raise RuntimeError("Something bad happened") from exc\n ...\n Traceback (most recent call last):\n File "", line 2, in \n ZeroDivisionError: int division or modulo by zero\n\n The above exception was the direct cause of the following exception:\n\n Traceback (most recent call last):\n File "", line 4, in \n RuntimeError: Something bad happened\n\nA similar mechanism works implicitly if an exception is raised inside\nan exception handler: the previous exception is then attached as the\nnew exception\'s ``__context__`` attribute:\n\n >>> try:\n ... print(1 / 0)\n ... except:\n ... raise RuntimeError("Something bad happened")\n ...\n Traceback (most recent call last):\n File "", line 2, in \n ZeroDivisionError: int division or modulo by zero\n\n During handling of the above exception, another exception occurred:\n\n Traceback (most recent call last):\n File "", line 4, in \n RuntimeError: Something bad happened\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information about handling exceptions is in section\n*The try statement*.\n', 'return': '\nThe ``return`` statement\n************************\n\n return_stmt ::= "return" [expression_list]\n\n``return`` may only occur syntactically nested in a function\ndefinition, not within a nested class definition.\n\nIf an expression list is present, it is evaluated, else ``None`` is\nsubstituted.\n\n``return`` leaves the current function call with the expression list\n(or ``None``) as return value.\n\nWhen ``return`` passes control out of a ``try`` statement with a\n``finally`` clause, that ``finally`` clause is executed before really\nleaving the function.\n\nIn a generator function, the ``return`` statement is not allowed to\ninclude an **expression_list**. In that context, a bare ``return``\nindicates that the generator is done and will cause ``StopIteration``\nto be raised.\n', - 'sequence-types': "\nEmulating container types\n*************************\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``get()``,\n``clear()``, ``setdefault()``, ``pop()``, ``popitem()``, ``copy()``,\nand ``update()`` behaving similar to those for Python's standard\ndictionary objects. The ``collections`` module provides a\n``MutableMapping`` abstract base class to help create those methods\nfrom a base set of ``__getitem__()``, ``__setitem__()``,\n``__delitem__()``, and ``keys()``. Mutable sequences should provide\nmethods ``append()``, ``count()``, ``index()``, ``extend()``,\n``insert()``, ``pop()``, ``remove()``, ``reverse()`` and ``sort()``,\nlike Python standard list objects. Finally, sequence types should\nimplement addition (meaning concatenation) and multiplication (meaning\nrepetition) by defining the methods ``__add__()``, ``__radd__()``,\n``__iadd__()``, ``__mul__()``, ``__rmul__()`` and ``__imul__()``\ndescribed below; they should not define other numerical operators. It\nis recommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should search the mapping's keys; for\nsequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``keys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn't define a ``__bool__()`` method and whose ``__len__()``\n method returns zero is considered to be false in a Boolean context.\n\nNote: Slicing is done exclusively with the following three methods. A\n call like\n\n a[1:2] = b\n\n is translated to\n\n a[slice(1, 2, None)] = b\n\n and so forth. Missing slice items are always filled in with\n ``None``.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``keys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n", + 'sequence-types': "\nEmulating container types\n*************************\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``get()``,\n``clear()``, ``setdefault()``, ``pop()``, ``popitem()``, ``copy()``,\nand ``update()`` behaving similar to those for Python's standard\ndictionary objects. The ``collections`` module provides a\n``MutableMapping`` abstract base class to help create those methods\nfrom a base set of ``__getitem__()``, ``__setitem__()``,\n``__delitem__()``, and ``keys()``. Mutable sequences should provide\nmethods ``append()``, ``count()``, ``index()``, ``extend()``,\n``insert()``, ``pop()``, ``remove()``, ``reverse()`` and ``sort()``,\nlike Python standard list objects. Finally, sequence types should\nimplement addition (meaning concatenation) and multiplication (meaning\nrepetition) by defining the methods ``__add__()``, ``__radd__()``,\n``__iadd__()``, ``__mul__()``, ``__rmul__()`` and ``__imul__()``\ndescribed below; they should not define other numerical operators. It\nis recommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should search the mapping's keys; for\nsequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``keys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn't define a ``__bool__()`` method and whose ``__len__()``\n method returns zero is considered to be false in a Boolean context.\n\nNote: Slicing is done exclusively with the following three methods. A\n call like\n\n a[1:2] = b\n\n is translated to\n\n a[slice(1, 2, None)] = b\n\n and so forth. Missing slice items are always filled in with\n ``None``.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``keys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects that\n support the sequence protocol should only provide\n ``__reversed__()`` if they can provide an implementation that is\n more efficient than the one provided by ``reversed()``.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n", 'shifting': '\nShifting operations\n*******************\n\nThe shifting operations have lower priority than the arithmetic\noperations:\n\n shift_expr ::= a_expr | shift_expr ( "<<" | ">>" ) a_expr\n\nThese operators accept integers as arguments. They shift the first\nargument to the left or right by the number of bits given by the\nsecond argument.\n\nA right shift by *n* bits is defined as division by ``pow(2,n)``. A\nleft shift by *n* bits is defined as multiplication with ``pow(2,n)``.\n', 'slicings': '\nSlicings\n********\n\nA slicing selects a range of items in a sequence object (e.g., a\nstring, tuple or list). Slicings may be used as expressions or as\ntargets in assignment or ``del`` statements. The syntax for a\nslicing:\n\n slicing ::= primary "[" slice_list "]"\n slice_list ::= slice_item ("," slice_item)* [","]\n slice_item ::= expression | proper_slice\n proper_slice ::= [lower_bound] ":" [upper_bound] [ ":" [stride] ]\n lower_bound ::= expression\n upper_bound ::= expression\n stride ::= expression\n\nThere is ambiguity in the formal syntax here: anything that looks like\nan expression list also looks like a slice list, so any subscription\ncan be interpreted as a slicing. Rather than further complicating the\nsyntax, this is disambiguated by defining that in this case the\ninterpretation as a subscription takes priority over the\ninterpretation as a slicing (this is the case if the slice list\ncontains no proper slice).\n\nThe semantics for a slicing are as follows. The primary must evaluate\nto a mapping object, and it is indexed (using the same\n``__getitem__()`` method as normal subscription) with a key that is\nconstructed from the slice list, as follows. If the slice list\ncontains at least one comma, the key is a tuple containing the\nconversion of the slice items; otherwise, the conversion of the lone\nslice item is the key. The conversion of a slice item that is an\nexpression is that expression. The conversion of a proper slice is a\nslice object (see section *The standard type hierarchy*) whose\n``start``, ``stop`` and ``step`` attributes are the values of the\nexpressions given as lower bound, upper bound and stride,\nrespectively, substituting ``None`` for missing expressions.\n', 'specialattrs': "\nSpecial Attributes\n******************\n\nThe implementation adds a few special read-only attributes to several\nobject types, where they are relevant. Some of these are not reported\nby the ``dir()`` built-in function.\n\nobject.__dict__\n\n A dictionary or other mapping object used to store an object's\n (writable) attributes.\n\ninstance.__class__\n\n The class to which a class instance belongs.\n\nclass.__bases__\n\n The tuple of base classes of a class object. If there are no base\n classes, this will be an empty tuple.\n\nclass.__name__\n\n The name of the class or type.\n\nThe following attributes are only supported by *new-style class*es.\n\nclass.__mro__\n\n This attribute is a tuple of classes that are considered when\n looking for base classes during method resolution.\n\nclass.mro()\n\n This method can be overridden by a metaclass to customize the\n method resolution order for its instances. It is called at class\n instantiation, and its result is stored in ``__mro__``.\n\nclass.__subclasses__()\n\n Each new-style class keeps a list of weak references to its\n immediate subclasses. This method returns a list of all those\n references still alive. Example:\n\n >>> int.__subclasses__()\n []\n\n-[ Footnotes ]-\n\n[1] Additional information on these special methods may be found in\n the Python Reference Manual (*Basic customization*).\n\n[2] As a consequence, the list ``[1, 2]`` is considered equal to\n ``[1.0, 2.0]``, and similarly for tuples.\n\n[3] They must have since the parser can't tell the type of the\n operands.\n\n[4] To format only a tuple you should therefore provide a singleton\n tuple whose only element is the tuple to be formatted.\n\n[5] The advantage of leaving the newline on is that returning an empty\n string is then an unambiguous EOF indication. It is also possible\n (in cases where it might matter, for example, if you want to make\n an exact copy of a file while scanning its lines) to tell whether\n the last line of a file ended in a newline or not (yes this\n happens!).\n", - 'specialnames': '\nSpecial method names\n********************\n\nA class can implement certain operations that are invoked by special\nsyntax (such as arithmetic operations or subscripting and slicing) by\ndefining methods with special names. This is Python\'s approach to\n*operator overloading*, allowing classes to define their own behavior\nwith respect to language operators. For instance, if a class defines\na method named ``__getitem__()``, and ``x`` is an instance of this\nclass, then ``x[i]`` is roughly equivalent to ``type(x).__getitem__(x,\ni)``. Except where mentioned, attempts to execute an operation raise\nan exception when no appropriate method is defined (typically\n``AttributeError`` or ``TypeError``).\n\nWhen implementing a class that emulates any built-in type, it is\nimportant that the emulation only be implemented to the degree that it\nmakes sense for the object being modelled. For example, some\nsequences may work well with retrieval of individual elements, but\nextracting a slice may not make sense. (One example of this is the\n``NodeList`` interface in the W3C\'s Document Object Model.)\n\n\nBasic customization\n===================\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_info()[2]`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.last_traceback``. Circular references which are garbage are\n detected when the option cycle detector is enabled (it\'s on by\n default), but can only be cleaned up if there are no Python-\n level ``__del__()`` methods involved. Refer to the documentation\n for the ``gc`` module for more information about how\n ``__del__()`` methods are handled by the cycle detector,\n particularly the description of the ``garbage`` value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted or in the process of being torn down (e.g. the\n import machinery shutting down). For this reason, ``__del__()``\n methods should do the absolute minimum needed to maintain\n external invariants. Starting with version 1.5, Python\n guarantees that globals whose name begins with a single\n underscore are deleted from their module before other globals are\n deleted; if no other references to such globals exist, this may\n help in assuring that imported modules are still available at the\n time when the ``__del__()`` method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function to compute the\n "official" string representation of an object. If at all possible,\n this should look like a valid Python expression that could be used\n to recreate an object with the same value (given an appropriate\n environment). If this is not possible, a string of the form\n ``<...some useful description...>`` should be returned. The return\n value must be a string object. If a class defines ``__repr__()``\n but not ``__str__()``, then ``__repr__()`` is also used when an\n "informal" string representation of instances of that class is\n required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print()``\n function to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__format__(self, format_spec)\n\n Called by the ``format()`` built-in function (and by extension, the\n ``format()`` method of class ``str``) to produce a "formatted"\n string representation of an object. The ``format_spec`` argument is\n a string that contains a description of the formatting options\n desired. The interpretation of the ``format_spec`` argument is up\n to the type implementing ``__format__()``, however most classes\n will either delegate formatting to one of the built-in types, or\n use a similar formatting option syntax.\n\n See *Format Specification Mini-Language* for a description of the\n standard formatting syntax.\n\n The return value must be a string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n These are the so-called "rich comparison" methods. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` calls ``x.__gt__(y)``, and ``x>=y`` calls\n ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\n To automatically generate ordering operations from a single root\n operation, see the Total Ordering recipe in the ASPN cookbook.\n\nobject.__hash__(self)\n\n Called by built-in function ``hash()`` and for operations on\n members of hashed collections including ``set``, ``frozenset``, and\n ``dict``. ``__hash__()`` should return an integer. The only\n required property is that objects which compare equal have the same\n hash value; it is advised to somehow mix together (e.g. using\n exclusive or) the hash values for the components of the object that\n also play a part in comparison of objects.\n\n If a class does not define an ``__eq__()`` method it should not\n define a ``__hash__()`` operation either; if it defines\n ``__eq__()`` but not ``__hash__()``, its instances will not be\n usable as items in hashable collections. If a class defines\n mutable objects and implements an ``__eq__()`` method, it should\n not implement ``__hash__()``, since the implementation of hashable\n collections requires that a key\'s hash value is immutable (if the\n object\'s hash value changes, it will be in the wrong hash bucket).\n\n User-defined classes have ``__eq__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal (except with\n themselves) and ``x.__hash__()`` returns ``id(x)``.\n\n Classes which inherit a ``__hash__()`` method from a parent class\n but change the meaning of ``__eq__()`` such that the hash value\n returned is no longer appropriate (e.g. by switching to a value-\n based concept of equality instead of the default identity based\n equality) can explicitly flag themselves as being unhashable by\n setting ``__hash__ = None`` in the class definition. Doing so means\n that not only will instances of the class raise an appropriate\n ``TypeError`` when a program attempts to retrieve their hash value,\n but they will also be correctly identified as unhashable when\n checking ``isinstance(obj, collections.Hashable)`` (unlike classes\n which define their own ``__hash__()`` to explicitly raise\n ``TypeError``).\n\n If a class that overrides ``__eq__()`` needs to retain the\n implementation of ``__hash__()`` from a parent class, the\n interpreter must be told this explicitly by setting ``__hash__ =\n .__hash__``. Otherwise the inheritance of\n ``__hash__()`` will be blocked, just as if ``__hash__`` had been\n explicitly set to ``None``.\n\nobject.__bool__(self)\n\n Called to implement truth value testing and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined, and the object is\n considered true if its result is nonzero. If a class defines\n neither ``__len__()`` nor ``__bool__()``, all its instances are\n considered true.\n\n\nCustomizing attribute access\n============================\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__getattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control over attribute access.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n Note: This method may still be bypassed when looking up special methods\n as the result of implicit invocation via language syntax or\n builtin functions. See *Special method lookup*.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should call the base class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\nobject.__dir__(self)\n\n Called when ``dir()`` is called on the object. A list must be\n returned.\n\n\nImplementing Descriptors\n------------------------\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another class, known as the *owner* class. In the\nexamples below, "the attribute" refers to the attribute whose name is\nthe key of the property in the owner class\' ``__dict__``.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n--------------------\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called.\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to an object instance, ``a.x`` is transformed into the\n call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a class, ``A.x`` is transformed into the call:\n ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [2]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n---------\n\nBy default, instances of classes have a dictionary for attribute\nstorage. This wastes space for objects having very few instance\nvariables. The space consumption can become acute when creating large\nnumbers of instances.\n\nThe default can be overridden by defining *__slots__* in a class\ndefinition. The *__slots__* declaration takes a sequence of instance\nvariables and reserves just enough space in each instance to hold a\nvalue for each variable. Space is saved because *__dict__* is not\ncreated for each instance.\n\nobject.__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n class, *__slots__* reserves space for the declared variables and\n prevents the automatic creation of *__dict__* and *__weakref__* for\n each instance.\n\n\nNotes on using *__slots__*\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n* When inheriting from a class without *__slots__*, the *__dict__*\n attribute of that class will always be accessible, so a *__slots__*\n definition in the subclass is meaningless.\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* Nonempty *__slots__* does not work for classes derived from\n "variable-length" built-in types such as ``int``, ``str`` and\n ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n\nCustomizing class creation\n==========================\n\nBy default, classes are constructed using ``type()``. A class\ndefinition is read into a separate namespace and the value of class\nname is bound to the result of ``type(name, bases, dict)``.\n\nWhen the class definition is read, if a callable ``metaclass`` keyword\nargument is passed after the bases in the class definition, the\ncallable given will be called instead of ``type()``. If other keyword\narguments are passed, they will also be passed to the metaclass. This\nallows classes or functions to be written which monitor or alter the\nclass creation process:\n\n* Modifying the class dictionary prior to the class being created.\n\n* Returning an instance of another class -- essentially performing the\n role of a factory function.\n\nThese steps will have to be performed in the metaclass\'s ``__new__()``\nmethod -- ``type.__new__()`` can then be called from this method to\ncreate a class with different properties. This example adds a new\nelement to the class dictionary before creating the class:\n\n class metacls(type):\n def __new__(mcs, name, bases, dict):\n dict[\'foo\'] = \'metacls was here\'\n return type.__new__(mcs, name, bases, dict)\n\nYou can of course also override other class methods (or add new\nmethods); for example defining a custom ``__call__()`` method in the\nmetaclass allows custom behavior when the class is called, e.g. not\nalways creating a new instance.\n\nIf the metaclass has a ``__prepare__()`` attribute (usually\nimplemented as a class or static method), it is called before the\nclass body is evaluated with the name of the class and a tuple of its\nbases for arguments. It should return an object that supports the\nmapping interface that will be used to store the namespace of the\nclass. The default is a plain dictionary. This could be used, for\nexample, to keep track of the order that class attributes are declared\nin by returning an ordered dictionary.\n\nThe appropriate metaclass is determined by the following precedence\nrules:\n\n* If the ``metaclass`` keyword argument is based with the bases, it is\n used.\n\n* Otherwise, if there is at least one base class, its metaclass is\n used.\n\n* Otherwise, the default metaclass (``type``) is used.\n\nThe potential uses for metaclasses are boundless. Some ideas that have\nbeen explored including logging, interface checking, automatic\ndelegation, automatic property creation, proxies, frameworks, and\nautomatic resource locking/synchronization.\n\nHere is an example of a metaclass that uses an\n``collections.OrderedDict`` to remember the order that class members\nwere defined:\n\n class OrderedClass(type):\n\n @classmethod\n def __prepare__(metacls, name, bases, **kwds):\n return collections.OrderedDict()\n\n def __new__(cls, name, bases, classdict):\n result = type.__new__(cls, name, bases, dict(classdict))\n result.members = tuple(classdict)\n return result\n\n class A(metaclass=OrderedClass):\n def one(self): pass\n def two(self): pass\n def three(self): pass\n def four(self): pass\n\n >>> A.members\n (\'__module__\', \'one\', \'two\', \'three\', \'four\')\n\nWhen the class definition for *A* gets executed, the process begins\nwith calling the metaclass\'s ``__prepare__()`` method which returns an\nempty ``collections.OrderedDict``. That mapping records the methods\nand attributes of *A* as they are defined within the body of the class\nstatement. Once those definitions are executed, the ordered dictionary\nis fully populated and the metaclass\'s ``__new__()`` method gets\ninvoked. That method builds the new type and it saves the ordered\ndictionary keys in an attribute called *members*.\n\n\nEmulating callable objects\n==========================\n\nobject.__call__(self[, args...])\n\n Called when the instance is "called" as a function; if this method\n is defined, ``x(arg1, arg2, ...)`` is a shorthand for\n ``x.__call__(arg1, arg2, ...)``.\n\n\nEmulating container types\n=========================\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``get()``,\n``clear()``, ``setdefault()``, ``pop()``, ``popitem()``, ``copy()``,\nand ``update()`` behaving similar to those for Python\'s standard\ndictionary objects. The ``collections`` module provides a\n``MutableMapping`` abstract base class to help create those methods\nfrom a base set of ``__getitem__()``, ``__setitem__()``,\n``__delitem__()``, and ``keys()``. Mutable sequences should provide\nmethods ``append()``, ``count()``, ``index()``, ``extend()``,\n``insert()``, ``pop()``, ``remove()``, ``reverse()`` and ``sort()``,\nlike Python standard list objects. Finally, sequence types should\nimplement addition (meaning concatenation) and multiplication (meaning\nrepetition) by defining the methods ``__add__()``, ``__radd__()``,\n``__iadd__()``, ``__mul__()``, ``__rmul__()`` and ``__imul__()``\ndescribed below; they should not define other numerical operators. It\nis recommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should search the mapping\'s keys; for\nsequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``keys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn\'t define a ``__bool__()`` method and whose ``__len__()``\n method returns zero is considered to be false in a Boolean context.\n\nNote: Slicing is done exclusively with the following three methods. A\n call like\n\n a[1:2] = b\n\n is translated to\n\n a[slice(1, 2, None)] = b\n\n and so forth. Missing slice items are always filled in with\n ``None``.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``keys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects should\n normally only provide ``__reversed__()`` if they do not support the\n sequence protocol and an efficient implementation of reverse\n iteration is possible.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n\n\nEmulating numeric types\n=======================\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__truediv__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``//``, ``%``,\n ``divmod()``, ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``,\n ``|``). For instance, to evaluate the expression ``x + y``, where\n *x* is an instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()``. Note that\n ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``//``, ``%``,\n ``divmod()``, ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``,\n ``|``) with reflected (swapped) operands. These functions are only\n called if the left operand does not support the corresponding\n operation and the operands are of different types. [3] For\n instance, to evaluate the expression ``x - y``, where *y* is an\n instance of a class that has an ``__rsub__()`` method,\n ``y.__rsub__(x)`` is called if ``x.__sub__(y)`` returns\n *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n assignments (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n assignment falls back to the normal methods. For instance, to\n execute the statement ``x += y``, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of ``x + y``.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__float__(self)\nobject.__round__(self[, n])\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``float()`` and ``round()``. Should return a value of\n the appropriate type.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing, or in the\n built-in ``bin()``, ``hex()`` and ``oct()`` functions). Must return\n an integer.\n\n\nWith Statement Context Managers\n===============================\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nSpecial method lookup\n=====================\n\nFor custom classes, implicit invocations of special methods are only\nguaranteed to work correctly if defined on an object\'s type, not in\nthe object\'s instance dictionary. That behaviour is the reason why\nthe following code raises an exception:\n\n >>> class C(object):\n ... pass\n ...\n >>> c = C()\n >>> c.__len__ = lambda: 5\n >>> len(c)\n Traceback (most recent call last):\n File "", line 1, in \n TypeError: object of type \'C\' has no len()\n\nThe rationale behind this behaviour lies with a number of special\nmethods such as ``__hash__()`` and ``__repr__()`` that are implemented\nby all objects, including type objects. If the implicit lookup of\nthese methods used the conventional lookup process, they would fail\nwhen invoked on the type object itself:\n\n >>> 1 .__hash__() == hash(1)\n True\n >>> int.__hash__() == hash(int)\n Traceback (most recent call last):\n File "", line 1, in \n TypeError: descriptor \'__hash__\' of \'int\' object needs an argument\n\nIncorrectly attempting to invoke an unbound method of a class in this\nway is sometimes referred to as \'metaclass confusion\', and is avoided\nby bypassing the instance when looking up special methods:\n\n >>> type(1).__hash__(1) == hash(1)\n True\n >>> type(int).__hash__(int) == hash(int)\n True\n\nIn addition to bypassing any instance attributes in the interest of\ncorrectness, implicit special method lookup generally also bypasses\nthe ``__getattribute__()`` method even of the object\'s metaclass:\n\n >>> class Meta(type):\n ... def __getattribute__(*args):\n ... print("Metaclass getattribute invoked")\n ... return type.__getattribute__(*args)\n ...\n >>> class C(object, metaclass=Meta):\n ... def __len__(self):\n ... return 10\n ... def __getattribute__(*args):\n ... print("Class getattribute invoked")\n ... return object.__getattribute__(*args)\n ...\n >>> c = C()\n >>> c.__len__() # Explicit lookup via instance\n Class getattribute invoked\n 10\n >>> type(c).__len__(c) # Explicit lookup via type\n Metaclass getattribute invoked\n 10\n >>> len(c) # Implicit lookup\n 10\n\nBypassing the ``__getattribute__()`` machinery in this fashion\nprovides significant scope for speed optimisations within the\ninterpreter, at the cost of some flexibility in the handling of\nspecial methods (the special method *must* be set on the class object\nitself in order to be consistently invoked by the interpreter).\n\n-[ Footnotes ]-\n\n[1] It *is* possible in some cases to change an object\'s type, under\n certain controlled conditions. It generally isn\'t a good idea\n though, since it can lead to some very strange behaviour if it is\n handled incorrectly.\n\n[2] A descriptor can define any combination of ``__get__()``,\n ``__set__()`` and ``__delete__()``. If it does not define\n ``__get__()``, then accessing the attribute even on an instance\n will return the descriptor object itself. If the descriptor\n defines ``__set__()`` and/or ``__delete__()``, it is a data\n descriptor; if it defines neither, it is a non-data descriptor.\n\n[3] For operands of the same type, it is assumed that if the non-\n reflected method (such as ``__add__()``) fails the operation is\n not supported, which is why the reflected method is not called.\n', + 'specialnames': '\nSpecial method names\n********************\n\nA class can implement certain operations that are invoked by special\nsyntax (such as arithmetic operations or subscripting and slicing) by\ndefining methods with special names. This is Python\'s approach to\n*operator overloading*, allowing classes to define their own behavior\nwith respect to language operators. For instance, if a class defines\na method named ``__getitem__()``, and ``x`` is an instance of this\nclass, then ``x[i]`` is roughly equivalent to ``type(x).__getitem__(x,\ni)``. Except where mentioned, attempts to execute an operation raise\nan exception when no appropriate method is defined (typically\n``AttributeError`` or ``TypeError``).\n\nWhen implementing a class that emulates any built-in type, it is\nimportant that the emulation only be implemented to the degree that it\nmakes sense for the object being modelled. For example, some\nsequences may work well with retrieval of individual elements, but\nextracting a slice may not make sense. (One example of this is the\n``NodeList`` interface in the W3C\'s Document Object Model.)\n\n\nBasic customization\n===================\n\nobject.__new__(cls[, ...])\n\n Called to create a new instance of class *cls*. ``__new__()`` is a\n static method (special-cased so you need not declare it as such)\n that takes the class of which an instance was requested as its\n first argument. The remaining arguments are those passed to the\n object constructor expression (the call to the class). The return\n value of ``__new__()`` should be the new object instance (usually\n an instance of *cls*).\n\n Typical implementations create a new instance of the class by\n invoking the superclass\'s ``__new__()`` method using\n ``super(currentclass, cls).__new__(cls[, ...])`` with appropriate\n arguments and then modifying the newly-created instance as\n necessary before returning it.\n\n If ``__new__()`` returns an instance of *cls*, then the new\n instance\'s ``__init__()`` method will be invoked like\n ``__init__(self[, ...])``, where *self* is the new instance and the\n remaining arguments are the same as were passed to ``__new__()``.\n\n If ``__new__()`` does not return an instance of *cls*, then the new\n instance\'s ``__init__()`` method will not be invoked.\n\n ``__new__()`` is intended mainly to allow subclasses of immutable\n types (like int, str, or tuple) to customize instance creation. It\n is also commonly overridden in custom metaclasses in order to\n customize class creation.\n\nobject.__init__(self[, ...])\n\n Called when the instance is created. The arguments are those\n passed to the class constructor expression. If a base class has an\n ``__init__()`` method, the derived class\'s ``__init__()`` method,\n if any, must explicitly call it to ensure proper initialization of\n the base class part of the instance; for example:\n ``BaseClass.__init__(self, [args...])``. As a special constraint\n on constructors, no value may be returned; doing so will cause a\n ``TypeError`` to be raised at runtime.\n\nobject.__del__(self)\n\n Called when the instance is about to be destroyed. This is also\n called a destructor. If a base class has a ``__del__()`` method,\n the derived class\'s ``__del__()`` method, if any, must explicitly\n call it to ensure proper deletion of the base class part of the\n instance. Note that it is possible (though not recommended!) for\n the ``__del__()`` method to postpone destruction of the instance by\n creating a new reference to it. It may then be called at a later\n time when this new reference is deleted. It is not guaranteed that\n ``__del__()`` methods are called for objects that still exist when\n the interpreter exits.\n\n Note: ``del x`` doesn\'t directly call ``x.__del__()`` --- the former\n decrements the reference count for ``x`` by one, and the latter\n is only called when ``x``\'s reference count reaches zero. Some\n common situations that may prevent the reference count of an\n object from going to zero include: circular references between\n objects (e.g., a doubly-linked list or a tree data structure with\n parent and child pointers); a reference to the object on the\n stack frame of a function that caught an exception (the traceback\n stored in ``sys.exc_info()[2]`` keeps the stack frame alive); or\n a reference to the object on the stack frame that raised an\n unhandled exception in interactive mode (the traceback stored in\n ``sys.last_traceback`` keeps the stack frame alive). The first\n situation can only be remedied by explicitly breaking the cycles;\n the latter two situations can be resolved by storing ``None`` in\n ``sys.last_traceback``. Circular references which are garbage are\n detected when the option cycle detector is enabled (it\'s on by\n default), but can only be cleaned up if there are no Python-\n level ``__del__()`` methods involved. Refer to the documentation\n for the ``gc`` module for more information about how\n ``__del__()`` methods are handled by the cycle detector,\n particularly the description of the ``garbage`` value.\n\n Warning: Due to the precarious circumstances under which ``__del__()``\n methods are invoked, exceptions that occur during their execution\n are ignored, and a warning is printed to ``sys.stderr`` instead.\n Also, when ``__del__()`` is invoked in response to a module being\n deleted (e.g., when execution of the program is done), other\n globals referenced by the ``__del__()`` method may already have\n been deleted or in the process of being torn down (e.g. the\n import machinery shutting down). For this reason, ``__del__()``\n methods should do the absolute minimum needed to maintain\n external invariants. Starting with version 1.5, Python\n guarantees that globals whose name begins with a single\n underscore are deleted from their module before other globals are\n deleted; if no other references to such globals exist, this may\n help in assuring that imported modules are still available at the\n time when the ``__del__()`` method is called.\n\nobject.__repr__(self)\n\n Called by the ``repr()`` built-in function to compute the\n "official" string representation of an object. If at all possible,\n this should look like a valid Python expression that could be used\n to recreate an object with the same value (given an appropriate\n environment). If this is not possible, a string of the form\n ``<...some useful description...>`` should be returned. The return\n value must be a string object. If a class defines ``__repr__()``\n but not ``__str__()``, then ``__repr__()`` is also used when an\n "informal" string representation of instances of that class is\n required.\n\n This is typically used for debugging, so it is important that the\n representation is information-rich and unambiguous.\n\nobject.__str__(self)\n\n Called by the ``str()`` built-in function and by the ``print()``\n function to compute the "informal" string representation of an\n object. This differs from ``__repr__()`` in that it does not have\n to be a valid Python expression: a more convenient or concise\n representation may be used instead. The return value must be a\n string object.\n\nobject.__format__(self, format_spec)\n\n Called by the ``format()`` built-in function (and by extension, the\n ``format()`` method of class ``str``) to produce a "formatted"\n string representation of an object. The ``format_spec`` argument is\n a string that contains a description of the formatting options\n desired. The interpretation of the ``format_spec`` argument is up\n to the type implementing ``__format__()``, however most classes\n will either delegate formatting to one of the built-in types, or\n use a similar formatting option syntax.\n\n See *Format Specification Mini-Language* for a description of the\n standard formatting syntax.\n\n The return value must be a string object.\n\nobject.__lt__(self, other)\nobject.__le__(self, other)\nobject.__eq__(self, other)\nobject.__ne__(self, other)\nobject.__gt__(self, other)\nobject.__ge__(self, other)\n\n These are the so-called "rich comparison" methods. The\n correspondence between operator symbols and method names is as\n follows: ``xy`` calls ``x.__gt__(y)``, and ``x>=y`` calls\n ``x.__ge__(y)``.\n\n A rich comparison method may return the singleton\n ``NotImplemented`` if it does not implement the operation for a\n given pair of arguments. By convention, ``False`` and ``True`` are\n returned for a successful comparison. However, these methods can\n return any value, so if the comparison operator is used in a\n Boolean context (e.g., in the condition of an ``if`` statement),\n Python will call ``bool()`` on the value to determine if the result\n is true or false.\n\n There are no implied relationships among the comparison operators.\n The truth of ``x==y`` does not imply that ``x!=y`` is false.\n Accordingly, when defining ``__eq__()``, one should also define\n ``__ne__()`` so that the operators will behave as expected. See\n the paragraph on ``__hash__()`` for some important notes on\n creating *hashable* objects which support custom comparison\n operations and are usable as dictionary keys.\n\n There are no swapped-argument versions of these methods (to be used\n when the left argument does not support the operation but the right\n argument does); rather, ``__lt__()`` and ``__gt__()`` are each\n other\'s reflection, ``__le__()`` and ``__ge__()`` are each other\'s\n reflection, and ``__eq__()`` and ``__ne__()`` are their own\n reflection.\n\n Arguments to rich comparison methods are never coerced.\n\n To automatically generate ordering operations from a single root\n operation, see the Total Ordering recipe in the ASPN cookbook.\n\nobject.__hash__(self)\n\n Called by built-in function ``hash()`` and for operations on\n members of hashed collections including ``set``, ``frozenset``, and\n ``dict``. ``__hash__()`` should return an integer. The only\n required property is that objects which compare equal have the same\n hash value; it is advised to somehow mix together (e.g. using\n exclusive or) the hash values for the components of the object that\n also play a part in comparison of objects.\n\n If a class does not define an ``__eq__()`` method it should not\n define a ``__hash__()`` operation either; if it defines\n ``__eq__()`` but not ``__hash__()``, its instances will not be\n usable as items in hashable collections. If a class defines\n mutable objects and implements an ``__eq__()`` method, it should\n not implement ``__hash__()``, since the implementation of hashable\n collections requires that a key\'s hash value is immutable (if the\n object\'s hash value changes, it will be in the wrong hash bucket).\n\n User-defined classes have ``__eq__()`` and ``__hash__()`` methods\n by default; with them, all objects compare unequal (except with\n themselves) and ``x.__hash__()`` returns ``id(x)``.\n\n Classes which inherit a ``__hash__()`` method from a parent class\n but change the meaning of ``__eq__()`` such that the hash value\n returned is no longer appropriate (e.g. by switching to a value-\n based concept of equality instead of the default identity based\n equality) can explicitly flag themselves as being unhashable by\n setting ``__hash__ = None`` in the class definition. Doing so means\n that not only will instances of the class raise an appropriate\n ``TypeError`` when a program attempts to retrieve their hash value,\n but they will also be correctly identified as unhashable when\n checking ``isinstance(obj, collections.Hashable)`` (unlike classes\n which define their own ``__hash__()`` to explicitly raise\n ``TypeError``).\n\n If a class that overrides ``__eq__()`` needs to retain the\n implementation of ``__hash__()`` from a parent class, the\n interpreter must be told this explicitly by setting ``__hash__ =\n .__hash__``. Otherwise the inheritance of\n ``__hash__()`` will be blocked, just as if ``__hash__`` had been\n explicitly set to ``None``.\n\nobject.__bool__(self)\n\n Called to implement truth value testing and the built-in operation\n ``bool()``; should return ``False`` or ``True``, or their integer\n equivalents ``0`` or ``1``. When this method is not defined,\n ``__len__()`` is called, if it is defined, and the object is\n considered true if its result is nonzero. If a class defines\n neither ``__len__()`` nor ``__bool__()``, all its instances are\n considered true.\n\n\nCustomizing attribute access\n============================\n\nThe following methods can be defined to customize the meaning of\nattribute access (use of, assignment to, or deletion of ``x.name``)\nfor class instances.\n\nobject.__getattr__(self, name)\n\n Called when an attribute lookup has not found the attribute in the\n usual places (i.e. it is not an instance attribute nor is it found\n in the class tree for ``self``). ``name`` is the attribute name.\n This method should return the (computed) attribute value or raise\n an ``AttributeError`` exception.\n\n Note that if the attribute is found through the normal mechanism,\n ``__getattr__()`` is not called. (This is an intentional asymmetry\n between ``__getattr__()`` and ``__setattr__()``.) This is done both\n for efficiency reasons and because otherwise ``__getattr__()``\n would have no way to access other attributes of the instance. Note\n that at least for instance variables, you can fake total control by\n not inserting any values in the instance attribute dictionary (but\n instead inserting them in another object). See the\n ``__getattribute__()`` method below for a way to actually get total\n control over attribute access.\n\nobject.__getattribute__(self, name)\n\n Called unconditionally to implement attribute accesses for\n instances of the class. If the class also defines\n ``__getattr__()``, the latter will not be called unless\n ``__getattribute__()`` either calls it explicitly or raises an\n ``AttributeError``. This method should return the (computed)\n attribute value or raise an ``AttributeError`` exception. In order\n to avoid infinite recursion in this method, its implementation\n should always call the base class method with the same name to\n access any attributes it needs, for example,\n ``object.__getattribute__(self, name)``.\n\n Note: This method may still be bypassed when looking up special methods\n as the result of implicit invocation via language syntax or\n builtin functions. See *Special method lookup*.\n\nobject.__setattr__(self, name, value)\n\n Called when an attribute assignment is attempted. This is called\n instead of the normal mechanism (i.e. store the value in the\n instance dictionary). *name* is the attribute name, *value* is the\n value to be assigned to it.\n\n If ``__setattr__()`` wants to assign to an instance attribute, it\n should call the base class method with the same name, for example,\n ``object.__setattr__(self, name, value)``.\n\nobject.__delattr__(self, name)\n\n Like ``__setattr__()`` but for attribute deletion instead of\n assignment. This should only be implemented if ``del obj.name`` is\n meaningful for the object.\n\nobject.__dir__(self)\n\n Called when ``dir()`` is called on the object. A list must be\n returned.\n\n\nImplementing Descriptors\n------------------------\n\nThe following methods only apply when an instance of the class\ncontaining the method (a so-called *descriptor* class) appears in the\nclass dictionary of another class, known as the *owner* class. In the\nexamples below, "the attribute" refers to the attribute whose name is\nthe key of the property in the owner class\' ``__dict__``.\n\nobject.__get__(self, instance, owner)\n\n Called to get the attribute of the owner class (class attribute\n access) or of an instance of that class (instance attribute\n access). *owner* is always the owner class, while *instance* is the\n instance that the attribute was accessed through, or ``None`` when\n the attribute is accessed through the *owner*. This method should\n return the (computed) attribute value or raise an\n ``AttributeError`` exception.\n\nobject.__set__(self, instance, value)\n\n Called to set the attribute on an instance *instance* of the owner\n class to a new value, *value*.\n\nobject.__delete__(self, instance)\n\n Called to delete the attribute on an instance *instance* of the\n owner class.\n\n\nInvoking Descriptors\n--------------------\n\nIn general, a descriptor is an object attribute with "binding\nbehavior", one whose attribute access has been overridden by methods\nin the descriptor protocol: ``__get__()``, ``__set__()``, and\n``__delete__()``. If any of those methods are defined for an object,\nit is said to be a descriptor.\n\nThe default behavior for attribute access is to get, set, or delete\nthe attribute from an object\'s dictionary. For instance, ``a.x`` has a\nlookup chain starting with ``a.__dict__[\'x\']``, then\n``type(a).__dict__[\'x\']``, and continuing through the base classes of\n``type(a)`` excluding metaclasses.\n\nHowever, if the looked-up value is an object defining one of the\ndescriptor methods, then Python may override the default behavior and\ninvoke the descriptor method instead. Where this occurs in the\nprecedence chain depends on which descriptor methods were defined and\nhow they were called.\n\nThe starting point for descriptor invocation is a binding, ``a.x``.\nHow the arguments are assembled depends on ``a``:\n\nDirect Call\n The simplest and least common call is when user code directly\n invokes a descriptor method: ``x.__get__(a)``.\n\nInstance Binding\n If binding to an object instance, ``a.x`` is transformed into the\n call: ``type(a).__dict__[\'x\'].__get__(a, type(a))``.\n\nClass Binding\n If binding to a class, ``A.x`` is transformed into the call:\n ``A.__dict__[\'x\'].__get__(None, A)``.\n\nSuper Binding\n If ``a`` is an instance of ``super``, then the binding ``super(B,\n obj).m()`` searches ``obj.__class__.__mro__`` for the base class\n ``A`` immediately preceding ``B`` and then invokes the descriptor\n with the call: ``A.__dict__[\'m\'].__get__(obj, A)``.\n\nFor instance bindings, the precedence of descriptor invocation depends\non the which descriptor methods are defined. Normally, data\ndescriptors define both ``__get__()`` and ``__set__()``, while non-\ndata descriptors have just the ``__get__()`` method. Data descriptors\nalways override a redefinition in an instance dictionary. In\ncontrast, non-data descriptors can be overridden by instances. [2]\n\nPython methods (including ``staticmethod()`` and ``classmethod()``)\nare implemented as non-data descriptors. Accordingly, instances can\nredefine and override methods. This allows individual instances to\nacquire behaviors that differ from other instances of the same class.\n\nThe ``property()`` function is implemented as a data descriptor.\nAccordingly, instances cannot override the behavior of a property.\n\n\n__slots__\n---------\n\nBy default, instances of classes have a dictionary for attribute\nstorage. This wastes space for objects having very few instance\nvariables. The space consumption can become acute when creating large\nnumbers of instances.\n\nThe default can be overridden by defining *__slots__* in a class\ndefinition. The *__slots__* declaration takes a sequence of instance\nvariables and reserves just enough space in each instance to hold a\nvalue for each variable. Space is saved because *__dict__* is not\ncreated for each instance.\n\nobject.__slots__\n\n This class variable can be assigned a string, iterable, or sequence\n of strings with variable names used by instances. If defined in a\n class, *__slots__* reserves space for the declared variables and\n prevents the automatic creation of *__dict__* and *__weakref__* for\n each instance.\n\n\nNotes on using *__slots__*\n~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n* When inheriting from a class without *__slots__*, the *__dict__*\n attribute of that class will always be accessible, so a *__slots__*\n definition in the subclass is meaningless.\n\n* Without a *__dict__* variable, instances cannot be assigned new\n variables not listed in the *__slots__* definition. Attempts to\n assign to an unlisted variable name raises ``AttributeError``. If\n dynamic assignment of new variables is desired, then add\n ``\'__dict__\'`` to the sequence of strings in the *__slots__*\n declaration.\n\n* Without a *__weakref__* variable for each instance, classes defining\n *__slots__* do not support weak references to its instances. If weak\n reference support is needed, then add ``\'__weakref__\'`` to the\n sequence of strings in the *__slots__* declaration.\n\n* *__slots__* are implemented at the class level by creating\n descriptors (*Implementing Descriptors*) for each variable name. As\n a result, class attributes cannot be used to set default values for\n instance variables defined by *__slots__*; otherwise, the class\n attribute would overwrite the descriptor assignment.\n\n* If a class defines a slot also defined in a base class, the instance\n variable defined by the base class slot is inaccessible (except by\n retrieving its descriptor directly from the base class). This\n renders the meaning of the program undefined. In the future, a\n check may be added to prevent this.\n\n* The action of a *__slots__* declaration is limited to the class\n where it is defined. As a result, subclasses will have a *__dict__*\n unless they also define *__slots__*.\n\n* Nonempty *__slots__* does not work for classes derived from\n "variable-length" built-in types such as ``int``, ``str`` and\n ``tuple``.\n\n* Any non-string iterable may be assigned to *__slots__*. Mappings may\n also be used; however, in the future, special meaning may be\n assigned to the values corresponding to each key.\n\n* *__class__* assignment works only if both classes have the same\n *__slots__*.\n\n\nCustomizing class creation\n==========================\n\nBy default, classes are constructed using ``type()``. A class\ndefinition is read into a separate namespace and the value of class\nname is bound to the result of ``type(name, bases, dict)``.\n\nWhen the class definition is read, if a callable ``metaclass`` keyword\nargument is passed after the bases in the class definition, the\ncallable given will be called instead of ``type()``. If other keyword\narguments are passed, they will also be passed to the metaclass. This\nallows classes or functions to be written which monitor or alter the\nclass creation process:\n\n* Modifying the class dictionary prior to the class being created.\n\n* Returning an instance of another class -- essentially performing the\n role of a factory function.\n\nThese steps will have to be performed in the metaclass\'s ``__new__()``\nmethod -- ``type.__new__()`` can then be called from this method to\ncreate a class with different properties. This example adds a new\nelement to the class dictionary before creating the class:\n\n class metacls(type):\n def __new__(mcs, name, bases, dict):\n dict[\'foo\'] = \'metacls was here\'\n return type.__new__(mcs, name, bases, dict)\n\nYou can of course also override other class methods (or add new\nmethods); for example defining a custom ``__call__()`` method in the\nmetaclass allows custom behavior when the class is called, e.g. not\nalways creating a new instance.\n\nIf the metaclass has a ``__prepare__()`` attribute (usually\nimplemented as a class or static method), it is called before the\nclass body is evaluated with the name of the class and a tuple of its\nbases for arguments. It should return an object that supports the\nmapping interface that will be used to store the namespace of the\nclass. The default is a plain dictionary. This could be used, for\nexample, to keep track of the order that class attributes are declared\nin by returning an ordered dictionary.\n\nThe appropriate metaclass is determined by the following precedence\nrules:\n\n* If the ``metaclass`` keyword argument is based with the bases, it is\n used.\n\n* Otherwise, if there is at least one base class, its metaclass is\n used.\n\n* Otherwise, the default metaclass (``type``) is used.\n\nThe potential uses for metaclasses are boundless. Some ideas that have\nbeen explored including logging, interface checking, automatic\ndelegation, automatic property creation, proxies, frameworks, and\nautomatic resource locking/synchronization.\n\nHere is an example of a metaclass that uses an\n``collections.OrderedDict`` to remember the order that class members\nwere defined:\n\n class OrderedClass(type):\n\n @classmethod\n def __prepare__(metacls, name, bases, **kwds):\n return collections.OrderedDict()\n\n def __new__(cls, name, bases, classdict):\n result = type.__new__(cls, name, bases, dict(classdict))\n result.members = tuple(classdict)\n return result\n\n class A(metaclass=OrderedClass):\n def one(self): pass\n def two(self): pass\n def three(self): pass\n def four(self): pass\n\n >>> A.members\n (\'__module__\', \'one\', \'two\', \'three\', \'four\')\n\nWhen the class definition for *A* gets executed, the process begins\nwith calling the metaclass\'s ``__prepare__()`` method which returns an\nempty ``collections.OrderedDict``. That mapping records the methods\nand attributes of *A* as they are defined within the body of the class\nstatement. Once those definitions are executed, the ordered dictionary\nis fully populated and the metaclass\'s ``__new__()`` method gets\ninvoked. That method builds the new type and it saves the ordered\ndictionary keys in an attribute called *members*.\n\n\nEmulating callable objects\n==========================\n\nobject.__call__(self[, args...])\n\n Called when the instance is "called" as a function; if this method\n is defined, ``x(arg1, arg2, ...)`` is a shorthand for\n ``x.__call__(arg1, arg2, ...)``.\n\n\nEmulating container types\n=========================\n\nThe following methods can be defined to implement container objects.\nContainers usually are sequences (such as lists or tuples) or mappings\n(like dictionaries), but can represent other containers as well. The\nfirst set of methods is used either to emulate a sequence or to\nemulate a mapping; the difference is that for a sequence, the\nallowable keys should be the integers *k* for which ``0 <= k < N``\nwhere *N* is the length of the sequence, or slice objects, which\ndefine a range of items. It is also recommended that mappings provide\nthe methods ``keys()``, ``values()``, ``items()``, ``get()``,\n``clear()``, ``setdefault()``, ``pop()``, ``popitem()``, ``copy()``,\nand ``update()`` behaving similar to those for Python\'s standard\ndictionary objects. The ``collections`` module provides a\n``MutableMapping`` abstract base class to help create those methods\nfrom a base set of ``__getitem__()``, ``__setitem__()``,\n``__delitem__()``, and ``keys()``. Mutable sequences should provide\nmethods ``append()``, ``count()``, ``index()``, ``extend()``,\n``insert()``, ``pop()``, ``remove()``, ``reverse()`` and ``sort()``,\nlike Python standard list objects. Finally, sequence types should\nimplement addition (meaning concatenation) and multiplication (meaning\nrepetition) by defining the methods ``__add__()``, ``__radd__()``,\n``__iadd__()``, ``__mul__()``, ``__rmul__()`` and ``__imul__()``\ndescribed below; they should not define other numerical operators. It\nis recommended that both mappings and sequences implement the\n``__contains__()`` method to allow efficient use of the ``in``\noperator; for mappings, ``in`` should search the mapping\'s keys; for\nsequences, it should search through the values. It is further\nrecommended that both mappings and sequences implement the\n``__iter__()`` method to allow efficient iteration through the\ncontainer; for mappings, ``__iter__()`` should be the same as\n``keys()``; for sequences, it should iterate through the values.\n\nobject.__len__(self)\n\n Called to implement the built-in function ``len()``. Should return\n the length of the object, an integer ``>=`` 0. Also, an object\n that doesn\'t define a ``__bool__()`` method and whose ``__len__()``\n method returns zero is considered to be false in a Boolean context.\n\nNote: Slicing is done exclusively with the following three methods. A\n call like\n\n a[1:2] = b\n\n is translated to\n\n a[slice(1, 2, None)] = b\n\n and so forth. Missing slice items are always filled in with\n ``None``.\n\nobject.__getitem__(self, key)\n\n Called to implement evaluation of ``self[key]``. For sequence\n types, the accepted keys should be integers and slice objects.\n Note that the special interpretation of negative indexes (if the\n class wishes to emulate a sequence type) is up to the\n ``__getitem__()`` method. If *key* is of an inappropriate type,\n ``TypeError`` may be raised; if of a value outside the set of\n indexes for the sequence (after any special interpretation of\n negative values), ``IndexError`` should be raised. For mapping\n types, if *key* is missing (not in the container), ``KeyError``\n should be raised.\n\n Note: ``for`` loops expect that an ``IndexError`` will be raised for\n illegal indexes to allow proper detection of the end of the\n sequence.\n\nobject.__setitem__(self, key, value)\n\n Called to implement assignment to ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support changes to the values for keys, or if new keys\n can be added, or for sequences if elements can be replaced. The\n same exceptions should be raised for improper *key* values as for\n the ``__getitem__()`` method.\n\nobject.__delitem__(self, key)\n\n Called to implement deletion of ``self[key]``. Same note as for\n ``__getitem__()``. This should only be implemented for mappings if\n the objects support removal of keys, or for sequences if elements\n can be removed from the sequence. The same exceptions should be\n raised for improper *key* values as for the ``__getitem__()``\n method.\n\nobject.__iter__(self)\n\n This method is called when an iterator is required for a container.\n This method should return a new iterator object that can iterate\n over all the objects in the container. For mappings, it should\n iterate over the keys of the container, and should also be made\n available as the method ``keys()``.\n\n Iterator objects also need to implement this method; they are\n required to return themselves. For more information on iterator\n objects, see *Iterator Types*.\n\nobject.__reversed__(self)\n\n Called (if present) by the ``reversed()`` builtin to implement\n reverse iteration. It should return a new iterator object that\n iterates over all the objects in the container in reverse order.\n\n If the ``__reversed__()`` method is not provided, the\n ``reversed()`` builtin will fall back to using the sequence\n protocol (``__len__()`` and ``__getitem__()``). Objects that\n support the sequence protocol should only provide\n ``__reversed__()`` if they can provide an implementation that is\n more efficient than the one provided by ``reversed()``.\n\nThe membership test operators (``in`` and ``not in``) are normally\nimplemented as an iteration through a sequence. However, container\nobjects can supply the following special method with a more efficient\nimplementation, which also does not require the object be a sequence.\n\nobject.__contains__(self, item)\n\n Called to implement membership test operators. Should return true\n if *item* is in *self*, false otherwise. For mapping objects, this\n should consider the keys of the mapping rather than the values or\n the key-item pairs.\n\n\nEmulating numeric types\n=======================\n\nThe following methods can be defined to emulate numeric objects.\nMethods corresponding to operations that are not supported by the\nparticular kind of number implemented (e.g., bitwise operations for\nnon-integral numbers) should be left undefined.\n\nobject.__add__(self, other)\nobject.__sub__(self, other)\nobject.__mul__(self, other)\nobject.__truediv__(self, other)\nobject.__floordiv__(self, other)\nobject.__mod__(self, other)\nobject.__divmod__(self, other)\nobject.__pow__(self, other[, modulo])\nobject.__lshift__(self, other)\nobject.__rshift__(self, other)\nobject.__and__(self, other)\nobject.__xor__(self, other)\nobject.__or__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``//``, ``%``,\n ``divmod()``, ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``,\n ``|``). For instance, to evaluate the expression ``x + y``, where\n *x* is an instance of a class that has an ``__add__()`` method,\n ``x.__add__(y)`` is called. The ``__divmod__()`` method should be\n the equivalent to using ``__floordiv__()`` and ``__mod__()``; it\n should not be related to ``__truediv__()``. Note that\n ``__pow__()`` should be defined to accept an optional third\n argument if the ternary version of the built-in ``pow()`` function\n is to be supported.\n\n If one of those methods does not support the operation with the\n supplied arguments, it should return ``NotImplemented``.\n\nobject.__radd__(self, other)\nobject.__rsub__(self, other)\nobject.__rmul__(self, other)\nobject.__rtruediv__(self, other)\nobject.__rfloordiv__(self, other)\nobject.__rmod__(self, other)\nobject.__rdivmod__(self, other)\nobject.__rpow__(self, other)\nobject.__rlshift__(self, other)\nobject.__rrshift__(self, other)\nobject.__rand__(self, other)\nobject.__rxor__(self, other)\nobject.__ror__(self, other)\n\n These methods are called to implement the binary arithmetic\n operations (``+``, ``-``, ``*``, ``/``, ``//``, ``%``,\n ``divmod()``, ``pow()``, ``**``, ``<<``, ``>>``, ``&``, ``^``,\n ``|``) with reflected (swapped) operands. These functions are only\n called if the left operand does not support the corresponding\n operation and the operands are of different types. [3] For\n instance, to evaluate the expression ``x - y``, where *y* is an\n instance of a class that has an ``__rsub__()`` method,\n ``y.__rsub__(x)`` is called if ``x.__sub__(y)`` returns\n *NotImplemented*.\n\n Note that ternary ``pow()`` will not try calling ``__rpow__()``\n (the coercion rules would become too complicated).\n\n Note: If the right operand\'s type is a subclass of the left operand\'s\n type and that subclass provides the reflected method for the\n operation, this method will be called before the left operand\'s\n non-reflected method. This behavior allows subclasses to\n override their ancestors\' operations.\n\nobject.__iadd__(self, other)\nobject.__isub__(self, other)\nobject.__imul__(self, other)\nobject.__itruediv__(self, other)\nobject.__ifloordiv__(self, other)\nobject.__imod__(self, other)\nobject.__ipow__(self, other[, modulo])\nobject.__ilshift__(self, other)\nobject.__irshift__(self, other)\nobject.__iand__(self, other)\nobject.__ixor__(self, other)\nobject.__ior__(self, other)\n\n These methods are called to implement the augmented arithmetic\n assignments (``+=``, ``-=``, ``*=``, ``/=``, ``//=``, ``%=``,\n ``**=``, ``<<=``, ``>>=``, ``&=``, ``^=``, ``|=``). These methods\n should attempt to do the operation in-place (modifying *self*) and\n return the result (which could be, but does not have to be,\n *self*). If a specific method is not defined, the augmented\n assignment falls back to the normal methods. For instance, to\n execute the statement ``x += y``, where *x* is an instance of a\n class that has an ``__iadd__()`` method, ``x.__iadd__(y)`` is\n called. If *x* is an instance of a class that does not define a\n ``__iadd__()`` method, ``x.__add__(y)`` and ``y.__radd__(x)`` are\n considered, as with the evaluation of ``x + y``.\n\nobject.__neg__(self)\nobject.__pos__(self)\nobject.__abs__(self)\nobject.__invert__(self)\n\n Called to implement the unary arithmetic operations (``-``, ``+``,\n ``abs()`` and ``~``).\n\nobject.__complex__(self)\nobject.__int__(self)\nobject.__float__(self)\nobject.__round__(self[, n])\n\n Called to implement the built-in functions ``complex()``,\n ``int()``, ``float()`` and ``round()``. Should return a value of\n the appropriate type.\n\nobject.__index__(self)\n\n Called to implement ``operator.index()``. Also called whenever\n Python needs an integer object (such as in slicing, or in the\n built-in ``bin()``, ``hex()`` and ``oct()`` functions). Must return\n an integer.\n\n\nWith Statement Context Managers\n===============================\n\nA *context manager* is an object that defines the runtime context to\nbe established when executing a ``with`` statement. The context\nmanager handles the entry into, and the exit from, the desired runtime\ncontext for the execution of the block of code. Context managers are\nnormally invoked using the ``with`` statement (described in section\n*The with statement*), but can also be used by directly invoking their\nmethods.\n\nTypical uses of context managers include saving and restoring various\nkinds of global state, locking and unlocking resources, closing opened\nfiles, etc.\n\nFor more information on context managers, see *Context Manager Types*.\n\nobject.__enter__(self)\n\n Enter the runtime context related to this object. The ``with``\n statement will bind this method\'s return value to the target(s)\n specified in the ``as`` clause of the statement, if any.\n\nobject.__exit__(self, exc_type, exc_value, traceback)\n\n Exit the runtime context related to this object. The parameters\n describe the exception that caused the context to be exited. If the\n context was exited without an exception, all three arguments will\n be ``None``.\n\n If an exception is supplied, and the method wishes to suppress the\n exception (i.e., prevent it from being propagated), it should\n return a true value. Otherwise, the exception will be processed\n normally upon exit from this method.\n\n Note that ``__exit__()`` methods should not reraise the passed-in\n exception; this is the caller\'s responsibility.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n\n\nSpecial method lookup\n=====================\n\nFor custom classes, implicit invocations of special methods are only\nguaranteed to work correctly if defined on an object\'s type, not in\nthe object\'s instance dictionary. That behaviour is the reason why\nthe following code raises an exception:\n\n >>> class C(object):\n ... pass\n ...\n >>> c = C()\n >>> c.__len__ = lambda: 5\n >>> len(c)\n Traceback (most recent call last):\n File "", line 1, in \n TypeError: object of type \'C\' has no len()\n\nThe rationale behind this behaviour lies with a number of special\nmethods such as ``__hash__()`` and ``__repr__()`` that are implemented\nby all objects, including type objects. If the implicit lookup of\nthese methods used the conventional lookup process, they would fail\nwhen invoked on the type object itself:\n\n >>> 1 .__hash__() == hash(1)\n True\n >>> int.__hash__() == hash(int)\n Traceback (most recent call last):\n File "", line 1, in \n TypeError: descriptor \'__hash__\' of \'int\' object needs an argument\n\nIncorrectly attempting to invoke an unbound method of a class in this\nway is sometimes referred to as \'metaclass confusion\', and is avoided\nby bypassing the instance when looking up special methods:\n\n >>> type(1).__hash__(1) == hash(1)\n True\n >>> type(int).__hash__(int) == hash(int)\n True\n\nIn addition to bypassing any instance attributes in the interest of\ncorrectness, implicit special method lookup generally also bypasses\nthe ``__getattribute__()`` method even of the object\'s metaclass:\n\n >>> class Meta(type):\n ... def __getattribute__(*args):\n ... print("Metaclass getattribute invoked")\n ... return type.__getattribute__(*args)\n ...\n >>> class C(object, metaclass=Meta):\n ... def __len__(self):\n ... return 10\n ... def __getattribute__(*args):\n ... print("Class getattribute invoked")\n ... return object.__getattribute__(*args)\n ...\n >>> c = C()\n >>> c.__len__() # Explicit lookup via instance\n Class getattribute invoked\n 10\n >>> type(c).__len__(c) # Explicit lookup via type\n Metaclass getattribute invoked\n 10\n >>> len(c) # Implicit lookup\n 10\n\nBypassing the ``__getattribute__()`` machinery in this fashion\nprovides significant scope for speed optimisations within the\ninterpreter, at the cost of some flexibility in the handling of\nspecial methods (the special method *must* be set on the class object\nitself in order to be consistently invoked by the interpreter).\n\n-[ Footnotes ]-\n\n[1] It *is* possible in some cases to change an object\'s type, under\n certain controlled conditions. It generally isn\'t a good idea\n though, since it can lead to some very strange behaviour if it is\n handled incorrectly.\n\n[2] A descriptor can define any combination of ``__get__()``,\n ``__set__()`` and ``__delete__()``. If it does not define\n ``__get__()``, then accessing the attribute even on an instance\n will return the descriptor object itself. If the descriptor\n defines ``__set__()`` and/or ``__delete__()``, it is a data\n descriptor; if it defines neither, it is a non-data descriptor.\n\n[3] For operands of the same type, it is assumed that if the non-\n reflected method (such as ``__add__()``) fails the operation is\n not supported, which is why the reflected method is not called.\n', 'string-methods': '\nString Methods\n**************\n\nString objects support the methods listed below. Note that none of\nthese methods take keyword arguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, bytes, bytearray, list,\ntuple, range* section. To output formatted strings, see the *String\nFormatting* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\nstr.count(sub[, start[, end]])\n\n Return the number of non-overlapping occurrences of substring *sub*\n in the range [*start*, *end*]. Optional arguments *start* and\n *end* are interpreted as in slice notation.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string as a bytes object. Default\n encoding is the current default string encoding. *errors* may be\n given to set a different error handling scheme. The default for\n *errors* is ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(*args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\nstr.isdecimal()\n\n Return true if all characters in the string are decimal characters\n and there is at least one character, false otherwise. Decimal\n characters include digit characters, and all characters that that\n can be used to form decimal-radix numbers, e.g. U+0660, ARABIC-\n INDIC DIGIT ZERO.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\nstr.isidentifier()\n\n Return true if the string is a valid identifier according to the\n language definition, section *Identifiers and keywords*.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\nstr.isnumeric()\n\n Return true if all characters in the string are numeric characters,\n and there is at least one character, false otherwise. Numeric\n characters include digit characters, and all characters that have\n the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION\n ONE FIFTH.\n\nstr.isprintable()\n\n Return true if all characters in the string are printable or the\n string is empty, false otherwise. Nonprintable characters are\n those characters defined in the Unicode character database as\n "Other" or "Separator", excepting the ASCII space (0x20) which is\n considered printable. (Note that printable characters in this\n context are those which should not be escaped when ``repr()`` is\n invoked on a string. It has no bearing on the handling of strings\n written to ``sys.stdout`` or ``sys.stderr``.)\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. A ``TypeError`` will be raised if there are any\n non-string values in *seq*, including ``bytes`` objects. The\n separator between elements is the string providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\nstatic str.maketrans(x[, y[, z]])\n\n This static method returns a translation table usable for\n ``str.translate()``.\n\n If there is only one argument, it must be a dictionary mapping\n Unicode ordinals (integers) or characters (strings of length 1) to\n Unicode ordinals, strings (of arbitrary lengths) or None.\n Character keys will then be converted to ordinals.\n\n If there are two arguments, they must be strings of equal length,\n and in the resulting dictionary, each character in x will be mapped\n to the character at the same position in y. If there is a third\n argument, it must be a string, whose characters will be mapped to\n None in the result.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\nstr.translate(map)\n\n Return a copy of the *s* where all characters have been mapped\n through the *map* which must be a dictionary of Unicode ordinals\n (integers) to Unicode ordinals, strings or ``None``. Unmapped\n characters are left untouched. Characters mapped to ``None`` are\n deleted.\n\n You can use ``str.maketrans()`` to create a translation map from\n character-to-character mappings in different formats.\n\n Note: An even more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see\n ``encodings.cp1251`` for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n', 'strings': '\nString and Bytes literals\n*************************\n\nString literals are described by the following lexical definitions:\n\n stringliteral ::= [stringprefix](shortstring | longstring)\n stringprefix ::= "r" | "R"\n shortstring ::= "\'" shortstringitem* "\'" | \'"\' shortstringitem* \'"\'\n longstring ::= "\'\'\'" longstringitem* "\'\'\'" | \'"""\' longstringitem* \'"""\'\n shortstringitem ::= shortstringchar | stringescapeseq\n longstringitem ::= longstringchar | stringescapeseq\n shortstringchar ::= \n longstringchar ::= \n stringescapeseq ::= "\\" \n\n bytesliteral ::= bytesprefix(shortbytes | longbytes)\n bytesprefix ::= "b" | "B"\n shortbytes ::= "\'" shortbytesitem* "\'" | \'"\' shortbytesitem* \'"\'\n longbytes ::= "\'\'\'" longbytesitem* "\'\'\'" | \'"""\' longbytesitem* \'"""\'\n shortbytesitem ::= shortbyteschar | bytesescapeseq\n longbytesitem ::= longbyteschar | bytesescapeseq\n shortbyteschar ::= \n longbyteschar ::= \n bytesescapeseq ::= "\\" \n\nOne syntactic restriction not indicated by these productions is that\nwhitespace is not allowed between the **stringprefix** or\n**bytesprefix** and the rest of the literal. The source character set\nis defined by the encoding declaration; it is UTF-8 if no encoding\ndeclaration is given in the source file; see section *Encoding\ndeclarations*.\n\nIn plain English: Both types of literals can be enclosed in matching\nsingle quotes (``\'``) or double quotes (``"``). They can also be\nenclosed in matching groups of three single or double quotes (these\nare generally referred to as *triple-quoted strings*). The backslash\n(``\\``) character is used to escape characters that otherwise have a\nspecial meaning, such as newline, backslash itself, or the quote\ncharacter.\n\nString literals may optionally be prefixed with a letter ``\'r\'`` or\n``\'R\'``; such strings are called *raw strings* and treat backslashes\nas literal characters. As a result, ``\'\\U\'`` and ``\'\\u\'`` escapes in\nraw strings are not treated specially.\n\nBytes literals are always prefixed with ``\'b\'`` or ``\'B\'``; they\nproduce an instance of the ``bytes`` type instead of the ``str`` type.\nThey may only contain ASCII characters; bytes with a numeric value of\n128 or greater must be expressed with escapes.\n\nIn triple-quoted strings, unescaped newlines and quotes are allowed\n(and are retained), except that three unescaped quotes in a row\nterminate the string. (A "quote" is the character used to open the\nstring, i.e. either ``\'`` or ``"``.)\n\nUnless an ``\'r\'`` or ``\'R\'`` prefix is present, escape sequences in\nstrings are interpreted according to rules similar to those used by\nStandard C. The recognized escape sequences are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence | Meaning | Notes |\n+===================+===================================+=========+\n| ``\\newline`` | Backslash and newline ignored | |\n+-------------------+-----------------------------------+---------+\n| ``\\\\`` | Backslash (``\\``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\\'`` | Single quote (``\'``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\"`` | Double quote (``"``) | |\n+-------------------+-----------------------------------+---------+\n| ``\\a`` | ASCII Bell (BEL) | |\n+-------------------+-----------------------------------+---------+\n| ``\\b`` | ASCII Backspace (BS) | |\n+-------------------+-----------------------------------+---------+\n| ``\\f`` | ASCII Formfeed (FF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\n`` | ASCII Linefeed (LF) | |\n+-------------------+-----------------------------------+---------+\n| ``\\r`` | ASCII Carriage Return (CR) | |\n+-------------------+-----------------------------------+---------+\n| ``\\t`` | ASCII Horizontal Tab (TAB) | |\n+-------------------+-----------------------------------+---------+\n| ``\\v`` | ASCII Vertical Tab (VT) | |\n+-------------------+-----------------------------------+---------+\n| ``\\ooo`` | Character with octal value *ooo* | (1,3) |\n+-------------------+-----------------------------------+---------+\n| ``\\xhh`` | Character with hex value *hh* | (2,3) |\n+-------------------+-----------------------------------+---------+\n\nEscape sequences only recognized in string literals are:\n\n+-------------------+-----------------------------------+---------+\n| Escape Sequence | Meaning | Notes |\n+===================+===================================+=========+\n| ``\\N{name}`` | Character named *name* in the | |\n| | Unicode database | |\n+-------------------+-----------------------------------+---------+\n| ``\\uxxxx`` | Character with 16-bit hex value | (4) |\n| | *xxxx* | |\n+-------------------+-----------------------------------+---------+\n| ``\\Uxxxxxxxx`` | Character with 32-bit hex value | (5) |\n| | *xxxxxxxx* | |\n+-------------------+-----------------------------------+---------+\n\nNotes:\n\n1. As in Standard C, up to three octal digits are accepted.\n\n2. Unlike in Standard C, at most two hex digits are accepted.\n\n3. In a bytes literal, hexadecimal and octal escapes denote the byte\n with the given value. In a string literal, these escapes denote a\n Unicode character with the given value.\n\n4. Individual code units which form parts of a surrogate pair can be\n encoded using this escape sequence. Unlike in Standard C, exactly\n two hex digits are required.\n\n5. Any Unicode character can be encoded this way, but characters\n outside the Basic Multilingual Plane (BMP) will be encoded using a\n surrogate pair if Python is compiled to use 16-bit code units (the\n default). Individual code units which form parts of a surrogate\n pair can be encoded using this escape sequence.\n\nUnlike Standard C, all unrecognized escape sequences are left in the\nstring unchanged, i.e., *the backslash is left in the string*. (This\nbehavior is useful when debugging: if an escape sequence is mistyped,\nthe resulting output is more easily recognized as broken.) It is also\nimportant to note that the escape sequences only recognized in string\nliterals fall into the category of unrecognized escapes for bytes\nliterals.\n\nEven in a raw string, string quotes can be escaped with a backslash,\nbut the backslash remains in the string; for example, ``r"\\""`` is a\nvalid string literal consisting of two characters: a backslash and a\ndouble quote; ``r"\\"`` is not a valid string literal (even a raw\nstring cannot end in an odd number of backslashes). Specifically, *a\nraw string cannot end in a single backslash* (since the backslash\nwould escape the following quote character). Note also that a single\nbackslash followed by a newline is interpreted as those two characters\nas part of the string, *not* as a line continuation.\n', 'subscriptions': '\nSubscriptions\n*************\n\nA subscription selects an item of a sequence (string, tuple or list)\nor mapping (dictionary) object:\n\n subscription ::= primary "[" expression_list "]"\n\nThe primary must evaluate to an object that supports subscription,\ne.g. a list or dictionary. User-defined objects can support\nsubscription by defining a ``__getitem__()`` method.\n\nFor built-in objects, there are two types of objects that support\nsubscription:\n\nIf the primary is a mapping, the expression list must evaluate to an\nobject whose value is one of the keys of the mapping, and the\nsubscription selects the value in the mapping that corresponds to that\nkey. (The expression list is a tuple except if it has exactly one\nitem.)\n\nIf the primary is a sequence, the expression (list) must evaluate to\nan integer. If this value is negative, the length of the sequence is\nadded to it (so that, e.g., ``x[-1]`` selects the last item of ``x``.)\nThe resulting value must be a nonnegative integer less than the number\nof items in the sequence, and the subscription selects the item whose\nindex is that value (counting from zero).\n\nA string\'s items are characters. A character is not a separate data\ntype but a string of exactly one character.\n', @@ -67,12 +67,12 @@ 'try': '\nThe ``try`` statement\n*********************\n\nThe ``try`` statement specifies exception handlers and/or cleanup code\nfor a group of statements:\n\n try_stmt ::= try1_stmt | try2_stmt\n try1_stmt ::= "try" ":" suite\n ("except" [expression ["as" target]] ":" suite)+\n ["else" ":" suite]\n ["finally" ":" suite]\n try2_stmt ::= "try" ":" suite\n "finally" ":" suite\n\nThe ``except`` clause(s) specify one or more exception handlers. When\nno exception occurs in the ``try`` clause, no exception handler is\nexecuted. When an exception occurs in the ``try`` suite, a search for\nan exception handler is started. This search inspects the except\nclauses in turn until one is found that matches the exception. An\nexpression-less except clause, if present, must be last; it matches\nany exception. For an except clause with an expression, that\nexpression is evaluated, and the clause matches the exception if the\nresulting object is "compatible" with the exception. An object is\ncompatible with an exception if it is the class or a base class of the\nexception object or a tuple containing an item compatible with the\nexception.\n\nIf no except clause matches the exception, the search for an exception\nhandler continues in the surrounding code and on the invocation stack.\n[1]\n\nIf the evaluation of an expression in the header of an except clause\nraises an exception, the original search for a handler is canceled and\na search starts for the new exception in the surrounding code and on\nthe call stack (it is treated as if the entire ``try`` statement\nraised the exception).\n\nWhen a matching except clause is found, the exception is assigned to\nthe target specified after the ``as`` keyword in that except clause,\nif present, and the except clause\'s suite is executed. All except\nclauses must have an executable block. When the end of this block is\nreached, execution continues normally after the entire try statement.\n(This means that if two nested handlers exist for the same exception,\nand the exception occurs in the try clause of the inner handler, the\nouter handler will not handle the exception.)\n\nWhen an exception has been assigned using ``as target``, it is cleared\nat the end of the except clause. This is as if\n\n except E as N:\n foo\n\nwas translated to\n\n except E as N:\n try:\n foo\n finally:\n N = None\n del N\n\nThat means that you have to assign the exception to a different name\nif you want to be able to refer to it after the except clause. The\nreason for this is that with the traceback attached to them,\nexceptions will form a reference cycle with the stack frame, keeping\nall locals in that frame alive until the next garbage collection\noccurs.\n\nBefore an except clause\'s suite is executed, details about the\nexception are stored in the ``sys`` module and can be access via\n``sys.exc_info()``. ``sys.exc_info()`` returns a 3-tuple consisting\nof: ``exc_type``, the exception class; ``exc_value``, the exception\ninstance; ``exc_traceback``, a traceback object (see section *The\nstandard type hierarchy*) identifying the point in the program where\nthe exception occurred. ``sys.exc_info()`` values are restored to\ntheir previous values (before the call) when returning from a function\nthat handled an exception.\n\nThe optional ``else`` clause is executed if and when control flows off\nthe end of the ``try`` clause. [2] Exceptions in the ``else`` clause\nare not handled by the preceding ``except`` clauses.\n\nIf ``finally`` is present, it specifies a \'cleanup\' handler. The\n``try`` clause is executed, including any ``except`` and ``else``\nclauses. If an exception occurs in any of the clauses and is not\nhandled, the exception is temporarily saved. The ``finally`` clause is\nexecuted. If there is a saved exception, it is re-raised at the end\nof the ``finally`` clause. If the ``finally`` clause raises another\nexception or executes a ``return`` or ``break`` statement, the saved\nexception is lost. The exception information is not available to the\nprogram during execution of the ``finally`` clause.\n\nWhen a ``return``, ``break`` or ``continue`` statement is executed in\nthe ``try`` suite of a ``try``...``finally`` statement, the\n``finally`` clause is also executed \'on the way out.\' A ``continue``\nstatement is illegal in the ``finally`` clause. (The reason is a\nproblem with the current implementation --- this restriction may be\nlifted in the future).\n\nAdditional information on exceptions can be found in section\n*Exceptions*, and information on using the ``raise`` statement to\ngenerate exceptions may be found in section *The raise statement*.\n', 'types': '\nThe standard type hierarchy\n***************************\n\nBelow is a list of the types that are built into Python. Extension\nmodules (written in C, Java, or other languages, depending on the\nimplementation) can define additional types. Future versions of\nPython may add types to the type hierarchy (e.g., rational numbers,\nefficiently stored arrays of integers, etc.), although such additions\nwill often be provided via the standard library instead.\n\nSome of the type descriptions below contain a paragraph listing\n\'special attributes.\' These are attributes that provide access to the\nimplementation and are not intended for general use. Their definition\nmay change in the future.\n\nNone\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name ``None``.\n It is used to signify the absence of a value in many situations,\n e.g., it is returned from functions that don\'t explicitly return\n anything. Its truth value is false.\n\nNotImplemented\n This type has a single value. There is a single object with this\n value. This object is accessed through the built-in name\n ``NotImplemented``. Numeric methods and rich comparison methods may\n return this value if they do not implement the operation for the\n operands provided. (The interpreter will then try the reflected\n operation, or some other fallback, depending on the operator.) Its\n truth value is true.\n\nEllipsis\n This type has a single value. There is a single object with this\n value. This object is accessed through the literal ``...`` or the\n built-in name ``Ellipsis``. Its truth value is true.\n\n``numbers.Number``\n These are created by numeric literals and returned as results by\n arithmetic operators and arithmetic built-in functions. Numeric\n objects are immutable; once created their value never changes.\n Python numbers are of course strongly related to mathematical\n numbers, but subject to the limitations of numerical representation\n in computers.\n\n Python distinguishes between integers, floating point numbers, and\n complex numbers:\n\n ``numbers.Integral``\n These represent elements from the mathematical set of integers\n (positive and negative).\n\n There are two types of integers:\n\n Integers (``int``)\n\n These represent numbers in an unlimited range, subject to\n available (virtual) memory only. For the purpose of shift\n and mask operations, a binary representation is assumed, and\n negative numbers are represented in a variant of 2\'s\n complement which gives the illusion of an infinite string of\n sign bits extending to the left.\n\n Booleans (``bool``)\n These represent the truth values False and True. The two\n objects representing the values False and True are the only\n Boolean objects. The Boolean type is a subtype of the integer\n type, and Boolean values behave like the values 0 and 1,\n respectively, in almost all contexts, the exception being\n that when converted to a string, the strings ``"False"`` or\n ``"True"`` are returned, respectively.\n\n The rules for integer representation are intended to give the\n most meaningful interpretation of shift and mask operations\n involving negative integers.\n\n ``numbers.Real`` (``float``)\n These represent machine-level double precision floating point\n numbers. You are at the mercy of the underlying machine\n architecture (and C or Java implementation) for the accepted\n range and handling of overflow. Python does not support single-\n precision floating point numbers; the savings in processor and\n memory usage that are usually the reason for using these is\n dwarfed by the overhead of using objects in Python, so there is\n no reason to complicate the language with two kinds of floating\n point numbers.\n\n ``numbers.Complex`` (``complex``)\n These represent complex numbers as a pair of machine-level\n double precision floating point numbers. The same caveats apply\n as for floating point numbers. The real and imaginary parts of a\n complex number ``z`` can be retrieved through the read-only\n attributes ``z.real`` and ``z.imag``.\n\nSequences\n These represent finite ordered sets indexed by non-negative\n numbers. The built-in function ``len()`` returns the number of\n items of a sequence. When the length of a sequence is *n*, the\n index set contains the numbers 0, 1, ..., *n*-1. Item *i* of\n sequence *a* is selected by ``a[i]``.\n\n Sequences also support slicing: ``a[i:j]`` selects all items with\n index *k* such that *i* ``<=`` *k* ``<`` *j*. When used as an\n expression, a slice is a sequence of the same type. This implies\n that the index set is renumbered so that it starts at 0.\n\n Some sequences also support "extended slicing" with a third "step"\n parameter: ``a[i:j:k]`` selects all items of *a* with index *x*\n where ``x = i + n*k``, *n* ``>=`` ``0`` and *i* ``<=`` *x* ``<``\n *j*.\n\n Sequences are distinguished according to their mutability:\n\n Immutable sequences\n An object of an immutable sequence type cannot change once it is\n created. (If the object contains references to other objects,\n these other objects may be mutable and may be changed; however,\n the collection of objects directly referenced by an immutable\n object cannot change.)\n\n The following types are immutable sequences:\n\n Strings\n The items of a string object are Unicode code units. A\n Unicode code unit is represented by a string object of one\n item and can hold either a 16-bit or 32-bit value\n representing a Unicode ordinal (the maximum value for the\n ordinal is given in ``sys.maxunicode``, and depends on how\n Python is configured at compile time). Surrogate pairs may\n be present in the Unicode object, and will be reported as two\n separate items. The built-in functions ``chr()`` and\n ``ord()`` convert between code units and nonnegative integers\n representing the Unicode ordinals as defined in the Unicode\n Standard 3.0. Conversion from and to other encodings are\n possible through the string method ``encode()``.\n\n Tuples\n The items of a tuple are arbitrary Python objects. Tuples of\n two or more items are formed by comma-separated lists of\n expressions. A tuple of one item (a \'singleton\') can be\n formed by affixing a comma to an expression (an expression by\n itself does not create a tuple, since parentheses must be\n usable for grouping of expressions). An empty tuple can be\n formed by an empty pair of parentheses.\n\n Bytes\n A bytes object is an immutable array. The items are 8-bit\n bytes, represented by integers in the range 0 <= x < 256.\n Bytes literals (like ``b\'abc\'`` and the built-in function\n ``bytes()`` can be used to construct bytes objects. Also,\n bytes objects can be decoded to strings via the ``decode()``\n method.\n\n Mutable sequences\n Mutable sequences can be changed after they are created. The\n subscription and slicing notations can be used as the target of\n assignment and ``del`` (delete) statements.\n\n There are currently two intrinsic mutable sequence types:\n\n Lists\n The items of a list are arbitrary Python objects. Lists are\n formed by placing a comma-separated list of expressions in\n square brackets. (Note that there are no special cases needed\n to form lists of length 0 or 1.)\n\n Byte Arrays\n A bytearray object is a mutable array. They are created by\n the built-in ``bytearray()`` constructor. Aside from being\n mutable (and hence unhashable), byte arrays otherwise provide\n the same interface and functionality as immutable bytes\n objects.\n\n The extension module ``array`` provides an additional example of\n a mutable sequence type, as does the ``collections`` module.\n\nSet types\n These represent unordered, finite sets of unique, immutable\n objects. As such, they cannot be indexed by any subscript. However,\n they can be iterated over, and the built-in function ``len()``\n returns the number of items in a set. Common uses for sets are fast\n membership testing, removing duplicates from a sequence, and\n computing mathematical operations such as intersection, union,\n difference, and symmetric difference.\n\n For set elements, the same immutability rules apply as for\n dictionary keys. Note that numeric types obey the normal rules for\n numeric comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``), only one of them can be contained in a set.\n\n There are currently two intrinsic set types:\n\n Sets\n These represent a mutable set. They are created by the built-in\n ``set()`` constructor and can be modified afterwards by several\n methods, such as ``add()``.\n\n Frozen sets\n These represent an immutable set. They are created by the\n built-in ``frozenset()`` constructor. As a frozenset is\n immutable and *hashable*, it can be used again as an element of\n another set, or as a dictionary key.\n\nMappings\n These represent finite sets of objects indexed by arbitrary index\n sets. The subscript notation ``a[k]`` selects the item indexed by\n ``k`` from the mapping ``a``; this can be used in expressions and\n as the target of assignments or ``del`` statements. The built-in\n function ``len()`` returns the number of items in a mapping.\n\n There is currently a single intrinsic mapping type:\n\n Dictionaries\n These represent finite sets of objects indexed by nearly\n arbitrary values. The only types of values not acceptable as\n keys are values containing lists or dictionaries or other\n mutable types that are compared by value rather than by object\n identity, the reason being that the efficient implementation of\n dictionaries requires a key\'s hash value to remain constant.\n Numeric types used for keys obey the normal rules for numeric\n comparison: if two numbers compare equal (e.g., ``1`` and\n ``1.0``) then they can be used interchangeably to index the same\n dictionary entry.\n\n Dictionaries are mutable; they can be created by the ``{...}``\n notation (see section *Dictionary displays*).\n\n The extension modules ``dbm.ndbm`` and ``dbm.gnu`` provide\n additional examples of mapping types, as does the\n ``collections`` module.\n\nCallable types\n These are the types to which the function call operation (see\n section *Calls*) can be applied:\n\n User-defined functions\n A user-defined function object is created by a function\n definition (see section *Function definitions*). It should be\n called with an argument list containing the same number of items\n as the function\'s formal parameter list.\n\n Special attributes:\n\n +---------------------------+---------------------------------+-------------+\n | Attribute | Meaning | |\n +===========================+=================================+=============+\n | ``__doc__`` | The function\'s documentation | Writable |\n | | string, or ``None`` if | |\n | | unavailable | |\n +---------------------------+---------------------------------+-------------+\n | ``__name__`` | The function\'s name | Writable |\n +---------------------------+---------------------------------+-------------+\n | ``__module__`` | The name of the module the | Writable |\n | | function was defined in, or | |\n | | ``None`` if unavailable. | |\n +---------------------------+---------------------------------+-------------+\n | ``__defaults__`` | A tuple containing default | Writable |\n | | argument values for those | |\n | | arguments that have defaults, | |\n | | or ``None`` if no arguments | |\n | | have a default value | |\n +---------------------------+---------------------------------+-------------+\n | ``__code__`` | The code object representing | Writable |\n | | the compiled function body. | |\n +---------------------------+---------------------------------+-------------+\n | ``__globals__`` | A reference to the dictionary | Read-only |\n | | that holds the function\'s | |\n | | global variables --- the global | |\n | | namespace of the module in | |\n | | which the function was defined. | |\n +---------------------------+---------------------------------+-------------+\n | ``__dict__`` | The namespace supporting | Writable |\n | | arbitrary function attributes. | |\n +---------------------------+---------------------------------+-------------+\n | ``__closure__`` | ``None`` or a tuple of cells | Read-only |\n | | that contain bindings for the | |\n | | function\'s free variables. | |\n +---------------------------+---------------------------------+-------------+\n | ``__annotations__`` | A dict containing annotations | Writable |\n | | of parameters. The keys of the | |\n | | dict are the parameter names, | |\n | | or ``\'return\'`` for the return | |\n | | annotation, if provided. | |\n +---------------------------+---------------------------------+-------------+\n | ``__kwdefaults__`` | A dict containing defaults for | Writable |\n | | keyword-only parameters. | |\n +---------------------------+---------------------------------+-------------+\n\n Most of the attributes labelled "Writable" check the type of the\n assigned value.\n\n Function objects also support getting and setting arbitrary\n attributes, which can be used, for example, to attach metadata\n to functions. Regular attribute dot-notation is used to get and\n set such attributes. *Note that the current implementation only\n supports function attributes on user-defined functions. Function\n attributes on built-in functions may be supported in the\n future.*\n\n Additional information about a function\'s definition can be\n retrieved from its code object; see the description of internal\n types below.\n\n Instance methods\n An instance method object combines a class, a class instance and\n any callable object (normally a user-defined function).\n\n Special read-only attributes: ``__self__`` is the class instance\n object, ``__func__`` is the function object; ``__doc__`` is the\n method\'s documentation (same as ``__func__.__doc__``);\n ``__name__`` is the method name (same as ``__func__.__name__``);\n ``__module__`` is the name of the module the method was defined\n in, or ``None`` if unavailable.\n\n Methods also support accessing (but not setting) the arbitrary\n function attributes on the underlying function object.\n\n User-defined method objects may be created when getting an\n attribute of a class (perhaps via an instance of that class), if\n that attribute is a user-defined function object or a class\n method object.\n\n When an instance method object is created by retrieving a user-\n defined function object from a class via one of its instances,\n its ``__self__`` attribute is the instance, and the method\n object is said to be bound. The new method\'s ``__func__``\n attribute is the original function object.\n\n When a user-defined method object is created by retrieving\n another method object from a class or instance, the behaviour is\n the same as for a function object, except that the ``__func__``\n attribute of the new instance is not the original method object\n but its ``__func__`` attribute.\n\n When an instance method object is created by retrieving a class\n method object from a class or instance, its ``__self__``\n attribute is the class itself, and its ``__func__`` attribute is\n the function object underlying the class method.\n\n When an instance method object is called, the underlying\n function (``__func__``) is called, inserting the class instance\n (``__self__``) in front of the argument list. For instance,\n when ``C`` is a class which contains a definition for a function\n ``f()``, and ``x`` is an instance of ``C``, calling ``x.f(1)``\n is equivalent to calling ``C.f(x, 1)``.\n\n When an instance method object is derived from a class method\n object, the "class instance" stored in ``__self__`` will\n actually be the class itself, so that calling either ``x.f(1)``\n or ``C.f(1)`` is equivalent to calling ``f(C,1)`` where ``f`` is\n the underlying function.\n\n Note that the transformation from function object to instance\n method object happens each time the attribute is retrieved from\n the instance. In some cases, a fruitful optimization is to\n assign the attribute to a local variable and call that local\n variable. Also notice that this transformation only happens for\n user-defined functions; other callable objects (and all non-\n callable objects) are retrieved without transformation. It is\n also important to note that user-defined functions which are\n attributes of a class instance are not converted to bound\n methods; this *only* happens when the function is an attribute\n of the class.\n\n Generator functions\n A function or method which uses the ``yield`` statement (see\n section *The yield statement*) is called a *generator function*.\n Such a function, when called, always returns an iterator object\n which can be used to execute the body of the function: calling\n the iterator\'s ``__next__()`` method will cause the function to\n execute until it provides a value using the ``yield`` statement.\n When the function executes a ``return`` statement or falls off\n the end, a ``StopIteration`` exception is raised and the\n iterator will have reached the end of the set of values to be\n returned.\n\n Built-in functions\n A built-in function object is a wrapper around a C function.\n Examples of built-in functions are ``len()`` and ``math.sin()``\n (``math`` is a standard built-in module). The number and type of\n the arguments are determined by the C function. Special read-\n only attributes: ``__doc__`` is the function\'s documentation\n string, or ``None`` if unavailable; ``__name__`` is the\n function\'s name; ``__self__`` is set to ``None`` (but see the\n next item); ``__module__`` is the name of the module the\n function was defined in or ``None`` if unavailable.\n\n Built-in methods\n This is really a different disguise of a built-in function, this\n time containing an object passed to the C function as an\n implicit extra argument. An example of a built-in method is\n ``alist.append()``, assuming *alist* is a list object. In this\n case, the special read-only attribute ``__self__`` is set to the\n object denoted by *list*.\n\n Classes\n Classes are callable. These objects normally act as factories\n for new instances of themselves, but variations are possible for\n class types that override ``__new__()``. The arguments of the\n call are passed to ``__new__()`` and, in the typical case, to\n ``__init__()`` to initialize the new instance.\n\n Class Instances\n Instances of arbitrary classes can be made callable by defining\n a ``__call__()`` method in their class.\n\nModules\n Modules are imported by the ``import`` statement (see section *The\n import statement*). A module object has a namespace implemented by\n a dictionary object (this is the dictionary referenced by the\n __globals__ attribute of functions defined in the module).\n Attribute references are translated to lookups in this dictionary,\n e.g., ``m.x`` is equivalent to ``m.__dict__["x"]``. A module object\n does not contain the code object used to initialize the module\n (since it isn\'t needed once the initialization is done).\n\n Attribute assignment updates the module\'s namespace dictionary,\n e.g., ``m.x = 1`` is equivalent to ``m.__dict__["x"] = 1``.\n\n Special read-only attribute: ``__dict__`` is the module\'s namespace\n as a dictionary object.\n\n Predefined (writable) attributes: ``__name__`` is the module\'s\n name; ``__doc__`` is the module\'s documentation string, or ``None``\n if unavailable; ``__file__`` is the pathname of the file from which\n the module was loaded, if it was loaded from a file. The\n ``__file__`` attribute is not present for C modules that are\n statically linked into the interpreter; for extension modules\n loaded dynamically from a shared library, it is the pathname of the\n shared library file.\n\nCustom classes\n Custon class types are typically created by class definitions (see\n section *Class definitions*). A class has a namespace implemented\n by a dictionary object. Class attribute references are translated\n to lookups in this dictionary, e.g., ``C.x`` is translated to\n ``C.__dict__["x"]`` (although there are a number of hooks which\n allow for other means of locating attributes). When the attribute\n name is not found there, the attribute search continues in the base\n classes. This search of the base classes uses the C3 method\n resolution order which behaves correctly even in the presence of\n \'diamond\' inheritance structures where there are multiple\n inheritance paths leading back to a common ancestor. Additional\n details on the C3 MRO used by Python can be found in the\n documentation accompanying the 2.3 release at\n http://www.python.org/download/releases/2.3/mro/.\n\n When a class attribute reference (for class ``C``, say) would yield\n a class method object, it is transformed into an instance method\n object whose ``__self__`` attributes is ``C``. When it would yield\n a static method object, it is transformed into the object wrapped\n by the static method object. See section *Implementing Descriptors*\n for another way in which attributes retrieved from a class may\n differ from those actually contained in its ``__dict__``.\n\n Class attribute assignments update the class\'s dictionary, never\n the dictionary of a base class.\n\n A class object can be called (see above) to yield a class instance\n (see below).\n\n Special attributes: ``__name__`` is the class name; ``__module__``\n is the module name in which the class was defined; ``__dict__`` is\n the dictionary containing the class\'s namespace; ``__bases__`` is a\n tuple (possibly empty or a singleton) containing the base classes,\n in the order of their occurrence in the base class list;\n ``__doc__`` is the class\'s documentation string, or None if\n undefined.\n\nClass instances\n A class instance is created by calling a class object (see above).\n A class instance has a namespace implemented as a dictionary which\n is the first place in which attribute references are searched.\n When an attribute is not found there, and the instance\'s class has\n an attribute by that name, the search continues with the class\n attributes. If a class attribute is found that is a user-defined\n function object, it is transformed into an instance method object\n whose ``__self__`` attribute is the instance. Static method and\n class method objects are also transformed; see above under\n "Classes". See section *Implementing Descriptors* for another way\n in which attributes of a class retrieved via its instances may\n differ from the objects actually stored in the class\'s\n ``__dict__``. If no class attribute is found, and the object\'s\n class has a ``__getattr__()`` method, that is called to satisfy the\n lookup.\n\n Attribute assignments and deletions update the instance\'s\n dictionary, never a class\'s dictionary. If the class has a\n ``__setattr__()`` or ``__delattr__()`` method, this is called\n instead of updating the instance dictionary directly.\n\n Class instances can pretend to be numbers, sequences, or mappings\n if they have methods with certain special names. See section\n *Special method names*.\n\n Special attributes: ``__dict__`` is the attribute dictionary;\n ``__class__`` is the instance\'s class.\n\nFiles\n A file object represents an open file. File objects are created by\n the ``open()`` built-in function, and also by ``os.popen()``,\n ``os.fdopen()``, and the ``makefile()`` method of socket objects\n (and perhaps by other functions or methods provided by extension\n modules). The objects ``sys.stdin``, ``sys.stdout`` and\n ``sys.stderr`` are initialized to file objects corresponding to the\n interpreter\'s standard input, output and error streams. See *File\n Objects* for complete documentation of file objects.\n\nInternal types\n A few types used internally by the interpreter are exposed to the\n user. Their definitions may change with future versions of the\n interpreter, but they are mentioned here for completeness.\n\n Code objects\n Code objects represent *byte-compiled* executable Python code,\n or *bytecode*. The difference between a code object and a\n function object is that the function object contains an explicit\n reference to the function\'s globals (the module in which it was\n defined), while a code object contains no context; also the\n default argument values are stored in the function object, not\n in the code object (because they represent values calculated at\n run-time). Unlike function objects, code objects are immutable\n and contain no references (directly or indirectly) to mutable\n objects.\n\n Special read-only attributes: ``co_name`` gives the function\n name; ``co_argcount`` is the number of positional arguments\n (including arguments with default values); ``co_nlocals`` is the\n number of local variables used by the function (including\n arguments); ``co_varnames`` is a tuple containing the names of\n the local variables (starting with the argument names);\n ``co_cellvars`` is a tuple containing the names of local\n variables that are referenced by nested functions;\n ``co_freevars`` is a tuple containing the names of free\n variables; ``co_code`` is a string representing the sequence of\n bytecode instructions; ``co_consts`` is a tuple containing the\n literals used by the bytecode; ``co_names`` is a tuple\n containing the names used by the bytecode; ``co_filename`` is\n the filename from which the code was compiled;\n ``co_firstlineno`` is the first line number of the function;\n ``co_lnotab`` is a string encoding the mapping from bytecode\n offsets to line numbers (for details see the source code of the\n interpreter); ``co_stacksize`` is the required stack size\n (including local variables); ``co_flags`` is an integer encoding\n a number of flags for the interpreter.\n\n The following flag bits are defined for ``co_flags``: bit\n ``0x04`` is set if the function uses the ``*arguments`` syntax\n to accept an arbitrary number of positional arguments; bit\n ``0x08`` is set if the function uses the ``**keywords`` syntax\n to accept arbitrary keyword arguments; bit ``0x20`` is set if\n the function is a generator.\n\n Future feature declarations (``from __future__ import\n division``) also use bits in ``co_flags`` to indicate whether a\n code object was compiled with a particular feature enabled: bit\n ``0x2000`` is set if the function was compiled with future\n division enabled; bits ``0x10`` and ``0x1000`` were used in\n earlier versions of Python.\n\n Other bits in ``co_flags`` are reserved for internal use.\n\n If a code object represents a function, the first item in\n ``co_consts`` is the documentation string of the function, or\n ``None`` if undefined.\n\n Frame objects\n Frame objects represent execution frames. They may occur in\n traceback objects (see below).\n\n Special read-only attributes: ``f_back`` is to the previous\n stack frame (towards the caller), or ``None`` if this is the\n bottom stack frame; ``f_code`` is the code object being executed\n in this frame; ``f_locals`` is the dictionary used to look up\n local variables; ``f_globals`` is used for global variables;\n ``f_builtins`` is used for built-in (intrinsic) names;\n ``f_lasti`` gives the precise instruction (this is an index into\n the bytecode string of the code object).\n\n Special writable attributes: ``f_trace``, if not ``None``, is a\n function called at the start of each source code line (this is\n used by the debugger); ``f_lineno`` is the current line number\n of the frame --- writing to this from within a trace function\n jumps to the given line (only for the bottom-most frame). A\n debugger can implement a Jump command (aka Set Next Statement)\n by writing to f_lineno.\n\n Traceback objects\n Traceback objects represent a stack trace of an exception. A\n traceback object is created when an exception occurs. When the\n search for an exception handler unwinds the execution stack, at\n each unwound level a traceback object is inserted in front of\n the current traceback. When an exception handler is entered,\n the stack trace is made available to the program. (See section\n *The try statement*.) It is accessible as the third item of the\n tuple returned by ``sys.exc_info()``. When the program contains\n no suitable handler, the stack trace is written (nicely\n formatted) to the standard error stream; if the interpreter is\n interactive, it is also made available to the user as\n ``sys.last_traceback``.\n\n Special read-only attributes: ``tb_next`` is the next level in\n the stack trace (towards the frame where the exception\n occurred), or ``None`` if there is no next level; ``tb_frame``\n points to the execution frame of the current level;\n ``tb_lineno`` gives the line number where the exception\n occurred; ``tb_lasti`` indicates the precise instruction. The\n line number and last instruction in the traceback may differ\n from the line number of its frame object if the exception\n occurred in a ``try`` statement with no matching except clause\n or with a finally clause.\n\n Slice objects\n Slice objects are used to represent slices for ``__getitem__()``\n methods. They are also created by the built-in ``slice()``\n function.\n\n Special read-only attributes: ``start`` is the lower bound;\n ``stop`` is the upper bound; ``step`` is the step value; each is\n ``None`` if omitted. These attributes can have any type.\n\n Slice objects support one method:\n\n slice.indices(self, length)\n\n This method takes a single integer argument *length* and\n computes information about the slice that the slice object\n would describe if applied to a sequence of *length* items.\n It returns a tuple of three integers; respectively these are\n the *start* and *stop* indices and the *step* or stride\n length of the slice. Missing or out-of-bounds indices are\n handled in a manner consistent with regular slices.\n\n Static method objects\n Static method objects provide a way of defeating the\n transformation of function objects to method objects described\n above. A static method object is a wrapper around any other\n object, usually a user-defined method object. When a static\n method object is retrieved from a class or a class instance, the\n object actually returned is the wrapped object, which is not\n subject to any further transformation. Static method objects are\n not themselves callable, although the objects they wrap usually\n are. Static method objects are created by the built-in\n ``staticmethod()`` constructor.\n\n Class method objects\n A class method object, like a static method object, is a wrapper\n around another object that alters the way in which that object\n is retrieved from classes and class instances. The behaviour of\n class method objects upon such retrieval is described above,\n under "User-defined methods". Class method objects are created\n by the built-in ``classmethod()`` constructor.\n', 'typesfunctions': '\nFunctions\n*********\n\nFunction objects are created by function definitions. The only\noperation on a function object is to call it: ``func(argument-list)``.\n\nThere are really two flavors of function objects: built-in functions\nand user-defined functions. Both support the same operation (to call\nthe function), but the implementation is different, hence the\ndifferent object types.\n\nSee *Function definitions* for more information.\n', - 'typesmapping': '\nMapping Types --- ``dict``\n**************************\n\nA *mapping* object maps *hashable* values to arbitrary objects.\nMappings are mutable objects. There is currently only one standard\nmapping type, the *dictionary*. (For other containers see the built\nin ``list``, ``set``, and ``tuple`` classes, and the ``collections``\nmodule.)\n\nA dictionary\'s keys are *almost* arbitrary values. Values that are\nnot *hashable*, that is, values containing lists, dictionaries or\nother mutable types (that are compared by value rather than by object\nidentity) may not be used as keys. Numeric types used for keys obey\nthe normal rules for numeric comparison: if two numbers compare equal\n(such as ``1`` and ``1.0``) then they can be used interchangeably to\nindex the same dictionary entry. (Note however, that since computers\nstore floating-point numbers as approximations it is usually unwise to\nuse them as dictionary keys.)\n\nDictionaries can be created by placing a comma-separated list of\n``key: value`` pairs within braces, for example: ``{\'jack\': 4098,\n\'sjoerd\': 4127}`` or ``{4098: \'jack\', 4127: \'sjoerd\'}``, or by the\n``dict`` constructor.\n\nclass class dict([arg])\n\n Return a new dictionary initialized from an optional positional\n argument or from a set of keyword arguments. If no arguments are\n given, return a new empty dictionary. If the positional argument\n *arg* is a mapping object, return a dictionary mapping the same\n keys to the same values as does the mapping object. Otherwise the\n positional argument must be a sequence, a container that supports\n iteration, or an iterator object. The elements of the argument\n must each also be of one of those kinds, and each must in turn\n contain exactly two objects. The first is used as a key in the new\n dictionary, and the second as the key\'s value. If a given key is\n seen more than once, the last value associated with it is retained\n in the new dictionary.\n\n If keyword arguments are given, the keywords themselves with their\n associated values are added as items to the dictionary. If a key\n is specified both in the positional argument and as a keyword\n argument, the value associated with the keyword is retained in the\n dictionary. For example, these all return a dictionary equal to\n ``{"one": 2, "two": 3}``:\n\n * ``dict(one=2, two=3)``\n\n * ``dict({\'one\': 2, \'two\': 3})``\n\n * ``dict(zip((\'one\', \'two\'), (2, 3)))``\n\n * ``dict([[\'two\', 3], [\'one\', 2]])``\n\n The first example only works for keys that are valid Python\n identifiers; the others work with any valid keys.\n\n These are the operations that dictionaries support (and therefore,\n custom mapping types should support too):\n\n len(d)\n\n Return the number of items in the dictionary *d*.\n\n d[key]\n\n Return the item of *d* with key *key*. Raises a ``KeyError`` if\n *key* is not in the map.\n\n If a subclass of dict defines a method ``__missing__()``, if the\n key *key* is not present, the ``d[key]`` operation calls that\n method with the key *key* as argument. The ``d[key]`` operation\n then returns or raises whatever is returned or raised by the\n ``__missing__(key)`` call if the key is not present. No other\n operations or methods invoke ``__missing__()``. If\n ``__missing__()`` is not defined, ``KeyError`` is raised.\n ``__missing__()`` must be a method; it cannot be an instance\n variable. For an example, see ``collections.defaultdict``.\n\n d[key] = value\n\n Set ``d[key]`` to *value*.\n\n del d[key]\n\n Remove ``d[key]`` from *d*. Raises a ``KeyError`` if *key* is\n not in the map.\n\n key in d\n\n Return ``True`` if *d* has a key *key*, else ``False``.\n\n key not in d\n\n Equivalent to ``not key in d``.\n\n iter(d)\n\n Return an iterator over the keys of the dictionary. This is a\n shortcut for ``iterkeys()``.\n\n clear()\n\n Remove all items from the dictionary.\n\n copy()\n\n Return a shallow copy of the dictionary.\n\n classmethod fromkeys(seq[, value])\n\n Create a new dictionary with keys from *seq* and values set to\n *value*.\n\n ``fromkeys()`` is a class method that returns a new dictionary.\n *value* defaults to ``None``.\n\n get(key[, default])\n\n Return the value for *key* if *key* is in the dictionary, else\n *default*. If *default* is not given, it defaults to ``None``,\n so that this method never raises a ``KeyError``.\n\n items()\n\n Return a new view of the dictionary\'s items (``(key, value)``\n pairs). See below for documentation of view objects.\n\n keys()\n\n Return a new view of the dictionary\'s keys. See below for\n documentation of view objects.\n\n pop(key[, default])\n\n If *key* is in the dictionary, remove it and return its value,\n else return *default*. If *default* is not given and *key* is\n not in the dictionary, a ``KeyError`` is raised.\n\n popitem()\n\n Remove and return an arbitrary ``(key, value)`` pair from the\n dictionary.\n\n ``popitem()`` is useful to destructively iterate over a\n dictionary, as often used in set algorithms. If the dictionary\n is empty, calling ``popitem()`` raises a ``KeyError``.\n\n setdefault(key[, default])\n\n If *key* is in the dictionary, return its value. If not, insert\n *key* with a value of *default* and return *default*. *default*\n defaults to ``None``.\n\n update([other])\n\n Update the dictionary with the key/value pairs from *other*,\n overwriting existing keys. Return ``None``.\n\n ``update()`` accepts either another dictionary object or an\n iterable of key/value pairs (as a tuple or other iterable of\n length two). If keyword arguments are specified, the\n dictionary is then is updated with those key/value pairs:\n ``d.update(red=1, blue=2)``.\n\n values()\n\n Return a new view of the dictionary\'s values. See below for\n documentation of view objects.\n\n\nDictionary view objects\n=======================\n\nThe objects returned by ``dict.keys()``, ``dict.values()`` and\n``dict.items()`` are *view objects*. They provide a dynamic view on\nthe dictionary\'s entries, which means that when the dictionary\nchanges, the view reflects these changes.\n\nDictionary views can be iterated over to yield their respective data,\nand support membership tests:\n\nlen(dictview)\n\n Return the number of entries in the dictionary.\n\niter(dictview)\n\n Return an iterator over the keys, values or items (represented as\n tuples of ``(key, value)``) in the dictionary.\n\n Keys and values are iterated over in an arbitrary order which is\n non-random, varies across Python implementations, and depends on\n the dictionary\'s history of insertions and deletions. If keys,\n values and items views are iterated over with no intervening\n modifications to the dictionary, the order of items will directly\n correspond. This allows the creation of ``(value, key)`` pairs\n using ``zip()``: ``pairs = zip(d.values(), d.keys())``. Another\n way to create the same list is ``pairs = [(v, k) for (k, v) in\n d.items()]``.\n\n Iterating views while adding or deleting entries in the dictionary\n will raise a ``RuntimeError``.\n\nx in dictview\n\n Return ``True`` if *x* is in the underlying dictionary\'s keys,\n values or items (in the latter case, *x* should be a ``(key,\n value)`` tuple).\n\nKeys views are set-like since their entries are unique and hashable.\nIf all values are hashable, so that (key, value) pairs are unique and\nhashable, then the items view is also set-like. (Values views are not\ntreated as set-like since the entries are generally not unique.) Then\nthese set operations are available ("other" refers either to another\nview or a set):\n\ndictview & other\n\n Return the intersection of the dictview and the other object as a\n new set.\n\ndictview | other\n\n Return the union of the dictview and the other object as a new set.\n\ndictview - other\n\n Return the difference between the dictview and the other object\n (all elements in *dictview* that aren\'t in *other*) as a new set.\n\ndictview ^ other\n\n Return the symmetric difference (all elements either in *dictview*\n or *other*, but not in both) of the dictview and the other object\n as a new set.\n\nAn example of dictionary view usage:\n\n >>> dishes = {\'eggs\': 2, \'sausage\': 1, \'bacon\': 1, \'spam\': 500}\n >>> keys = dishes.keys()\n >>> values = dishes.values()\n\n >>> # iteration\n >>> n = 0\n >>> for val in values:\n ... n += val\n >>> print(n)\n 504\n\n >>> # keys and values are iterated over in the same order\n >>> list(keys)\n [\'eggs\', \'bacon\', \'sausage\', \'spam\']\n >>> list(values)\n [2, 1, 1, 500]\n\n >>> # view objects are dynamic and reflect dict changes\n >>> del dishes[\'eggs\']\n >>> del dishes[\'sausage\']\n >>> list(keys)\n [\'spam\', \'bacon\']\n\n >>> # set operations\n >>> keys & {\'eggs\', \'bacon\', \'salad\'}\n {\'bacon\'}\n', + 'typesmapping': '\nMapping Types --- ``dict``\n**************************\n\nA *mapping* object maps *hashable* values to arbitrary objects.\nMappings are mutable objects. There is currently only one standard\nmapping type, the *dictionary*. (For other containers see the built\nin ``list``, ``set``, and ``tuple`` classes, and the ``collections``\nmodule.)\n\nA dictionary\'s keys are *almost* arbitrary values. Values that are\nnot *hashable*, that is, values containing lists, dictionaries or\nother mutable types (that are compared by value rather than by object\nidentity) may not be used as keys. Numeric types used for keys obey\nthe normal rules for numeric comparison: if two numbers compare equal\n(such as ``1`` and ``1.0``) then they can be used interchangeably to\nindex the same dictionary entry. (Note however, that since computers\nstore floating-point numbers as approximations it is usually unwise to\nuse them as dictionary keys.)\n\nDictionaries can be created by placing a comma-separated list of\n``key: value`` pairs within braces, for example: ``{\'jack\': 4098,\n\'sjoerd\': 4127}`` or ``{4098: \'jack\', 4127: \'sjoerd\'}``, or by the\n``dict`` constructor.\n\nclass class dict([arg])\n\n Return a new dictionary initialized from an optional positional\n argument or from a set of keyword arguments. If no arguments are\n given, return a new empty dictionary. If the positional argument\n *arg* is a mapping object, return a dictionary mapping the same\n keys to the same values as does the mapping object. Otherwise the\n positional argument must be a sequence, a container that supports\n iteration, or an iterator object. The elements of the argument\n must each also be of one of those kinds, and each must in turn\n contain exactly two objects. The first is used as a key in the new\n dictionary, and the second as the key\'s value. If a given key is\n seen more than once, the last value associated with it is retained\n in the new dictionary.\n\n If keyword arguments are given, the keywords themselves with their\n associated values are added as items to the dictionary. If a key\n is specified both in the positional argument and as a keyword\n argument, the value associated with the keyword is retained in the\n dictionary. For example, these all return a dictionary equal to\n ``{"one": 2, "two": 3}``:\n\n * ``dict(one=2, two=3)``\n\n * ``dict({\'one\': 2, \'two\': 3})``\n\n * ``dict(zip((\'one\', \'two\'), (2, 3)))``\n\n * ``dict([[\'two\', 3], [\'one\', 2]])``\n\n The first example only works for keys that are valid Python\n identifiers; the others work with any valid keys.\n\n These are the operations that dictionaries support (and therefore,\n custom mapping types should support too):\n\n len(d)\n\n Return the number of items in the dictionary *d*.\n\n d[key]\n\n Return the item of *d* with key *key*. Raises a ``KeyError`` if\n *key* is not in the map.\n\n If a subclass of dict defines a method ``__missing__()``, if the\n key *key* is not present, the ``d[key]`` operation calls that\n method with the key *key* as argument. The ``d[key]`` operation\n then returns or raises whatever is returned or raised by the\n ``__missing__(key)`` call if the key is not present. No other\n operations or methods invoke ``__missing__()``. If\n ``__missing__()`` is not defined, ``KeyError`` is raised.\n ``__missing__()`` must be a method; it cannot be an instance\n variable. For an example, see ``collections.defaultdict``.\n\n d[key] = value\n\n Set ``d[key]`` to *value*.\n\n del d[key]\n\n Remove ``d[key]`` from *d*. Raises a ``KeyError`` if *key* is\n not in the map.\n\n key in d\n\n Return ``True`` if *d* has a key *key*, else ``False``.\n\n key not in d\n\n Equivalent to ``not key in d``.\n\n iter(d)\n\n Return an iterator over the keys of the dictionary. This is a\n shortcut for ``iterkeys()``.\n\n clear()\n\n Remove all items from the dictionary.\n\n copy()\n\n Return a shallow copy of the dictionary.\n\n classmethod fromkeys(seq[, value])\n\n Create a new dictionary with keys from *seq* and values set to\n *value*.\n\n ``fromkeys()`` is a class method that returns a new dictionary.\n *value* defaults to ``None``.\n\n get(key[, default])\n\n Return the value for *key* if *key* is in the dictionary, else\n *default*. If *default* is not given, it defaults to ``None``,\n so that this method never raises a ``KeyError``.\n\n items()\n\n Return a new view of the dictionary\'s items (``(key, value)``\n pairs). See below for documentation of view objects.\n\n keys()\n\n Return a new view of the dictionary\'s keys. See below for\n documentation of view objects.\n\n pop(key[, default])\n\n If *key* is in the dictionary, remove it and return its value,\n else return *default*. If *default* is not given and *key* is\n not in the dictionary, a ``KeyError`` is raised.\n\n popitem()\n\n Remove and return an arbitrary ``(key, value)`` pair from the\n dictionary.\n\n ``popitem()`` is useful to destructively iterate over a\n dictionary, as often used in set algorithms. If the dictionary\n is empty, calling ``popitem()`` raises a ``KeyError``.\n\n setdefault(key[, default])\n\n If *key* is in the dictionary, return its value. If not, insert\n *key* with a value of *default* and return *default*. *default*\n defaults to ``None``.\n\n update([other])\n\n Update the dictionary with the key/value pairs from *other*,\n overwriting existing keys. Return ``None``.\n\n ``update()`` accepts either another dictionary object or an\n iterable of key/value pairs (as a tuple or other iterable of\n length two). If keyword arguments are specified, the\n dictionary is then is updated with those key/value pairs:\n ``d.update(red=1, blue=2)``.\n\n values()\n\n Return a new view of the dictionary\'s values. See below for\n documentation of view objects.\n\n\nDictionary view objects\n=======================\n\nThe objects returned by ``dict.keys()``, ``dict.values()`` and\n``dict.items()`` are *view objects*. They provide a dynamic view on\nthe dictionary\'s entries, which means that when the dictionary\nchanges, the view reflects these changes.\n\nDictionary views can be iterated over to yield their respective data,\nand support membership tests:\n\nlen(dictview)\n\n Return the number of entries in the dictionary.\n\niter(dictview)\n\n Return an iterator over the keys, values or items (represented as\n tuples of ``(key, value)``) in the dictionary.\n\n Keys and values are iterated over in an arbitrary order which is\n non-random, varies across Python implementations, and depends on\n the dictionary\'s history of insertions and deletions. If keys,\n values and items views are iterated over with no intervening\n modifications to the dictionary, the order of items will directly\n correspond. This allows the creation of ``(value, key)`` pairs\n using ``zip()``: ``pairs = zip(d.values(), d.keys())``. Another\n way to create the same list is ``pairs = [(v, k) for (k, v) in\n d.items()]``.\n\n Iterating views while adding or deleting entries in the dictionary\n may raise a ``RuntimeError`` or fail to iterate over all entries.\n\nx in dictview\n\n Return ``True`` if *x* is in the underlying dictionary\'s keys,\n values or items (in the latter case, *x* should be a ``(key,\n value)`` tuple).\n\nKeys views are set-like since their entries are unique and hashable.\nIf all values are hashable, so that (key, value) pairs are unique and\nhashable, then the items view is also set-like. (Values views are not\ntreated as set-like since the entries are generally not unique.) Then\nthese set operations are available ("other" refers either to another\nview or a set):\n\ndictview & other\n\n Return the intersection of the dictview and the other object as a\n new set.\n\ndictview | other\n\n Return the union of the dictview and the other object as a new set.\n\ndictview - other\n\n Return the difference between the dictview and the other object\n (all elements in *dictview* that aren\'t in *other*) as a new set.\n\ndictview ^ other\n\n Return the symmetric difference (all elements either in *dictview*\n or *other*, but not in both) of the dictview and the other object\n as a new set.\n\nAn example of dictionary view usage:\n\n >>> dishes = {\'eggs\': 2, \'sausage\': 1, \'bacon\': 1, \'spam\': 500}\n >>> keys = dishes.keys()\n >>> values = dishes.values()\n\n >>> # iteration\n >>> n = 0\n >>> for val in values:\n ... n += val\n >>> print(n)\n 504\n\n >>> # keys and values are iterated over in the same order\n >>> list(keys)\n [\'eggs\', \'bacon\', \'sausage\', \'spam\']\n >>> list(values)\n [2, 1, 1, 500]\n\n >>> # view objects are dynamic and reflect dict changes\n >>> del dishes[\'eggs\']\n >>> del dishes[\'sausage\']\n >>> list(keys)\n [\'spam\', \'bacon\']\n\n >>> # set operations\n >>> keys & {\'eggs\', \'bacon\', \'salad\'}\n {\'bacon\'}\n', 'typesmethods': "\nMethods\n*******\n\nMethods are functions that are called using the attribute notation.\nThere are two flavors: built-in methods (such as ``append()`` on\nlists) and class instance methods. Built-in methods are described\nwith the types that support them.\n\nIf you access a method (a function defined in a class namespace)\nthrough an instance, you get a special object: a *bound method* (also\ncalled *instance method*) object. When called, it will add the\n``self`` argument to the argument list. Bound methods have two\nspecial read-only attributes: ``m.__self__`` is the object on which\nthe method operates, and ``m.__func__`` is the function implementing\nthe method. Calling ``m(arg-1, arg-2, ..., arg-n)`` is completely\nequivalent to calling ``m.__func__(m.__self__, arg-1, arg-2, ...,\narg-n)``.\n\nLike function objects, bound method objects support getting arbitrary\nattributes. However, since method attributes are actually stored on\nthe underlying function object (``meth.__func__``), setting method\nattributes on bound methods is disallowed. Attempting to set a method\nattribute results in a ``TypeError`` being raised. In order to set a\nmethod attribute, you need to explicitly set it on the underlying\nfunction object:\n\n class C:\n def method(self):\n pass\n\n c = C()\n c.method.__func__.whoami = 'my name is c'\n\nSee *The standard type hierarchy* for more information.\n", 'typesmodules': "\nModules\n*******\n\nThe only special operation on a module is attribute access:\n``m.name``, where *m* is a module and *name* accesses a name defined\nin *m*'s symbol table. Module attributes can be assigned to. (Note\nthat the ``import`` statement is not, strictly speaking, an operation\non a module object; ``import foo`` does not require a module object\nnamed *foo* to exist, rather it requires an (external) *definition*\nfor a module named *foo* somewhere.)\n\nA special member of every module is ``__dict__``. This is the\ndictionary containing the module's symbol table. Modifying this\ndictionary will actually change the module's symbol table, but direct\nassignment to the ``__dict__`` attribute is not possible (you can\nwrite ``m.__dict__['a'] = 1``, which defines ``m.a`` to be ``1``, but\nyou can't write ``m.__dict__ = {}``). Modifying ``__dict__`` directly\nis not recommended.\n\nModules built into the interpreter are written like this: ````. If loaded from a file, they are written as\n````.\n", - 'typesseq': '\nSequence Types --- ``str``, ``bytes``, ``bytearray``, ``list``, ``tuple``, ``range``\n************************************************************************************\n\nThere are six sequence types: strings, byte sequences (``bytes``\nobjects), byte arrays (``bytearray`` objects), lists, tuples, and\nrange objects. For other containers see the built in ``dict`` and\n``set`` classes, and the ``collections`` module.\n\nStrings contain Unicode characters. Their literals are written in\nsingle or double quotes: ``\'xyzzy\'``, ``"frobozz"``. See *String and\nBytes literals* for more about string literals. In addition to the\nfunctionality described here, there are also string-specific methods\ndescribed in the *String Methods* section.\n\nBytes and bytearray objects contain single bytes -- the former is\nimmutable while the latter is a mutable sequence. Bytes objects can\nbe constructed the constructor, ``bytes()``, and from literals; use a\n``b`` prefix with normal string syntax: ``b\'xyzzy\'``. To construct\nbyte arrays, use the ``bytearray()`` function.\n\nWarning: While string objects are sequences of characters (represented by\n strings of length 1), bytes and bytearray objects are sequences of\n *integers* (between 0 and 255), representing the ASCII value of\n single bytes. That means that for a bytes or bytearray object *b*,\n ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes or\n bytearray object of length 1. The representation of bytes objects\n uses the literal format (``b\'...\'``) since it is generally more\n useful than e.g. ``bytes([50, 19, 100])``. You can always convert a\n bytes object into a list of integers using ``list(b)``.Also, while\n in previous Python versions, byte strings and Unicode strings could\n be exchanged for each other rather freely (barring encoding issues),\n strings and bytes are now completely separate concepts. There\'s no\n implicit en-/decoding if you pass and object of the wrong type. A\n string always compares unequal to a bytes or bytearray object.\n\nLists are constructed with square brackets, separating items with\ncommas: ``[a, b, c]``. Tuples are constructed by the comma operator\n(not within square brackets), with or without enclosing parentheses,\nbut an empty tuple must have the enclosing parentheses, such as ``a,\nb, c`` or ``()``. A single item tuple must have a trailing comma,\nsuch as ``(d,)``.\n\nObjects of type range are created using the ``range()`` function.\nThey don\'t support slicing, concatenation or repetition, and using\n``in``, ``not in``, ``min()`` or ``max()`` on them is inefficient.\n\nMost sequence types support the following operations. The ``in`` and\n``not in`` operations have the same priorities as the comparison\noperations. The ``+`` and ``*`` operations have the same priority as\nthe corresponding numeric operations. [3] Additional methods are\nprovided for *Mutable Sequence Types*.\n\nThis table lists the sequence operations sorted in ascending priority\n(operations in the same box have the same priority). In the table,\n*s* and *t* are sequences of the same type; *n*, *i* and *j* are\nintegers:\n\n+--------------------+----------------------------------+------------+\n| Operation | Result | Notes |\n+====================+==================================+============+\n| ``x in s`` | ``True`` if an item of *s* is | (1) |\n| | equal to *x*, else ``False`` | |\n+--------------------+----------------------------------+------------+\n| ``x not in s`` | ``False`` if an item of *s* is | (1) |\n| | equal to *x*, else ``True`` | |\n+--------------------+----------------------------------+------------+\n| ``s + t`` | the concatenation of *s* and *t* | (6) |\n+--------------------+----------------------------------+------------+\n| ``s * n, n * s`` | *n* shallow copies of *s* | (2) |\n| | concatenated | |\n+--------------------+----------------------------------+------------+\n| ``s[i]`` | *i*\'th item of *s*, origin 0 | (3) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j]`` | slice of *s* from *i* to *j* | (3)(4) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j:k]`` | slice of *s* from *i* to *j* | (3)(5) |\n| | with step *k* | |\n+--------------------+----------------------------------+------------+\n| ``len(s)`` | length of *s* | |\n+--------------------+----------------------------------+------------+\n| ``min(s)`` | smallest item of *s* | |\n+--------------------+----------------------------------+------------+\n| ``max(s)`` | largest item of *s* | |\n+--------------------+----------------------------------+------------+\n\nSequence types also support comparisons. In particular, tuples and\nlists are compared lexicographically by comparing corresponding\nelements. This means that to compare equal, every element must\ncompare equal and the two sequences must be of the same type and have\nthe same length. (For full details see *Comparisons* in the language\nreference.)\n\nNotes:\n\n1. When *s* is a string object, the ``in`` and ``not in`` operations\n act like a substring test.\n\n2. Values of *n* less than ``0`` are treated as ``0`` (which yields an\n empty sequence of the same type as *s*). Note also that the copies\n are shallow; nested structures are not copied. This often haunts\n new Python programmers; consider:\n\n >>> lists = [[]] * 3\n >>> lists\n [[], [], []]\n >>> lists[0].append(3)\n >>> lists\n [[3], [3], [3]]\n\n What has happened is that ``[[]]`` is a one-element list containing\n an empty list, so all three elements of ``[[]] * 3`` are (pointers\n to) this single empty list. Modifying any of the elements of\n ``lists`` modifies this single list. You can create a list of\n different lists this way:\n\n >>> lists = [[] for i in range(3)]\n >>> lists[0].append(3)\n >>> lists[1].append(5)\n >>> lists[2].append(7)\n >>> lists\n [[3], [5], [7]]\n\n3. If *i* or *j* is negative, the index is relative to the end of the\n string: ``len(s) + i`` or ``len(s) + j`` is substituted. But note\n that ``-0`` is still ``0``.\n\n4. The slice of *s* from *i* to *j* is defined as the sequence of\n items with index *k* such that ``i <= k < j``. If *i* or *j* is\n greater than ``len(s)``, use ``len(s)``. If *i* is omitted or\n ``None``, use ``0``. If *j* is omitted or ``None``, use\n ``len(s)``. If *i* is greater than or equal to *j*, the slice is\n empty.\n\n5. The slice of *s* from *i* to *j* with step *k* is defined as the\n sequence of items with index ``x = i + n*k`` such that ``0 <= n <\n (j-i)/k``. In other words, the indices are ``i``, ``i+k``,\n ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is reached (but\n never including *j*). If *i* or *j* is greater than ``len(s)``,\n use ``len(s)``. If *i* or *j* are omitted or ``None``, they become\n "end" values (which end depends on the sign of *k*). Note, *k*\n cannot be zero. If *k* is ``None``, it is treated like ``1``.\n\n6. If *s* and *t* are both strings, some Python implementations such\n as CPython can usually perform an in-place optimization for\n assignments of the form ``s=s+t`` or ``s+=t``. When applicable,\n this optimization makes quadratic run-time much less likely. This\n optimization is both version and implementation dependent. For\n performance sensitive code, it is preferable to use the\n ``str.join()`` method which assures consistent linear concatenation\n performance across versions and implementations.\n\n\nString Methods\n==============\n\nString objects support the methods listed below. Note that none of\nthese methods take keyword arguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, bytes, bytearray, list,\ntuple, range* section. To output formatted strings, see the *String\nFormatting* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\nstr.count(sub[, start[, end]])\n\n Return the number of non-overlapping occurrences of substring *sub*\n in the range [*start*, *end*]. Optional arguments *start* and\n *end* are interpreted as in slice notation.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string as a bytes object. Default\n encoding is the current default string encoding. *errors* may be\n given to set a different error handling scheme. The default for\n *errors* is ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(*args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\nstr.isdecimal()\n\n Return true if all characters in the string are decimal characters\n and there is at least one character, false otherwise. Decimal\n characters include digit characters, and all characters that that\n can be used to form decimal-radix numbers, e.g. U+0660, ARABIC-\n INDIC DIGIT ZERO.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\nstr.isidentifier()\n\n Return true if the string is a valid identifier according to the\n language definition, section *Identifiers and keywords*.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\nstr.isnumeric()\n\n Return true if all characters in the string are numeric characters,\n and there is at least one character, false otherwise. Numeric\n characters include digit characters, and all characters that have\n the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION\n ONE FIFTH.\n\nstr.isprintable()\n\n Return true if all characters in the string are printable or the\n string is empty, false otherwise. Nonprintable characters are\n those characters defined in the Unicode character database as\n "Other" or "Separator", excepting the ASCII space (0x20) which is\n considered printable. (Note that printable characters in this\n context are those which should not be escaped when ``repr()`` is\n invoked on a string. It has no bearing on the handling of strings\n written to ``sys.stdout`` or ``sys.stderr``.)\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. A ``TypeError`` will be raised if there are any\n non-string values in *seq*, including ``bytes`` objects. The\n separator between elements is the string providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\nstatic str.maketrans(x[, y[, z]])\n\n This static method returns a translation table usable for\n ``str.translate()``.\n\n If there is only one argument, it must be a dictionary mapping\n Unicode ordinals (integers) or characters (strings of length 1) to\n Unicode ordinals, strings (of arbitrary lengths) or None.\n Character keys will then be converted to ordinals.\n\n If there are two arguments, they must be strings of equal length,\n and in the resulting dictionary, each character in x will be mapped\n to the character at the same position in y. If there is a third\n argument, it must be a string, whose characters will be mapped to\n None in the result.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\nstr.translate(map)\n\n Return a copy of the *s* where all characters have been mapped\n through the *map* which must be a dictionary of Unicode ordinals\n (integers) to Unicode ordinals, strings or ``None``. Unmapped\n characters are left untouched. Characters mapped to ``None`` are\n deleted.\n\n You can use ``str.maketrans()`` to create a translation map from\n character-to-character mappings in different formats.\n\n Note: An even more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see\n ``encodings.cp1251`` for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n\nOld String Formatting Operations\n================================\n\nNote: The formatting operations described here are obsolete and may go\n away in future versions of Python. Use the new *String Formatting*\n in new code.\n\nString objects have one unique built-in operation: the ``%`` operator\n(modulo). This is also known as the string *formatting* or\n*interpolation* operator. Given ``format % values`` (where *format* is\na string), ``%`` conversion specifications in *format* are replaced\nwith zero or more elements of *values*. The effect is similar to the\nusing ``sprintf`` in the C language.\n\nIf *format* requires a single argument, *values* may be a single non-\ntuple object. [4] Otherwise, *values* must be a tuple with exactly\nthe number of items specified by the format string, or a single\nmapping object (for example, a dictionary).\n\nA conversion specifier contains two or more characters and has the\nfollowing components, which must occur in this order:\n\n1. The ``\'%\'`` character, which marks the start of the specifier.\n\n2. Mapping key (optional), consisting of a parenthesised sequence of\n characters (for example, ``(somename)``).\n\n3. Conversion flags (optional), which affect the result of some\n conversion types.\n\n4. Minimum field width (optional). If specified as an ``\'*\'``\n (asterisk), the actual width is read from the next element of the\n tuple in *values*, and the object to convert comes after the\n minimum field width and optional precision.\n\n5. Precision (optional), given as a ``\'.\'`` (dot) followed by the\n precision. If specified as ``\'*\'`` (an asterisk), the actual width\n is read from the next element of the tuple in *values*, and the\n value to convert comes after the precision.\n\n6. Length modifier (optional).\n\n7. Conversion type.\n\nWhen the right argument is a dictionary (or other mapping type), then\nthe formats in the string *must* include a parenthesised mapping key\ninto that dictionary inserted immediately after the ``\'%\'`` character.\nThe mapping key selects the value to be formatted from the mapping.\nFor example:\n\n>>> print(\'%(language)s has %(#)03d quote types.\' % \\\n... {\'language\': "Python", "#": 2})\nPython has 002 quote types.\n\nIn this case no ``*`` specifiers may occur in a format (since they\nrequire a sequential parameter list).\n\nThe conversion flag characters are:\n\n+-----------+-----------------------------------------------------------------------+\n| Flag | Meaning |\n+===========+=======================================================================+\n| ``\'#\'`` | The value conversion will use the "alternate form" (where defined |\n| | below). |\n+-----------+-----------------------------------------------------------------------+\n| ``\'0\'`` | The conversion will be zero padded for numeric values. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'-\'`` | The converted value is left adjusted (overrides the ``\'0\'`` |\n| | conversion if both are given). |\n+-----------+-----------------------------------------------------------------------+\n| ``\' \'`` | (a space) A blank should be left before a positive number (or empty |\n| | string) produced by a signed conversion. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'+\'`` | A sign character (``\'+\'`` or ``\'-\'``) will precede the conversion |\n| | (overrides a "space" flag). |\n+-----------+-----------------------------------------------------------------------+\n\nA length modifier (``h``, ``l``, or ``L``) may be present, but is\nignored as it is not necessary for Python -- so e.g. ``%ld`` is\nidentical to ``%d``.\n\nThe conversion types are:\n\n+--------------+-------------------------------------------------------+---------+\n| Conversion | Meaning | Notes |\n+==============+=======================================================+=========+\n| ``\'d\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'i\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'o\'`` | Signed octal value. | (1) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'u\'`` | Obsolete type -- it is identical to ``\'d\'``. | (7) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'x\'`` | Signed hexadecimal (lowercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'X\'`` | Signed hexadecimal (uppercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'e\'`` | Floating point exponential format (lowercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'E\'`` | Floating point exponential format (uppercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'f\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'F\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'g\'`` | Floating point format. Uses lowercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'G\'`` | Floating point format. Uses uppercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'c\'`` | Single character (accepts integer or single character | |\n| | string). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'r\'`` | String (converts any python object using ``repr()``). | (5) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'s\'`` | String (converts any python object using ``str()``). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'%\'`` | No argument is converted, results in a ``\'%\'`` | |\n| | character in the result. | |\n+--------------+-------------------------------------------------------+---------+\n\nNotes:\n\n1. The alternate form causes a leading zero (``\'0\'``) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n2. The alternate form causes a leading ``\'0x\'`` or ``\'0X\'`` (depending\n on whether the ``\'x\'`` or ``\'X\'`` format was used) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n3. The alternate form causes the result to always contain a decimal\n point, even if no digits follow it.\n\n The precision determines the number of digits after the decimal\n point and defaults to 6.\n\n4. The alternate form causes the result to always contain a decimal\n point, and trailing zeroes are not removed as they would otherwise\n be.\n\n The precision determines the number of significant digits before\n and after the decimal point and defaults to 6.\n\n5. The precision determines the maximal number of characters used.\n\n1. See **PEP 237**.\n\nSince Python strings have an explicit length, ``%s`` conversions do\nnot assume that ``\'\\0\'`` is the end of the string.\n\nChanged in version 3.1: ``%f`` conversions for numbers whose absolute\nvalue is over 1e50 are no longer replaced by ``%g`` conversions.\n\nAdditional string operations are defined in standard modules\n``string`` and ``re``.\n\n\nRange Type\n==========\n\nThe ``range`` type is an immutable sequence which is commonly used for\nlooping. The advantage of the ``range`` type is that an ``range``\nobject will always take the same amount of memory, no matter the size\nof the range it represents. There are no consistent performance\nadvantages.\n\nRange objects have very little behavior: they only support indexing,\niteration, and the ``len()`` function.\n\n\nMutable Sequence Types\n======================\n\nList and bytearray objects support additional operations that allow\nin-place modification of the object. Other mutable sequence types\n(when added to the language) should also support these operations.\nStrings and tuples are immutable sequence types: such objects cannot\nbe modified once created. The following operations are defined on\nmutable sequence types (where *x* is an arbitrary object).\n\nNote that while lists allow their items to be of any type, bytearray\nobject "items" are all integers in the range 0 <= x < 256.\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (2) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*\'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (3) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (5) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (6) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([key[, reverse]])`` | sort the items of *s* in place | (6), (7), (8) |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. *x* can be any iterable object.\n\n3. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the sequence length is added, as for slice indices. If it\n is still negative, it is truncated to zero, as for slice indices.\n\n4. When a negative index is passed as the first parameter to the\n ``insert()`` method, the sequence length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n5. The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n6. The ``sort()`` and ``reverse()`` methods modify the sequence in\n place for economy of space when sorting or reversing a large\n sequence. To remind you that they operate by side effect, they\n don\'t return the sorted or reversed sequence.\n\n7. The ``sort()`` method takes optional arguments for controlling the\n comparisons. Each must be specified as a keyword argument.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n The ``sort()`` method is guaranteed to be stable. A sort is stable\n if it guarantees not to change the relative order of elements that\n compare equal --- this is helpful for sorting in multiple passes\n (for example, sort by department, then by salary grade).\n\n While a list is being sorted, the effect of attempting to mutate,\n or even inspect, the list is undefined. The C implementation makes\n the list appear empty for the duration, and raises ``ValueError``\n if it can detect that the list has been mutated during a sort.\n\n8. ``sort()`` is not supported by ``bytearray`` objects.\n\n\nBytes and Byte Array Methods\n============================\n\nBytes and bytearray objects, being "strings of bytes", have all\nmethods found on strings, with the exception of ``encode()``,\n``format()`` and ``isidentifier()``, which do not make sense with\nthese types. For converting the objects to strings, they have a\n``decode()`` method.\n\nWherever one of these methods needs to interpret the bytes as\ncharacters (e.g. the ``is...()`` methods), the ASCII character set is\nassumed.\n\nNote: The methods on bytes and bytearray objects don\'t accept strings as\n their arguments, just as the methods on strings don\'t accept bytes\n as their arguments. For example, you have to write\n\n a = "abc"\n b = a.replace("a", "f")\n\n and\n\n a = b"abc"\n b = a.replace(b"a", b"f")\n\nbytes.decode([encoding[, errors]])\nbytearray.decode([encoding[, errors]])\n\n Return a string decoded from the given bytes. Default encoding is\n the current default string encoding. *errors* may be given to set\n a different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'`` and any other name registered via\n ``codecs.register_error()``, see section *Codec Base Classes*. For\n a list of possible encodings, see section *Standard Encodings*.\n\nThe bytes and bytearray types have an additional class method:\n\nclassmethod bytes.fromhex(string)\nclassmethod bytearray.fromhex(string)\n\n This ``bytes`` class method returns a bytes or bytearray object,\n decoding the given string object. The string must contain two\n hexadecimal digits per byte, spaces are ignored.\n\n >>> bytes.fromhex(\'f0 f1f2 \')\n b\'\\xf0\\xf1\\xf2\'\n\nThe maketrans and translate methods differ in semantics from the\nversions available on strings:\n\nbytes.translate(table[, delete])\n\n Return a copy of the bytes or bytearray object where all bytes\n occurring in the optional argument *delete* are removed, and the\n remaining bytes have been mapped through the given translation\n table, which must be a bytes object of length 256.\n\n You can use the ``bytes.maketrans()`` method to create a\n translation table.\n\n Set the *table* argument to ``None`` for translations that only\n delete characters:\n\n >>> b\'read this short text\'.translate(None, b\'aeiou\')\n b\'rd ths shrt txt\'\n\nstatic bytes.maketrans(from, to)\n\n This static method returns a translation table usable for\n ``bytes.translate()`` that will map each character in *from* into\n the character at the same position in *to*; *from* and *to* must be\n bytes objects and have the same length.\n\n New in version 3.1.\n', + 'typesseq': '\nSequence Types --- ``str``, ``bytes``, ``bytearray``, ``list``, ``tuple``, ``range``\n************************************************************************************\n\nThere are six sequence types: strings, byte sequences (``bytes``\nobjects), byte arrays (``bytearray`` objects), lists, tuples, and\nrange objects. For other containers see the built in ``dict`` and\n``set`` classes, and the ``collections`` module.\n\nStrings contain Unicode characters. Their literals are written in\nsingle or double quotes: ``\'xyzzy\'``, ``"frobozz"``. See *String and\nBytes literals* for more about string literals. In addition to the\nfunctionality described here, there are also string-specific methods\ndescribed in the *String Methods* section.\n\nBytes and bytearray objects contain single bytes -- the former is\nimmutable while the latter is a mutable sequence. Bytes objects can\nbe constructed the constructor, ``bytes()``, and from literals; use a\n``b`` prefix with normal string syntax: ``b\'xyzzy\'``. To construct\nbyte arrays, use the ``bytearray()`` function.\n\nWarning: While string objects are sequences of characters (represented by\n strings of length 1), bytes and bytearray objects are sequences of\n *integers* (between 0 and 255), representing the ASCII value of\n single bytes. That means that for a bytes or bytearray object *b*,\n ``b[0]`` will be an integer, while ``b[0:1]`` will be a bytes or\n bytearray object of length 1. The representation of bytes objects\n uses the literal format (``b\'...\'``) since it is generally more\n useful than e.g. ``bytes([50, 19, 100])``. You can always convert a\n bytes object into a list of integers using ``list(b)``.Also, while\n in previous Python versions, byte strings and Unicode strings could\n be exchanged for each other rather freely (barring encoding issues),\n strings and bytes are now completely separate concepts. There\'s no\n implicit en-/decoding if you pass and object of the wrong type. A\n string always compares unequal to a bytes or bytearray object.\n\nLists are constructed with square brackets, separating items with\ncommas: ``[a, b, c]``. Tuples are constructed by the comma operator\n(not within square brackets), with or without enclosing parentheses,\nbut an empty tuple must have the enclosing parentheses, such as ``a,\nb, c`` or ``()``. A single item tuple must have a trailing comma,\nsuch as ``(d,)``.\n\nObjects of type range are created using the ``range()`` function.\nThey don\'t support slicing, concatenation or repetition, and using\n``in``, ``not in``, ``min()`` or ``max()`` on them is inefficient.\n\nMost sequence types support the following operations. The ``in`` and\n``not in`` operations have the same priorities as the comparison\noperations. The ``+`` and ``*`` operations have the same priority as\nthe corresponding numeric operations. [3] Additional methods are\nprovided for *Mutable Sequence Types*.\n\nThis table lists the sequence operations sorted in ascending priority\n(operations in the same box have the same priority). In the table,\n*s* and *t* are sequences of the same type; *n*, *i* and *j* are\nintegers:\n\n+--------------------+----------------------------------+------------+\n| Operation | Result | Notes |\n+====================+==================================+============+\n| ``x in s`` | ``True`` if an item of *s* is | (1) |\n| | equal to *x*, else ``False`` | |\n+--------------------+----------------------------------+------------+\n| ``x not in s`` | ``False`` if an item of *s* is | (1) |\n| | equal to *x*, else ``True`` | |\n+--------------------+----------------------------------+------------+\n| ``s + t`` | the concatenation of *s* and *t* | (6) |\n+--------------------+----------------------------------+------------+\n| ``s * n, n * s`` | *n* shallow copies of *s* | (2) |\n| | concatenated | |\n+--------------------+----------------------------------+------------+\n| ``s[i]`` | *i*\'th item of *s*, origin 0 | (3) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j]`` | slice of *s* from *i* to *j* | (3)(4) |\n+--------------------+----------------------------------+------------+\n| ``s[i:j:k]`` | slice of *s* from *i* to *j* | (3)(5) |\n| | with step *k* | |\n+--------------------+----------------------------------+------------+\n| ``len(s)`` | length of *s* | |\n+--------------------+----------------------------------+------------+\n| ``min(s)`` | smallest item of *s* | |\n+--------------------+----------------------------------+------------+\n| ``max(s)`` | largest item of *s* | |\n+--------------------+----------------------------------+------------+\n\nSequence types also support comparisons. In particular, tuples and\nlists are compared lexicographically by comparing corresponding\nelements. This means that to compare equal, every element must\ncompare equal and the two sequences must be of the same type and have\nthe same length. (For full details see *Comparisons* in the language\nreference.)\n\nNotes:\n\n1. When *s* is a string object, the ``in`` and ``not in`` operations\n act like a substring test.\n\n2. Values of *n* less than ``0`` are treated as ``0`` (which yields an\n empty sequence of the same type as *s*). Note also that the copies\n are shallow; nested structures are not copied. This often haunts\n new Python programmers; consider:\n\n >>> lists = [[]] * 3\n >>> lists\n [[], [], []]\n >>> lists[0].append(3)\n >>> lists\n [[3], [3], [3]]\n\n What has happened is that ``[[]]`` is a one-element list containing\n an empty list, so all three elements of ``[[]] * 3`` are (pointers\n to) this single empty list. Modifying any of the elements of\n ``lists`` modifies this single list. You can create a list of\n different lists this way:\n\n >>> lists = [[] for i in range(3)]\n >>> lists[0].append(3)\n >>> lists[1].append(5)\n >>> lists[2].append(7)\n >>> lists\n [[3], [5], [7]]\n\n3. If *i* or *j* is negative, the index is relative to the end of the\n string: ``len(s) + i`` or ``len(s) + j`` is substituted. But note\n that ``-0`` is still ``0``.\n\n4. The slice of *s* from *i* to *j* is defined as the sequence of\n items with index *k* such that ``i <= k < j``. If *i* or *j* is\n greater than ``len(s)``, use ``len(s)``. If *i* is omitted or\n ``None``, use ``0``. If *j* is omitted or ``None``, use\n ``len(s)``. If *i* is greater than or equal to *j*, the slice is\n empty.\n\n5. The slice of *s* from *i* to *j* with step *k* is defined as the\n sequence of items with index ``x = i + n*k`` such that ``0 <= n <\n (j-i)/k``. In other words, the indices are ``i``, ``i+k``,\n ``i+2*k``, ``i+3*k`` and so on, stopping when *j* is reached (but\n never including *j*). If *i* or *j* is greater than ``len(s)``,\n use ``len(s)``. If *i* or *j* are omitted or ``None``, they become\n "end" values (which end depends on the sign of *k*). Note, *k*\n cannot be zero. If *k* is ``None``, it is treated like ``1``.\n\n6. If *s* and *t* are both strings, some Python implementations such\n as CPython can usually perform an in-place optimization for\n assignments of the form ``s=s+t`` or ``s+=t``. When applicable,\n this optimization makes quadratic run-time much less likely. This\n optimization is both version and implementation dependent. For\n performance sensitive code, it is preferable to use the\n ``str.join()`` method which assures consistent linear concatenation\n performance across versions and implementations.\n\n\nString Methods\n==============\n\nString objects support the methods listed below. Note that none of\nthese methods take keyword arguments.\n\nIn addition, Python\'s strings support the sequence type methods\ndescribed in the *Sequence Types --- str, bytes, bytearray, list,\ntuple, range* section. To output formatted strings, see the *String\nFormatting* section. Also, see the ``re`` module for string functions\nbased on regular expressions.\n\nstr.capitalize()\n\n Return a copy of the string with only its first character\n capitalized.\n\nstr.center(width[, fillchar])\n\n Return centered in a string of length *width*. Padding is done\n using the specified *fillchar* (default is a space).\n\nstr.count(sub[, start[, end]])\n\n Return the number of non-overlapping occurrences of substring *sub*\n in the range [*start*, *end*]. Optional arguments *start* and\n *end* are interpreted as in slice notation.\n\nstr.encode([encoding[, errors]])\n\n Return an encoded version of the string as a bytes object. Default\n encoding is the current default string encoding. *errors* may be\n given to set a different error handling scheme. The default for\n *errors* is ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'``, ``\'xmlcharrefreplace\'``, ``\'backslashreplace\'`` and\n any other name registered via ``codecs.register_error()``, see\n section *Codec Base Classes*. For a list of possible encodings, see\n section *Standard Encodings*.\n\nstr.endswith(suffix[, start[, end]])\n\n Return ``True`` if the string ends with the specified *suffix*,\n otherwise return ``False``. *suffix* can also be a tuple of\n suffixes to look for. With optional *start*, test beginning at\n that position. With optional *end*, stop comparing at that\n position.\n\nstr.expandtabs([tabsize])\n\n Return a copy of the string where all tab characters are replaced\n by one or more spaces, depending on the current column and the\n given tab size. The column number is reset to zero after each\n newline occurring in the string. If *tabsize* is not given, a tab\n size of ``8`` characters is assumed. This doesn\'t understand other\n non-printing characters or escape sequences.\n\nstr.find(sub[, start[, end]])\n\n Return the lowest index in the string where substring *sub* is\n found, such that *sub* is contained in the range [*start*, *end*].\n Optional arguments *start* and *end* are interpreted as in slice\n notation. Return ``-1`` if *sub* is not found.\n\nstr.format(*args, **kwargs)\n\n Perform a string formatting operation. The *format_string*\n argument can contain literal text or replacement fields delimited\n by braces ``{}``. Each replacement field contains either the\n numeric index of a positional argument, or the name of a keyword\n argument. Returns a copy of *format_string* where each replacement\n field is replaced with the string value of the corresponding\n argument.\n\n >>> "The sum of 1 + 2 is {0}".format(1+2)\n \'The sum of 1 + 2 is 3\'\n\n See *Format String Syntax* for a description of the various\n formatting options that can be specified in format strings.\n\nstr.index(sub[, start[, end]])\n\n Like ``find()``, but raise ``ValueError`` when the substring is not\n found.\n\nstr.isalnum()\n\n Return true if all characters in the string are alphanumeric and\n there is at least one character, false otherwise.\n\nstr.isalpha()\n\n Return true if all characters in the string are alphabetic and\n there is at least one character, false otherwise.\n\nstr.isdecimal()\n\n Return true if all characters in the string are decimal characters\n and there is at least one character, false otherwise. Decimal\n characters include digit characters, and all characters that that\n can be used to form decimal-radix numbers, e.g. U+0660, ARABIC-\n INDIC DIGIT ZERO.\n\nstr.isdigit()\n\n Return true if all characters in the string are digits and there is\n at least one character, false otherwise.\n\nstr.isidentifier()\n\n Return true if the string is a valid identifier according to the\n language definition, section *Identifiers and keywords*.\n\nstr.islower()\n\n Return true if all cased characters in the string are lowercase and\n there is at least one cased character, false otherwise.\n\nstr.isnumeric()\n\n Return true if all characters in the string are numeric characters,\n and there is at least one character, false otherwise. Numeric\n characters include digit characters, and all characters that have\n the Unicode numeric value property, e.g. U+2155, VULGAR FRACTION\n ONE FIFTH.\n\nstr.isprintable()\n\n Return true if all characters in the string are printable or the\n string is empty, false otherwise. Nonprintable characters are\n those characters defined in the Unicode character database as\n "Other" or "Separator", excepting the ASCII space (0x20) which is\n considered printable. (Note that printable characters in this\n context are those which should not be escaped when ``repr()`` is\n invoked on a string. It has no bearing on the handling of strings\n written to ``sys.stdout`` or ``sys.stderr``.)\n\nstr.isspace()\n\n Return true if there are only whitespace characters in the string\n and there is at least one character, false otherwise.\n\nstr.istitle()\n\n Return true if the string is a titlecased string and there is at\n least one character, for example uppercase characters may only\n follow uncased characters and lowercase characters only cased ones.\n Return false otherwise.\n\nstr.isupper()\n\n Return true if all cased characters in the string are uppercase and\n there is at least one cased character, false otherwise.\n\nstr.join(seq)\n\n Return a string which is the concatenation of the strings in the\n sequence *seq*. A ``TypeError`` will be raised if there are any\n non-string values in *seq*, including ``bytes`` objects. The\n separator between elements is the string providing this method.\n\nstr.ljust(width[, fillchar])\n\n Return the string left justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.lower()\n\n Return a copy of the string converted to lowercase.\n\nstr.lstrip([chars])\n\n Return a copy of the string with leading characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a prefix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.lstrip()\n \'spacious \'\n >>> \'www.example.com\'.lstrip(\'cmowz.\')\n \'example.com\'\n\nstatic str.maketrans(x[, y[, z]])\n\n This static method returns a translation table usable for\n ``str.translate()``.\n\n If there is only one argument, it must be a dictionary mapping\n Unicode ordinals (integers) or characters (strings of length 1) to\n Unicode ordinals, strings (of arbitrary lengths) or None.\n Character keys will then be converted to ordinals.\n\n If there are two arguments, they must be strings of equal length,\n and in the resulting dictionary, each character in x will be mapped\n to the character at the same position in y. If there is a third\n argument, it must be a string, whose characters will be mapped to\n None in the result.\n\nstr.partition(sep)\n\n Split the string at the first occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing the string itself, followed by\n two empty strings.\n\nstr.replace(old, new[, count])\n\n Return a copy of the string with all occurrences of substring *old*\n replaced by *new*. If the optional argument *count* is given, only\n the first *count* occurrences are replaced.\n\nstr.rfind(sub[, start[, end]])\n\n Return the highest index in the string where substring *sub* is\n found, such that *sub* is contained within s[start,end]. Optional\n arguments *start* and *end* are interpreted as in slice notation.\n Return ``-1`` on failure.\n\nstr.rindex(sub[, start[, end]])\n\n Like ``rfind()`` but raises ``ValueError`` when the substring *sub*\n is not found.\n\nstr.rjust(width[, fillchar])\n\n Return the string right justified in a string of length *width*.\n Padding is done using the specified *fillchar* (default is a\n space). The original string is returned if *width* is less than\n ``len(s)``.\n\nstr.rpartition(sep)\n\n Split the string at the last occurrence of *sep*, and return a\n 3-tuple containing the part before the separator, the separator\n itself, and the part after the separator. If the separator is not\n found, return a 3-tuple containing two empty strings, followed by\n the string itself.\n\nstr.rsplit([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit* splits\n are done, the *rightmost* ones. If *sep* is not specified or\n ``None``, any whitespace string is a separator. Except for\n splitting from the right, ``rsplit()`` behaves like ``split()``\n which is described in detail below.\n\nstr.rstrip([chars])\n\n Return a copy of the string with trailing characters removed. The\n *chars* argument is a string specifying the set of characters to be\n removed. If omitted or ``None``, the *chars* argument defaults to\n removing whitespace. The *chars* argument is not a suffix; rather,\n all combinations of its values are stripped:\n\n >>> \' spacious \'.rstrip()\n \' spacious\'\n >>> \'mississippi\'.rstrip(\'ipz\')\n \'mississ\'\n\nstr.split([sep[, maxsplit]])\n\n Return a list of the words in the string, using *sep* as the\n delimiter string. If *maxsplit* is given, at most *maxsplit*\n splits are done (thus, the list will have at most ``maxsplit+1``\n elements). If *maxsplit* is not specified, then there is no limit\n on the number of splits (all possible splits are made).\n\n If *sep* is given, consecutive delimiters are not grouped together\n and are deemed to delimit empty strings (for example,\n ``\'1,,2\'.split(\',\')`` returns ``[\'1\', \'\', \'2\']``). The *sep*\n argument may consist of multiple characters (for example,\n ``\'1<>2<>3\'.split(\'<>\')`` returns ``[\'1\', \'2\', \'3\']``). Splitting\n an empty string with a specified separator returns ``[\'\']``.\n\n If *sep* is not specified or is ``None``, a different splitting\n algorithm is applied: runs of consecutive whitespace are regarded\n as a single separator, and the result will contain no empty strings\n at the start or end if the string has leading or trailing\n whitespace. Consequently, splitting an empty string or a string\n consisting of just whitespace with a ``None`` separator returns\n ``[]``.\n\n For example, ``\' 1 2 3 \'.split()`` returns ``[\'1\', \'2\', \'3\']``,\n and ``\' 1 2 3 \'.split(None, 1)`` returns ``[\'1\', \'2 3 \']``.\n\nstr.splitlines([keepends])\n\n Return a list of the lines in the string, breaking at line\n boundaries. Line breaks are not included in the resulting list\n unless *keepends* is given and true.\n\nstr.startswith(prefix[, start[, end]])\n\n Return ``True`` if string starts with the *prefix*, otherwise\n return ``False``. *prefix* can also be a tuple of prefixes to look\n for. With optional *start*, test string beginning at that\n position. With optional *end*, stop comparing string at that\n position.\n\nstr.strip([chars])\n\n Return a copy of the string with the leading and trailing\n characters removed. The *chars* argument is a string specifying the\n set of characters to be removed. If omitted or ``None``, the\n *chars* argument defaults to removing whitespace. The *chars*\n argument is not a prefix or suffix; rather, all combinations of its\n values are stripped:\n\n >>> \' spacious \'.strip()\n \'spacious\'\n >>> \'www.example.com\'.strip(\'cmowz.\')\n \'example\'\n\nstr.swapcase()\n\n Return a copy of the string with uppercase characters converted to\n lowercase and vice versa.\n\nstr.title()\n\n Return a titlecased version of the string: words start with\n uppercase characters, all remaining cased characters are lowercase.\n\nstr.translate(map)\n\n Return a copy of the *s* where all characters have been mapped\n through the *map* which must be a dictionary of Unicode ordinals\n (integers) to Unicode ordinals, strings or ``None``. Unmapped\n characters are left untouched. Characters mapped to ``None`` are\n deleted.\n\n You can use ``str.maketrans()`` to create a translation map from\n character-to-character mappings in different formats.\n\n Note: An even more flexible approach is to create a custom character\n mapping codec using the ``codecs`` module (see\n ``encodings.cp1251`` for an example).\n\nstr.upper()\n\n Return a copy of the string converted to uppercase.\n\nstr.zfill(width)\n\n Return the numeric string left filled with zeros in a string of\n length *width*. A sign prefix is handled correctly. The original\n string is returned if *width* is less than ``len(s)``.\n\n\nOld String Formatting Operations\n================================\n\nNote: The formatting operations described here are obsolete and may go\n away in future versions of Python. Use the new *String Formatting*\n in new code.\n\nString objects have one unique built-in operation: the ``%`` operator\n(modulo). This is also known as the string *formatting* or\n*interpolation* operator. Given ``format % values`` (where *format* is\na string), ``%`` conversion specifications in *format* are replaced\nwith zero or more elements of *values*. The effect is similar to the\nusing ``sprintf()`` in the C language.\n\nIf *format* requires a single argument, *values* may be a single non-\ntuple object. [4] Otherwise, *values* must be a tuple with exactly\nthe number of items specified by the format string, or a single\nmapping object (for example, a dictionary).\n\nA conversion specifier contains two or more characters and has the\nfollowing components, which must occur in this order:\n\n1. The ``\'%\'`` character, which marks the start of the specifier.\n\n2. Mapping key (optional), consisting of a parenthesised sequence of\n characters (for example, ``(somename)``).\n\n3. Conversion flags (optional), which affect the result of some\n conversion types.\n\n4. Minimum field width (optional). If specified as an ``\'*\'``\n (asterisk), the actual width is read from the next element of the\n tuple in *values*, and the object to convert comes after the\n minimum field width and optional precision.\n\n5. Precision (optional), given as a ``\'.\'`` (dot) followed by the\n precision. If specified as ``\'*\'`` (an asterisk), the actual width\n is read from the next element of the tuple in *values*, and the\n value to convert comes after the precision.\n\n6. Length modifier (optional).\n\n7. Conversion type.\n\nWhen the right argument is a dictionary (or other mapping type), then\nthe formats in the string *must* include a parenthesised mapping key\ninto that dictionary inserted immediately after the ``\'%\'`` character.\nThe mapping key selects the value to be formatted from the mapping.\nFor example:\n\n>>> print(\'%(language)s has %(#)03d quote types.\' % \\\n... {\'language\': "Python", "#": 2})\nPython has 002 quote types.\n\nIn this case no ``*`` specifiers may occur in a format (since they\nrequire a sequential parameter list).\n\nThe conversion flag characters are:\n\n+-----------+-----------------------------------------------------------------------+\n| Flag | Meaning |\n+===========+=======================================================================+\n| ``\'#\'`` | The value conversion will use the "alternate form" (where defined |\n| | below). |\n+-----------+-----------------------------------------------------------------------+\n| ``\'0\'`` | The conversion will be zero padded for numeric values. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'-\'`` | The converted value is left adjusted (overrides the ``\'0\'`` |\n| | conversion if both are given). |\n+-----------+-----------------------------------------------------------------------+\n| ``\' \'`` | (a space) A blank should be left before a positive number (or empty |\n| | string) produced by a signed conversion. |\n+-----------+-----------------------------------------------------------------------+\n| ``\'+\'`` | A sign character (``\'+\'`` or ``\'-\'``) will precede the conversion |\n| | (overrides a "space" flag). |\n+-----------+-----------------------------------------------------------------------+\n\nA length modifier (``h``, ``l``, or ``L``) may be present, but is\nignored as it is not necessary for Python -- so e.g. ``%ld`` is\nidentical to ``%d``.\n\nThe conversion types are:\n\n+--------------+-------------------------------------------------------+---------+\n| Conversion | Meaning | Notes |\n+==============+=======================================================+=========+\n| ``\'d\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'i\'`` | Signed integer decimal. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'o\'`` | Signed octal value. | (1) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'u\'`` | Obsolete type -- it is identical to ``\'d\'``. | (7) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'x\'`` | Signed hexadecimal (lowercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'X\'`` | Signed hexadecimal (uppercase). | (2) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'e\'`` | Floating point exponential format (lowercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'E\'`` | Floating point exponential format (uppercase). | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'f\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'F\'`` | Floating point decimal format. | (3) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'g\'`` | Floating point format. Uses lowercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'G\'`` | Floating point format. Uses uppercase exponential | (4) |\n| | format if exponent is less than -4 or not less than | |\n| | precision, decimal format otherwise. | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'c\'`` | Single character (accepts integer or single character | |\n| | string). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'r\'`` | String (converts any python object using ``repr()``). | (5) |\n+--------------+-------------------------------------------------------+---------+\n| ``\'s\'`` | String (converts any python object using ``str()``). | |\n+--------------+-------------------------------------------------------+---------+\n| ``\'%\'`` | No argument is converted, results in a ``\'%\'`` | |\n| | character in the result. | |\n+--------------+-------------------------------------------------------+---------+\n\nNotes:\n\n1. The alternate form causes a leading zero (``\'0\'``) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n2. The alternate form causes a leading ``\'0x\'`` or ``\'0X\'`` (depending\n on whether the ``\'x\'`` or ``\'X\'`` format was used) to be inserted\n between left-hand padding and the formatting of the number if the\n leading character of the result is not already a zero.\n\n3. The alternate form causes the result to always contain a decimal\n point, even if no digits follow it.\n\n The precision determines the number of digits after the decimal\n point and defaults to 6.\n\n4. The alternate form causes the result to always contain a decimal\n point, and trailing zeroes are not removed as they would otherwise\n be.\n\n The precision determines the number of significant digits before\n and after the decimal point and defaults to 6.\n\n5. The precision determines the maximal number of characters used.\n\n1. See **PEP 237**.\n\nSince Python strings have an explicit length, ``%s`` conversions do\nnot assume that ``\'\\0\'`` is the end of the string.\n\nChanged in version 3.1: ``%f`` conversions for numbers whose absolute\nvalue is over 1e50 are no longer replaced by ``%g`` conversions.\n\nAdditional string operations are defined in standard modules\n``string`` and ``re``.\n\n\nRange Type\n==========\n\nThe ``range`` type is an immutable sequence which is commonly used for\nlooping. The advantage of the ``range`` type is that an ``range``\nobject will always take the same amount of memory, no matter the size\nof the range it represents. There are no consistent performance\nadvantages.\n\nRange objects have very little behavior: they only support indexing,\niteration, and the ``len()`` function.\n\n\nMutable Sequence Types\n======================\n\nList and bytearray objects support additional operations that allow\nin-place modification of the object. Other mutable sequence types\n(when added to the language) should also support these operations.\nStrings and tuples are immutable sequence types: such objects cannot\nbe modified once created. The following operations are defined on\nmutable sequence types (where *x* is an arbitrary object).\n\nNote that while lists allow their items to be of any type, bytearray\nobject "items" are all integers in the range 0 <= x < 256.\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (2) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*\'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (3) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (5) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (6) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([key[, reverse]])`` | sort the items of *s* in place | (6), (7), (8) |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. *x* can be any iterable object.\n\n3. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the sequence length is added, as for slice indices. If it\n is still negative, it is truncated to zero, as for slice indices.\n\n4. When a negative index is passed as the first parameter to the\n ``insert()`` method, the sequence length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n5. The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n6. The ``sort()`` and ``reverse()`` methods modify the sequence in\n place for economy of space when sorting or reversing a large\n sequence. To remind you that they operate by side effect, they\n don\'t return the sorted or reversed sequence.\n\n7. The ``sort()`` method takes optional arguments for controlling the\n comparisons. Each must be specified as a keyword argument.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n The ``sort()`` method is guaranteed to be stable. A sort is stable\n if it guarantees not to change the relative order of elements that\n compare equal --- this is helpful for sorting in multiple passes\n (for example, sort by department, then by salary grade).\n\n While a list is being sorted, the effect of attempting to mutate,\n or even inspect, the list is undefined. The C implementation makes\n the list appear empty for the duration, and raises ``ValueError``\n if it can detect that the list has been mutated during a sort.\n\n8. ``sort()`` is not supported by ``bytearray`` objects.\n\n\nBytes and Byte Array Methods\n============================\n\nBytes and bytearray objects, being "strings of bytes", have all\nmethods found on strings, with the exception of ``encode()``,\n``format()`` and ``isidentifier()``, which do not make sense with\nthese types. For converting the objects to strings, they have a\n``decode()`` method.\n\nWherever one of these methods needs to interpret the bytes as\ncharacters (e.g. the ``is...()`` methods), the ASCII character set is\nassumed.\n\nNote: The methods on bytes and bytearray objects don\'t accept strings as\n their arguments, just as the methods on strings don\'t accept bytes\n as their arguments. For example, you have to write\n\n a = "abc"\n b = a.replace("a", "f")\n\n and\n\n a = b"abc"\n b = a.replace(b"a", b"f")\n\nbytes.decode([encoding[, errors]])\nbytearray.decode([encoding[, errors]])\n\n Return a string decoded from the given bytes. Default encoding is\n the current default string encoding. *errors* may be given to set\n a different error handling scheme. The default for *errors* is\n ``\'strict\'``, meaning that encoding errors raise a\n ``UnicodeError``. Other possible values are ``\'ignore\'``,\n ``\'replace\'`` and any other name registered via\n ``codecs.register_error()``, see section *Codec Base Classes*. For\n a list of possible encodings, see section *Standard Encodings*.\n\nThe bytes and bytearray types have an additional class method:\n\nclassmethod bytes.fromhex(string)\nclassmethod bytearray.fromhex(string)\n\n This ``bytes`` class method returns a bytes or bytearray object,\n decoding the given string object. The string must contain two\n hexadecimal digits per byte, spaces are ignored.\n\n >>> bytes.fromhex(\'f0 f1f2 \')\n b\'\\xf0\\xf1\\xf2\'\n\nThe maketrans and translate methods differ in semantics from the\nversions available on strings:\n\nbytes.translate(table[, delete])\n\n Return a copy of the bytes or bytearray object where all bytes\n occurring in the optional argument *delete* are removed, and the\n remaining bytes have been mapped through the given translation\n table, which must be a bytes object of length 256.\n\n You can use the ``bytes.maketrans()`` method to create a\n translation table.\n\n Set the *table* argument to ``None`` for translations that only\n delete characters:\n\n >>> b\'read this short text\'.translate(None, b\'aeiou\')\n b\'rd ths shrt txt\'\n\nstatic bytes.maketrans(from, to)\n\n This static method returns a translation table usable for\n ``bytes.translate()`` that will map each character in *from* into\n the character at the same position in *to*; *from* and *to* must be\n bytes objects and have the same length.\n\n New in version 3.1.\n', 'typesseq-mutable': '\nMutable Sequence Types\n**********************\n\nList and bytearray objects support additional operations that allow\nin-place modification of the object. Other mutable sequence types\n(when added to the language) should also support these operations.\nStrings and tuples are immutable sequence types: such objects cannot\nbe modified once created. The following operations are defined on\nmutable sequence types (where *x* is an arbitrary object).\n\nNote that while lists allow their items to be of any type, bytearray\nobject "items" are all integers in the range 0 <= x < 256.\n\n+--------------------------------+----------------------------------+-----------------------+\n| Operation | Result | Notes |\n+================================+==================================+=======================+\n| ``s[i] = x`` | item *i* of *s* is replaced by | |\n| | *x* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j] = t`` | slice of *s* from *i* to *j* is | |\n| | replaced by the contents of the | |\n| | iterable *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j]`` | same as ``s[i:j] = []`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s[i:j:k] = t`` | the elements of ``s[i:j:k]`` are | (1) |\n| | replaced by those of *t* | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``del s[i:j:k]`` | removes the elements of | |\n| | ``s[i:j:k]`` from the list | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.append(x)`` | same as ``s[len(s):len(s)] = | |\n| | [x]`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.extend(x)`` | same as ``s[len(s):len(s)] = x`` | (2) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.count(x)`` | return number of *i*\'s for which | |\n| | ``s[i] == x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.index(x[, i[, j]])`` | return smallest *k* such that | (3) |\n| | ``s[k] == x`` and ``i <= k < j`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.insert(i, x)`` | same as ``s[i:i] = [x]`` | (4) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.pop([i])`` | same as ``x = s[i]; del s[i]; | (5) |\n| | return x`` | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.remove(x)`` | same as ``del s[s.index(x)]`` | (3) |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.reverse()`` | reverses the items of *s* in | (6) |\n| | place | |\n+--------------------------------+----------------------------------+-----------------------+\n| ``s.sort([key[, reverse]])`` | sort the items of *s* in place | (6), (7), (8) |\n+--------------------------------+----------------------------------+-----------------------+\n\nNotes:\n\n1. *t* must have the same length as the slice it is replacing.\n\n2. *x* can be any iterable object.\n\n3. Raises ``ValueError`` when *x* is not found in *s*. When a negative\n index is passed as the second or third parameter to the ``index()``\n method, the sequence length is added, as for slice indices. If it\n is still negative, it is truncated to zero, as for slice indices.\n\n4. When a negative index is passed as the first parameter to the\n ``insert()`` method, the sequence length is added, as for slice\n indices. If it is still negative, it is truncated to zero, as for\n slice indices.\n\n5. The optional argument *i* defaults to ``-1``, so that by default\n the last item is removed and returned.\n\n6. The ``sort()`` and ``reverse()`` methods modify the sequence in\n place for economy of space when sorting or reversing a large\n sequence. To remind you that they operate by side effect, they\n don\'t return the sorted or reversed sequence.\n\n7. The ``sort()`` method takes optional arguments for controlling the\n comparisons. Each must be specified as a keyword argument.\n\n *key* specifies a function of one argument that is used to extract\n a comparison key from each list element: ``key=str.lower``. The\n default value is ``None``.\n\n *reverse* is a boolean value. If set to ``True``, then the list\n elements are sorted as if each comparison were reversed.\n\n The ``sort()`` method is guaranteed to be stable. A sort is stable\n if it guarantees not to change the relative order of elements that\n compare equal --- this is helpful for sorting in multiple passes\n (for example, sort by department, then by salary grade).\n\n While a list is being sorted, the effect of attempting to mutate,\n or even inspect, the list is undefined. The C implementation makes\n the list appear empty for the duration, and raises ``ValueError``\n if it can detect that the list has been mutated during a sort.\n\n8. ``sort()`` is not supported by ``bytearray`` objects.\n', 'unary': '\nUnary arithmetic and bitwise operations\n***************************************\n\nAll unary arithmetic and bitwise operations have the same priority:\n\n u_expr ::= power | "-" u_expr | "+" u_expr | "~" u_expr\n\nThe unary ``-`` (minus) operator yields the negation of its numeric\nargument.\n\nThe unary ``+`` (plus) operator yields its numeric argument unchanged.\n\nThe unary ``~`` (invert) operator yields the bitwise inversion of its\ninteger argument. The bitwise inversion of ``x`` is defined as\n``-(x+1)``. It only applies to integral numbers.\n\nIn all three cases, if the argument does not have the proper type, a\n``TypeError`` exception is raised.\n', 'while': '\nThe ``while`` statement\n***********************\n\nThe ``while`` statement is used for repeated execution as long as an\nexpression is true:\n\n while_stmt ::= "while" expression ":" suite\n ["else" ":" suite]\n\nThis repeatedly tests the expression and, if it is true, executes the\nfirst suite; if the expression is false (which may be the first time\nit is tested) the suite of the ``else`` clause, if present, is\nexecuted and the loop terminates.\n\nA ``break`` statement executed in the first suite terminates the loop\nwithout executing the ``else`` clause\'s suite. A ``continue``\nstatement executed in the first suite skips the rest of the suite and\ngoes back to testing the expression.\n', - 'with': '\nThe ``with`` statement\n**********************\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" expression ["as" target] ":" suite\n\nThe execution of the ``with`` statement proceeds as follows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n', + 'with': '\nThe ``with`` statement\n**********************\n\nThe ``with`` statement is used to wrap the execution of a block with\nmethods defined by a context manager (see section *With Statement\nContext Managers*). This allows common\n``try``...``except``...``finally`` usage patterns to be encapsulated\nfor convenient reuse.\n\n with_stmt ::= "with" with_item ("," with_item)* ":" suite\n with_item ::= expression ["as" target]\n\nThe execution of the ``with`` statement with one "item" proceeds as\nfollows:\n\n1. The context expression is evaluated to obtain a context manager.\n\n2. The context manager\'s ``__enter__()`` method is invoked.\n\n3. If a target was included in the ``with`` statement, the return\n value from ``__enter__()`` is assigned to it.\n\n Note: The ``with`` statement guarantees that if the ``__enter__()``\n method returns without an error, then ``__exit__()`` will always\n be called. Thus, if an error occurs during the assignment to the\n target list, it will be treated the same as an error occurring\n within the suite would be. See step 5 below.\n\n4. The suite is executed.\n\n5. The context manager\'s ``__exit__()`` method is invoked. If an\n exception caused the suite to be exited, its type, value, and\n traceback are passed as arguments to ``__exit__()``. Otherwise,\n three ``None`` arguments are supplied.\n\n If the suite was exited due to an exception, and the return value\n from the ``__exit__()`` method was false, the exception is\n reraised. If the return value was true, the exception is\n suppressed, and execution continues with the statement following\n the ``with`` statement.\n\n If the suite was exited for any reason other than an exception, the\n return value from ``__exit__()`` is ignored, and execution proceeds\n at the normal location for the kind of exit that was taken.\n\nWith more than one item, the context managers are processed as if\nmultiple ``with`` statements were nested:\n\n with A() as a, B() as b:\n suite\n\nis equivalent to\n\n with A() as a:\n with B() as b:\n suite\n\nChanged in version 3.1: Support for multiple context expressions.\n\nSee also:\n\n **PEP 0343** - The "with" statement\n The specification, background, and examples for the Python\n ``with`` statement.\n', 'yield': '\nThe ``yield`` statement\n***********************\n\n yield_stmt ::= yield_expression\n\nThe ``yield`` statement is only used when defining a generator\nfunction, and is only used in the body of the generator function.\nUsing a ``yield`` statement in a function definition is sufficient to\ncause that definition to create a generator function instead of a\nnormal function. When a generator function is called, it returns an\niterator known as a generator iterator, or more commonly, a generator.\nThe body of the generator function is executed by calling the\n``next()`` function on the generator repeatedly until it raises an\nexception.\n\nWhen a ``yield`` statement is executed, the state of the generator is\nfrozen and the value of **expression_list** is returned to\n``next()``\'s caller. By "frozen" we mean that all local state is\nretained, including the current bindings of local variables, the\ninstruction pointer, and the internal evaluation stack: enough\ninformation is saved so that the next time ``next()`` is invoked, the\nfunction can proceed exactly as if the ``yield`` statement were just\nanother external call.\n\nThe ``yield`` statement is allowed in the ``try`` clause of a ``try``\n... ``finally`` construct. If the generator is not resumed before it\nis finalized (by reaching a zero reference count or by being garbage\ncollected), the generator-iterator\'s ``close()`` method will be\ncalled, allowing any pending ``finally`` clauses to execute.\n\nSee also:\n\n **PEP 0255** - Simple Generators\n The proposal for adding generators and the ``yield`` statement\n to Python.\n\n **PEP 0342** - Coroutines via Enhanced Generators\n The proposal that, among other generator enhancements, proposed\n allowing ``yield`` to appear inside a ``try`` ... ``finally``\n block.\n'} From python-checkins at python.org Sat May 30 17:47:38 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 30 May 2009 17:47:38 +0200 (CEST) Subject: [Python-checkins] r73057 - python/tags/r31rc1 Message-ID: <20090530154738.EFC4EC4FC@mail.python.org> Author: benjamin.peterson Date: Sat May 30 17:47:38 2009 New Revision: 73057 Log: tag 3.1 release candidate 1 Added: python/tags/r31rc1/ - copied from r73056, /python/branches/py3k/ From buildbot at python.org Sat May 30 19:02:57 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 30 May 2009 17:02:57 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090530170257.8A3C3C4F9@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/782 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 2 tests failed: test_import test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sat May 30 20:43:49 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 30 May 2009 20:43:49 +0200 (CEST) Subject: [Python-checkins] r73058 - in python/branches/py3k: Include/patchlevel.h Misc/NEWS Message-ID: <20090530184349.533AEC388@mail.python.org> Author: benjamin.peterson Date: Sat May 30 20:43:49 2009 New Revision: 73058 Log: post-release updates Modified: python/branches/py3k/Include/patchlevel.h python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Include/patchlevel.h ============================================================================== --- python/branches/py3k/Include/patchlevel.h (original) +++ python/branches/py3k/Include/patchlevel.h Sat May 30 20:43:49 2009 @@ -23,7 +23,7 @@ #define PY_RELEASE_SERIAL 1 /* Version as a string */ -#define PY_VERSION "3.1rc1" +#define PY_VERSION "3.1rc1+" /*--end constants--*/ /* Subversion Revision number of this file (not of the repository) */ Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 30 20:43:49 2009 @@ -4,6 +4,18 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) +What's New in Python Release Candidate 2? +========================================= + +*Release date: 17-June-2009* + +Core and Builtins +----------------- + +Library +------- + + What's New in Python 3.1 release candidate 1? ============================================= From buildbot at python.org Sat May 30 20:57:48 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 30 May 2009 18:57:48 +0000 Subject: [Python-checkins] buildbot failure in x86 gentoo 3.x Message-ID: <20090530185748.2D510D449@mail.python.org> The Buildbot has detected a new failure of x86 gentoo 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20gentoo%203.x/builds/957 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-x86 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: make: *** [buildbottest] Unknown signal 32 sincerely, -The Buildbot From python-checkins at python.org Sat May 30 21:49:16 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sat, 30 May 2009 21:49:16 +0200 (CEST) Subject: [Python-checkins] r73059 - peps/trunk/pep-0375.txt Message-ID: <20090530194916.1FB7ED35A@mail.python.org> Author: benjamin.peterson Date: Sat May 30 21:49:15 2009 New Revision: 73059 Log: remove some things that didn't happen Modified: peps/trunk/pep-0375.txt Modified: peps/trunk/pep-0375.txt ============================================================================== --- peps/trunk/pep-0375.txt (original) +++ peps/trunk/pep-0375.txt Sat May 30 21:49:15 2009 @@ -47,11 +47,9 @@ - importlib - io in C -- A reworked email package - Adding an IP Address library to the stdlib [#iplib]_. - Update simplejson to the latest external version [#simplejson]_. - Ordered dictionary for collections [#ordered]_. -- Fixing contextlib.nested() [#contextlib]_. - auto-numbered replacement fields in str.format() strings [#strformat]_ - Upgrading xml.etree to the latest external version [#etree]_ - Nested with-statements in one with statement @@ -69,9 +67,6 @@ .. [#ordered] PEP 372 http://www.python.org/dev/peps/pep-0372/ -.. [#contextlib] - http://bugs.python.org/issue5251 - .. [#strformat] http://bugs.python.org/issue5237 From python-checkins at python.org Sat May 30 21:58:11 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sat, 30 May 2009 21:58:11 +0200 (CEST) Subject: [Python-checkins] r73060 - python/trunk/Doc/library/ipaddr.rst Message-ID: <20090530195811.C4806D4D5@mail.python.org> Author: gregory.p.smith Date: Sat May 30 21:58:11 2009 New Revision: 73060 Log: Add more examples to the ipaddr documentation. Modified: python/trunk/Doc/library/ipaddr.rst Modified: python/trunk/Doc/library/ipaddr.rst ============================================================================== --- python/trunk/Doc/library/ipaddr.rst (original) +++ python/trunk/Doc/library/ipaddr.rst Sat May 30 21:58:11 2009 @@ -16,6 +16,90 @@ both IPv4 and IPv6. +.. _ipaddr_examples: + +Examples +-------- + +Netmask. + + >>> ipaddr.IP('1.1.1.1/255.255.255.0') + IPv4('1.1.1.1/24') + >>> ipaddr.IP('1080::200C:417B/96') + IPv6('1080::200c:417b/96') + +Hostmask. + + >>> ipaddr.IPv4('1.1.1.1/0.0.0.255') + IPv4('1.1.1.1/24') + +Prefix length. + + >>> addr = ipaddr.IPv4('1.1.1.1/24') + >>> addr.prefixlen + 24 + +Individual addresses. + + >>> ipaddr.IP('1.1.1.1') + IPv4('1.1.1.1/32') + +Many standard Python operations are also supported. + +Comparison. + + >>> ipaddr.IPv4('1.1.1.1') == ipaddr.IPv4('1.1.1.2') + False + >>> ipaddr.IPv4('1.1.1.1') < ipaddr.IPv4('1.1.1.2') + True + +Inclusion. + + >>> ipaddr.IPv4('1.1.1.1') in ipaddr.IPv4("1.0.0.0/8") + True + +Sorting. + + >>> a = ipaddr.IPv4('1.1.1.10') + >>> b = ipaddr.IPv4('1.10.1.10') + >>> c = ipaddr.IPv4('1.1.10.10') + >>> d = ipaddr.IPv4('1.1.1.1') + >>> sorted([a, b, c, d]) + [IPv4('1.1.1.1/32'), IPv4('1.1.1.10/32'), IPv4('1.1.10.10/32'), IPv4('1.10.1.10/32')] + +Conversion to string and integer forms. + + >>> spam = ipaddr.IPv4('192.168.1.254')) + >>> str(spam) + '192.168.1.254/32' + >>> spam.ip_ext + '192.168.1.254' + >>> int(spam) + 3232236030 + >>> eggs = ipaddr.IPv6('ffff::1/120') + >>> int(eggs) + 340277174624079928635746076935438991361 + +Additionally, there are quite a few network-specific features available to +ipaddr. + + >>> ipaddr.IPv4('10.0.0.0/8').supernet() + IPv4('10.0.0.0/7') + >>> ipaddr.IPv4('10.0.0.0/8').subnet() + [IPv4('10.0.0.0/9'), IPv4('10.128.0.0/9')] + # This returns networks with a prefix length of /10 + >>> ipaddr.IPv4('10.0.0.0/8').subnet(prefixlen_diff=2) + [IPv4('10.0.0.0/10'), IPv4('10.64.0.0/10'), IPv4('10.128.0.0/10'), IPv4('10.192.0.0/10')] + # Remove an address from a superblock. + >>> ipaddr.IP('10.0.0.0/24').address_exclude(ipaddr.IP('10.0.0.0/28')) + [IPv4('10.0.0.16/28'), IPv4('10.0.0.32/27'), IPv4('10.0.0.64/26'), IPv4('10.0.0.128/25')] + + +.. _ipaddr_funcs_and_classes: + +Functions And Classes +--------------------- + .. function:: IP(ipaddr) Take an IP string or int and return an object of the correct type. Returns @@ -158,8 +242,7 @@ >>> addr1 = IP('::1/32') >>> addr2 = IP('::1/128') >>> addr1.address_exclude(addr2) - [IP('::0/128'), IP('::2/127'), IP('::4/126'), IP('::8/125'), - ... IP('0:0:8000::/33')] + [IP('::0/128'), IP('::2/127'), IP('::4/126'), IP('::8/125'), IP('0:0:8000::/33')] Raises :exc:`ValueError` if *other* is not completely contained by *self*. @@ -286,6 +369,11 @@ 2.5.2. +.. _ipaddr_exceptions: + +Exceptions +---------- + The following exceptions are defined by this module: .. exception:: Error From python-checkins at python.org Sat May 30 22:01:43 2009 From: python-checkins at python.org (gregory.p.smith) Date: Sat, 30 May 2009 22:01:43 +0200 (CEST) Subject: [Python-checkins] r73061 - in python/branches/py3k: Doc/library/ipaddr.rst Message-ID: <20090530200143.B1DD6D52A@mail.python.org> Author: gregory.p.smith Date: Sat May 30 22:01:43 2009 New Revision: 73061 Log: Merged revisions 73060 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r73060 | gregory.p.smith | 2009-05-30 12:58:11 -0700 (Sat, 30 May 2009) | 2 lines Add more examples to the ipaddr documentation. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/ipaddr.rst Modified: python/branches/py3k/Doc/library/ipaddr.rst ============================================================================== --- python/branches/py3k/Doc/library/ipaddr.rst (original) +++ python/branches/py3k/Doc/library/ipaddr.rst Sat May 30 22:01:43 2009 @@ -16,6 +16,90 @@ both IPv4 and IPv6. +.. _ipaddr_examples: + +Examples +-------- + +Netmask. + + >>> ipaddr.IP('1.1.1.1/255.255.255.0') + IPv4('1.1.1.1/24') + >>> ipaddr.IP('1080::200C:417B/96') + IPv6('1080::200c:417b/96') + +Hostmask. + + >>> ipaddr.IPv4('1.1.1.1/0.0.0.255') + IPv4('1.1.1.1/24') + +Prefix length. + + >>> addr = ipaddr.IPv4('1.1.1.1/24') + >>> addr.prefixlen + 24 + +Individual addresses. + + >>> ipaddr.IP('1.1.1.1') + IPv4('1.1.1.1/32') + +Many standard Python operations are also supported. + +Comparison. + + >>> ipaddr.IPv4('1.1.1.1') == ipaddr.IPv4('1.1.1.2') + False + >>> ipaddr.IPv4('1.1.1.1') < ipaddr.IPv4('1.1.1.2') + True + +Inclusion. + + >>> ipaddr.IPv4('1.1.1.1') in ipaddr.IPv4("1.0.0.0/8") + True + +Sorting. + + >>> a = ipaddr.IPv4('1.1.1.10') + >>> b = ipaddr.IPv4('1.10.1.10') + >>> c = ipaddr.IPv4('1.1.10.10') + >>> d = ipaddr.IPv4('1.1.1.1') + >>> sorted([a, b, c, d]) + [IPv4('1.1.1.1/32'), IPv4('1.1.1.10/32'), IPv4('1.1.10.10/32'), IPv4('1.10.1.10/32')] + +Conversion to string and integer forms. + + >>> spam = ipaddr.IPv4('192.168.1.254')) + >>> str(spam) + '192.168.1.254/32' + >>> spam.ip_ext + '192.168.1.254' + >>> int(spam) + 3232236030 + >>> eggs = ipaddr.IPv6('ffff::1/120') + >>> int(eggs) + 340277174624079928635746076935438991361 + +Additionally, there are quite a few network-specific features available to +ipaddr. + + >>> ipaddr.IPv4('10.0.0.0/8').supernet() + IPv4('10.0.0.0/7') + >>> ipaddr.IPv4('10.0.0.0/8').subnet() + [IPv4('10.0.0.0/9'), IPv4('10.128.0.0/9')] + # This returns networks with a prefix length of /10 + >>> ipaddr.IPv4('10.0.0.0/8').subnet(prefixlen_diff=2) + [IPv4('10.0.0.0/10'), IPv4('10.64.0.0/10'), IPv4('10.128.0.0/10'), IPv4('10.192.0.0/10')] + # Remove an address from a superblock. + >>> ipaddr.IP('10.0.0.0/24').address_exclude(ipaddr.IP('10.0.0.0/28')) + [IPv4('10.0.0.16/28'), IPv4('10.0.0.32/27'), IPv4('10.0.0.64/26'), IPv4('10.0.0.128/25')] + + +.. _ipaddr_funcs_and_classes: + +Functions And Classes +--------------------- + .. function:: IP(ipaddr) Take an IP string or int and return an object of the correct type. Returns @@ -159,8 +243,7 @@ >>> addr1 = IP('::1/32') >>> addr2 = IP('::1/128') >>> addr1.address_exclude(addr2) - [IP('::0/128'), IP('::2/127'), IP('::4/126'), IP('::8/125'), - ... IP('0:0:8000::/33')] + [IP('::0/128'), IP('::2/127'), IP('::4/126'), IP('::8/125'), IP('0:0:8000::/33')] Raises :exc:`ValueError` if *other* is not completely contained by *self*. @@ -297,6 +380,11 @@ 2.5.2. +.. _ipaddr_exceptions: + +Exceptions +---------- + The following exceptions are defined by this module: .. exception:: Error From buildbot at python.org Sat May 30 22:49:56 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 30 May 2009 20:49:56 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090530204957.08A01D680@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/784 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: gregory.p.smith BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sat May 30 23:01:23 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 30 May 2009 23:01:23 +0200 (CEST) Subject: [Python-checkins] r73062 - python/branches/py3k/Misc/NEWS Message-ID: <20090530210123.34B9ED6B0@mail.python.org> Author: antoine.pitrou Date: Sat May 30 23:01:23 2009 New Revision: 73062 Log: Fix missing version number Modified: python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 30 23:01:23 2009 @@ -4,8 +4,8 @@ (editors: check NEWS.help for information about editing NEWS using ReST.) -What's New in Python Release Candidate 2? -========================================= +What's New in Python 3.1 Release Candidate 2? +============================================= *Release date: 17-June-2009* From python-checkins at python.org Sat May 30 23:04:26 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 30 May 2009 23:04:26 +0200 (CEST) Subject: [Python-checkins] r73063 - in python/branches/py3k: Lib/test/test_weakref.py Lib/weakref.py Misc/NEWS Message-ID: <20090530210426.66E33C449@mail.python.org> Author: antoine.pitrou Date: Sat May 30 23:04:26 2009 New Revision: 73063 Log: Issue #6149: Fix initialization of WeakValueDictionary objects from non-empty parameters. Modified: python/branches/py3k/Lib/test/test_weakref.py python/branches/py3k/Lib/weakref.py python/branches/py3k/Misc/NEWS Modified: python/branches/py3k/Lib/test/test_weakref.py ============================================================================== --- python/branches/py3k/Lib/test/test_weakref.py (original) +++ python/branches/py3k/Lib/test/test_weakref.py Sat May 30 23:04:26 2009 @@ -942,6 +942,17 @@ dict[o] = o.arg return dict, objects + def test_make_weak_valued_dict_from_dict(self): + o = Object(3) + dict = weakref.WeakValueDictionary({364:o}) + self.assertEqual(dict[364], o) + + def test_make_weak_valued_dict_from_weak_valued_dict(self): + o = Object(3) + dict = weakref.WeakValueDictionary({364:o}) + dict2 = weakref.WeakValueDictionary(dict) + self.assertEqual(dict[364], o) + def make_weak_valued_dict(self): dict = weakref.WeakValueDictionary() objects = list(map(Object, range(self.COUNT))) Modified: python/branches/py3k/Lib/weakref.py ============================================================================== --- python/branches/py3k/Lib/weakref.py (original) +++ python/branches/py3k/Lib/weakref.py Sat May 30 23:04:26 2009 @@ -49,7 +49,7 @@ del self.data[wr.key] self._remove = remove self.data = d = {} - d.update(*args, **kw) + self.update(*args, **kw) def __getitem__(self, key): o = self.data[key]() Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 30 23:04:26 2009 @@ -15,6 +15,9 @@ Library ------- +- Issue #6149: Fix initialization of WeakValueDictionary objects from non-empty + parameters. + What's New in Python 3.1 release candidate 1? ============================================= From python-checkins at python.org Sat May 30 23:27:01 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 30 May 2009 23:27:01 +0200 (CEST) Subject: [Python-checkins] r73064 - in python/trunk: Lib/test/test_cprofile.py Lib/test/test_profile.py Misc/NEWS Python/ceval.c Message-ID: <20090530212701.291B9D6AD@mail.python.org> Author: antoine.pitrou Date: Sat May 30 23:27:00 2009 New Revision: 73064 Log: Issue #5330: C functions called with keyword arguments were not reported by the various profiling modules (profile, cProfile). Patch by Hagen F??rstenau. Modified: python/trunk/Lib/test/test_cprofile.py python/trunk/Lib/test/test_profile.py python/trunk/Misc/NEWS python/trunk/Python/ceval.c Modified: python/trunk/Lib/test/test_cprofile.py ============================================================================== --- python/trunk/Lib/test/test_cprofile.py (original) +++ python/trunk/Lib/test/test_cprofile.py Sat May 30 23:27:00 2009 @@ -9,6 +9,7 @@ class CProfileTest(ProfileTest): profilerclass = cProfile.Profile + expected_list_sort_output = "{method 'sort' of 'list' objects}" # Issue 3895. def test_bad_counter_during_dealloc(self): Modified: python/trunk/Lib/test/test_profile.py ============================================================================== --- python/trunk/Lib/test/test_profile.py (original) +++ python/trunk/Lib/test/test_profile.py Sat May 30 23:27:00 2009 @@ -16,6 +16,7 @@ profilerclass = profile.Profile methodnames = ['print_stats', 'print_callers', 'print_callees'] expected_output = {} + expected_list_sort_output = ':0(sort)' @classmethod def do_profiling(cls): @@ -40,6 +41,25 @@ "Stats.%s output for %s doesn't fit expectation!" % (method, self.profilerclass.__name__)) + def test_calling_conventions(self): + # Issue #5330: profile and cProfile wouldn't report C functions called + # with keyword arguments. We test all calling conventions. + prof = self.profilerclass(timer, 0.001) + stmts = [ + "[].sort()", + "[].sort(reverse=True)", + "[].sort(*(None, None, True))", + "[].sort(**dict(reverse=True))", + ] + for stmt in stmts: + s = StringIO() + prof.runctx(stmt, globals(), locals()) + stats = pstats.Stats(prof, stream=s) + stats.print_stats() + res = s.getvalue() + self.assertTrue(self.expected_list_sort_output in res, + "Profiling {0!r} didn't report list.sort:\n{1}".format(stmt, res)) + def regenerate_expected_output(filename, cls): filename = filename.rstrip('co') Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sat May 30 23:27:00 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #5330: C functions called with keyword arguments were not reported by + the various profiling modules (profile, cProfile). Patch by Hagen F?rstenau. + - Issue #5982: staticmethod and classmethod now expose the wrapped function with __func__. Modified: python/trunk/Python/ceval.c ============================================================================== --- python/trunk/Python/ceval.c (original) +++ python/trunk/Python/ceval.c Sat May 30 23:27:00 2009 @@ -4160,10 +4160,17 @@ PCALL(PCALL_METHOD); else if (PyType_Check(func)) PCALL(PCALL_TYPE); + else if (PyCFunction_Check(func)) + PCALL(PCALL_CFUNCTION); else PCALL(PCALL_OTHER); #endif - result = PyObject_Call(func, callargs, kwdict); + if (PyCFunction_Check(func)) { + PyThreadState *tstate = PyThreadState_GET(); + C_TRACE(result, PyCFunction_Call(func, callargs, kwdict)); + } + else + result = PyObject_Call(func, callargs, kwdict); call_fail: Py_XDECREF(callargs); Py_XDECREF(kwdict); @@ -4248,10 +4255,17 @@ PCALL(PCALL_METHOD); else if (PyType_Check(func)) PCALL(PCALL_TYPE); + else if (PyCFunction_Check(func)) + PCALL(PCALL_CFUNCTION); else PCALL(PCALL_OTHER); #endif - result = PyObject_Call(func, callargs, kwdict); + if (PyCFunction_Check(func)) { + PyThreadState *tstate = PyThreadState_GET(); + C_TRACE(result, PyCFunction_Call(func, callargs, kwdict)); + } + else + result = PyObject_Call(func, callargs, kwdict); ext_call_fail: Py_XDECREF(callargs); Py_XDECREF(kwdict); From python-checkins at python.org Sat May 30 23:39:25 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 30 May 2009 23:39:25 +0200 (CEST) Subject: [Python-checkins] r73065 - python/trunk/Lib/test/test_profile.py Message-ID: <20090530213925.D6560D7D0@mail.python.org> Author: antoine.pitrou Date: Sat May 30 23:39:25 2009 New Revision: 73065 Log: The test for #5330 wasn't correct. Modified: python/trunk/Lib/test/test_profile.py Modified: python/trunk/Lib/test/test_profile.py ============================================================================== --- python/trunk/Lib/test/test_profile.py (original) +++ python/trunk/Lib/test/test_profile.py Sat May 30 23:39:25 2009 @@ -44,7 +44,6 @@ def test_calling_conventions(self): # Issue #5330: profile and cProfile wouldn't report C functions called # with keyword arguments. We test all calling conventions. - prof = self.profilerclass(timer, 0.001) stmts = [ "[].sort()", "[].sort(reverse=True)", @@ -53,6 +52,7 @@ ] for stmt in stmts: s = StringIO() + prof = self.profilerclass(timer, 0.001) prof.runctx(stmt, globals(), locals()) stats = pstats.Stats(prof, stream=s) stats.print_stats() From python-checkins at python.org Sat May 30 23:41:11 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 30 May 2009 23:41:11 +0200 (CEST) Subject: [Python-checkins] r73066 - in python/branches/py3k: Lib/test/test_cprofile.py Lib/test/test_profile.py Misc/NEWS Python/ceval.c Message-ID: <20090530214111.33D94D555@mail.python.org> Author: antoine.pitrou Date: Sat May 30 23:41:10 2009 New Revision: 73066 Log: Merged revisions 73064 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r73064 | antoine.pitrou | 2009-05-30 23:27:00 +0200 (sam., 30 mai 2009) | 4 lines Issue #5330: C functions called with keyword arguments were not reported by the various profiling modules (profile, cProfile). Patch by Hagen F??rstenau. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/test/test_cprofile.py python/branches/py3k/Lib/test/test_profile.py python/branches/py3k/Misc/NEWS python/branches/py3k/Python/ceval.c Modified: python/branches/py3k/Lib/test/test_cprofile.py ============================================================================== --- python/branches/py3k/Lib/test/test_cprofile.py (original) +++ python/branches/py3k/Lib/test/test_cprofile.py Sat May 30 23:41:10 2009 @@ -9,6 +9,7 @@ class CProfileTest(ProfileTest): profilerclass = cProfile.Profile + expected_max_output = "{built-in method max}" def get_expected_output(self): return _ProfileOutput Modified: python/branches/py3k/Lib/test/test_profile.py ============================================================================== --- python/branches/py3k/Lib/test/test_profile.py (original) +++ python/branches/py3k/Lib/test/test_profile.py Sat May 30 23:41:10 2009 @@ -16,6 +16,7 @@ profilerclass = profile.Profile methodnames = ['print_stats', 'print_callers', 'print_callees'] + expected_max_output = ':0(max)' def get_expected_output(self): return _ProfileOutput @@ -53,6 +54,27 @@ results[i+1].split('\n'), expected[method].split('\n')))) + def test_calling_conventions(self): + # Issue #5330: profile and cProfile wouldn't report C functions called + # with keyword arguments. We test all calling conventions. + stmts = [ + "max([0])", + "max([0], key=int)", + "max([0], **dict(key=int))", + "max(*([0],))", + "max(*([0],), key=int)", + "max(*([0],), **dict(key=int))", + ] + for stmt in stmts: + s = StringIO() + prof = self.profilerclass(timer, 0.001) + prof.runctx(stmt, globals(), locals()) + stats = pstats.Stats(prof, stream=s) + stats.print_stats() + res = s.getvalue() + self.assertTrue(self.expected_max_output in res, + "Profiling {0!r} didn't report max:\n{1}".format(stmt, res)) + def regenerate_expected_output(filename, cls): filename = filename.rstrip('co') Modified: python/branches/py3k/Misc/NEWS ============================================================================== --- python/branches/py3k/Misc/NEWS (original) +++ python/branches/py3k/Misc/NEWS Sat May 30 23:41:10 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #5330: C functions called with keyword arguments were not reported by + the various profiling modules (profile, cProfile). Patch by Hagen F?rstenau. + Library ------- Modified: python/branches/py3k/Python/ceval.c ============================================================================== --- python/branches/py3k/Python/ceval.c (original) +++ python/branches/py3k/Python/ceval.c Sat May 30 23:41:10 2009 @@ -3951,10 +3951,17 @@ PCALL(PCALL_METHOD); else if (PyType_Check(func)) PCALL(PCALL_TYPE); + else if (PyCFunction_Check(func)) + PCALL(PCALL_CFUNCTION); else PCALL(PCALL_OTHER); #endif - result = PyObject_Call(func, callargs, kwdict); + if (PyCFunction_Check(func)) { + PyThreadState *tstate = PyThreadState_GET(); + C_TRACE(result, PyCFunction_Call(func, callargs, kwdict)); + } + else + result = PyObject_Call(func, callargs, kwdict); call_fail: Py_XDECREF(callargs); Py_XDECREF(kwdict); @@ -4039,10 +4046,17 @@ PCALL(PCALL_METHOD); else if (PyType_Check(func)) PCALL(PCALL_TYPE); + else if (PyCFunction_Check(func)) + PCALL(PCALL_CFUNCTION); else PCALL(PCALL_OTHER); #endif - result = PyObject_Call(func, callargs, kwdict); + if (PyCFunction_Check(func)) { + PyThreadState *tstate = PyThreadState_GET(); + C_TRACE(result, PyCFunction_Call(func, callargs, kwdict)); + } + else + result = PyObject_Call(func, callargs, kwdict); ext_call_fail: Py_XDECREF(callargs); Py_XDECREF(kwdict); From python-checkins at python.org Sat May 30 23:43:48 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 30 May 2009 23:43:48 +0200 (CEST) Subject: [Python-checkins] r73067 - in python/branches/release26-maint: Lib/test/test_cprofile.py Lib/test/test_profile.py Misc/NEWS Python/ceval.c Message-ID: <20090530214348.76889D555@mail.python.org> Author: antoine.pitrou Date: Sat May 30 23:43:48 2009 New Revision: 73067 Log: Merged revisions 73064-73065 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r73064 | antoine.pitrou | 2009-05-30 23:27:00 +0200 (sam., 30 mai 2009) | 4 lines Issue #5330: C functions called with keyword arguments were not reported by the various profiling modules (profile, cProfile). Patch by Hagen F?rstenau. ........ r73065 | antoine.pitrou | 2009-05-30 23:39:25 +0200 (sam., 30 mai 2009) | 3 lines The test for #5330 wasn't correct. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Lib/test/test_cprofile.py python/branches/release26-maint/Lib/test/test_profile.py python/branches/release26-maint/Misc/NEWS python/branches/release26-maint/Python/ceval.c Modified: python/branches/release26-maint/Lib/test/test_cprofile.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_cprofile.py (original) +++ python/branches/release26-maint/Lib/test/test_cprofile.py Sat May 30 23:43:48 2009 @@ -9,6 +9,7 @@ class CProfileTest(ProfileTest): profilerclass = cProfile.Profile + expected_list_sort_output = "{method 'sort' of 'list' objects}" # Issue 3895. def test_bad_counter_during_dealloc(self): Modified: python/branches/release26-maint/Lib/test/test_profile.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_profile.py (original) +++ python/branches/release26-maint/Lib/test/test_profile.py Sat May 30 23:43:48 2009 @@ -16,6 +16,7 @@ profilerclass = profile.Profile methodnames = ['print_stats', 'print_callers', 'print_callees'] expected_output = {} + expected_list_sort_output = ':0(sort)' @classmethod def do_profiling(cls): @@ -40,6 +41,25 @@ "Stats.%s output for %s doesn't fit expectation!" % (method, self.profilerclass.__name__)) + def test_calling_conventions(self): + # Issue #5330: profile and cProfile wouldn't report C functions called + # with keyword arguments. We test all calling conventions. + stmts = [ + "[].sort()", + "[].sort(reverse=True)", + "[].sort(*(None, None, True))", + "[].sort(**dict(reverse=True))", + ] + for stmt in stmts: + s = StringIO() + prof = self.profilerclass(timer, 0.001) + prof.runctx(stmt, globals(), locals()) + stats = pstats.Stats(prof, stream=s) + stats.print_stats() + res = s.getvalue() + self.assertTrue(self.expected_list_sort_output in res, + "Profiling {0!r} didn't report list.sort:\n{1}".format(stmt, res)) + def regenerate_expected_output(filename, cls): filename = filename.rstrip('co') Modified: python/branches/release26-maint/Misc/NEWS ============================================================================== --- python/branches/release26-maint/Misc/NEWS (original) +++ python/branches/release26-maint/Misc/NEWS Sat May 30 23:43:48 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #5330: C functions called with keyword arguments were not reported by + the various profiling modules (profile, cProfile). Patch by Hagen F?rstenau. + - Issue #6089: str.format can raise SystemError with certain invalid field specifiers. Modified: python/branches/release26-maint/Python/ceval.c ============================================================================== --- python/branches/release26-maint/Python/ceval.c (original) +++ python/branches/release26-maint/Python/ceval.c Sat May 30 23:43:48 2009 @@ -3911,10 +3911,17 @@ PCALL(PCALL_METHOD); else if (PyType_Check(func)) PCALL(PCALL_TYPE); + else if (PyCFunction_Check(func)) + PCALL(PCALL_CFUNCTION); else PCALL(PCALL_OTHER); #endif - result = PyObject_Call(func, callargs, kwdict); + if (PyCFunction_Check(func)) { + PyThreadState *tstate = PyThreadState_GET(); + C_TRACE(result, PyCFunction_Call(func, callargs, kwdict)); + } + else + result = PyObject_Call(func, callargs, kwdict); call_fail: Py_XDECREF(callargs); Py_XDECREF(kwdict); @@ -3999,10 +4006,17 @@ PCALL(PCALL_METHOD); else if (PyType_Check(func)) PCALL(PCALL_TYPE); + else if (PyCFunction_Check(func)) + PCALL(PCALL_CFUNCTION); else PCALL(PCALL_OTHER); #endif - result = PyObject_Call(func, callargs, kwdict); + if (PyCFunction_Check(func)) { + PyThreadState *tstate = PyThreadState_GET(); + C_TRACE(result, PyCFunction_Call(func, callargs, kwdict)); + } + else + result = PyObject_Call(func, callargs, kwdict); ext_call_fail: Py_XDECREF(callargs); Py_XDECREF(kwdict); From python-checkins at python.org Sat May 30 23:45:40 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sat, 30 May 2009 23:45:40 +0200 (CEST) Subject: [Python-checkins] r73068 - python/trunk/Misc/ACKS Message-ID: <20090530214540.7CBD6D5E3@mail.python.org> Author: antoine.pitrou Date: Sat May 30 23:45:40 2009 New Revision: 73068 Log: Update ACKS Modified: python/trunk/Misc/ACKS Modified: python/trunk/Misc/ACKS ============================================================================== --- python/trunk/Misc/ACKS (original) +++ python/trunk/Misc/ACKS Sat May 30 23:45:40 2009 @@ -239,6 +239,7 @@ Peter Funk Geoff Furnish Ulisses Furquim +Hagen F?rstenau Achim Gaedke Martin von Gagern Lele Gaifax From buildbot at python.org Sun May 31 00:53:01 2009 From: buildbot at python.org (buildbot at python.org) Date: Sat, 30 May 2009 22:53:01 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 3.x Message-ID: <20090530225301.B4242D36F@mail.python.org> The Buildbot has detected a new failure of x86 XP-4 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%203.x/builds/655 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 540, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' 2 tests failed: test_import test_winreg ====================================================================== ERROR: testImport (test.test_import.ImportTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 61, in test_with_extension mod = __import__(TESTFN) ImportError: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 540, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 63, in test_with_extension self.fail("import from %s failed: %s" % (ext, err)) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\unittest.py", line 540, in fail raise self.failureException(msg) AssertionError: import from .PY failed: No module named @test Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 80, in testImport test_with_extension(ext) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_import.py", line 73, in test_with_extension del sys.modules[TESTFN] KeyError: '@test' ====================================================================== FAIL: testLocalMachineRegistryWorks (test.test_winreg.WinregTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_winreg.py", line 148, in testLocalMachineRegistryWorks self.TestAll(HKEY_CURRENT_USER) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_winreg.py", line 143, in TestAll self.WriteTestData(root_key, subkeystr) File "E:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_winreg.py", line 50, in WriteTestData "Not the correct number of values") AssertionError: Not the correct number of values sincerely, -The Buildbot From buildbot at python.org Sun May 31 02:19:22 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 31 May 2009 00:19:22 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090531001922.2D4B4D697@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/786 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: antoine.pitrou BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot From python-checkins at python.org Sun May 31 02:42:42 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 31 May 2009 02:42:42 +0200 (CEST) Subject: [Python-checkins] r73069 - python/trunk/Doc/c-api/buffer.rst Message-ID: <20090531004242.A2A2CD603@mail.python.org> Author: benjamin.peterson Date: Sun May 31 02:42:42 2009 New Revision: 73069 Log: fix signature Modified: python/trunk/Doc/c-api/buffer.rst Modified: python/trunk/Doc/c-api/buffer.rst ============================================================================== --- python/trunk/Doc/c-api/buffer.rst (original) +++ python/trunk/Doc/c-api/buffer.rst Sun May 31 02:42:42 2009 @@ -141,7 +141,7 @@ Return 1 if *obj* supports the buffer interface otherwise 0. -.. cfunction:: int PyObject_GetBuffer(PyObject *obj, PyObject *view, int flags) +.. cfunction:: int PyObject_GetBuffer(PyObject *obj, Py_buffer *view, int flags) Export *obj* into a :ctype:`Py_buffer`, *view*. These arguments must never be *NULL*. The *flags* argument is a bit field indicating what From python-checkins at python.org Sun May 31 09:46:12 2009 From: python-checkins at python.org (martin.v.loewis) Date: Sun, 31 May 2009 09:46:12 +0200 (CEST) Subject: [Python-checkins] r73070 - python/branches/py3k/Tools/msi/uuids.py Message-ID: <20090531074612.076A9C472@mail.python.org> Author: martin.v.loewis Date: Sun May 31 09:46:11 2009 New Revision: 73070 Log: Fix typo. Modified: python/branches/py3k/Tools/msi/uuids.py Modified: python/branches/py3k/Tools/msi/uuids.py ============================================================================== --- python/branches/py3k/Tools/msi/uuids.py (original) +++ python/branches/py3k/Tools/msi/uuids.py Sun May 31 09:46:11 2009 @@ -71,6 +71,6 @@ '3.1.102': '{f6e199bf-dc64-42f3-87d4-1525991a013e}', # 3.1a2 '3.1.111': '{c3c82893-69b2-4676-8554-1b6ee6c191e9}', # 3.1b1 '3.1.121': '{da2b5170-12f3-4d99-8a1f-54926cca7acd}', # 3.1c1 - '3.1.122': '{bceb5133-e2ee-4109-951f-ac7e941a1692}', # 3.1c1 + '3.1.122': '{bceb5133-e2ee-4109-951f-ac7e941a1692}', # 3.1c2 '3.1.150': '{3ad61ee5-81d2-4d7e-adef-da1dd37277d1}', # 3.1.0 } From python-checkins at python.org Sun May 31 16:15:25 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 31 May 2009 16:15:25 +0200 (CEST) Subject: [Python-checkins] r73071 - python/trunk/Doc/library/unittest.rst Message-ID: <20090531141525.D5715D56D@mail.python.org> Author: georg.brandl Date: Sun May 31 16:15:25 2009 New Revision: 73071 Log: Fix markup. Modified: python/trunk/Doc/library/unittest.rst Modified: python/trunk/Doc/library/unittest.rst ============================================================================== --- python/trunk/Doc/library/unittest.rst (original) +++ python/trunk/Doc/library/unittest.rst Sun May 31 16:15:25 2009 @@ -79,18 +79,15 @@ Module :mod:`doctest` Another test-support module with a very different flavor. - `Simple Smalltalk Testing: With Patterns - `_ + `Simple Smalltalk Testing: With Patterns `_ Kent Beck's original paper on testing frameworks using the pattern shared by :mod:`unittest`. - `Nose `_ and `py.test - `_ + `Nose `_ and `py.test `_ Third-party unittest frameworks with a lighter-weight syntax for writing tests. For example, ``assert func(10) == 42``. - `python-mock `_ and - `minimock `_ + `python-mock `_ and `minimock `_ Tools for creating mock test objects (objects simulating external resources). From python-checkins at python.org Sun May 31 16:20:14 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 31 May 2009 16:20:14 +0200 (CEST) Subject: [Python-checkins] r73072 - in python/trunk: Doc/whatsnew/2.7.rst Lib/test/regrtest.py Lib/test/test_support.py Misc/NEWS Message-ID: <20090531142014.68DD7D66C@mail.python.org> Author: antoine.pitrou Date: Sun May 31 16:20:14 2009 New Revision: 73072 Log: Issue #6152: New option '-j'/'--multiprocess' for regrtest allows running regression tests in parallel, shortening the total runtime. Modified: python/trunk/Doc/whatsnew/2.7.rst python/trunk/Lib/test/regrtest.py python/trunk/Lib/test/test_support.py python/trunk/Misc/NEWS Modified: python/trunk/Doc/whatsnew/2.7.rst ============================================================================== --- python/trunk/Doc/whatsnew/2.7.rst (original) +++ python/trunk/Doc/whatsnew/2.7.rst Sun May 31 16:20:14 2009 @@ -654,6 +654,12 @@ The :option:`-r` option also now reports the seed that was used (Added by Collin Winter.) +* The :file:`regrtest.py` script now takes a :option:`-j` switch + that takes an integer specifying how many tests run in parallel. This + allows to shorten the total runtime on multi-core machines. + This option is compatible with several other options, including the + :option:`-R` switch which is known to produce long runtimes. + (Added by Antoine Pitrou, :issue:`6152`.) .. ====================================================================== Modified: python/trunk/Lib/test/regrtest.py ============================================================================== --- python/trunk/Lib/test/regrtest.py (original) +++ python/trunk/Lib/test/regrtest.py Sun May 31 16:20:14 2009 @@ -26,6 +26,7 @@ -L: runleaks -- run the leaks(1) command just before exit -R: huntrleaks -- search for reference leaks (needs debug build, v. slow) -M: memlimit -- run very large memory-consuming tests +-j: multiprocess -- run several processes at once If non-option arguments are present, they are names for tests to run, unless -x is given, in which case they are names for tests not to run. @@ -133,6 +134,7 @@ import cStringIO import getopt +import json import os import random import re @@ -193,7 +195,7 @@ exclude=False, single=False, randomize=False, fromfile=None, findleaks=False, use_resources=None, trace=False, coverdir='coverage', runleaks=False, huntrleaks=False, verbose2=False, print_slow=False, - random_seed=None): + random_seed=None, use_mp=None): """Execute a test suite. This also parses command-line options and modifies its behavior @@ -218,13 +220,13 @@ test_support.record_original_stdout(sys.stdout) try: - opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsSrf:lu:t:TD:NLR:wM:', + opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsSrf:lu:t:TD:NLR:wM:j:', ['help', 'verbose', 'quiet', 'exclude', 'single', 'slow', 'random', 'fromfile', 'findleaks', 'use=', 'threshold=', 'trace', 'coverdir=', 'nocoverdir', 'runleaks', 'huntrleaks=', 'verbose2', 'memlimit=', - 'randseed=' + 'randseed=', 'multiprocess=', 'slaveargs=', ]) except getopt.error, msg: usage(2, msg) @@ -303,8 +305,23 @@ use_resources.remove(r) elif r not in use_resources: use_resources.append(r) + elif o in ('-j', '--multiprocess'): + use_mp = int(a) + elif o == '--slaveargs': + args, kwargs = json.loads(a) + try: + result = runtest(*args, **kwargs) + except BaseException, e: + result = -3, e.__class__.__name__ + print # Force a newline (just in case) + print json.dumps(result) + sys.exit(0) if single and fromfile: usage(2, "-s and -f don't go together!") + if use_mp and trace: + usage(2, "-T and -j don't go together!") + if use_mp and findleaks: + usage(2, "-l and -j don't go together!") good = [] bad = [] @@ -370,50 +387,111 @@ tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix], trace=False, count=True) test_times = [] - test_support.verbose = verbose # Tell tests to be moderately quiet test_support.use_resources = use_resources save_modules = sys.modules.keys() - for test in tests: - if not quiet: - print test - sys.stdout.flush() - if trace: - # If we're tracing code coverage, then we don't exit with status - # if on a false return value from main. - tracer.runctx('runtest(test, verbose, quiet,' - ' test_times, testdir)', - globals=globals(), locals=vars()) + + def accumulate_result(test, result): + ok, test_time = result + test_times.append((test_time, test)) + if ok > 0: + good.append(test) + elif ok == 0: + bad.append(test) else: + skipped.append(test) + if ok == -2: + resource_denieds.append(test) + + if use_mp: + from threading import Thread + from Queue import Queue, Empty + from subprocess import Popen, PIPE, STDOUT + from collections import deque + debug_output_pat = re.compile(r"\[\d+ refs\]$") + pending = deque() + output = Queue() + for test in tests: + args_tuple = ( + (test, verbose, quiet, testdir), + dict(huntrleaks=huntrleaks, use_resources=use_resources) + ) + pending.append((test, args_tuple)) + def work(): + # A worker thread. try: - ok = runtest(test, verbose, quiet, test_times, - testdir, huntrleaks) - except KeyboardInterrupt: - # print a newline separate from the ^C - print - break - except: + while True: + try: + test, args_tuple = pending.popleft() + except IndexError: + output.put((None, None, None)) + return + if not quiet: + print test + sys.stdout.flush() + popen = Popen([sys.executable, '-m', 'test.regrtest', + '--slaveargs', json.dumps(args_tuple)], + stdout=PIPE, stderr=STDOUT, + universal_newlines=True, close_fds=True) + out = popen.communicate()[0].strip() + out = debug_output_pat.sub("", out) + out, _, result = out.strip().rpartition("\n") + result = json.loads(result) + output.put((test, out.strip(), result)) + except BaseException: + output.put((None, None, None)) raise - if ok > 0: - good.append(test) - elif ok == 0: - bad.append(test) + workers = [Thread(target=work) for i in range(use_mp)] + for worker in workers: + worker.start() + finished = 0 + while finished < use_mp: + test, out, result = output.get() + if test is None: + finished += 1 + continue + if out: + print out + if result[0] == -3: + assert result[1] == 'KeyboardInterrupt' + pending.clear() + raise KeyboardInterrupt # What else? + accumulate_result(test, result) + for worker in workers: + worker.join() + else: + for test in tests: + if not quiet: + print test + sys.stdout.flush() + if trace: + # If we're tracing code coverage, then we don't exit with status + # if on a false return value from main. + tracer.runctx('runtest(test, verbose, quiet, testdir)', + globals=globals(), locals=vars()) else: - skipped.append(test) - if ok == -2: - resource_denieds.append(test) - if findleaks: - gc.collect() - if gc.garbage: - print "Warning: test created", len(gc.garbage), - print "uncollectable object(s)." - # move the uncollectable objects somewhere so we don't see - # them again - found_garbage.extend(gc.garbage) - del gc.garbage[:] - # Unload the newly imported modules (best effort finalization) - for module in sys.modules.keys(): - if module not in save_modules and module.startswith("test."): - test_support.unload(module) + try: + result = runtest(test, verbose, quiet, + testdir, huntrleaks) + accumulate_result(test, result) + except KeyboardInterrupt: + # print a newline separate from the ^C + print + break + except: + raise + if findleaks: + gc.collect() + if gc.garbage: + print "Warning: test created", len(gc.garbage), + print "uncollectable object(s)." + # move the uncollectable objects somewhere so we don't see + # them again + found_garbage.extend(gc.garbage) + del gc.garbage[:] + # Unload the newly imported modules (best effort finalization) + for module in sys.modules.keys(): + if module not in save_modules and module.startswith("test."): + test_support.unload(module) # The lists won't be sorted if running with -r good.sort() @@ -457,7 +535,7 @@ sys.stdout.flush() try: test_support.verbose = True - ok = runtest(test, True, quiet, test_times, testdir, + ok = runtest(test, True, quiet, testdir, huntrleaks) except KeyboardInterrupt: # print a newline separate from the ^C @@ -521,8 +599,8 @@ tests.sort() return stdtests + tests -def runtest(test, verbose, quiet, test_times, - testdir=None, huntrleaks=False): +def runtest(test, verbose, quiet, + testdir=None, huntrleaks=False, use_resources=None): """Run a single test. test -- the name of the test @@ -539,13 +617,16 @@ 1 test passed """ + test_support.verbose = verbose # Tell tests to be moderately quiet + if use_resources is not None: + test_support.use_resources = use_resources try: - return runtest_inner(test, verbose, quiet, test_times, + return runtest_inner(test, verbose, quiet, testdir, huntrleaks) finally: cleanup_test_droppings(test, verbose) -def runtest_inner(test, verbose, quiet, test_times, +def runtest_inner(test, verbose, quiet, testdir=None, huntrleaks=False): test_support.unload(test) if not testdir: @@ -555,6 +636,7 @@ else: capture_stdout = cStringIO.StringIO() + test_time = 0.0 refleak = False # True if the test leaked references. try: save_stdout = sys.stdout @@ -578,25 +660,24 @@ if huntrleaks: refleak = dash_R(the_module, test, indirect_test, huntrleaks) test_time = time.time() - start_time - test_times.append((test_time, test)) finally: sys.stdout = save_stdout except test_support.ResourceDenied, msg: if not quiet: print test, "skipped --", msg sys.stdout.flush() - return -2 + return -2, test_time except unittest.SkipTest, msg: if not quiet: print test, "skipped --", msg sys.stdout.flush() - return -1 + return -1, test_time except KeyboardInterrupt: raise except test_support.TestFailed, msg: print "test", test, "failed --", msg sys.stdout.flush() - return 0 + return 0, test_time except: type, value = sys.exc_info()[:2] print "test", test, "crashed --", str(type) + ":", value @@ -604,22 +685,22 @@ if verbose: traceback.print_exc(file=sys.stdout) sys.stdout.flush() - return 0 + return 0, test_time else: if refleak: - return 0 + return 0, test_time # Except in verbose mode, tests should not print anything if verbose or huntrleaks: - return 1 + return 1, test_time output = capture_stdout.getvalue() if not output: - return 1 + return 1, test_time print "test", test, "produced unexpected output:" print "*" * 70 print output print "*" * 70 sys.stdout.flush() - return 0 + return 0, test_time def cleanup_test_droppings(testname, verbose): import shutil @@ -707,9 +788,9 @@ if any(deltas): msg = '%s leaked %s references, sum=%s' % (test, deltas, sum(deltas)) print >> sys.stderr, msg - refrep = open(fname, "a") - print >> refrep, msg - refrep.close() + with open(fname, "a") as refrep: + print >> refrep, msg + refrep.flush() return True return False @@ -1227,6 +1308,6 @@ i -= 1 if os.path.abspath(os.path.normpath(sys.path[i])) == mydir: del sys.path[i] - if len(sys.path) == pathlen: + if '--slaveargs' not in sys.argv and len(sys.path) == pathlen: print 'Could not find %r in sys.path to remove it' % mydir main() Modified: python/trunk/Lib/test/test_support.py ============================================================================== --- python/trunk/Lib/test/test_support.py (original) +++ python/trunk/Lib/test/test_support.py Sun May 31 16:20:14 2009 @@ -378,6 +378,10 @@ 'Unicode filename tests may not be effective' \ % TESTFN_UNICODE_UNENCODEABLE +# Disambiguate TESTFN for parallel testing, while letting it remain a valid +# module name. +TESTFN = "{0}_{1}_tmp".format(TESTFN, os.getpid()) + # Make sure we can write to TESTFN, try in /tmp if we can't fp = None try: Modified: python/trunk/Misc/NEWS ============================================================================== --- python/trunk/Misc/NEWS (original) +++ python/trunk/Misc/NEWS Sun May 31 16:20:14 2009 @@ -1104,6 +1104,9 @@ Tests ----- +- Issue #6152: New option '-j'/'--multiprocess' for regrtest allows running + regression tests in parallel, shortening the total runtime. + - Issue #5354: New test support function import_fresh_module() makes it easy to import both normal and optimised versions of modules. test_heapq and test_warnings have been adjusted to use it, tests for From python-checkins at python.org Sun May 31 16:43:00 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 31 May 2009 16:43:00 +0200 (CEST) Subject: [Python-checkins] r73073 - python/trunk/Lib/test/test_support.py Message-ID: <20090531144300.6279ED358@mail.python.org> Author: benjamin.peterson Date: Sun May 31 16:43:00 2009 New Revision: 73073 Log: remove function import Modified: python/trunk/Lib/test/test_support.py Modified: python/trunk/Lib/test/test_support.py ============================================================================== --- python/trunk/Lib/test/test_support.py (original) +++ python/trunk/Lib/test/test_support.py Sun May 31 16:43:00 2009 @@ -6,6 +6,7 @@ import contextlib import errno import functools +import gc import socket import sys import os @@ -644,7 +645,6 @@ longer than expected. This function tries its best to force all garbage objects to disappear. """ - import gc gc.collect() gc.collect() gc.collect() From python-checkins at python.org Sun May 31 17:00:27 2009 From: python-checkins at python.org (benjamin.peterson) Date: Sun, 31 May 2009 17:00:27 +0200 (CEST) Subject: [Python-checkins] r73074 - python/trunk/Lib/multiprocessing/synchronize.py Message-ID: <20090531150027.AFCDED61B@mail.python.org> Author: benjamin.peterson Date: Sun May 31 17:00:27 2009 New Revision: 73074 Log: __enter__ and __exit__ must be on the class Modified: python/trunk/Lib/multiprocessing/synchronize.py Modified: python/trunk/Lib/multiprocessing/synchronize.py ============================================================================== --- python/trunk/Lib/multiprocessing/synchronize.py (original) +++ python/trunk/Lib/multiprocessing/synchronize.py Sun May 31 17:00:27 2009 @@ -58,8 +58,12 @@ def _make_methods(self): self.acquire = self._semlock.acquire self.release = self._semlock.release - self.__enter__ = self._semlock.__enter__ - self.__exit__ = self._semlock.__exit__ + + def __enter__(self): + return self._semlock.__enter__() + + def __exit__(self, *args): + return self._semlock.__exit__(*args) def __getstate__(self): assert_spawning(self) @@ -181,11 +185,15 @@ self._woken_count, self._wait_semaphore) = state self._make_methods() + def __enter__(self): + return self._lock.__enter__() + + def __exit__(self, *args): + return self._lock.__exit__(*args) + def _make_methods(self): self.acquire = self._lock.acquire self.release = self._lock.release - self.__enter__ = self._lock.__enter__ - self.__exit__ = self._lock.__exit__ def __repr__(self): try: From python-checkins at python.org Sun May 31 18:41:59 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 31 May 2009 18:41:59 +0200 (CEST) Subject: [Python-checkins] r73075 - python/branches/py3k/Doc/library/logging.rst Message-ID: <20090531164159.31BA7D878@mail.python.org> Author: georg.brandl Date: Sun May 31 18:41:59 2009 New Revision: 73075 Log: #6155: remove usage of cPickle. Modified: python/branches/py3k/Doc/library/logging.rst Modified: python/branches/py3k/Doc/library/logging.rst ============================================================================== --- python/branches/py3k/Doc/library/logging.rst (original) +++ python/branches/py3k/Doc/library/logging.rst Sun May 31 18:41:59 2009 @@ -1352,7 +1352,7 @@ At the receiving end, you can set up a receiver using the :mod:`socketserver` module. Here is a basic working example:: - import cPickle + import pickle import logging import logging.handlers import socketserver @@ -1385,7 +1385,7 @@ self.handleLogRecord(record) def unPickle(self, data): - return cPickle.loads(data) + return pickle.loads(data) def handleLogRecord(self, record): # if a name is specified, we use the named logger rather than the one From buildbot at python.org Sun May 31 20:04:11 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 31 May 2009 18:04:11 +0000 Subject: [Python-checkins] buildbot failure in x86 XP-4 trunk Message-ID: <20090531180411.82E59D8E4@mail.python.org> The Buildbot has detected a new failure of x86 XP-4 trunk. Full details are available at: http://www.python.org/dev/buildbot/all/x86%20XP-4%20trunk/builds/2207 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: bolen-windows Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: benjamin.peterson BUILD FAILED: failed test Excerpt from the test logfile: 4 tests failed: test__locale test_float test_unittest test_winreg Traceback (most recent call last): File "../lib/test/regrtest.py", line 652, in runtest_inner the_package = __import__(abstest, globals(), locals(), []) File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\test\test__locale.py", line 2, in from _locale import (setlocale, LC_NUMERIC, RADIXCHAR, THOUSEP, nl_langinfo, ImportError: cannot import name RADIXCHAR ====================================================================== FAIL: test_format_testfile (test.test_float.IEEEFormatTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\test\test_float.py", line 319, in test_format_testfile self.assertEqual(fmt % float(arg), rhs) AssertionError: '3' != '2' ====================================================================== FAIL: test_find_tests_with_package (test.test_unittest.TestDiscovery) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\test\test_unittest.py", line 3532, in test_find_tests_with_package self.assertEqual(suite, ['load_tests', '/foo/test_directory2 module tests']) AssertionError: Lists differ: ['load_tests', '/foo\\test_dir... != ['load_tests', '/foo/test_dire... ====================================================================== FAIL: testLocalMachineRegistryWorks (test.test_winreg.WinregTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\test\test_winreg.py", line 154, in testLocalMachineRegistryWorks self.TestAll(HKEY_CURRENT_USER) File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\test\test_winreg.py", line 149, in TestAll self.WriteTestData(root_key) File "E:\cygwin\home\db3l\buildarea\trunk.bolen-windows\build\lib\test\test_winreg.py", line 56, in WriteTestData "Not the correct number of values") AssertionError: Not the correct number of values sincerely, -The Buildbot From python-checkins at python.org Sun May 31 20:05:51 2009 From: python-checkins at python.org (antoine.pitrou) Date: Sun, 31 May 2009 20:05:51 +0200 (CEST) Subject: [Python-checkins] r73076 - python/trunk/Objects/object.c Message-ID: <20090531180551.89B10D901@mail.python.org> Author: antoine.pitrou Date: Sun May 31 20:05:51 2009 New Revision: 73076 Log: Uninitialized file type would lead to __exit__ lookup failure when site.py tries to read *.pth files on interpreter startup. Modified: python/trunk/Objects/object.c Modified: python/trunk/Objects/object.c ============================================================================== --- python/trunk/Objects/object.c (original) +++ python/trunk/Objects/object.c Sun May 31 20:05:51 2009 @@ -2156,6 +2156,9 @@ if (PyType_Ready(&PyMemberDescr_Type) < 0) Py_FatalError("Can't initialize member descriptor type"); + + if (PyType_Ready(&PyFile_Type) < 0) + Py_FatalError("Can't initialize file type"); } From python-checkins at python.org Sun May 31 21:15:57 2009 From: python-checkins at python.org (r.david.murray) Date: Sun, 31 May 2009 21:15:57 +0200 (CEST) Subject: [Python-checkins] r73077 - in python/trunk: Doc/library/select.rst Lib/test/test_epoll.py Message-ID: <20090531191557.E527DD979@mail.python.org> Author: r.david.murray Date: Sun May 31 21:15:57 2009 New Revision: 73077 Log: Issue 3848: document the fact that epoll register raises an IOError if an fd is registered twice, and add some additional epoll tests. Patch by Christian Heimes. Modified: python/trunk/Doc/library/select.rst python/trunk/Lib/test/test_epoll.py Modified: python/trunk/Doc/library/select.rst ============================================================================== --- python/trunk/Doc/library/select.rst (original) +++ python/trunk/Doc/library/select.rst Sun May 31 21:15:57 2009 @@ -160,6 +160,11 @@ Register a fd descriptor with the epoll object. + .. note:: + + Registering a file descriptor that's already registered raises an + IOError -- contrary to :ref:`poll-objects`'s register. + .. method:: epoll.modify(fd, eventmask) Modified: python/trunk/Lib/test/test_epoll.py ============================================================================== --- python/trunk/Lib/test/test_epoll.py (original) +++ python/trunk/Lib/test/test_epoll.py Sun May 31 21:15:57 2009 @@ -95,6 +95,34 @@ finally: ep.close() + # adding by object w/ fileno works, too. + ep = select.epoll(2) + try: + ep.register(server, select.EPOLLIN | select.EPOLLOUT) + ep.register(client, select.EPOLLIN | select.EPOLLOUT) + finally: + ep.close() + + ep = select.epoll(2) + try: + # TypeError: argument must be an int, or have a fileno() method. + self.assertRaises(TypeError, ep.register, object(), + select.EPOLLIN | select.EPOLLOUT) + self.assertRaises(TypeError, ep.register, None, + select.EPOLLIN | select.EPOLLOUT) + # ValueError: file descriptor cannot be a negative integer (-1) + self.assertRaises(ValueError, ep.register, -1, + select.EPOLLIN | select.EPOLLOUT) + # IOError: [Errno 9] Bad file descriptor + self.assertRaises(IOError, ep.register, 10000, + select.EPOLLIN | select.EPOLLOUT) + # registering twice also raises an exception + ep.register(server, select.EPOLLIN | select.EPOLLOUT) + self.assertRaises(IOError, ep.register, server, + select.EPOLLIN | select.EPOLLOUT) + finally: + ep.close() + def test_fromfd(self): server, client = self._connected_pair() From python-checkins at python.org Sun May 31 21:29:05 2009 From: python-checkins at python.org (r.david.murray) Date: Sun, 31 May 2009 21:29:05 +0200 (CEST) Subject: [Python-checkins] r73078 - in python/branches/release26-maint: Doc/library/select.rst Lib/test/test_epoll.py Message-ID: <20090531192905.BC3C2D969@mail.python.org> Author: r.david.murray Date: Sun May 31 21:29:05 2009 New Revision: 73078 Log: Merged revisions 73077 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r73077 | r.david.murray | 2009-05-31 15:15:57 -0400 (Sun, 31 May 2009) | 4 lines Issue 3848: document the fact that epoll register raises an IOError if an fd is registered twice, and add some additional epoll tests. Patch by Christian Heimes. ........ Modified: python/branches/release26-maint/ (props changed) python/branches/release26-maint/Doc/library/select.rst python/branches/release26-maint/Lib/test/test_epoll.py Modified: python/branches/release26-maint/Doc/library/select.rst ============================================================================== --- python/branches/release26-maint/Doc/library/select.rst (original) +++ python/branches/release26-maint/Doc/library/select.rst Sun May 31 21:29:05 2009 @@ -160,6 +160,11 @@ Register a fd descriptor with the epoll object. + .. note:: + + Registering a file descriptor that's already registered raises an + IOError -- contrary to :ref:`poll-objects`'s register. + .. method:: epoll.modify(fd, eventmask) Modified: python/branches/release26-maint/Lib/test/test_epoll.py ============================================================================== --- python/branches/release26-maint/Lib/test/test_epoll.py (original) +++ python/branches/release26-maint/Lib/test/test_epoll.py Sun May 31 21:29:05 2009 @@ -95,6 +95,34 @@ finally: ep.close() + # adding by object w/ fileno works, too. + ep = select.epoll(2) + try: + ep.register(server, select.EPOLLIN | select.EPOLLOUT) + ep.register(client, select.EPOLLIN | select.EPOLLOUT) + finally: + ep.close() + + ep = select.epoll(2) + try: + # TypeError: argument must be an int, or have a fileno() method. + self.assertRaises(TypeError, ep.register, object(), + select.EPOLLIN | select.EPOLLOUT) + self.assertRaises(TypeError, ep.register, None, + select.EPOLLIN | select.EPOLLOUT) + # ValueError: file descriptor cannot be a negative integer (-1) + self.assertRaises(ValueError, ep.register, -1, + select.EPOLLIN | select.EPOLLOUT) + # IOError: [Errno 9] Bad file descriptor + self.assertRaises(IOError, ep.register, 10000, + select.EPOLLIN | select.EPOLLOUT) + # registering twice also raises an exception + ep.register(server, select.EPOLLIN | select.EPOLLOUT) + self.assertRaises(IOError, ep.register, server, + select.EPOLLIN | select.EPOLLOUT) + finally: + ep.close() + def test_fromfd(self): server, client = self._connected_pair() From python-checkins at python.org Sun May 31 21:44:27 2009 From: python-checkins at python.org (r.david.murray) Date: Sun, 31 May 2009 21:44:27 +0200 (CEST) Subject: [Python-checkins] r73079 - in python/branches/py3k: Doc/library/select.rst Lib/test/test_epoll.py Message-ID: <20090531194427.A990AD96C@mail.python.org> Author: r.david.murray Date: Sun May 31 21:44:27 2009 New Revision: 73079 Log: Merged revisions 73077 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r73077 | r.david.murray | 2009-05-31 15:15:57 -0400 (Sun, 31 May 2009) | 4 lines Issue 3848: document the fact that epoll register raises an IOError if an fd is registered twice, and add some additional epoll tests. Patch by Christian Heimes. ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Doc/library/select.rst python/branches/py3k/Lib/test/test_epoll.py Modified: python/branches/py3k/Doc/library/select.rst ============================================================================== --- python/branches/py3k/Doc/library/select.rst (original) +++ python/branches/py3k/Doc/library/select.rst Sun May 31 21:44:27 2009 @@ -154,6 +154,11 @@ Register a fd descriptor with the epoll object. + .. note:: + + Registering a file descriptor that's already registered raises an + IOError -- contrary to :ref:`poll-objects`'s register. + .. method:: epoll.modify(fd, eventmask) Modified: python/branches/py3k/Lib/test/test_epoll.py ============================================================================== --- python/branches/py3k/Lib/test/test_epoll.py (original) +++ python/branches/py3k/Lib/test/test_epoll.py Sun May 31 21:44:27 2009 @@ -95,6 +95,34 @@ finally: ep.close() + # adding by object w/ fileno works, too. + ep = select.epoll(2) + try: + ep.register(server, select.EPOLLIN | select.EPOLLOUT) + ep.register(client, select.EPOLLIN | select.EPOLLOUT) + finally: + ep.close() + + ep = select.epoll(2) + try: + # TypeError: argument must be an int, or have a fileno() method. + self.assertRaises(TypeError, ep.register, object(), + select.EPOLLIN | select.EPOLLOUT) + self.assertRaises(TypeError, ep.register, None, + select.EPOLLIN | select.EPOLLOUT) + # ValueError: file descriptor cannot be a negative integer (-1) + self.assertRaises(ValueError, ep.register, -1, + select.EPOLLIN | select.EPOLLOUT) + # IOError: [Errno 9] Bad file descriptor + self.assertRaises(IOError, ep.register, 10000, + select.EPOLLIN | select.EPOLLOUT) + # registering twice also raises an exception + ep.register(server, select.EPOLLIN | select.EPOLLOUT) + self.assertRaises(IOError, ep.register, server, + select.EPOLLIN | select.EPOLLOUT) + finally: + ep.close() + def test_fromfd(self): server, client = self._connected_pair() From python-checkins at python.org Sun May 31 21:52:28 2009 From: python-checkins at python.org (guilherme.polo) Date: Sun, 31 May 2009 21:52:28 +0200 (CEST) Subject: [Python-checkins] r73080 - python/branches/tk_and_idle_maintenance/Lib/lib-tk/test/test_tkinter/test_text.py Message-ID: <20090531195228.44825C49B@mail.python.org> Author: guilherme.polo Date: Sun May 31 21:52:28 2009 New Revision: 73080 Log: Some tests for Tkinter.Text Modified: python/branches/tk_and_idle_maintenance/Lib/lib-tk/test/test_tkinter/test_text.py Modified: python/branches/tk_and_idle_maintenance/Lib/lib-tk/test/test_tkinter/test_text.py ============================================================================== --- python/branches/tk_and_idle_maintenance/Lib/lib-tk/test/test_tkinter/test_text.py (original) +++ python/branches/tk_and_idle_maintenance/Lib/lib-tk/test/test_tkinter/test_text.py Sun May 31 21:52:28 2009 @@ -15,6 +15,138 @@ self.text.destroy() + def test_bbox(self): + self.text.insert('1.0', 'o') + bbox = self.text.bbox('1.0') + self.assertTrue(isinstance(bbox, tuple)) + self.assertEqual(len(bbox), 4) + + self.assertIs(self.text.bbox('2.0'), None) + + bbox = self.text.bbox(('1.0', '-1c', '+1c')) + self.assertTrue(isinstance(bbox, tuple)) + self.assertEqual(len(bbox), 4) + + # The following used to raise Tkinter.TclError since text.bbox allowed + # passing multiple args. + self.assertRaises(TypeError, self.text.bbox, '1.0', '-1c') + + def test_compare(self): + self.text.insert('1.0', 'avocado') + self.assertEqual(self.text.compare( + '1.%d' % len('avocado'), '==', '1.%d' % len('avocado')), 1) + self.assertRaises(Tkinter.TclError, + self.text.compare, 'end', None, 'end') + self.assertRaises(Tkinter.TclError, + self.text.compare, 'end', '', 'end') + + def test_debug(self): + self.assertFalse(self.text.debug()) + self.text.debug(True) + self.assertTrue(self.text.debug()) + self.text.debug('0') + self.assertFalse(self.text.debug()) + + def test_delete(self): + word = 'avocado' + self.text.insert('1.0', word) + end_insert = len(word) - 1 + # 'delete' doesn't include the character at index2, so word[-1] will + # not be removed. + self.text.delete('1.0', '1.%d' % end_insert) + self.assertEqual(self.text.get('1.0'), word[-1]) + self.text.delete('1.0') + self.assertEqual(self.text.get('1.0').strip(), '') + + def test_dlineinfo(self): + self.text.insert('1.0', 'hi') + info = self.text.dlineinfo('1.0') + self.assertTrue(isinstance(info, tuple)) + self.assertEqual(len(info), 5) + + self.assertIs(self.text.dlineinfo('3.0'), None) + + def test_dump(self): + text = 'hi there' + self.text.insert('1.0', text) + output = self.text.dump('1.0', '1.5') + self.assertTrue(isinstance(output, list)) + self.assertEqual(len(output), 1) + self.assertTrue(isinstance(output[0], tuple)) + test = output[0] + self.assertEqual(test, ('text', text[:5], '1.0')) + + self.assertEqual(self.text.dump('1.0', 'end'), + self.text.dump('1.0', 'end', image=True, mark=True, tag=True, + text=True, window=True)) + + result = [] + def cmd(key, value, index): + result.append((key, value, index)) + self.assertIs(self.text.dump('1.0', command=cmd), None) + self.assertEqual(result, [('text', text[0], '1.0')]) + self.assertFalse(self.text._tclCommands) + + def test_edit(self): + self.text['undo'] = False + self.assertFalse(self.text['undo']) + + self.text.insert('1.0', 'hi') + self.text.edit_undo() + self.assertEqual(self.text.get('1.0', '1.2'), 'hi') + self.text.delete('1.0', 'end') + + self.text['undo'] = True + self.assertTrue(self.text['undo']) + self.text.insert('1.0', 'hi') + self.assertEqual(self.text.get('1.0', '1.2'), 'hi') + self.assertTrue(self.text.edit_modified()) + self.text.edit_undo() + self.assertFalse(self.text.get('1.0', '1.2')) + # There is nothing to undo now + self.assertRaises(Tkinter.TclError, self.text.edit_undo) + + self.text.edit_redo() + self.assertEqual(self.text.get('1.0', '1.2'), 'hi') + + self.text.edit_reset() + self.assertRaises(Tkinter.TclError, self.text.edit_undo) + self.assertRaises(Tkinter.TclError, self.text.edit_redo) + + def test_get(self): + word = 'avocado' + self.text.insert('1.0', word) + self.assertEqual(self.text.get('1.0'), word[0]) + self.assertEqual(self.text.get('1.0', '1.2'), word[:2]) + + def test_image_cget(self): + pass + + def test_image_configure(self): + pass + + def test_image_names(self): + pass + + def test_index(self): + self.assertTrue(isinstance(self.text.index('end'), str)) + self.assertRaises(Tkinter.TclError, self.text.index, '') + + def test_insert(self): + self.text.insert('1.0', 'abc') + self.text.insert('1.1', 'bcd a', 'mytag') + self.assertEqual(self.text.get('1.0', 'end').strip(), 'abcd abc') + self.assertIn(self.text.tag_name(), 'mytag') + + def test_mark(self): + pass + + def test_scan_mark(self): + pass + + def test_scan_dragto(self): + pass + def test_search(self): text = self.text @@ -32,6 +164,21 @@ self.failUnlessEqual(text.search('-test', '1.0', 'end'), '1.2') self.failUnlessEqual(text.search('test', '1.0', 'end'), '1.3') + def test_see(self): + pass + + def test_tag(self): + pass + + def test_window(self): + pass + + def test_xview(self): + pass + + def test_yview(self): + pass + tests_gui = (TextTest, ) From python-checkins at python.org Sun May 31 22:03:27 2009 From: python-checkins at python.org (r.david.murray) Date: Sun, 31 May 2009 22:03:27 +0200 (CEST) Subject: [Python-checkins] r73081 - in python/branches/release30-maint: Doc/library/select.rst Lib/test/test_epoll.py Message-ID: <20090531200327.7DA98D929@mail.python.org> Author: r.david.murray Date: Sun May 31 22:03:27 2009 New Revision: 73081 Log: Merged revisions 73079 via svnmerge from svn+ssh://pythondev at svn.python.org/python/branches/py3k ................ r73079 | r.david.murray | 2009-05-31 15:44:27 -0400 (Sun, 31 May 2009) | 11 lines Merged revisions 73077 via svnmerge from svn+ssh://pythondev at svn.python.org/python/trunk ........ r73077 | r.david.murray | 2009-05-31 15:15:57 -0400 (Sun, 31 May 2009) | 4 lines Issue 3848: document the fact that epoll register raises an IOError if an fd is registered twice, and add some additional epoll tests. Patch by Christian Heimes. ........ ................ Modified: python/branches/release30-maint/ (props changed) python/branches/release30-maint/Doc/library/select.rst python/branches/release30-maint/Lib/test/test_epoll.py Modified: python/branches/release30-maint/Doc/library/select.rst ============================================================================== --- python/branches/release30-maint/Doc/library/select.rst (original) +++ python/branches/release30-maint/Doc/library/select.rst Sun May 31 22:03:27 2009 @@ -154,6 +154,11 @@ Register a fd descriptor with the epoll object. + .. note:: + + Registering a file descriptor that's already registered raises an + IOError -- contrary to :ref:`poll-objects`'s register. + .. method:: epoll.modify(fd, eventmask) Modified: python/branches/release30-maint/Lib/test/test_epoll.py ============================================================================== --- python/branches/release30-maint/Lib/test/test_epoll.py (original) +++ python/branches/release30-maint/Lib/test/test_epoll.py Sun May 31 22:03:27 2009 @@ -95,6 +95,34 @@ finally: ep.close() + # adding by object w/ fileno works, too. + ep = select.epoll(2) + try: + ep.register(server, select.EPOLLIN | select.EPOLLOUT) + ep.register(client, select.EPOLLIN | select.EPOLLOUT) + finally: + ep.close() + + ep = select.epoll(2) + try: + # TypeError: argument must be an int, or have a fileno() method. + self.assertRaises(TypeError, ep.register, object(), + select.EPOLLIN | select.EPOLLOUT) + self.assertRaises(TypeError, ep.register, None, + select.EPOLLIN | select.EPOLLOUT) + # ValueError: file descriptor cannot be a negative integer (-1) + self.assertRaises(ValueError, ep.register, -1, + select.EPOLLIN | select.EPOLLOUT) + # IOError: [Errno 9] Bad file descriptor + self.assertRaises(IOError, ep.register, 10000, + select.EPOLLIN | select.EPOLLOUT) + # registering twice also raises an exception + ep.register(server, select.EPOLLIN | select.EPOLLOUT) + self.assertRaises(IOError, ep.register, server, + select.EPOLLIN | select.EPOLLOUT) + finally: + ep.close() + def test_fromfd(self): server, client = self._connected_pair() From python-checkins at python.org Sun May 31 22:04:19 2009 From: python-checkins at python.org (guilherme.polo) Date: Sun, 31 May 2009 22:04:19 +0200 (CEST) Subject: [Python-checkins] r73082 - python/branches/tk_and_idle_maintenance/Lib/lib-tk/test/test_tkinter/test_text.py Message-ID: <20090531200419.08C06D929@mail.python.org> Author: guilherme.polo Date: Sun May 31 22:04:18 2009 New Revision: 73082 Log: Typo fix and a minor new test for bbox. Modified: python/branches/tk_and_idle_maintenance/Lib/lib-tk/test/test_tkinter/test_text.py Modified: python/branches/tk_and_idle_maintenance/Lib/lib-tk/test/test_tkinter/test_text.py ============================================================================== --- python/branches/tk_and_idle_maintenance/Lib/lib-tk/test/test_tkinter/test_text.py (original) +++ python/branches/tk_and_idle_maintenance/Lib/lib-tk/test/test_tkinter/test_text.py Sun May 31 22:04:18 2009 @@ -26,6 +26,7 @@ bbox = self.text.bbox(('1.0', '-1c', '+1c')) self.assertTrue(isinstance(bbox, tuple)) self.assertEqual(len(bbox), 4) + self.assertEqual(bbox, self.text.bbox('1.0 -1c +1c')) # The following used to raise Tkinter.TclError since text.bbox allowed # passing multiple args. @@ -136,7 +137,7 @@ self.text.insert('1.0', 'abc') self.text.insert('1.1', 'bcd a', 'mytag') self.assertEqual(self.text.get('1.0', 'end').strip(), 'abcd abc') - self.assertIn(self.text.tag_name(), 'mytag') + self.assertIn('mytag', self.text.tag_names()) def test_mark(self): pass From buildbot at python.org Sun May 31 22:05:34 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 31 May 2009 20:05:34 +0000 Subject: [Python-checkins] buildbot failure in amd64 gentoo trunk Message-ID: <20090531200535.033FCD93E@mail.python.org> The Buildbot has detected a new failure of amd64 gentoo trunk. Full details are available at: http://www.python.org/dev/buildbot/all/amd64%20gentoo%20trunk/builds/100 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: norwitz-amd64 Build Reason: Build Source Stamp: [branch trunk] HEAD Blamelist: r.david.murray BUILD FAILED: failed failed slave lost sincerely, -The Buildbot From python-checkins at python.org Sun May 31 23:31:21 2009 From: python-checkins at python.org (guilherme.polo) Date: Sun, 31 May 2009 23:31:21 +0200 (CEST) Subject: [Python-checkins] r73083 - python/trunk/Lib/lib-tk/Tkinter.py Message-ID: <20090531213121.415F2D977@mail.python.org> Author: guilherme.polo Date: Sun May 31 23:31:21 2009 New Revision: 73083 Log: Improved PanedWindow.add's docstring. 'subcomand' is a Tcl term, and the possible options and values are the same accepted by paneconfigure (not configure). Modified: python/trunk/Lib/lib-tk/Tkinter.py Modified: python/trunk/Lib/lib-tk/Tkinter.py ============================================================================== --- python/trunk/Lib/lib-tk/Tkinter.py (original) +++ python/trunk/Lib/lib-tk/Tkinter.py Sun May 31 23:31:21 2009 @@ -3550,8 +3550,8 @@ The child argument is the name of the child widget followed by pairs of arguments that specify how to - manage the windows. Options may have any of the values - accepted by the configure subcommand. + manage the windows. The possible options and values + are the ones accepted by the paneconfigure method. """ self.tk.call((self._w, 'add', child) + self._options(kw)) From python-checkins at python.org Sun May 31 23:35:23 2009 From: python-checkins at python.org (guilherme.polo) Date: Sun, 31 May 2009 23:35:23 +0200 (CEST) Subject: [Python-checkins] r73084 - in python/branches/py3k: Lib/tkinter/__init__.py Message-ID: <20090531213523.D79B8D9EF@mail.python.org> Author: guilherme.polo Date: Sun May 31 23:35:23 2009 New Revision: 73084 Log: Merged revisions 73083 via svnmerge from svn+ssh://pythondev/python/trunk ........ r73083 | guilherme.polo | 2009-05-31 18:31:21 -0300 (Sun, 31 May 2009) | 1 line Improved PanedWindow.add's docstring. 'subcomand' is a Tcl term, and the possible options and values are the same accepted by paneconfigure (not configure). ........ Modified: python/branches/py3k/ (props changed) python/branches/py3k/Lib/tkinter/__init__.py Modified: python/branches/py3k/Lib/tkinter/__init__.py ============================================================================== --- python/branches/py3k/Lib/tkinter/__init__.py (original) +++ python/branches/py3k/Lib/tkinter/__init__.py Sun May 31 23:35:23 2009 @@ -3534,8 +3534,8 @@ The child argument is the name of the child widget followed by pairs of arguments that specify how to - manage the windows. Options may have any of the values - accepted by the configure subcommand. + manage the windows. The possible options and values + are the ones accepted by the paneconfigure method. """ self.tk.call((self._w, 'add', child) + self._options(kw)) From python-checkins at python.org Sun May 31 23:36:16 2009 From: python-checkins at python.org (guilherme.polo) Date: Sun, 31 May 2009 23:36:16 +0200 (CEST) Subject: [Python-checkins] r73085 - in python/branches/tk_and_idle_maintenance: Doc/c-api/buffer.rst Doc/library/ipaddr.rst Doc/library/select.rst Doc/library/unittest.rst Doc/whatsnew/2.7.rst Lib/lib-tk/Tkinter.py Lib/multiprocessing/synchronize.py Lib/test/regrtest.py Lib/test/test_cprofile.py Lib/test/test_epoll.py Lib/test/test_profile.py Lib/test/test_support.py Misc/ACKS Misc/NEWS Objects/object.c Python/ceval.c Message-ID: <20090531213616.17705DA49@mail.python.org> Author: guilherme.polo Date: Sun May 31 23:36:15 2009 New Revision: 73085 Log: Merged revisions 73060,73064-73065,73068-73069,73071-73074,73076-73077,73083 via svnmerge from svn+ssh://pythondev/python/trunk ........ r73060 | gregory.p.smith | 2009-05-30 16:58:11 -0300 (Sat, 30 May 2009) | 2 lines Add more examples to the ipaddr documentation. ........ r73064 | antoine.pitrou | 2009-05-30 18:27:00 -0300 (Sat, 30 May 2009) | 4 lines Issue #5330: C functions called with keyword arguments were not reported by the various profiling modules (profile, cProfile). Patch by Hagen F??rstenau. ........ r73065 | antoine.pitrou | 2009-05-30 18:39:25 -0300 (Sat, 30 May 2009) | 3 lines The test for #5330 wasn't correct. ........ r73068 | antoine.pitrou | 2009-05-30 18:45:40 -0300 (Sat, 30 May 2009) | 3 lines Update ACKS ........ r73069 | benjamin.peterson | 2009-05-30 21:42:42 -0300 (Sat, 30 May 2009) | 1 line fix signature ........ r73071 | georg.brandl | 2009-05-31 11:15:25 -0300 (Sun, 31 May 2009) | 1 line Fix markup. ........ r73072 | antoine.pitrou | 2009-05-31 11:20:14 -0300 (Sun, 31 May 2009) | 4 lines Issue #6152: New option '-j'/'--multiprocess' for regrtest allows running regression tests in parallel, shortening the total runtime. ........ r73073 | benjamin.peterson | 2009-05-31 11:43:00 -0300 (Sun, 31 May 2009) | 1 line remove function import ........ r73074 | benjamin.peterson | 2009-05-31 12:00:27 -0300 (Sun, 31 May 2009) | 1 line __enter__ and __exit__ must be on the class ........ r73076 | antoine.pitrou | 2009-05-31 15:05:51 -0300 (Sun, 31 May 2009) | 4 lines Uninitialized file type would lead to __exit__ lookup failure when site.py tries to read *.pth files on interpreter startup. ........ r73077 | r.david.murray | 2009-05-31 16:15:57 -0300 (Sun, 31 May 2009) | 4 lines Issue 3848: document the fact that epoll register raises an IOError if an fd is registered twice, and add some additional epoll tests. Patch by Christian Heimes. ........ r73083 | guilherme.polo | 2009-05-31 18:31:21 -0300 (Sun, 31 May 2009) | 1 line Improved PanedWindow.add's docstring. 'subcomand' is a Tcl term, and the possible options and values are the same accepted by paneconfigure (not configure). ........ Modified: python/branches/tk_and_idle_maintenance/ (props changed) python/branches/tk_and_idle_maintenance/Doc/c-api/buffer.rst python/branches/tk_and_idle_maintenance/Doc/library/ipaddr.rst python/branches/tk_and_idle_maintenance/Doc/library/select.rst python/branches/tk_and_idle_maintenance/Doc/library/unittest.rst python/branches/tk_and_idle_maintenance/Doc/whatsnew/2.7.rst python/branches/tk_and_idle_maintenance/Lib/lib-tk/Tkinter.py python/branches/tk_and_idle_maintenance/Lib/multiprocessing/synchronize.py python/branches/tk_and_idle_maintenance/Lib/test/regrtest.py python/branches/tk_and_idle_maintenance/Lib/test/test_cprofile.py python/branches/tk_and_idle_maintenance/Lib/test/test_epoll.py python/branches/tk_and_idle_maintenance/Lib/test/test_profile.py python/branches/tk_and_idle_maintenance/Lib/test/test_support.py python/branches/tk_and_idle_maintenance/Misc/ACKS python/branches/tk_and_idle_maintenance/Misc/NEWS python/branches/tk_and_idle_maintenance/Objects/object.c python/branches/tk_and_idle_maintenance/Python/ceval.c Modified: python/branches/tk_and_idle_maintenance/Doc/c-api/buffer.rst ============================================================================== --- python/branches/tk_and_idle_maintenance/Doc/c-api/buffer.rst (original) +++ python/branches/tk_and_idle_maintenance/Doc/c-api/buffer.rst Sun May 31 23:36:15 2009 @@ -141,7 +141,7 @@ Return 1 if *obj* supports the buffer interface otherwise 0. -.. cfunction:: int PyObject_GetBuffer(PyObject *obj, PyObject *view, int flags) +.. cfunction:: int PyObject_GetBuffer(PyObject *obj, Py_buffer *view, int flags) Export *obj* into a :ctype:`Py_buffer`, *view*. These arguments must never be *NULL*. The *flags* argument is a bit field indicating what Modified: python/branches/tk_and_idle_maintenance/Doc/library/ipaddr.rst ============================================================================== --- python/branches/tk_and_idle_maintenance/Doc/library/ipaddr.rst (original) +++ python/branches/tk_and_idle_maintenance/Doc/library/ipaddr.rst Sun May 31 23:36:15 2009 @@ -16,6 +16,90 @@ both IPv4 and IPv6. +.. _ipaddr_examples: + +Examples +-------- + +Netmask. + + >>> ipaddr.IP('1.1.1.1/255.255.255.0') + IPv4('1.1.1.1/24') + >>> ipaddr.IP('1080::200C:417B/96') + IPv6('1080::200c:417b/96') + +Hostmask. + + >>> ipaddr.IPv4('1.1.1.1/0.0.0.255') + IPv4('1.1.1.1/24') + +Prefix length. + + >>> addr = ipaddr.IPv4('1.1.1.1/24') + >>> addr.prefixlen + 24 + +Individual addresses. + + >>> ipaddr.IP('1.1.1.1') + IPv4('1.1.1.1/32') + +Many standard Python operations are also supported. + +Comparison. + + >>> ipaddr.IPv4('1.1.1.1') == ipaddr.IPv4('1.1.1.2') + False + >>> ipaddr.IPv4('1.1.1.1') < ipaddr.IPv4('1.1.1.2') + True + +Inclusion. + + >>> ipaddr.IPv4('1.1.1.1') in ipaddr.IPv4("1.0.0.0/8") + True + +Sorting. + + >>> a = ipaddr.IPv4('1.1.1.10') + >>> b = ipaddr.IPv4('1.10.1.10') + >>> c = ipaddr.IPv4('1.1.10.10') + >>> d = ipaddr.IPv4('1.1.1.1') + >>> sorted([a, b, c, d]) + [IPv4('1.1.1.1/32'), IPv4('1.1.1.10/32'), IPv4('1.1.10.10/32'), IPv4('1.10.1.10/32')] + +Conversion to string and integer forms. + + >>> spam = ipaddr.IPv4('192.168.1.254')) + >>> str(spam) + '192.168.1.254/32' + >>> spam.ip_ext + '192.168.1.254' + >>> int(spam) + 3232236030 + >>> eggs = ipaddr.IPv6('ffff::1/120') + >>> int(eggs) + 340277174624079928635746076935438991361 + +Additionally, there are quite a few network-specific features available to +ipaddr. + + >>> ipaddr.IPv4('10.0.0.0/8').supernet() + IPv4('10.0.0.0/7') + >>> ipaddr.IPv4('10.0.0.0/8').subnet() + [IPv4('10.0.0.0/9'), IPv4('10.128.0.0/9')] + # This returns networks with a prefix length of /10 + >>> ipaddr.IPv4('10.0.0.0/8').subnet(prefixlen_diff=2) + [IPv4('10.0.0.0/10'), IPv4('10.64.0.0/10'), IPv4('10.128.0.0/10'), IPv4('10.192.0.0/10')] + # Remove an address from a superblock. + >>> ipaddr.IP('10.0.0.0/24').address_exclude(ipaddr.IP('10.0.0.0/28')) + [IPv4('10.0.0.16/28'), IPv4('10.0.0.32/27'), IPv4('10.0.0.64/26'), IPv4('10.0.0.128/25')] + + +.. _ipaddr_funcs_and_classes: + +Functions And Classes +--------------------- + .. function:: IP(ipaddr) Take an IP string or int and return an object of the correct type. Returns @@ -158,8 +242,7 @@ >>> addr1 = IP('::1/32') >>> addr2 = IP('::1/128') >>> addr1.address_exclude(addr2) - [IP('::0/128'), IP('::2/127'), IP('::4/126'), IP('::8/125'), - ... IP('0:0:8000::/33')] + [IP('::0/128'), IP('::2/127'), IP('::4/126'), IP('::8/125'), IP('0:0:8000::/33')] Raises :exc:`ValueError` if *other* is not completely contained by *self*. @@ -286,6 +369,11 @@ 2.5.2. +.. _ipaddr_exceptions: + +Exceptions +---------- + The following exceptions are defined by this module: .. exception:: Error Modified: python/branches/tk_and_idle_maintenance/Doc/library/select.rst ============================================================================== --- python/branches/tk_and_idle_maintenance/Doc/library/select.rst (original) +++ python/branches/tk_and_idle_maintenance/Doc/library/select.rst Sun May 31 23:36:15 2009 @@ -160,6 +160,11 @@ Register a fd descriptor with the epoll object. + .. note:: + + Registering a file descriptor that's already registered raises an + IOError -- contrary to :ref:`poll-objects`'s register. + .. method:: epoll.modify(fd, eventmask) Modified: python/branches/tk_and_idle_maintenance/Doc/library/unittest.rst ============================================================================== --- python/branches/tk_and_idle_maintenance/Doc/library/unittest.rst (original) +++ python/branches/tk_and_idle_maintenance/Doc/library/unittest.rst Sun May 31 23:36:15 2009 @@ -79,18 +79,15 @@ Module :mod:`doctest` Another test-support module with a very different flavor. - `Simple Smalltalk Testing: With Patterns - `_ + `Simple Smalltalk Testing: With Patterns `_ Kent Beck's original paper on testing frameworks using the pattern shared by :mod:`unittest`. - `Nose `_ and `py.test - `_ + `Nose `_ and `py.test `_ Third-party unittest frameworks with a lighter-weight syntax for writing tests. For example, ``assert func(10) == 42``. - `python-mock `_ and - `minimock `_ + `python-mock `_ and `minimock `_ Tools for creating mock test objects (objects simulating external resources). Modified: python/branches/tk_and_idle_maintenance/Doc/whatsnew/2.7.rst ============================================================================== --- python/branches/tk_and_idle_maintenance/Doc/whatsnew/2.7.rst (original) +++ python/branches/tk_and_idle_maintenance/Doc/whatsnew/2.7.rst Sun May 31 23:36:15 2009 @@ -654,6 +654,12 @@ The :option:`-r` option also now reports the seed that was used (Added by Collin Winter.) +* The :file:`regrtest.py` script now takes a :option:`-j` switch + that takes an integer specifying how many tests run in parallel. This + allows to shorten the total runtime on multi-core machines. + This option is compatible with several other options, including the + :option:`-R` switch which is known to produce long runtimes. + (Added by Antoine Pitrou, :issue:`6152`.) .. ====================================================================== Modified: python/branches/tk_and_idle_maintenance/Lib/lib-tk/Tkinter.py ============================================================================== --- python/branches/tk_and_idle_maintenance/Lib/lib-tk/Tkinter.py (original) +++ python/branches/tk_and_idle_maintenance/Lib/lib-tk/Tkinter.py Sun May 31 23:36:15 2009 @@ -3550,8 +3550,8 @@ The child argument is the name of the child widget followed by pairs of arguments that specify how to - manage the windows. Options may have any of the values - accepted by the configure subcommand. + manage the windows. The possible options and values + are the ones accepted by the paneconfigure method. """ self.tk.call((self._w, 'add', child) + self._options(kw)) Modified: python/branches/tk_and_idle_maintenance/Lib/multiprocessing/synchronize.py ============================================================================== --- python/branches/tk_and_idle_maintenance/Lib/multiprocessing/synchronize.py (original) +++ python/branches/tk_and_idle_maintenance/Lib/multiprocessing/synchronize.py Sun May 31 23:36:15 2009 @@ -58,8 +58,12 @@ def _make_methods(self): self.acquire = self._semlock.acquire self.release = self._semlock.release - self.__enter__ = self._semlock.__enter__ - self.__exit__ = self._semlock.__exit__ + + def __enter__(self): + return self._semlock.__enter__() + + def __exit__(self, *args): + return self._semlock.__exit__(*args) def __getstate__(self): assert_spawning(self) @@ -181,11 +185,15 @@ self._woken_count, self._wait_semaphore) = state self._make_methods() + def __enter__(self): + return self._lock.__enter__() + + def __exit__(self, *args): + return self._lock.__exit__(*args) + def _make_methods(self): self.acquire = self._lock.acquire self.release = self._lock.release - self.__enter__ = self._lock.__enter__ - self.__exit__ = self._lock.__exit__ def __repr__(self): try: Modified: python/branches/tk_and_idle_maintenance/Lib/test/regrtest.py ============================================================================== --- python/branches/tk_and_idle_maintenance/Lib/test/regrtest.py (original) +++ python/branches/tk_and_idle_maintenance/Lib/test/regrtest.py Sun May 31 23:36:15 2009 @@ -26,6 +26,7 @@ -L: runleaks -- run the leaks(1) command just before exit -R: huntrleaks -- search for reference leaks (needs debug build, v. slow) -M: memlimit -- run very large memory-consuming tests +-j: multiprocess -- run several processes at once If non-option arguments are present, they are names for tests to run, unless -x is given, in which case they are names for tests not to run. @@ -133,6 +134,7 @@ import cStringIO import getopt +import json import os import random import re @@ -193,7 +195,7 @@ exclude=False, single=False, randomize=False, fromfile=None, findleaks=False, use_resources=None, trace=False, coverdir='coverage', runleaks=False, huntrleaks=False, verbose2=False, print_slow=False, - random_seed=None): + random_seed=None, use_mp=None): """Execute a test suite. This also parses command-line options and modifies its behavior @@ -218,13 +220,13 @@ test_support.record_original_stdout(sys.stdout) try: - opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsSrf:lu:t:TD:NLR:wM:', + opts, args = getopt.getopt(sys.argv[1:], 'hvgqxsSrf:lu:t:TD:NLR:wM:j:', ['help', 'verbose', 'quiet', 'exclude', 'single', 'slow', 'random', 'fromfile', 'findleaks', 'use=', 'threshold=', 'trace', 'coverdir=', 'nocoverdir', 'runleaks', 'huntrleaks=', 'verbose2', 'memlimit=', - 'randseed=' + 'randseed=', 'multiprocess=', 'slaveargs=', ]) except getopt.error, msg: usage(2, msg) @@ -303,8 +305,23 @@ use_resources.remove(r) elif r not in use_resources: use_resources.append(r) + elif o in ('-j', '--multiprocess'): + use_mp = int(a) + elif o == '--slaveargs': + args, kwargs = json.loads(a) + try: + result = runtest(*args, **kwargs) + except BaseException, e: + result = -3, e.__class__.__name__ + print # Force a newline (just in case) + print json.dumps(result) + sys.exit(0) if single and fromfile: usage(2, "-s and -f don't go together!") + if use_mp and trace: + usage(2, "-T and -j don't go together!") + if use_mp and findleaks: + usage(2, "-l and -j don't go together!") good = [] bad = [] @@ -370,50 +387,111 @@ tracer = trace.Trace(ignoredirs=[sys.prefix, sys.exec_prefix], trace=False, count=True) test_times = [] - test_support.verbose = verbose # Tell tests to be moderately quiet test_support.use_resources = use_resources save_modules = sys.modules.keys() - for test in tests: - if not quiet: - print test - sys.stdout.flush() - if trace: - # If we're tracing code coverage, then we don't exit with status - # if on a false return value from main. - tracer.runctx('runtest(test, verbose, quiet,' - ' test_times, testdir)', - globals=globals(), locals=vars()) + + def accumulate_result(test, result): + ok, test_time = result + test_times.append((test_time, test)) + if ok > 0: + good.append(test) + elif ok == 0: + bad.append(test) else: + skipped.append(test) + if ok == -2: + resource_denieds.append(test) + + if use_mp: + from threading import Thread + from Queue import Queue, Empty + from subprocess import Popen, PIPE, STDOUT + from collections import deque + debug_output_pat = re.compile(r"\[\d+ refs\]$") + pending = deque() + output = Queue() + for test in tests: + args_tuple = ( + (test, verbose, quiet, testdir), + dict(huntrleaks=huntrleaks, use_resources=use_resources) + ) + pending.append((test, args_tuple)) + def work(): + # A worker thread. try: - ok = runtest(test, verbose, quiet, test_times, - testdir, huntrleaks) - except KeyboardInterrupt: - # print a newline separate from the ^C - print - break - except: + while True: + try: + test, args_tuple = pending.popleft() + except IndexError: + output.put((None, None, None)) + return + if not quiet: + print test + sys.stdout.flush() + popen = Popen([sys.executable, '-m', 'test.regrtest', + '--slaveargs', json.dumps(args_tuple)], + stdout=PIPE, stderr=STDOUT, + universal_newlines=True, close_fds=True) + out = popen.communicate()[0].strip() + out = debug_output_pat.sub("", out) + out, _, result = out.strip().rpartition("\n") + result = json.loads(result) + output.put((test, out.strip(), result)) + except BaseException: + output.put((None, None, None)) raise - if ok > 0: - good.append(test) - elif ok == 0: - bad.append(test) + workers = [Thread(target=work) for i in range(use_mp)] + for worker in workers: + worker.start() + finished = 0 + while finished < use_mp: + test, out, result = output.get() + if test is None: + finished += 1 + continue + if out: + print out + if result[0] == -3: + assert result[1] == 'KeyboardInterrupt' + pending.clear() + raise KeyboardInterrupt # What else? + accumulate_result(test, result) + for worker in workers: + worker.join() + else: + for test in tests: + if not quiet: + print test + sys.stdout.flush() + if trace: + # If we're tracing code coverage, then we don't exit with status + # if on a false return value from main. + tracer.runctx('runtest(test, verbose, quiet, testdir)', + globals=globals(), locals=vars()) else: - skipped.append(test) - if ok == -2: - resource_denieds.append(test) - if findleaks: - gc.collect() - if gc.garbage: - print "Warning: test created", len(gc.garbage), - print "uncollectable object(s)." - # move the uncollectable objects somewhere so we don't see - # them again - found_garbage.extend(gc.garbage) - del gc.garbage[:] - # Unload the newly imported modules (best effort finalization) - for module in sys.modules.keys(): - if module not in save_modules and module.startswith("test."): - test_support.unload(module) + try: + result = runtest(test, verbose, quiet, + testdir, huntrleaks) + accumulate_result(test, result) + except KeyboardInterrupt: + # print a newline separate from the ^C + print + break + except: + raise + if findleaks: + gc.collect() + if gc.garbage: + print "Warning: test created", len(gc.garbage), + print "uncollectable object(s)." + # move the uncollectable objects somewhere so we don't see + # them again + found_garbage.extend(gc.garbage) + del gc.garbage[:] + # Unload the newly imported modules (best effort finalization) + for module in sys.modules.keys(): + if module not in save_modules and module.startswith("test."): + test_support.unload(module) # The lists won't be sorted if running with -r good.sort() @@ -457,7 +535,7 @@ sys.stdout.flush() try: test_support.verbose = True - ok = runtest(test, True, quiet, test_times, testdir, + ok = runtest(test, True, quiet, testdir, huntrleaks) except KeyboardInterrupt: # print a newline separate from the ^C @@ -521,8 +599,8 @@ tests.sort() return stdtests + tests -def runtest(test, verbose, quiet, test_times, - testdir=None, huntrleaks=False): +def runtest(test, verbose, quiet, + testdir=None, huntrleaks=False, use_resources=None): """Run a single test. test -- the name of the test @@ -539,13 +617,16 @@ 1 test passed """ + test_support.verbose = verbose # Tell tests to be moderately quiet + if use_resources is not None: + test_support.use_resources = use_resources try: - return runtest_inner(test, verbose, quiet, test_times, + return runtest_inner(test, verbose, quiet, testdir, huntrleaks) finally: cleanup_test_droppings(test, verbose) -def runtest_inner(test, verbose, quiet, test_times, +def runtest_inner(test, verbose, quiet, testdir=None, huntrleaks=False): test_support.unload(test) if not testdir: @@ -555,6 +636,7 @@ else: capture_stdout = cStringIO.StringIO() + test_time = 0.0 refleak = False # True if the test leaked references. try: save_stdout = sys.stdout @@ -578,25 +660,24 @@ if huntrleaks: refleak = dash_R(the_module, test, indirect_test, huntrleaks) test_time = time.time() - start_time - test_times.append((test_time, test)) finally: sys.stdout = save_stdout except test_support.ResourceDenied, msg: if not quiet: print test, "skipped --", msg sys.stdout.flush() - return -2 + return -2, test_time except unittest.SkipTest, msg: if not quiet: print test, "skipped --", msg sys.stdout.flush() - return -1 + return -1, test_time except KeyboardInterrupt: raise except test_support.TestFailed, msg: print "test", test, "failed --", msg sys.stdout.flush() - return 0 + return 0, test_time except: type, value = sys.exc_info()[:2] print "test", test, "crashed --", str(type) + ":", value @@ -604,22 +685,22 @@ if verbose: traceback.print_exc(file=sys.stdout) sys.stdout.flush() - return 0 + return 0, test_time else: if refleak: - return 0 + return 0, test_time # Except in verbose mode, tests should not print anything if verbose or huntrleaks: - return 1 + return 1, test_time output = capture_stdout.getvalue() if not output: - return 1 + return 1, test_time print "test", test, "produced unexpected output:" print "*" * 70 print output print "*" * 70 sys.stdout.flush() - return 0 + return 0, test_time def cleanup_test_droppings(testname, verbose): import shutil @@ -707,9 +788,9 @@ if any(deltas): msg = '%s leaked %s references, sum=%s' % (test, deltas, sum(deltas)) print >> sys.stderr, msg - refrep = open(fname, "a") - print >> refrep, msg - refrep.close() + with open(fname, "a") as refrep: + print >> refrep, msg + refrep.flush() return True return False @@ -1227,6 +1308,6 @@ i -= 1 if os.path.abspath(os.path.normpath(sys.path[i])) == mydir: del sys.path[i] - if len(sys.path) == pathlen: + if '--slaveargs' not in sys.argv and len(sys.path) == pathlen: print 'Could not find %r in sys.path to remove it' % mydir main() Modified: python/branches/tk_and_idle_maintenance/Lib/test/test_cprofile.py ============================================================================== --- python/branches/tk_and_idle_maintenance/Lib/test/test_cprofile.py (original) +++ python/branches/tk_and_idle_maintenance/Lib/test/test_cprofile.py Sun May 31 23:36:15 2009 @@ -9,6 +9,7 @@ class CProfileTest(ProfileTest): profilerclass = cProfile.Profile + expected_list_sort_output = "{method 'sort' of 'list' objects}" # Issue 3895. def test_bad_counter_during_dealloc(self): Modified: python/branches/tk_and_idle_maintenance/Lib/test/test_epoll.py ============================================================================== --- python/branches/tk_and_idle_maintenance/Lib/test/test_epoll.py (original) +++ python/branches/tk_and_idle_maintenance/Lib/test/test_epoll.py Sun May 31 23:36:15 2009 @@ -95,6 +95,34 @@ finally: ep.close() + # adding by object w/ fileno works, too. + ep = select.epoll(2) + try: + ep.register(server, select.EPOLLIN | select.EPOLLOUT) + ep.register(client, select.EPOLLIN | select.EPOLLOUT) + finally: + ep.close() + + ep = select.epoll(2) + try: + # TypeError: argument must be an int, or have a fileno() method. + self.assertRaises(TypeError, ep.register, object(), + select.EPOLLIN | select.EPOLLOUT) + self.assertRaises(TypeError, ep.register, None, + select.EPOLLIN | select.EPOLLOUT) + # ValueError: file descriptor cannot be a negative integer (-1) + self.assertRaises(ValueError, ep.register, -1, + select.EPOLLIN | select.EPOLLOUT) + # IOError: [Errno 9] Bad file descriptor + self.assertRaises(IOError, ep.register, 10000, + select.EPOLLIN | select.EPOLLOUT) + # registering twice also raises an exception + ep.register(server, select.EPOLLIN | select.EPOLLOUT) + self.assertRaises(IOError, ep.register, server, + select.EPOLLIN | select.EPOLLOUT) + finally: + ep.close() + def test_fromfd(self): server, client = self._connected_pair() Modified: python/branches/tk_and_idle_maintenance/Lib/test/test_profile.py ============================================================================== --- python/branches/tk_and_idle_maintenance/Lib/test/test_profile.py (original) +++ python/branches/tk_and_idle_maintenance/Lib/test/test_profile.py Sun May 31 23:36:15 2009 @@ -16,6 +16,7 @@ profilerclass = profile.Profile methodnames = ['print_stats', 'print_callers', 'print_callees'] expected_output = {} + expected_list_sort_output = ':0(sort)' @classmethod def do_profiling(cls): @@ -40,6 +41,25 @@ "Stats.%s output for %s doesn't fit expectation!" % (method, self.profilerclass.__name__)) + def test_calling_conventions(self): + # Issue #5330: profile and cProfile wouldn't report C functions called + # with keyword arguments. We test all calling conventions. + stmts = [ + "[].sort()", + "[].sort(reverse=True)", + "[].sort(*(None, None, True))", + "[].sort(**dict(reverse=True))", + ] + for stmt in stmts: + s = StringIO() + prof = self.profilerclass(timer, 0.001) + prof.runctx(stmt, globals(), locals()) + stats = pstats.Stats(prof, stream=s) + stats.print_stats() + res = s.getvalue() + self.assertTrue(self.expected_list_sort_output in res, + "Profiling {0!r} didn't report list.sort:\n{1}".format(stmt, res)) + def regenerate_expected_output(filename, cls): filename = filename.rstrip('co') Modified: python/branches/tk_and_idle_maintenance/Lib/test/test_support.py ============================================================================== --- python/branches/tk_and_idle_maintenance/Lib/test/test_support.py (original) +++ python/branches/tk_and_idle_maintenance/Lib/test/test_support.py Sun May 31 23:36:15 2009 @@ -6,6 +6,7 @@ import contextlib import errno import functools +import gc import socket import sys import os @@ -378,6 +379,10 @@ 'Unicode filename tests may not be effective' \ % TESTFN_UNICODE_UNENCODEABLE +# Disambiguate TESTFN for parallel testing, while letting it remain a valid +# module name. +TESTFN = "{0}_{1}_tmp".format(TESTFN, os.getpid()) + # Make sure we can write to TESTFN, try in /tmp if we can't fp = None try: @@ -640,7 +645,6 @@ longer than expected. This function tries its best to force all garbage objects to disappear. """ - import gc gc.collect() gc.collect() gc.collect() Modified: python/branches/tk_and_idle_maintenance/Misc/ACKS ============================================================================== --- python/branches/tk_and_idle_maintenance/Misc/ACKS (original) +++ python/branches/tk_and_idle_maintenance/Misc/ACKS Sun May 31 23:36:15 2009 @@ -239,6 +239,7 @@ Peter Funk Geoff Furnish Ulisses Furquim +Hagen F?rstenau Achim Gaedke Martin von Gagern Lele Gaifax Modified: python/branches/tk_and_idle_maintenance/Misc/NEWS ============================================================================== --- python/branches/tk_and_idle_maintenance/Misc/NEWS (original) +++ python/branches/tk_and_idle_maintenance/Misc/NEWS Sun May 31 23:36:15 2009 @@ -12,6 +12,9 @@ Core and Builtins ----------------- +- Issue #5330: C functions called with keyword arguments were not reported by + the various profiling modules (profile, cProfile). Patch by Hagen F?rstenau. + - Issue #5982: staticmethod and classmethod now expose the wrapped function with __func__. @@ -1101,6 +1104,9 @@ Tests ----- +- Issue #6152: New option '-j'/'--multiprocess' for regrtest allows running + regression tests in parallel, shortening the total runtime. + - Issue #5354: New test support function import_fresh_module() makes it easy to import both normal and optimised versions of modules. test_heapq and test_warnings have been adjusted to use it, tests for Modified: python/branches/tk_and_idle_maintenance/Objects/object.c ============================================================================== --- python/branches/tk_and_idle_maintenance/Objects/object.c (original) +++ python/branches/tk_and_idle_maintenance/Objects/object.c Sun May 31 23:36:15 2009 @@ -2156,6 +2156,9 @@ if (PyType_Ready(&PyMemberDescr_Type) < 0) Py_FatalError("Can't initialize member descriptor type"); + + if (PyType_Ready(&PyFile_Type) < 0) + Py_FatalError("Can't initialize file type"); } Modified: python/branches/tk_and_idle_maintenance/Python/ceval.c ============================================================================== --- python/branches/tk_and_idle_maintenance/Python/ceval.c (original) +++ python/branches/tk_and_idle_maintenance/Python/ceval.c Sun May 31 23:36:15 2009 @@ -4160,10 +4160,17 @@ PCALL(PCALL_METHOD); else if (PyType_Check(func)) PCALL(PCALL_TYPE); + else if (PyCFunction_Check(func)) + PCALL(PCALL_CFUNCTION); else PCALL(PCALL_OTHER); #endif - result = PyObject_Call(func, callargs, kwdict); + if (PyCFunction_Check(func)) { + PyThreadState *tstate = PyThreadState_GET(); + C_TRACE(result, PyCFunction_Call(func, callargs, kwdict)); + } + else + result = PyObject_Call(func, callargs, kwdict); call_fail: Py_XDECREF(callargs); Py_XDECREF(kwdict); @@ -4248,10 +4255,17 @@ PCALL(PCALL_METHOD); else if (PyType_Check(func)) PCALL(PCALL_TYPE); + else if (PyCFunction_Check(func)) + PCALL(PCALL_CFUNCTION); else PCALL(PCALL_OTHER); #endif - result = PyObject_Call(func, callargs, kwdict); + if (PyCFunction_Check(func)) { + PyThreadState *tstate = PyThreadState_GET(); + C_TRACE(result, PyCFunction_Call(func, callargs, kwdict)); + } + else + result = PyObject_Call(func, callargs, kwdict); ext_call_fail: Py_XDECREF(callargs); Py_XDECREF(kwdict); From python-checkins at python.org Sun May 31 23:38:37 2009 From: python-checkins at python.org (georg.brandl) Date: Sun, 31 May 2009 23:38:37 +0200 (CEST) Subject: [Python-checkins] r73086 - python/branches/py3k/Doc/library/stdtypes.rst Message-ID: <20090531213837.50BFAD8CE@mail.python.org> Author: georg.brandl Date: Sun May 31 23:38:37 2009 New Revision: 73086 Log: #5675 followup: bytearray also has translate and maketrans. Modified: python/branches/py3k/Doc/library/stdtypes.rst Modified: python/branches/py3k/Doc/library/stdtypes.rst ============================================================================== --- python/branches/py3k/Doc/library/stdtypes.rst (original) +++ python/branches/py3k/Doc/library/stdtypes.rst Sun May 31 23:38:37 2009 @@ -1541,6 +1541,7 @@ available on strings: .. method:: bytes.translate(table[, delete]) + bytearray.translate(table[, delete]) Return a copy of the bytes or bytearray object where all bytes occurring in the optional argument *delete* are removed, and the remaining bytes have been @@ -1557,6 +1558,7 @@ .. staticmethod:: bytes.maketrans(from, to) + bytearray.maketrans(from, to) This static method returns a translation table usable for :meth:`bytes.translate` that will map each character in *from* into the From buildbot at python.org Sun May 31 23:39:15 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 31 May 2009 21:39:15 +0000 Subject: [Python-checkins] buildbot failure in ia64 Ubuntu 3.x Message-ID: <20090531213915.C8405D984@mail.python.org> The Buildbot has detected a new failure of ia64 Ubuntu 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/ia64%20Ubuntu%203.x/builds/846 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: klose-debian-ia64 Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl,r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 3 tests failed: test_ast test_mailbox test_pyclbr ====================================================================== ERROR: test_copy_location (test.test_ast.ASTHelpers_Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_ast.py", line 207, in test_copy_location src.body.right = ast.copy_location(ast.Num(2), src.body.right) AttributeError: 'module' object has no attribute 'copy_location' ====================================================================== ERROR: test_fix_missing_locations (test.test_ast.ASTHelpers_Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_ast.py", line 218, in test_fix_missing_locations self.assertEqual(src, ast.fix_missing_locations(src)) AttributeError: 'module' object has no attribute 'fix_missing_locations' ====================================================================== ERROR: test_get_docstring (test.test_ast.ASTHelpers_Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_ast.py", line 259, in test_get_docstring self.assertEqual(ast.get_docstring(node.body[0]), AttributeError: 'module' object has no attribute 'get_docstring' ====================================================================== ERROR: test_increment_lineno (test.test_ast.ASTHelpers_Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_ast.py", line 232, in test_increment_lineno self.assertEqual(ast.increment_lineno(src, n=3), src) AttributeError: 'module' object has no attribute 'increment_lineno' ====================================================================== ERROR: test_iter_child_nodes (test.test_ast.ASTHelpers_Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_ast.py", line 248, in test_iter_child_nodes self.assertEqual(len(list(ast.iter_child_nodes(node.body))), 4) AttributeError: 'module' object has no attribute 'iter_child_nodes' ====================================================================== ERROR: test_iter_fields (test.test_ast.ASTHelpers_Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_ast.py", line 241, in test_iter_fields d = dict(ast.iter_fields(node.body)) AttributeError: 'module' object has no attribute 'iter_fields' ====================================================================== FAIL: test_dump (test.test_ast.ASTHelpers_Test) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_ast.py", line 189, in test_dump "Module(body=[Expr(value=Call(func=Name(id='spam', ctx=Load()), " AssertionError: None != "Module(body=[Expr(value=Call(func=Name(id='spam', ctx=Load()), args=[Name(id='eggs', ctx=Load()), Str(s='and cheese')], keywords=[], starargs=None, kwargs=None))])" ====================================================================== FAIL: test_easy (test.test_pyclbr.PyclbrTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_pyclbr.py", line 143, in test_easy self.checkModule('ast') File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_pyclbr.py", line 84, in checkModule self.assertHasattr(module, name, ignore) File "/home/pybot/buildarea/3.x.klose-debian-ia64/build/Lib/test/test_pyclbr.py", line 35, in assertHasattr 'expected hasattr(%r, %r)' % (obj, attr)) AssertionError: expected hasattr(, 'NodeVisitor') make: *** [buildbottest] Error 1 sincerely, -The Buildbot From buildbot at python.org Sun May 31 23:53:46 2009 From: buildbot at python.org (buildbot at python.org) Date: Sun, 31 May 2009 21:53:46 +0000 Subject: [Python-checkins] buildbot failure in sparc solaris10 gcc 3.x Message-ID: <20090531215346.B132DD99E@mail.python.org> The Buildbot has detected a new failure of sparc solaris10 gcc 3.x. Full details are available at: http://www.python.org/dev/buildbot/all/sparc%20solaris10%20gcc%203.x/builds/788 Buildbot URL: http://www.python.org/dev/buildbot/all/ Buildslave for this Build: loewis-sun Build Reason: Build Source Stamp: [branch branches/py3k] HEAD Blamelist: georg.brandl,r.david.murray BUILD FAILED: failed test Excerpt from the test logfile: 1 test failed: test_posix ====================================================================== ERROR: test_getcwd_long_pathnames (test.test_posix.PosixTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/test_posix.py", line 251, in test_getcwd_long_pathnames support.rmtree(base_path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/test/support.py", line 178, in rmtree shutil.rmtree(path) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 238, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/home2/buildbot/slave/3.x.loewis-sun/build/Lib/shutil.py", line 236, in rmtree os.rmdir(path) OSError: [Errno 22] Invalid argument: '/home2/buildbot/slave/3.x.loewis-sun/build/@test.getcwd/@test.getcwd' sincerely, -The Buildbot